本文整理匯總了PHP中Crypt::de方法的典型用法代碼示例。如果您正苦於以下問題:PHP Crypt::de方法的具體用法?PHP Crypt::de怎麽用?PHP Crypt::de使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Crypt
的用法示例。
在下文中一共展示了Crypt::de方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: decrypt
function decrypt($eid, $prefix = "JHC")
{
// 默認ID都加密了,不允許ID直接訪問
if ($_GET['id'] && is_numeric($_GET['id'])) {
return 0;
}
if (strpos($eid, $prefix) === 0) {
$eid = substr($eid, 3);
return intval(Crypt::de($eid));
}
return $eid;
}
示例2: __construct
function __construct()
{
global $login_user;
global $partner;
// login as customer
if ($this->_get('token')) {
$cmd_user_id_viapm = intval(Crypt::de($this->_get('token')));
$login_user = D('CmsUsers')->getById($cmd_user_id_viapm);
Session::Set("login_user", $login_user);
Session::Set("via_pm", 1);
} else {
$login_user = Session::Get("login_user");
}
if (!empty($login_user)) {
$this->assign("login_user", $login_user);
$user_info = D(PM_NAME . "://UserInfo")->getUserInfo($login_user['id']);
if ($user_info && !$user_info['birthday']) {
$user_info['birthday'] = '1990-01-01';
// if(!$user_info['submit_time']) {
// $user_info['submit_time'] = date('Y-m-d');
// }
}
$this->user_info = $this->userinfo = $user_info;
define(USER_ID, $login_user['id']);
} else {
redirect("/");
}
$options = M("Options")->where("autoload = 'Y'")->select();
$INI = array();
foreach ($options as $index => $option) {
$INI[$option['option_name']] = $option['option_value'];
}
$this->assign("INI", $INI);
// 安全過濾
foreach ($_POST as $k => $v) {
if (!is_array($v)) {
$v = preg_replace('/script.*?\\/script/is', '', $v);
$v = preg_replace('/alert\\(.*?\\)/is', '', $v);
$v = str_replace(array('eval', 'function', 'onerror', 'alert'), '', $v);
// $_POST[$k] = htmlspecialchars($v);
}
}
// $this->user_info_items = $this->get_user_info();
}
示例3: decrypt_id
static function decrypt_id($eid, $prefix = "CYD")
{
if (strpos($eid, $prefix) === 0) {
$eid = substr($eid, 3);
return intval(Crypt::de($eid));
}
return $eid;
}
示例4: decrypt_id
function decrypt_id($eid, $prefix = "XSZZ")
{
if (strpos($eid, $prefix) === 0) {
$eid = substr($eid, 4);
return Crypt::de($eid);
}
return $eid;
}
示例5: verify_repass
public function verify_repass()
{
$id = Crypt::de($this->_param("id"));
$repasscode = $this->_param("repasscode");
$user = D("CmsUsers")->where(array("id" => $id, "repasscode" => $repasscode))->find();
if ($user) {
//為保證安全,用戶信息保存在session中,確認修改後再刪除
Session::set("repass_user", $user);
$this->display();
} else {
$this->display("repass_fail");
}
}
示例6: decrypt_id
function decrypt_id($eid)
{
if (strpos($eid, 'JXD') === 0) {
$eid = substr($eid, 3);
return Crypt::de($eid);
}
return $eid;
}