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


PHP check::strEncryption方法代碼示例

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


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

示例1: unset

 if (!check::CheckUser($_POST['user_name'])) {
     check::AlertExit("輸入的用戶名必須是4-21字符之間的數字、字母,或7個中文!", -1);
 }
 if (!check::CheckPassword($_POST['password'])) {
     check::AlertExit("輸入的密碼必須是4-21字符之間的數字、字母!", -1);
 }
 if (empty($_POST['user_id'])) {
     check::AlertExit("用戶ID不能為空!", -1);
 }
 if (empty($_POST['nick_name'])) {
     check::AlertExit("用戶昵稱不能為空!", -1);
 }
 //如果兩次密碼不一致,說明,需要更新密碼
 if ($_POST['password'] != $_POST['oldpassword']) {
     if (!empty($arrGWeb['user_pass_type'])) {
         $_POST['password'] = check::strEncryption($_POST['password'], $arrGWeb['jamstr']);
     }
 }
 unset($_POST['oldpassword']);
 if ($_POST['user_name'] != $_POST['olduser_name']) {
     $arr = $objWebInit->getUserWhere(" Where user_name='" . $_POST['user_name'] . "'");
     if (!empty($arr)) {
         check::AlertExit($_POST['user_name'] . ", 該用戶名已被占用", -1);
     }
 }
 unset($_POST['olduser_name']);
 //生日轉換
 $_POST['birthday'] = date('Y-m-d', strtotime($_POST['year'] . '-' . $_POST['month'] . '-' . $_POST['day']));
 unset($_POST['year']);
 unset($_POST['month']);
 unset($_POST['day']);
開發者ID:TiMoChao,項目名稱:xingfu,代碼行數:31,代碼來源:modifyinfo.php

示例2: userLogin

 /**
  * 會員登陸
  * @author	肖飛
  * @param	array $arrUser    會員信息數組
  * @return  void
  */
 public function userLogin($arrData, $isEncryption = 0, $jamStr)
 {
     if (!check::CheckUser($arrData['User'])) {
         check::AlertExit("輸入的用戶名必須是4-20字符之間的數字、字母或中文!", -1);
         return false;
     }
     if (!check::CheckPassword($arrData['Pass'])) {
         check::AlertExit("輸入的密碼必須是4-20字符之間的數字、字母!", -1);
         return false;
     }
     $strPassTemp = $arrData['Pass'];
     if ($isEncryption) {
         $strPassTemp = check::strEncryption($strPassTemp, $jamStr);
     }
     $strSQL = "SELECT * FROM {$this->tablename2} WHERE user_name = ? and password = ?";
     $rs = $this->db->prepare($strSQL);
     $rs->execute(array($arrData['User'], $strPassTemp));
     if ($arr = $rs->fetchAll()) {
         $arr = current($this->loadTableFieldG($arr));
         $user_id = '';
         $user_name = '';
         $password = '';
         $real_name = '';
         $user_group = '';
         $user_popedom = '';
         $submit_date = '';
         $pass = '';
         $email = '';
         $tel = '';
         $company_cn = '';
         $user_type = '';
         $user_bonus = '';
         $_SESSION['user_id'] = $arr['user_id'];
         $_SESSION['user_name'] = $arr['user_name'];
         $_SESSION['password'] = $arr['password'];
         $_SESSION['user_group'] = $arr['user_group'];
         $_SESSION['user_grade'] = $arr['user_grade'];
         $_SESSION['user_popedom'] = $arr['user_popedom'];
         $_SESSION['real_name'] = $arr['real_name'];
         $_SESSION['email'] = $arr['email'];
         $_SESSION['tel'] = $arr['tel'];
         $_SESSION['company_cn'] = $arr['company_cn'];
         $_SESSION['user_type'] = $arr['user_type'];
         $_SESSION['user_bonus'] = $arr['user_bonus'];
         $_SESSION['pass'] = $arr['pass'];
         $_SESSION['province'] = $arr['province'];
         $_SESSION['city'] = $arr['city'];
         $_SESSION['type_id'] = $arr['type_id'];
         $arrUpdate['user_ip'] = check::getIP();
         $arrUpdate['lastlog '] = date('Y-m-d H:i:s');
         $arrUpdate['user_id'] = $arr['user_id'];
         $this->updateUser($arrUpdate);
         return true;
     } else {
         return false;
     }
 }
開發者ID:TiMoChao,項目名稱:lc_ad_first,代碼行數:63,代碼來源:user.class.php

示例3: userLogin

 /**
  * 會員登陸
  * @author	肖飛
  * @param	array $arrUser    會員信息數組
  * @return  void
  */
 public function userLogin($arrData, $isEncryption = 0, $jamStr, $isAlert = ture)
 {
     if (!check::CheckUser($arrData['User']) && !check::CheckEmailAddr($_POST['User']) && !check::CheckMobilePhone($_POST['User'])) {
         if ($isAlert) {
             check::AlertExit("輸入的用戶名必須是4-21字符之間的數字、字母,或7個中文!", -1);
         } else {
             return 0;
         }
     }
     if (!check::CheckPassword($arrData['Pass'])) {
         if ($isAlert) {
             check::AlertExit("輸入的密碼必須是4-21字符之間的數字、字母!", -1);
         }
         return 0;
     }
     $strPassTemp = $arrData['Pass'];
     if ($isEncryption) {
         $strPassTemp = check::strEncryption($strPassTemp, $jamStr);
     }
     $strUserName = $arrData['User'];
     if ($_SESSION['user_group'] == 3) {
         $strSQL = "SELECT * FROM {$this->tablename1} WHERE user_name = '" . $strUserName . "' and status=1";
         $rs = $this->db->query($strSQL);
     } else {
         $strSQL = "SELECT * FROM {$this->tablename1} WHERE user_name = '" . $strUserName . "' and password = '" . $strPassTemp . "' and status=1";
         $rs = $this->db->query($strSQL);
         if (!($arr = $rs->fetch(PDO::FETCH_ASSOC))) {
             $strSQL = "SELECT * FROM {$this->tablename1} WHERE email  = '" . $strUserName . "' and password = '" . $strPassTemp . "' and status=1";
             $rs = $this->db->query($strSQL);
             if (!($arr = $rs->fetch(PDO::FETCH_ASSOC))) {
                 $strSQL = "SELECT * FROM {$this->tablename1} WHERE mobile  = '" . $strUserName . "' and password = '" . $strPassTemp . "' and status=1";
                 $rs = $this->db->query($strSQL);
                 $arr = $rs->fetch(PDO::FETCH_ASSOC);
             }
         }
     }
     if ($arr) {
         if (is_array($_SESSION)) {
             $_SESSION = array_merge($_SESSION, $arr);
         } else {
             $_SESSION = $arr;
         }
         $arrUpdate = array();
         $arrUpdate['user_ip'] = check::getIP();
         $arrUpdate['lastlog'] = date('Y-m-d H:i:s');
         $arrUpdate['user_id'] = $arr['user_id'];
         $arrUpdate['logtimes'] = ++$arr['logtimes'];
         $arrUpdate['session_id'] = session_id();
         $this->updateUser($arrUpdate);
         return 1;
     } else {
         if ($isAlert) {
             check::AlertExit("用戶名或密碼錯誤", -1);
         } else {
             return 0;
         }
     }
 }
開發者ID:TiMoChao,項目名稱:xingfu,代碼行數:64,代碼來源:mcenter.class.php

示例4: userLogin

 /**
  * 會員登陸
  * @author	肖飛
  * @param	array $arrUser    會員信息數組
  * @return  void
  */
 public function userLogin($arrData, $isEncryption = 0, $jamStr, $isAlert = true)
 {
     $arrData['User'] = trim($arrData['User']);
     $arrData['Pass'] = trim($arrData['Pass']);
     if ($isEncryption) {
         $strPassTemp = check::strEncryption($arrData['Pass'], $jamStr);
     }
     if (($_SESSION['user_name'] == $arrData['User'] || $_SESSION['email'] == $arrData['User'] || $_SESSION['mobile'] == $arrData['User']) && $_SESSION['password'] == $strPassTemp && isset($_SESSION['user_group'])) {
         return true;
     }
     $strData = check::getAPIArray($arrData);
     if (!check::getAPI('mcenter', 'userLogin', "{$strData}^{$isEncryption}^{$jamStr}")) {
         if ($isAlert) {
             check::AlertExit("用戶名或密碼錯誤!", -1);
         }
         return 0;
     }
     if (empty($_SESSION['user_id'])) {
         if ($isAlert) {
             check::AlertExit("用戶名或密碼錯誤!", -1);
         } else {
             return 0;
         }
     }
     $arr = $this->getInfoWhere("WHERE user_id = " . $_SESSION['user_id']);
     if (!empty($arr)) {
         unset($arr['id']);
         $_SESSION = array_merge($_SESSION, $arr);
         $arrUpdate = array();
         $arrUpdate['lastlog'] = date('Y-m-d H:i:s');
         $arrUpdate['user_id'] = $arr['user_id'];
         $this->updateUser($arrUpdate);
         return 1;
     } else {
         //Mcenter有信息,但本係統未注冊,則自動注冊。
         $arrTemp = array();
         $arrTemp = $_SESSION;
         $intID = $this->saveInfo($arrTemp, 0, false, false);
         if ($intID) {
             $this->userLogin($arrData, $isEncryption, $jamStr, $isAlert);
             return 1;
         } else {
             if ($isAlert) {
                 check::AlertExit("會員信息不存在", -1);
             } else {
                 return 0;
             }
         }
     }
 }
開發者ID:TiMoChao,項目名稱:xingfu,代碼行數:56,代碼來源:user.class.php

示例5: elseif

} elseif ($_GET['step'] == 5) {
    if ($_SERVER["REQUEST_METHOD"] == "POST") {
        if (empty($_POST['db_host']) || empty($_POST['db_port']) || empty($_POST['db_user']) || empty($_POST['db_name'])) {
            check::AlertExit("錯誤:數據庫地址、端口、用戶名和庫名信息必須填寫!", -1);
        }
        if (empty($_POST['password']) || empty($_POST['user_name']) || empty($_POST['real_name']) || empty($_POST['email'])) {
            check::AlertExit("錯誤:管理員的信息必須全部填寫!", -1);
        }
        if ($_POST['password'] != $_POST['password_c']) {
            check::AlertExit("錯誤:兩次輸入的密碼不相同!", -1);
        }
        $_SESSION['user_name'] = $_POST['user_name'];
        $_SESSION['real_name'] = $_POST['real_name'];
        $_SESSION['email'] = $_POST['email'];
        if (!empty($_POST['user_pass_type']) && $_POST['user_pass_type']) {
            $_SESSION['password'] = check::strEncryption($_POST['password'], $_POST['jamstr']);
        } else {
            $_SESSION['password'] = $_POST['password'];
        }
        $_SESSION['install_type'] = $_POST['install_type'];
        $_SESSION['user_pass_type'] = $_POST['user_pass_type'];
        $_SESSION['jamstr'] = $_POST['jamstr'];
        unset($_POST['user_name']);
        unset($_POST['real_name']);
        unset($_POST['email']);
        unset($_POST['password']);
        unset($_POST['password_c']);
        unset($_POST['install_type']);
        unset($_POST['biweb']);
        unset($arrGWeb);
        $strFilename = '../data/webconfig.inc.php';
開發者ID:TiMoChao,項目名稱:lc_ad_first,代碼行數:31,代碼來源:index.php


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