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


PHP Pw::encrypt方法代碼示例

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


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

示例1: getLaiwangInfoAction

 /**
  * 查詢laiwang帳號信息
  * 注意為了兼容舊的phpwind代碼,當設置項中不存在ios的appkey時,返回空的結果。
  * 
  * @access public
  * @return void
  */
 public function getLaiwangInfoAction()
 {
     $config = Wekit::C()->getValues('wukong');
     if (empty($config) || !isset($config['ios.appKey'])) {
         $data = array('info' => '');
     } else {
         $cont = array('appToken' => $config['appToken'], 'org' => $config['org'], 'domain' => $config['domain'], 'Android' => array('appKey' => $config['android.appKey'], 'appSecret' => $config['android.appSecret']), 'iOS' => array('appKey' => $config['ios.appKey'], 'appSecret' => $config['ios.appSecret']));
         $cont = serialize($cont);
         $_securityKey = Wekit::C()->getConfigByName('site', 'securityKey');
         $cont = Pw::encrypt($cont, $_securityKey['value']);
         $data = array('info' => $cont ? $cont : '');
     }
     $this->setOutput($data, 'data');
     $this->showMessage("success");
 }
開發者ID:chendong0444,項目名稱:phpwind,代碼行數:22,代碼來源:SettingController.php

示例2: _getUserInfo

 /**
  * 獲得基本用戶信息 
  * 
  * @param mixed $uid 
  * @access private
  * @return void
  */
 protected function _getUserInfo($laiwangOK = true)
 {
     //
     $_userInfo = $this->_getUserAllInfo(PwUser::FETCH_MAIN + PwUser::FETCH_INFO);
     //登錄成功後,加密身份key
     $_idInfo = array('username' => $_userInfo['username'], 'password' => $_userInfo['password']);
     $securityKey = Pw::encrypt(serialize($_idInfo), $this->_securityKey);
     //laiwang
     $wk_setting = PwLaiWangSerivce::$wk_setting;
     $wk_setting['openid'] = $_userInfo['uid'];
     $wk_setting['secretToken'] = PwLaiWangSerivce::getSecretToken($_userInfo['uid'], $_userInfo['password']);
     // 是否已經成功同步用戶到來往
     $wk_setting['laiwangOK'] = $laiwangOK;
     //返回數據
     $_data = array('securityKey' => $securityKey, 'userinfo' => array('uid' => $_userInfo['uid'], 'username' => $_userInfo['username'], 'avatar' => Pw::getAvatar($_userInfo['uid'], 'big'), 'gender' => $_userInfo['gender']), 'laiwangSetting' => $wk_setting);
     return $_data;
 }
開發者ID:chendong0444,項目名稱:phpwind,代碼行數:24,代碼來源:NativeBaseController.php

示例3: signVisitor

 /**
  * 標記一個訪問者
  * 
  * @param string $ip
  * @param int $createdTime
  * @param int $modifyTime
  */
 public function signVisitor($ip, $createdTime, $modifyTime, $extension = array())
 {
     $ip = ip2long($ip);
     $sign = Pw::encrypt($ip . '_' . $createdTime . '_' . $modifyTime . '_' . serialize($extension));
     return Pw::setCookie('visitor', $sign);
 }
開發者ID:chendong0444,項目名稱:phpwind,代碼行數:13,代碼來源:PwOnlineService.php

示例4: createRegistIdentify

 /** 
  * 構造用戶標誌
  *
  * @param int $uid  用戶ID
  * @param string $pwd 用戶密碼
  * @return string
  */
 public static function createRegistIdentify($uid, $pwd)
 {
     $code = Pw::encrypt($uid . "\t" . Pw::getPwdCode($pwd));
     return rawurlencode($code);
 }
開發者ID:YoursBoss,項目名稱:nextwind,代碼行數:12,代碼來源:PwRegisterService.php

示例5: _saveVerifyCode

 private function _saveVerifyCode()
 {
     Wind::import('LIB:utility.verifycode.PwBaseCode');
     $code = WindConvert::convert(PwBaseCode::getCode(), Wekit::V('charset'), 'UTF-8');
     $code = Pw::encrypt(strtolower($code));
     //Wind::import('WIND:http.session.WindSession');
     Pw::setCookie('Pw_verify_code', $code, 3600);
     /*$session = new WindSession();
     		$session->set('verifycode', $code);*/
 }
開發者ID:latticet,項目名稱:EduSoho_jb51,代碼行數:10,代碼來源:PwVerifyCode.php

示例6: login

 /**
  * 後台用戶登錄服務
  *
  * 後台用戶登錄服務,並返回用戶對象.參數信息:<code>
  * $loginInfo: AdminUser
  * </code>
  *
  * @param string $username 用戶名
  * @param string $password 密碼
  * @return boolean
  */
 public function login($username, $password)
 {
     $conf = $this->loadFounderService()->getFounders();
     if (isset($conf[$username])) {
         $r = $this->loadFounderService()->checkPwd($conf[$username], $password);
         if (!$r) {
             return new PwError('ADMIN:login.fail.user.illegal');
         }
         $cookie = Pw::encrypt(self::FOUNDER . "\t" . $username . "\t" . Pw::getPwdCode($r));
     } else {
         if (!$this->loadSafeService()->ipLegal(Wekit::app()->clientIp)) {
             return new PwError('ADMIN:login.fail.ip');
         }
         $user = $this->loadUserService()->verifyUser($username, $password);
         if ($user instanceof PwError) {
             return new PwError('ADMIN:login.fail.user.illegal');
         }
         /* @var $auth AdminAuth */
         $auth = Wekit::load('ADMIN:service.AdminAuth');
         if (!$auth->findByUid($user['uid'])) {
             return new PwError('ADMIN:login.fail.allow');
         }
         $u = $this->loadUserService()->getUserByUid($user['uid']);
         $cookie = Pw::encrypt(self::USER . "\t" . $user['uid'] . "\t" . Pw::getPwdCode($u['password']));
     }
     Pw::setCookie($this->cookieName, $cookie, 1800);
     return true;
 }
開發者ID:fanqimeng,項目名稱:4tweb,代碼行數:39,代碼來源:AdminUserService.php

示例7: createIdentity

 /** 
  * 創建登錄用戶標識
  *
  * @param int $uid 用戶ID
  * @param string $password 用戶密碼
  * @return boolean
  */
 public function createIdentity($uid, $password)
 {
     $identity = Pw::encrypt($uid . "\t" . Pw::getPwdCode($password));
     return Pw::setCookie('winduser', $identity, 31536000);
 }
開發者ID:fanqimeng,項目名稱:4tweb,代碼行數:12,代碼來源:PwUserService.php

示例8: createLoginIdentify

 /**
  * 創建登錄標識
  *
  * @param array $userInfo 用戶信息
  * @return string
  */
 public static function createLoginIdentify($userInfo)
 {
     $code = Pw::encrypt($userInfo['uid'] . "\t" . Pw::getPwdCode($userInfo['password']) . "\t" . Pw::getTime());
     return rawurlencode($code);
 }
開發者ID:chendong0444,項目名稱:phpwind,代碼行數:11,代碼來源:PwLoginService.php

示例9: createFindPwdIdentify

 /**
  * 創建找回密碼的唯一標識
  *
  * @param string $username 需要找回密碼的用戶名
  * @param string $way 找回方式標識
  * @param string $value 找回方式對應的值
  * @return string
  */
 public static function createFindPwdIdentify($username, $way, $value)
 {
     $code = Pw::encrypt($username . '|' . $way . '|' . $value, Wekit::C('site', 'hash') . '___findpwd');
     return rawurlencode($code);
 }
開發者ID:fanqimeng,項目名稱:4tweb,代碼行數:13,代碼來源:PwFindPassword.php

示例10: login

 /**
  * 後台用戶登錄服務
  *
  * 後台用戶登錄服務,並返回用戶對象.參數信息:<code>
  * $loginInfo: AdminUser
  * </code>
  *
  * @param string $username 用戶名
  * @param string $password 密碼
  * @return boolean
  */
 public function login($username, $password)
 {
     $srv = $this->loadFounderService();
     if (!$srv->isFounder($username)) {
         $srv = $this->loadManagerService();
     }
     if (($result = $srv->login($username, $password)) instanceof PwError) {
         return $result;
     }
     Pw::setCookie($this->cookieName, Pw::encrypt(implode("\t", $result)), 1800);
     return true;
 }
開發者ID:chendong0444,項目名稱:phpwind,代碼行數:23,代碼來源:AdminUserService.php

示例11: createIdentity

 /** 
  * 創建登錄用戶標識
  *
  * @param int $uid 用戶ID
  * @param string $password 用戶密碼
  * @param int $rememberme 是否采用記住當前用戶,記住則保存1年
  * @return boolean
  */
 public function createIdentity($uid, $password, $rememberme = 0)
 {
     $identity = Pw::encrypt($uid . "\t" . Pw::getPwdCode($password));
     return Pw::setCookie('winduser', $identity, $rememberme ? 31536000 : NULL);
 }
開發者ID:chendong0444,項目名稱:phpwind,代碼行數:13,代碼來源:PwUserService.php

示例12: createIdentify

 /**
  * 創建找回密碼的唯一標識
  *
  * @param string $uid 需要找回密碼的用戶名
  * @param string $way 找回方式標識
  * @param string $value 找回方式對應的值
  * @return string
  */
 public static function createIdentify($uid, $type, $passwd)
 {
     $code = Pw::encrypt($uid . '|' . $type . '|' . $passwd, Wekit::C('site', 'hash') . '___verify');
     return rawurlencode($code);
 }
開發者ID:sanzhumu,項目名稱:nextwind,代碼行數:13,代碼來源:App_Verify_Service.php

示例13: _saveVerifyCode

 private function _saveVerifyCode()
 {
     Wind::import('LIB:utility.verifycode.PwBaseCode');
     $code = WindConvert::convert(PwBaseCode::getCode(), Wekit::V('charset'), 'UTF-8');
     $code = Pw::encrypt(strtolower($code), $this->_config['key']);
     //
     $verify_session_id = Pw::getCookie('Pw_verify_code');
     if (!$verify_session_id) {
         $verify_session_id = md5($code);
         Pw::setCookie('Pw_verify_code', md5($code), 3600);
     }
     //session 保存驗證碼
     Wind::import('WIND:http.session.WindSession');
     $session = new WindSession();
     $session->set('verifycode', $code);
 }
開發者ID:chendong0444,項目名稱:phpwind,代碼行數:16,代碼來源:PwVerifyCode.php


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