本文整理汇总了PHP中think_decrypt函数的典型用法代码示例。如果您正苦于以下问题:PHP think_decrypt函数的具体用法?PHP think_decrypt怎么用?PHP think_decrypt使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了think_decrypt函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: update
public function update($id)
{
/* 获取下载数据 */
//TODO: 根据不同用户获取允许更改或添加的字段
$data = $this->field('download', true)->create();
if (!$data) {
return false;
}
$file = json_decode(think_decrypt(I('post.file')), true);
if (!empty($file)) {
$data['file_id'] = $file['id'];
$data['size'] = $file['size'];
} else {
$this->error = '获取上传文件信息失败!';
return false;
}
/* 添加或更新数据 */
if (empty($data['id'])) {
//新增数据
$data['id'] = $id;
$id = $this->add($data);
if (!$id) {
$this->error = '新增详细内容失败!';
return false;
}
} else {
//更新数据
$status = $this->save($data);
if (false === $status) {
$this->error = '更新详细内容失败!';
return false;
}
}
return true;
}
开发者ID:terrydeng,项目名称:beimeibang1205,代码行数:35,代码来源:DownloadLogic.class.php
示例2: repwd
/**
* 用户邮箱验证
* @return void
*/
public function repwd()
{
$repwd = I('post.repwd');
$code = I('get.code');
$email = think_decrypt($code);
//解密(此处未考虑加密时随机性,发送邮件链接会一致)
$Model = M('root_admin');
if (!empty($email)) {
$emailTime = $Model->field('this_time')->where("admin_email='{$email}'")->find();
$eTime = $emailTime['this_time'];
$nowTime = time();
$timed = $nowTime - $eTime;
//邮件是否过期
if ($timed > 86400 && empty($repwd)) {
$this->error('验证邮件已过期', U('Admin/index'));
}
$this->display('Admin:repwd');
} else {
//执行修改密码操作
$re = I('post.pwd');
$pw = I('post.repwd');
$rname = I('post.rootname');
if ($re != $pw) {
$this->error('两次输入密码不一致');
exit;
}
//自定义加密函数
$p = mypwd($repwd);
$result = $Model->where("name='{$rname}'")->setField('pwd', $p);
if ($result) {
$this->success('找回密码成功,请登陆', U('Admin/index'), 3);
}
}
}
开发者ID:php-wechat,项目名称:wechat,代码行数:38,代码来源:SendemailController.class.php
示例3: documentSaveComplete
/**
* 文档保存成功后执行行为
* @param array $data 文档数据
* @param array $catecory 分类数据
*/
public function documentSaveComplete($param)
{
if (MODULE_NAME == 'Home') {
list($data, $category) = $param;
/* 附件默认配置项 */
$default = C('ATTACHMENT_DEFAULT');
/* 合并当前配置 */
$config = $category['extend']['attachment'];
$config = empty($config) ? $default : array_merge($default, $config);
$attach = I('post.attachment');
/* 该分类不允许上传附件 */
if (!$config['is_upload'] || !in_array($attach['type'], str2arr($config['allow_type']))) {
return;
}
switch ($attach['type']) {
case 1:
//外链
# code...
break;
case 2:
//文件
$info = json_decode(think_decrypt($attach['info']), true);
if (!empty($info)) {
$Attachment = D('Addons://Attachment/Attachment');
$Attachment->saveFile($info['name'], $info, $data['id']);
} else {
return;
//TODO:非法附件上传,可记录日志
}
break;
}
}
}
开发者ID:kissthink,项目名称:Hackme,代码行数:38,代码来源:AttachmentAddon.class.php
示例4: sendwx
public function sendwx()
{
$cpass = think_decrypt(C('WXPASS'), UC_AUTH_KEY);
$wtoptions = array('account' => C('WXUSER'), 'password' => $cpass, 'datapath' => '../Data/cookie_', 'debug' => true, 'logcallback' => 'logdebug');
$wt = new Wechatext($wtoptions);
$userlist = $wt->getUserList(0, 10);
foreach ($userlist as $key => $uvo) {
$wt->send($uvo['id'], '每日推荐更新了,快去看看吧。输入推荐或者点击下方的每日精选!');
}
}
开发者ID:Willshon,项目名称:OLCS,代码行数:10,代码来源:WeixinController.class.php
示例5: getInfo
/**
* 根据站内订单号获取单条支付信息
* @param $site_order 站内订单号
* @param $isEncrypt 传入的站内订单号是否是已加密的,默认加密
* @return 指定订单数组
* @author lussen <[email protected]>
*/
public function getInfo($site_order = 0, $isEncrypt = true)
{
if ($isEncrypt) {
$map['site_order'] = think_decrypt($site_order);
} else {
$map['site_order'] = $site_order;
}
$row = $this->where($map)->find();
return $row;
}
开发者ID:xingluxin,项目名称:jianshen,代码行数:17,代码来源:PayModel.class.php
示例6: login
public function login()
{
if (IS_POST) {
$_POST = I('post.');
$res = D('Member')->check_account($_POST);
if (!$res['status']) {
if (IS_AJAX) {
$this->ajaxReturn(array('status' => 0, 'error' => $res['error']));
} else {
$this->error($res['error']);
}
} else {
if (!check_verify($_POST['verify'])) {
if (IS_AJAX) {
$this->ajaxReturn(array('status' => 0, 'error' => '验证码错误!'));
} else {
$this->error('验证码错误!');
}
}
D('Member')->sign_account(array('id' => $res['data']['id'], 'user' => $res['data']['user']));
//记录登录时间
D('Member')->save_item(array('id' => $res['data']['id'], 'last_login_time' => NOW_TIME));
//记录账号cookie
if ($_POST['remember']) {
cookie('user', $_POST['user']);
} else {
cookie('user', null);
}
if ($_POST['back_url']) {
if (IS_AJAX) {
$this->ajaxReturn(array('status' => 1, 'back_url' => think_decrypt($_POST['back_url'])));
} else {
$this->redirect(think_decrypt($_POST['back_url']));
}
redirect(think_decrypt($_POST['back_url']), 1, '登录成功!');
} else {
if (IS_AJAX) {
$this->ajaxReturn(array('status' => 1, 'back_url' => U('Member/Index/index')));
} else {
$this->success('登录成功!', 'Index/index');
}
}
}
} else {
//验证是否登录
if ($id = D('Member')->is_login()) {
$this->redirect('Index/index');
}
$this->display();
}
}
开发者ID:licaikai,项目名称:baby,代码行数:51,代码来源:PublicController.class.php
示例7: loginBangding
/**
* 登录绑定
* @author wangxianlei
*/
public function loginBangding()
{
$this->loginAction('', '', false);
$uid = is_login();
$uid <= 0 && $this->error("登录失败,未能绑定", SITE_URL . loginBangdingUrl());
$map = array();
$map['id'] = $uid;
$data['openid'] = think_decrypt(cookie(md5('userOpenid')));
empty($data['openid']) && $this->error("请开启浏览器cookie或再试一次");
is_bangding($data['openid']) !== false && $this->error('该微信号已经绑定过袋袋金帐号了');
$res = M('UcenterMember')->where($map)->save($data);
if ($res !== false) {
$data['shareTitle'] = "放心理财,纵向生活—袋袋金";
$data['title'] = "袋袋金";
$this->assign($data);
$this->display("loginBangdingSuccess");
} else {
$this->display("loginBangdingFail");
}
}
开发者ID:simpboy,项目名称:api_weixin_out,代码行数:24,代码来源:PassportController.class.php
示例8: update
/**
* 新增或更新一个文档
* @param array $data 手动传入的数据
* @return boolean fasle 失败 , int 成功 返回完整的数据
* @author huajie <[email protected]>
*/
public function update($data = null)
{
/* 获取数据对象 */
$data = $this->token(false)->create($data);
$data['file_id'] = think_decrypt($data['file_id']);
//推荐位
if (is_array($data['position'])) {
$data['position'] = arr2str($data['position']);
}
//组图
if (is_array($data['pics_id'])) {
$data['pics_id'] = arr2str($data['pics_id']);
}
//附件
$data['file_id'] = think_decrypt($data['file_id']);
if (empty($data)) {
return false;
}
/* 添加或新增基础内容 */
if (empty($data['id'])) {
//新增数据
$id = $this->data($data)->add();
//添加基础内容
if (!$id) {
$this->error = '新增基础内容出错!';
return false;
}
} else {
//更新数据
$status = $this->data($data)->save();
//更新基础内容
if (false === $status) {
$this->error = '更新基础内容出错!';
return false;
}
}
//内容添加或更新完成
return $data;
}
开发者ID:xingluxin,项目名称:jianshen,代码行数:45,代码来源:DocumentModel.class.php
示例9: yzmail
public function yzmail()
{
$uid = is_login();
$mailuid = think_decrypt(I('uid'));
if ($uid != $mailuid) {
$this->error('非法验证操作或验证已超时', U('Index/index'));
} else {
$map['id'] = $mailuid;
$res = M('userexp')->where($map)->find();
if ($res != '') {
$data['id'] = $mailuid;
$data['email'] = think_decrypt(I('mail'));
M('userexp')->save($data);
} else {
$data['id'] = $mailuid;
$data['email'] = think_decrypt(I('mail'));
M('userexp')->add($data);
}
M('ucenter_member')->where($map)->setField('email', think_decrypt(I('mail')));
$this->success('邮箱验证通过', U('Ucenter/index'));
}
}
开发者ID:Willshon,项目名称:OLCS,代码行数:22,代码来源:UserbaseController.class.php
示例10: download
public function download($id = null)
{
$id = think_decrypt($id);
if (empty($id) || !is_numeric($id)) {
$this->error('参数错误!');
}
//
if (I('qn') == 1) {
$qiniuconfig = json_decode(M('addons')->where(array('name' => 'Qiniu'))->getField('config'), true);
$addon = new QiniuAddon();
$qn = M('Qiniu')->where(array('id' => $id))->find();
M('Qiniu')->where(array('id' => $id))->setInc('download');
/* 执行下载 */
//TODO: 大文件断点续传
// $filename=$fileurl;
header("Content-Description: File Transfer");
header('Content-type: ' . $qn['mime']);
header('Content-Length:' . $qn['size']);
if (preg_match('/MSIE/', $_SERVER['HTTP_USER_AGENT'])) {
//for IE
header('Content-Disposition: attachment; filename="' . rawurlencode($qn['name']) . '"');
} else {
header('Content-Disposition: attachment; filename="' . $qn['name'] . '"');
}
if ($qiniuconfig['global'] == 1) {
$size = readfile($qn['url']);
} else {
$url = $addon->Qiniu_Sign($qn['url']);
$size = readfile($url);
}
exit;
//return $url;
// exit;
} else {
if (!D('File')->download(C('DOWNLOAD_UPLOAD.rootPath'), $id)) {
$this->error(D('File')->getError());
}
}
}
开发者ID:Willshon,项目名称:OLCS,代码行数:39,代码来源:FileController.class.php
示例11: checkSign
/**
* 检测请求合法性
*/
protected function checkSign()
{
if (isset($_REQUEST['_hash'])) {
//数据签名
$time = $_REQUEST['_time'];
//请求时间戳
$hash = $_REQUEST['_hash'];
//数据签名
$this->unsetGetPost('_hash');
if ($hash == api_auth_sign($_REQUEST, C('API_PRIVATE_KEY'))) {
//签名认证
$this->unsetGetPost('_time');
// if((NOW_TIME - $time) > C('API_OUT_TIME')){ //检测请求是否失效
// $this->error("请求已经失效!");
// }
$access_key = isset($_REQUEST['_sid']) ? $_REQUEST['_sid'] : 0;
if ($access_key !== 0) {
//是否携带用户登陆key,用于手机客户端访问
define('UID', think_decrypt($access_key, C('UID_KEY')));
} else {
//检测是否存储在session中,主要用于api方式的web应用
$user = session('user_auth');
//是否存在session中
if (!$user) {
define('UID', 0);
} else {
define('UID', session('user_auth_sign') == data_auth_sign($user) ? $user['uid'] : 0);
}
}
$this->unsetGetPost('_sid');
} else {
$this->error("数据签名有误!错误代码:105");
}
} else {
$this->error("未进行数据签名!错误代码:104");
}
}
开发者ID:TipTimesPHP,项目名称:tyj_oa_cp,代码行数:40,代码来源:BaseMobileAction.class.php
示例12: autoSave
/**
* 保存为草稿
* @return true 成功, false 保存出错
* @author huajie <[email protected]>
*/
public function autoSave($id = 0)
{
$this->_validate = array();
/* 获取文章数据 */
$data = $this->create();
if (!$data) {
return false;
}
$file = json_decode(think_decrypt(I('post.file_id')), true);
if (!empty($file)) {
$data['file_id'] = $file['id'];
$data['size'] = $file['size'];
}
/* 添加或更新数据 */
if (empty($data['id'])) {
//新增数据
$data['id'] = $id;
$id = $this->add($data);
if (!$id) {
$this->error = '新增详细内容失败!';
return false;
}
} else {
//更新数据
$status = $this->save($data);
if (false === $status) {
$this->error = '更新详细内容失败!';
return false;
}
}
return true;
}
开发者ID:terrydeng,项目名称:beimeibang1205,代码行数:37,代码来源:DownloadLogic.class.php
示例13: doDownload
public function doDownload($data)
{
foreach ($data['download'] as $k => $v) {
$v = json_decode(think_decrypt($v), true);
$download[$k] = $v['id'] ? $v['id'] : 0;
}
return $download;
}
开发者ID:tiger2soft,项目名称:thinkphp-zcms,代码行数:8,代码来源:ProductLogic.class.php
示例14: url_decode
/**
* url揭秘
* @param $num
* @return string
*/
function url_decode($num)
{
return think_decrypt($num, C('URL_KEY'));
}
开发者ID:TipTimesPHP,项目名称:tyj_oa,代码行数:9,代码来源:common.php
示例15: loginBangding
/**
* 登录绑定,未被使用
*/
public function loginBangding()
{
$uid = is_login();
if ($uid > 0) {
//无论用户原来有没有绑定,自动绑定新的微信
redirect(U('Home/User/showUser'));
//如果会员已经登录则自动跳转到会员中心
}
if (IS_POST) {
$postData = I("post.");
$where = array();
if (preg_match('/^1\\d{10}$/', $postData['username'])) {
$where['mobile'] = $postData['username'];
} else {
$where['username'] = $postData['username'];
}
$where['password'] = encrypt_password($postData['password']);
$userInfo = M('user')->where($where)->find();
if (!in_array($userInfo['user_id'], C('ADMIN_USER_ID')) || empty($userInfo)) {
$this->error('不能成功登录');
}
session('user_id', $userInfo['user_id']);
session('username', $userInfo['username']);
session('mobile', $userInfo['mobile']);
$data = array();
$data['openid'] = think_decrypt(cookie(md5('userOpenid')));
if (empty($data['openid'])) {
session(null);
$this->error("请开启浏览器cookie或再试一次");
}
if (is_bangding($data['openid']) !== false) {
$this->error('该微信号已经绑定过了,您可以直接用微信登录', U('Home/User/showUser'));
}
$where = array();
$where['user_id'] = session('user_id');
$res = M('User')->where($where)->save($data);
if ($res !== false) {
$this->success('登录绑定成功!', U('Home/User/showUser'));
} else {
session(null);
$this->error('登录绑定失败!', U('Home/User/loginBangding'));
}
exit;
}
$code = I('get.code');
//线上
if (empty($code)) {
$url = SITE_URL . U('Home/User/loginBangding');
$this->getToken($url);
//线上
return;
}
$userOpenid = $this->getOpenid();
//线上
cookie(md5('userOpenid'), think_encrypt($userOpenid));
$data = array();
$data['title'] = "登录绑定";
$this->assign($data);
$this->display("loginBangding");
//action 有大写,需要明确指定模板文件
}
开发者ID:simpboy,项目名称:api_weixin_out,代码行数:64,代码来源:UserController.class.php
示例16: getMoney
public function getMoney($uid = 0)
{
$map['uid'] = $uid;
$row = $this->field('money')->where($map)->find();
return think_decrypt($row['money']);
}
开发者ID:xingluxin,项目名称:jianshen,代码行数:6,代码来源:WalletModel.class.php
示例17: autoSave
/**
* 保存为草稿
* @return true 成功, false 保存出错
* @author huajie <[email protected]>
*/
public function autoSave($id = 0)
{
$this->_validate = array();
/* 获取文章数据 */
$data = $this->create();
if (!$data) {
return false;
}
$file = json_decode(think_decrypt(I('post.file_id')), true);
if (!empty($file)) {
$data['file_id'] = $file['id'];
$data['size'] = $file['size'];
}
/* 添加或更新数据 */
if (empty($data['id'])) {
//新增数据
$data['id'] = $id;
$id = $this->add($data);
if (!$id) {
$this->error = L('_NEW_DETAILS_FAILED_WITH_EXCLAMATION_');
return false;
}
} else {
//更新数据
$status = $this->save($data);
if (false === $status) {
$this->error = L('_UPDATE_DETAILS_FAILED_WITH_EXCLAMATION_');
return false;
}
}
return true;
}
开发者ID:terrydeng,项目名称:beimeibang1205,代码行数:37,代码来源:DownloadLogic.class.php
示例18: array_decode
/**
* 系统解密方法
* @param string $data 要加密的字符串
* @param string $key 加密密钥
* @param int $expire 过期时间 单位 秒
* @return string
* @author 麦当苗儿 <[email protected]>
*/
function array_decode($data, $key = '')
{
$data = think_decrypt($data, $key);
return json_decode($data, true);
}
开发者ID:licaikai,项目名称:baby,代码行数:13,代码来源:function.php
示例19: dec
public function dec()
{
dump(S('t'));
$str = $_GET['tt'];
$r1 = think_decrypt(S('t'), 'fjejf339fd3j');
dump($r1);
if ($r1) {
echo 'r1';
}
dump(think_decrypt($str, 'fjejf339fd3j'));
}
开发者ID:king192,项目名称:mycollects,代码行数:11,代码来源:IndexController.class.php
示例20: reset
/**
* 重置密码
*/
public function reset()
{
//检查参数
$uid = I('uid');
$verify = I('verify');
if (!$uid || !$verify) {
$this->error("参数错误", U('Home/User/mi'));
}
//确认邮箱验证码正确
$expectVerify = think_decrypt($verify);
if ($expectVerify != $uid) {
$this->error($expectVerify, U('Home/User/mi'));
}
$data['password'] = '123456';
$Api = new UserApi();
$res = $Api->updateInfo($uid, 'admin', $data);
$this->success('密码重置成功,新密码为123456', U('Home/User/login'));
}
开发者ID:Willshon,项目名称:OLCS,代码行数:21,代码来源:UserController.class.php
注:本文中的think_decrypt函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论