当前位置: 首页>>代码示例>>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;未经允许,请勿转载。