本文整理汇总了PHP中Notifier::passwordExpiration方法的典型用法代码示例。如果您正苦于以下问题:PHP Notifier::passwordExpiration方法的具体用法?PHP Notifier::passwordExpiration怎么用?PHP Notifier::passwordExpiration使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Notifier
的用法示例。
在下文中一共展示了Notifier::passwordExpiration方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: sendPasswordExpirationReminders
/**
* Send password expiration reminders to contacts
*
* @access public
* @return int
*/
static function sendPasswordExpirationReminders()
{
$sent = 0;
$password_expiration_days = config_option('password_expiration', 0);
$password_expiration_notification = config_option('password_expiration_notification', 0);
$contact_passwords = ContactPasswords::getNewestContactPasswords();
foreach ($contact_passwords as $password) {
$diff_days = self::getContactPasswordDays($password);
if ($diff_days == $password_expiration_days - $password_expiration_notification) {
$contact = Contacts::findById($password->getContactId());
if ($contact instanceof Contact) {
if (Notifier::passwordExpiration($contact, $password_expiration_notification)) {
$sent++;
}
}
}
}
return $sent;
}
示例2: sendPasswordExpirationReminders
/**
* Send password expiration reminders to users
*
* @access public
* @return int
*/
static function sendPasswordExpirationReminders()
{
$sent = 0;
$password_expiration_days = config_option('password_expiration', 0);
$password_expiration_notification = config_option('password_expiration_notification', 0);
$user_passwords = UserPasswords::getNewestUserPasswords();
foreach ($user_passwords as $password) {
$diff_days = self::getUserPasswordDays($password);
if ($diff_days == $password_expiration_days - $password_expiration_notification) {
$user = Users::findById($password->getUserId());
if ($user instanceof User) {
if (Notifier::passwordExpiration($user, $password_expiration_notification)) {
$sent++;
}
}
}
}
return $sent;
}