當前位置: 首頁>>代碼示例>>PHP>>正文


PHP wfUtils::localHumanDateShort方法代碼示例

本文整理匯總了PHP中wfUtils::localHumanDateShort方法的典型用法代碼示例。如果您正苦於以下問題:PHP wfUtils::localHumanDateShort方法的具體用法?PHP wfUtils::localHumanDateShort怎麽用?PHP wfUtils::localHumanDateShort使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在wfUtils的用法示例。


在下文中一共展示了wfUtils::localHumanDateShort方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: loginAction

 public static function loginAction($username)
 {
     if (sizeof($_POST) < 1) {
         return;
     }
     //only execute if login form is posted
     if (!$username) {
         return;
     }
     wfConfig::inc('totalLogins');
     $user = get_user_by('login', $username);
     $userID = $user ? $user->ID : 0;
     self::getLog()->logLogin('loginOK', 0, $username);
     if (wfUtils::isAdmin($user)) {
         wfConfig::set_ser('lastAdminLogin', array('userID' => $userID, 'username' => $username, 'firstName' => $user->first_name, 'lastName' => $user->last_name, 'time' => wfUtils::localHumanDateShort(), 'IP' => wfUtils::getIP()));
     }
     if (user_can($userID, 'update_core')) {
         if (wfConfig::get('alertOn_adminLogin')) {
             wordfence::alert("Admin Login", "A user with username \"{$username}\" who has administrator access signed in to your WordPress site.", wfUtils::getIP());
         }
     } else {
         if (wfConfig::get('alertOn_nonAdminLogin')) {
             wordfence::alert("User login", "A non-admin user with username \"{$username}\" signed in to your WordPress site.", wfUtils::getIP());
         }
     }
 }
開發者ID:ashenkar,項目名稱:sanga,代碼行數:26,代碼來源:wordfenceClass.php

示例2: loginAction

 public static function loginAction($username)
 {
     if (sizeof($_POST) < 1) {
         return;
     }
     //only execute if login form is posted
     if (!$username) {
         return;
     }
     wfConfig::inc('totalLogins');
     $user = get_user_by('login', $username);
     $userID = $user ? $user->ID : 0;
     self::getLog()->logLogin('loginOK', 0, $username);
     if (wfUtils::isAdmin($user)) {
         wfConfig::set_ser('lastAdminLogin', array('userID' => $userID, 'username' => $username, 'firstName' => $user->first_name, 'lastName' => $user->last_name, 'time' => wfUtils::localHumanDateShort(), 'IP' => wfUtils::getIP()));
     }
     $salt = wp_salt('logged_in');
     $cookiename = 'wf_loginalerted_' . hash_hmac('sha256', wfUtils::getIP() . '|' . $user->ID, $salt);
     $cookievalue = hash_hmac('sha256', $user->user_login, $salt);
     if (user_can($userID, 'update_core')) {
         if (wfConfig::get('alertOn_adminLogin')) {
             $shouldAlert = true;
             if (wfConfig::get('alertOn_firstAdminLoginOnly') && isset($_COOKIE[$cookiename])) {
                 $shouldAlert = !hash_equals($cookievalue, $_COOKIE[$cookiename]);
             }
             if ($shouldAlert) {
                 wordfence::alert("Admin Login", "A user with username \"{$username}\" who has administrator access signed in to your WordPress site.", wfUtils::getIP());
             }
         }
     } else {
         if (wfConfig::get('alertOn_nonAdminLogin')) {
             $shouldAlert = true;
             if (wfConfig::get('alertOn_firstNonAdminLoginOnly') && isset($_COOKIE[$cookiename])) {
                 $shouldAlert = !hash_equals($cookievalue, $_COOKIE[$cookiename]);
             }
             if ($shouldAlert) {
                 wordfence::alert("User login", "A non-admin user with username \"{$username}\" signed in to your WordPress site.", wfUtils::getIP());
             }
         }
     }
     if (wfConfig::get('alertOn_firstAdminLoginOnly') || wfConfig::get('alertOn_firstNonAdminLoginOnly')) {
         wfUtils::setcookie($cookiename, $cookievalue, time() + 86400 * 365, '/', null, null, true);
     }
 }
開發者ID:Jerram-Marketing,項目名稱:Gummer-Co,代碼行數:44,代碼來源:wordfenceClass.php


注:本文中的wfUtils::localHumanDateShort方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。