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


PHP Encrypt::decode方法代码示例

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


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

示例1: __get

 /**
  * Decrypt the data when taking it out of the database
  * @Developer brandon
  * @Date May 18, 2010
  */
 public function __get($key)
 {
     $value = parent::__get($key);
     if (in_array($key, array('content', 'title'))) {
         if ($value) {
             $encrypt = new Encrypt();
             $value = $encrypt->decode($value);
         }
     }
     return $value;
 }
开发者ID:ready4god2513,项目名称:Journal,代码行数:16,代码来源:journal.php

示例2: Next

 public static function Next($account, $queue)
 {
     $q = MessageQueue::Get($account);
     try {
         $message = $q->receive(1);
         $c = new Encrypt();
         $message = $c->decode($message);
         return new Message($account, $queue, $message);
     } catch (AWSException $ex) {
         return null;
     }
 }
开发者ID:jawngee,项目名称:HeavyMetal,代码行数:12,代码来源:message.php

示例3: ChangeSSPwd

 public function ChangeSSPwd()
 {
     $result = array('error' => 1, 'message' => '修改失败');
     $uid = trim($_GET['uid']);
     $user_cookie = explode('\\t', Encrypt::decode(base64_decode($_COOKIE['auth']), COOKIE_KEY));
     $sspwd = trim($_GET['sspwd']);
     if ('' == $sspwd || null == $sspwd) {
         $sspwd = Util::GetRandomPwd();
     }
     if ($uid == $user_cookie[0]) {
         $user = UserModel::GetUserByUserId($uid);
         $user->sspwd = $sspwd;
         $user->updateUser();
         $result = array('error' => 1, 'message' => '修改SS连接密码成功');
     }
     echo json_encode($result);
     exit;
 }
开发者ID:gclove,项目名称:shadowsocks-panel,代码行数:18,代码来源:Form.php

示例4: action_unsubscribe

 public function action_unsubscribe()
 {
     $email_encoded = $this->request->param('id');
     $user = new Model_User();
     //mail encoded
     if ($email_encoded !== NULL) {
         //decode emails
         $email_encoded = Base64::fix_from_url($email_encoded);
         $encrypt = new Encrypt(Core::config('auth.hash_key'), MCRYPT_MODE_NOFB, MCRYPT_RIJNDAEL_128);
         $email = $encrypt->decode($email_encoded);
         if (Valid::email($email, TRUE)) {
             //check we have this email in the DB
             $user = new Model_User();
             $user = $user->where('email', '=', $email)->limit(1)->find();
         } else {
             Alert::set(Alert::INFO, __('Not valid email.'));
         }
     } elseif (Auth::instance()->logged_in()) {
         $user = Auth::instance()->get_user();
     }
     //lets unsubscribe the user
     if ($user->loaded()) {
         $user->subscriber = 0;
         $user->last_modified = Date::unix2mysql();
         try {
             $user->save();
             Alert::set(Alert::SUCCESS, __('You have successfuly unsubscribed'));
         } catch (Exception $e) {
             //throw 500
             throw HTTP_Exception::factory(500, $e->getMessage());
         }
     } else {
         Alert::set(Alert::INFO, __('Pleae login to unsubscribe.'));
     }
     //smart redirect
     if (Auth::instance()->logged_in()) {
         $this->redirect(Route::url('oc-panel', array('controller' => 'profile', 'action' => 'edit')));
     } else {
         $this->redirect(Route::url('default'));
     }
 }
开发者ID:Ryanker,项目名称:open-eshop,代码行数:41,代码来源:auth.php

示例5: test_decode_invalid_data

 /**
  * Tests for decode when the string is not valid base64,
  * or is too short to contain a valid IV
  *
  * @param type $key
  * @param type $mode
  * @param type $cipher
  * @param type $txt_encoded
  *
  * @dataProvider provider_decode_invalid_data
  */
 public function test_decode_invalid_data($key, $mode, $cipher, $txt_invalid_encoded)
 {
     // initialize
     $e = new Encrypt($key, $mode, $cipher);
     // assert
     $this->AssertFalse($e->decode($txt_invalid_encoded));
 }
开发者ID:Chinese1904,项目名称:openclassifieds2,代码行数:18,代码来源:EncryptTest.php

示例6: load_ticket

	/**
	 * Generates the auth ticket and auto login cookies for a validated user
	 * 
	 * @param bool $remember_login Should the user's login info be remembered for auto-login?
	 */
	protected function load_ticket($ticket=null)
	{
		// get the ticket cookie
		if ($ticket==null)
			$ticket=get_cookie(self::$_config->auth_ticket_cookie);
		
		if ($ticket==false)
			return;

		$encrypter=new Encrypt();
		// decrypt the auth ticket
		
		$ass=$encrypter->decode($ticket);

		$content=explode("|@@!@@|",$ass);
		if (count($content)>1)
			$this->data=unserialize($content[0]);
	}
开发者ID:jawngee,项目名称:Thor,代码行数:23,代码来源:session.php

示例7: getToken

 public static function getToken($tokenName = "token")
 {
     $token = time() - Encrypt::decode(base64_decode(@$_COOKIE[$tokenName]), COOKIE_KEY);
     return $token;
 }
开发者ID:dreammes,项目名称:shadowsocks-panel,代码行数:5,代码来源:Util.php

示例8: isset

<?php

require "init.php";
$act = isset($_REQUEST["act"]) ? $_REQUEST["act"] : "default";
if ($act == "default") {
    $smarty->assign('web_name', constant("WEB_NAME"));
    if (isset($_COOKIE["curr_user_name"])) {
        //一周内自动登录
        $name = str_filter(urldecode($_COOKIE["curr_user_name"]));
        $name = Encrypt::decode($name);
        $sql = "select * from user where name = '" . $name . "'";
        $user = $db->get_row($sql, ARRAY_A);
        unset($user["pwd"]);
        $_SESSION["curr_user"] = $user;
        $user["err_login"] = 0;
        $id = $user["id"];
        unset($user["id"]);
        $db->query(SqlText::update("user", $user, "id = " . $id));
        header("location:admin_index.php");
        exit;
    } elseif (isset($_SESSION["curr_user"])) {
        header("location:admin_index.php");
        exit;
    }
    $smarty->display(WEBPATH_ADMIN . '/index.html');
} elseif ($act == "login") {
    $name = str_filter($_REQUEST["name"]);
    $pwd = str_filter($_REQUEST["pwd"]);
    $sql = "select * from user where name = '" . $name . "'";
    $user = $db->get_row($sql, ARRAY_A);
    if ($user) {
开发者ID:dalinhuang,项目名称:ozgweb,代码行数:31,代码来源:index.php


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