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


PHP _encrypt函数代码示例

本文整理汇总了PHP中_encrypt函数的典型用法代码示例。如果您正苦于以下问题:PHP _encrypt函数的具体用法?PHP _encrypt怎么用?PHP _encrypt使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: CheckAdminInfo

 protected final function CheckAdminInfo($uid = null, $ashell = null)
 {
     $this->db = System::load_app_model('admin_model', G_ADMIN_DIR);
     if ($uid && $ashell) {
         $CheckId = _encrypt($uid, 'DECODE');
         $CheckAshell = _encrypt($ashell, 'DECODE');
     } else {
         $CheckId = _encrypt(_getcookie("AID"), 'DECODE');
         $CheckAshell = _encrypt(_getcookie("ASHELL"), 'DECODE');
     }
     if (!$CheckId || !$CheckAshell) {
         return false;
     }
     $info = $this->db->GetOne("SELECT * FROM `@#_admin` WHERE `uid` = '{$CheckId}'");
     if (!$info) {
         return false;
     }
     $infoshell = md5($info['username'] . $info['userpass']) . md5($_SERVER['HTTP_USER_AGENT']);
     if ($infoshell != $CheckAshell) {
         return false;
     }
     if (empty($_SESSION['token']) && $_SESSION['token'] != md5($info['username'] . $info['userpass'])) {
         return false;
     }
     $this->AdminInfo = $info;
     return true;
 }
开发者ID:haidao17,项目名称:backend,代码行数:27,代码来源:admin.class.php

示例2: CheckAdminInfo

 protected final function CheckAdminInfo($uid = null, $ashell = null)
 {
     $this->db = System::load_app_model('admin_model', G_ADMIN_DIR);
     if ($uid && $ashell) {
         $CheckId = _encrypt($uid, 'DECODE');
         $CheckAshell = _encrypt($ashell, 'DECODE');
     } else {
         $CheckId = _encrypt(_getcookie("AID"), 'DECODE');
         $CheckAshell = _encrypt(_getcookie("ASHELL"), 'DECODE');
     }
     if (!$CheckId || !$CheckAshell) {
         return false;
     }
     $info = $this->db->GetOne("SELECT * FROM `@#_admin` WHERE `uid` = '{$CheckId}'");
     if (isset($_POST['dosubmit']) || isset($_POST['submit-1'])) {
         if ($info[mid] == '1') {
             _message("测试帐号无修改权限!");
         }
     }
     if (!$info) {
         return false;
     }
     $infoshell = md5($info['username'] . $info['userpass']) . md5($_SERVER['HTTP_USER_AGENT']);
     if ($infoshell != $CheckAshell) {
         return false;
     }
     $this->AdminInfo = $info;
     return true;
 }
开发者ID:ping199143,项目名称:1ydb,代码行数:29,代码来源:admin.class.php

示例3: insert

 public function insert()
 {
     $msg = array();
     $path = isset($_POST['path']) ? _encrypt($_POST['path'], 'DECODE') : '';
     $size = isset($_POST['size']) ? _encrypt($_POST['size'], 'DECODE') : 0;
     $type = isset($_POST['type']) ? _encrypt($_POST['type'], 'DECODE') : 'image';
     $type = explode(',', $this->getUPtype($type, true));
     $watermark = $_POST['iswatermark'] == "true" ? "yes" : "no";
     if (!is_dir(G_UPLOAD . $path)) {
         $msg['ok'] = 'no';
         $msg['text'] = $path . "文件夹不存在";
         echo json_encode($msg);
         exit;
     }
     System::load_app_class("admin", G_ADMIN_DIR, "no");
     $admincheck = admin::StaticCheckAdminInfo() ? 1 : 0;
     if (is_array($_FILES['Filedata'])) {
         System::load_sys_class('upload', 'sys', 'no');
         upload::upload_config($type, $size, $path);
         upload::go_upload($_FILES['Filedata'], $watermark);
         if (!upload::$ok) {
             $msg['ok'] = 'no';
             $msg['text'] = upload::$error;
         } else {
             $msg['ok'] = 'yes';
             $msg['text'] = $path . '/' . upload::$filedir . "/" . upload::$filename;
         }
         echo json_encode($msg);
     }
 }
开发者ID:think-css,项目名称:yungou,代码行数:30,代码来源:uploadify.action.php

示例4: card_addmoney

 public function card_addmoney()
 {
     $czknum = htmlspecialchars($_POST['czknum']);
     $password = htmlspecialchars($_POST['password']);
     if (empty($czknum) or empty($password)) {
         _message("您尚未填写卡密信息");
     }
     $czkdata = $this->db->GetList("select * from `@#_czk` where `status` = '1'  AND czknum='{$czknum}' AND password='{$password}'");
     if (!$czkdata) {
         _message("卡号或卡密不正确");
     }
     $czkdata = $czkdata[0];
     $uid = intval(_encrypt(_getcookie("uid"), 'DECODE'));
     //查询用户信息
     if ($czkdata['type'] == 1) {
         $members = $this->db->GetList("select * from `@#_member` where uid='{$uid}'");
         $money = $czkdata['mianzhi'] + $members[0]['money'];
         $this->db->Query("UPDATE `@#_member` SET money='{$money}' where `uid`='{$uid}' ");
     } else {
         $members = $this->db->GetList("select * from `@#_member` where uid='{$uid}' and tyczk='0'");
         if (empty($members)) {
             _message("卡密不存在或者已经参与此活动!");
             die;
         }
         $money = $czkdata['mianzhi'] + $members[0]['money'];
         $this->db->Query("UPDATE `@#_member` SET money='{$money}',tyczk='1' where `uid`='{$uid}' ");
     }
     $this->db->Query("UPDATE `@#_czk` SET status='0' where czknum='{$czknum}' AND password='{$password}' ");
     $time = time();
     $this->db->Query("INSERT INTO `@#_member_account`(uid,type,pay,content,money,time)VALUES('{$uid}','1','账户','充值卡','{$czkdata['mianzhi']}','{$time}')");
     _message("充值成功!");
 }
开发者ID:shuay,项目名称:projectYG,代码行数:32,代码来源:cart.action.php

示例5: __construct

 public function __construct()
 {
     if (ROUTE_M == 'member' && ROUTE_C == 'user' && ROUTE_A == 'login') {
         return;
     }
     if (ROUTE_M == 'member' && ROUTE_C == 'user' && ROUTE_A == 'register') {
         return;
     }
     $uid = intval(_encrypt(_getcookie("uid"), 'DECODE'));
     $utype = _encrypt(_getcookie("utype"), 'DECODE');
     $ushell = _encrypt(_getcookie("ushell"), 'DECODE');
     if ($utype === NULL) {
         $this->HeaderLogin();
     }
     if (!$uid) {
         $this->HeaderLogin();
     }
     $this->userinfo = $this->DB()->GetOne("SELECT * from `@#_member` where `uid` = '{$uid}'");
     if (!$this->userinfo) {
         $this->HeaderLogin();
     }
     $shell = md5($this->userinfo['uid'] . $this->userinfo['password'] . $this->userinfo[$utype]);
     if ($ushell != $shell) {
         $this->HeaderLogin();
     }
 }
开发者ID:ping199143,项目名称:1ydb,代码行数:26,代码来源:base.class.php

示例6: insert

 public function insert()
 {
     $msg = array();
     $path = isset($_POST['path']) ? _encrypt($_POST['path'], 'DECODE') : '';
     $size = isset($_POST['size']) ? _encrypt($_POST['size'], 'DECODE') : 0;
     $type = isset($_POST['type']) ? _encrypt($_POST['type'], 'DECODE') : 'image';
     $type = explode(',', $this->getUPtype($type, true));
     if (!is_dir(G_UPLOAD . $path)) {
         $msg['ok'] = 'no';
         $msg['text'] = $path . "文件夹不存在";
         echo json_encode($msg);
         exit;
     }
     if (is_array($_FILES['Filedata'])) {
         System::load_sys_class('upload', 'sys', 'no');
         upload::upload_config($type, $size, $path);
         upload::go_upload($_FILES['Filedata']);
         if (!upload::$ok) {
             $msg['ok'] = 'no';
             $msg['text'] = upload::$error;
         } else {
             $msg['ok'] = 'yes';
             $msg['text'] = $path . '/' . upload::$filedir . "/" . upload::$filename;
         }
         echo json_encode($msg);
     }
 }
开发者ID:king3388,项目名称:king,代码行数:27,代码来源:uploadify.action.php

示例7: Tdefault

 public function Tdefault()
 {
     $info = $this->AdminInfo;
     $SysInfo = GetSysInfo();
     $SysInfo['MysqlVersion'] = $this->db->GetVersion();
     $versions = System::load_sys_config("version");
     $banben_arr = explode(",", _encrypt(G_BANBEN_TYPE, "DECODE", "G_BANBEN_TYPE"));
     $banben_num = G_BANBEN_NUMBER;
     if (isset($banben_arr[$banben_num])) {
         $banben_txt = $banben_arr[$banben_num];
     } else {
         if (G_BANBEN_NUMBER == -1) {
             $banben_txt = base64_decode("5pyq5o6I5p2D");
         } else {
             if (G_BANBEN_NUMBER == -2) {
                 $banben_txt = base64_decode("5o6I5p2D5Yiw5pyf");
             } else {
                 $banben_txt = base64_decode("5pyq5o6I5p2D");
             }
         }
     }
     $yungou_alert = file_get_contents("http://www.baidu.com");
     $text = $banben_txt;
     //$catelen = $this->db->count();
     include $this->tpl(ROUTE_M, 'admin.default');
 }
开发者ID:ping199143,项目名称:1ydb,代码行数:26,代码来源:index.action.php

示例8: setUp

 public function setUp()
 {
     db_delete_multi('document');
     db_delete_multi('post_image');
     db_delete_multi('post');
     db_delete_multi('category');
     db_delete_multi('lc_sessions');
     db_delete_multi('user');
     db_insert('user', array('fullName' => 'Administrator', 'uid' => 1, 'username' => 'admin', 'password' => _encrypt('admin'), 'email' => 'admin@localhost.com', 'role' => 'admin', 'isMaster' => 1));
 }
开发者ID:phplucidframe,项目名称:phplucidframe,代码行数:10,代码来源:LucidFrameTestCase.php

示例9: spcook

function spcook($me)
{
    $mysql_model = System::load_sys_class('model');
    $uid = _encrypt(_getcookie('uid'), 'DECODE');
    $member = $mysql_model->GetOne("select * from `@#_member` where `uid`='" . $uid . "'");
    if ($me == "pic") {
        $img = explode(".", $member['img']);
        return $img[1];
    } else {
        return $member[$me];
    }
}
开发者ID:ping199143,项目名称:1ydb,代码行数:12,代码来源:user.fun.php

示例10: cook

 public function cook()
 {
     $mysql_model = System::load_sys_class('model');
     $uid = _encrypt(_getcookie('uid'), 'DECODE');
     $member = $mysql_model->GetOne("select * from `@#_member` where `uid`='" . $uid . "'");
     if (!$member) {
         $lei = $this->segment(2);
         $funct = $this->segment(3);
         //echo $lei;
         header("location:" . WEB_PATH . "home/user/login?lei=" . $lei . "&funct=" . $funct);
         exit;
     } else {
         return $member;
     }
 }
开发者ID:ping199143,项目名称:1ydb,代码行数:15,代码来源:base.class.php

示例11: send_email_reg

/**
*	发送用户验证邮箱
*	email  @用户邮箱地址
*   uid    @用户的ID
*/
function send_email_reg($email = null, $uid = null)
{
    $db = System::load_sys_class('model');
    $checkcode = _getcode(10);
    $checkcode_sql = $checkcode['code'] . '|' . $checkcode['time'];
    $check_code = serialize(array("email" => $email, "code" => $checkcode['code'], "time" => $checkcode['time']));
    $check_code_url = _encrypt($check_code, "ENCODE", '', 3600 * 24);
    $clickurl = WEB_PATH . '/member/user/emailok/' . $check_code_url;
    $db->Query("UPDATE `@#_member` SET `emailcode`='{$checkcode_sql}' where `uid`='{$uid}'");
    $web_name = _cfg("web_name");
    $title = _cfg("web_name") . "激活注册邮箱";
    $template = $db->GetOne("select * from `@#_caches` where `key` = 'template_email_reg'");
    $url = '<a href="';
    $url .= $clickurl . '">';
    $url .= $clickurl . "</a>";
    $template['value'] = str_ireplace("{地址}", $url, $template['value']);
    return _sendemail($email, '', $title, $template['value']);
}
开发者ID:king3388,项目名称:king,代码行数:23,代码来源:send.fun.php

示例12: __construct

 public function __construct()
 {
     $this->mysql_model = System::load_sys_class('model');
     $this->userid = intval(_encrypt(_getcookie("uid"), 'DECODE'));
     //获取当前客户的基本信息 (积分、剩余金额等)
     $this->userinfo = $this->mysql_model->GetOne("SELECT * from `@#_member` where `uid` = '{$this->userid}'");
     $curtime = time();
     /* if(!$this->userid){
     			_message("你还未登录,无权限访问该页!",WEB_PATH."/member/user/login");
     	    } */
     //显示当前抽奖第几期
     $this->ruleinfo = $this->mysql_model->GetOne("select * from `@#_egglotter_rule` where `starttime`<='{$curtime}' and `endtime`>='{$curtime}' and `startusing`=1");
     $this->username = $this->userinfo['username'];
     $rule_id = $this->ruleinfo['rule_id'];
     if (!$this->ruleinfo) {
         _message("没有设置游戏");
     }
     //产看当期奖品
     $this->spoilinfo = $this->mysql_model->GetList("select * from `@#_egglotter_spoil` where `rule_id`='{$rule_id}'");
 }
开发者ID:king3388,项目名称:king,代码行数:20,代码来源:egglotter.plugin.php

示例13: checkuser

 protected function checkuser($uid, $ushell)
 {
     $uid = intval(_encrypt($uid, 'DECODE'));
     $ushell = _encrypt($ushell, 'DECODE');
     if (!$uid) {
         return false;
     }
     if ($ushell === NULL) {
         return false;
     }
     $this->userinfo = $this->db->GetOne("SELECT * from `@#_member` where `uid` = '{$uid}'");
     if (!$this->userinfo) {
         $this->userinfo = false;
         return false;
     }
     $shell = md5($this->userinfo['uid'] . $this->userinfo['password'] . $this->userinfo['mobile'] . $this->userinfo['email']);
     if ($ushell != $shell) {
         $this->userinfo = false;
         return false;
     } else {
         return true;
     }
 }
开发者ID:king3388,项目名称:king,代码行数:23,代码来源:base.class.php

示例14: StaticCheckAdminInfo

 static final function StaticCheckAdminInfo($uid = null, $ashell = null)
 {
     $db = System::load_app_model('admin_model', G_ADMIN_DIR);
     if ($uid && $ashell) {
         $CheckId = _encrypt($uid, 'DECODE');
         $CheckAshell = _encrypt($ashell, 'DECODE');
     } else {
         $CheckId = _encrypt(_getcookie("AID"), 'DECODE');
         $CheckAshell = _encrypt(_getcookie("ASHELL"), 'DECODE');
     }
     if (!$CheckId || !$CheckAshell) {
         return false;
     }
     $info = $db->GetOne("SELECT * FROM `@#_admin` WHERE `uid` = '{$CheckId}'");
     if (!$info) {
         return false;
     }
     $infoshell = md5($info['username'] . $info['userpass']) . md5($_SERVER['HTTP_USER_AGENT']);
     if ($infoshell != $CheckAshell) {
         return false;
     }
     return $info;
 }
开发者ID:think-css,项目名称:yungou,代码行数:23,代码来源:admin.class.php

示例15: __construct

 public function __construct()
 {
     $this->userid = intval(_encrypt(_getcookie("uid"), 'DECODE'));
 }
开发者ID:think-css,项目名称:yungou,代码行数:4,代码来源:vote.action.php


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