当前位置: 首页>>代码示例>>PHP>>正文


PHP Fn::crypt方法代码示例

本文整理汇总了PHP中Fn::crypt方法的典型用法代码示例。如果您正苦于以下问题:PHP Fn::crypt方法的具体用法?PHP Fn::crypt怎么用?PHP Fn::crypt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Fn的用法示例。


在下文中一共展示了Fn::crypt方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: actionUpdatePwd

 public function actionUpdatePwd()
 {
     $response = array();
     $user_phone = $this->request->getParam('user_phone');
     $new_pwd = trim($this->request->getParam('new_pwd'));
     $phone_code = trim($this->request->getParam('phone_code'));
     $verifyCode = FCookie::get(FConfig::item('config.cookie.phone_key'));
     $verifyCode = Fn::crypt($verifyCode, FConfig::item('config.cookie.phone_code'), 'decode');
     if ($phone_code != $verifyCode) {
         $response['status'] = 100001;
         $response['content'] = '短信验证失败!';
     } else {
         $res = $this->user_model->updateAll(array('password' => md5($new_pwd)), 'phone_num=:phone', array(':phone' => $user_phone));
         if ($res) {
             $response['status'] = 100000;
             $response['content'] = '修改密码成功!';
         } else {
             $response['status'] = 100002;
             $response['content'] = '修改密码失败!';
         }
     }
     Yii::app()->end(FHelper::json($response['content'], $response['status']));
 }
开发者ID:niujie123,项目名称:myself,代码行数:23,代码来源:LoginController.php

示例2: actionSendMsgPhone

 public function actionSendMsgPhone()
 {
     $sendMessage = new SendMessage();
     $response = array();
     $code = FHelper::generate_code();
     $content = FConfig::item('siteMessage.register.first') . $code . FConfig::item('siteMessage.register.end');
     $user = FConfig::item('config.ws_mobile.userName');
     $pass = FConfig::item('config.ws_mobile.passWord');
     $today = date('Y-m-d 0:0:0', time());
     $condition = array('condition' => "mobile_no = '{$this->user['phone_num']}' and send_time >= '{$today}'");
     $messageCount = $sendMessage->count($condition);
     if ($messageCount < 5) {
         Yii::import('ext.wsMobile.ws.*');
         require_once 'ws-demo.php';
         $engine = WS_SDK::getInstance($user, $pass);
         $res = $engine->sendSmsAsNormal($this->user['phone_num'], $content, '', 0);
         if (intval($res) === 0) {
             $cryRes = Fn::crypt($code, FConfig::item('config.cookie.phone_code'));
             FCookie::set(FConfig::item('config.cookie.phone_key'), $cryRes);
             $response['status'] = 100000;
             $response['content'] = '短信发送成功';
             $telArr = array('mobile_no' => $this->user['phone_num'], 'mess_code' => $code, 'send_time' => FF_DATE_TIME);
             $sendMessage->attributes = $telArr;
             $sendMessage->save();
         } else {
             $response['status'] = 100001;
             $response['content'] = '短信发送失败,请重试';
         }
     } else {
         $response['status'] = 100002;
         $response['content'] = '该手机号码今天发送验证码过多';
     }
     Yii::app()->end(FHelper::json($response['content'], $response['status']));
 }
开发者ID:niujie123,项目名称:myself,代码行数:34,代码来源:UserController.php


注:本文中的Fn::crypt方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。