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


PHP Encryption::decode方法代码示例

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


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

示例1: testEncrypt

 /**
  * Tests encryption
  */
 public function testEncrypt()
 {
     $string = "this is a test string";
     $enc = new Encryption();
     $encrypted = $enc->encode($string);
     $this->assertTrue($encrypted != $string);
     $unencrypted = $enc->decode($encrypted);
     $this->assertTrue($unencrypted == $string);
 }
开发者ID:jawngee,项目名称:HeavyMetal,代码行数:12,代码来源:encryptiontest.php

示例2: getcookies

 function getcookies()
 {
     $crypt = new Encryption();
     $this->array = array();
     if (isset($_COOKIE[$this->name])) {
         foreach ($_COOKIE[$this->name] as $key => $value) {
             $this->array[$key] = $crypt->decode($value);
         }
     }
 }
开发者ID:CallBest,项目名称:CallCenter-CIMS,代码行数:10,代码来源:cookie.php

示例3: Encryption

            $city = strip_tags(trim($_POST['city']));
            $venue = preg_replace('/\\s+/', ' ', $venue);
            $city = preg_replace('/\\s+/', ' ', $city);
            $_SESSION['venue'] = $venue;
            $_SESSION['city'] = $city;
            //if(isset($_POST['login'])) {
            $uid1 = $data_rendezvous->getUserId($_SESSION['username']);
            $displayName = "{$venue}, {$city}";
            $data_rendezvous->insertBasicSearch($uid1, $venue, $city, $displayName);
            //}
        }
    }
}
if (isset($_GET['venue']) && isset($_GET['city'])) {
    $encryption = new Encryption();
    $venue = $encryption->decode($_GET['venue']);
    $city = $encryption->decode($_GET['city']);
    unset($_GET['venue']);
    unset($_GET['city']);
    sendNameCity($data_foursq, $venue, $city);
}
if (isset($_SESSION['venue']) && isset($_SESSION['city'])) {
    $venue = trim($_SESSION['venue']);
    $venue = strip_tags($venue);
    $city = trim($_SESSION['city']);
    $city = strip_tags($city);
    $venue = preg_replace("/\\s+/", " ", $venue);
    $city = preg_replace("/\\s+/", " ", $city);
    unset($_SESSION['venue']);
    unset($_SESSION['city']);
    sendNameCity($data_foursq, $venue, $city);
开发者ID:LakshmiRoja,项目名称:CS546_Rendezvous,代码行数:31,代码来源:basicSearchOutput.php

示例4: ConvertDirectoryPath

<?php

/* Here Geenerated document Download process will be held with the unique URL sent in Email*/
require 'wp-load.php';
// loads the wordpress methods
$enc_file = ConvertDirectoryPath(plugin_dir_path(__FILE__) . DIRECTORY_SEPARATOR . "wp-content" . DIRECTORY_SEPARATOR . "plugins" . DIRECTORY_SEPARATOR . "templatemerge" . DIRECTORY_SEPARATOR . "urlencode.php");
// checks for the URL encode decode library
if (file_exists($enc_file) && isset($_GET['q']) && !empty($_GET['q'])) {
    require_once $enc_file;
    $enc = new Encryption();
    //echo $enc_url = $enc->encode('www.google.com');
    $enc_url = $_GET['q'];
    ?>
<script>
	window.location.href="<?php 
    echo $enc->decode($enc_url);
    ?>
";
</script>
<?php 
} else {
    ?>
	<script>
		window.location.href="<?php 
    echo site_url();
    ?>
";
	</script>
<?php 
}
开发者ID:Ezyva2015,项目名称:SMSF-Academy-Wordpress,代码行数:30,代码来源:download.php

示例5: __beforeAction

 public function __beforeAction()
 {
     // User authentication
     $user_model = new User_Model();
     User_Model::$auth_status = User_Model::AUTH_STATUS_NOT_LOGGED;
     // Authentication by post
     if (isset($_POST['username']) && isset($_POST['password'])) {
         $username = $_POST['username'];
         $password = $_POST['password'];
         try {
             if (!preg_match('#^[a-z0-9-]+$#', $username)) {
                 throw new Exception('Invalid username');
             }
             if ($user_model->authenticate($username, $password)) {
                 User_Model::$auth_status = User_Model::AUTH_STATUS_LOGGED;
                 // Write session and cookie to remember sign-in
                 Cookie::write('login', Encryption::encode($username . ':' . $password), 60 * 24 * 3600);
                 Session::write('username', $username);
             } else {
                 throw new Exception('Bad username or password');
             }
         } catch (Exception $e) {
             User_Model::$auth_status = User_Model::AUTH_STATUS_BAD_USERNAME_OR_PASSWORD;
             Cookie::delete('login');
             Session::delete('username');
         }
     } else {
         // Authentication by session
         if (($username = Session::read('username')) !== null) {
             try {
                 $user_model->loadUser($username);
                 User_Model::$auth_status = User_Model::AUTH_STATUS_LOGGED;
             } catch (Exception $e) {
                 Session::delete('username');
                 Cookie::delete('login');
             }
             // Authentication by cookies
         } else {
             if (($login = Cookie::read('login')) !== null) {
                 try {
                     if (isset($login) && ($login = Encryption::decode($login))) {
                         $login = explode(':', $login);
                         $username = $login[0];
                         if (!preg_match('#^[a-z0-9-]+$#', $username)) {
                             throw new Exception('Invalid username');
                         }
                         array_splice($login, 0, 1);
                         $password = implode(':', $login);
                         if ($user_model->authenticate($username, $password)) {
                             User_Model::$auth_status = User_Model::AUTH_STATUS_LOGGED;
                             // Write session to remember sign-in
                             Session::write('username', $username);
                         } else {
                             throw new Exception('Bad username or password');
                         }
                     } else {
                         throw new Exception('Invalid user cookie');
                     }
                 } catch (Exception $e) {
                     Cookie::delete('login');
                 }
             }
         }
     }
 }
开发者ID:hugonicolas,项目名称:Site,代码行数:65,代码来源:Layout.php

示例6: DbFunctions

 function forget_password($param)
 {
     $db_functions_obj = new DbFunctions();
     $user_obj = new User();
     $converter = new Encryption();
     $decoded = $converter->decode($param);
     $email = explode(CHANGE_PW_SEPARATOR, $decoded);
     $link_date = $email[1];
     $exp_date = strtotime(FORGET_PW_EXP_DATE, $email[1]);
     $type = 'email';
     if ($email[0] != "" && $link_date < $exp_date) {
         $this->content = $user_obj->build_change_forget_password_form($email[0], 'email');
     } else {
         $this->page_not_found();
     }
 }
开发者ID:arh922,项目名称:ain,代码行数:16,代码来源:controller.php

示例7: load_session

 /**
  * 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?
  */
 public function load_session($ticket = null, $origin_ip = null)
 {
     // get the ticket cookie
     if ($ticket == null) {
         $ticket = get_cookie($this->name);
     }
     if ($ticket == false) {
         return;
     }
     $encrypter = new Encryption();
     $cookie = $encrypter->decode($ticket);
     list($content, $time, $ip, $md5) = explode("|@@!@@|", $cookie);
     if ($origin_ip) {
         $ipaddy = $origin_ip;
     } else {
         if (defined('ORIGIN_IP_ADDRESS')) {
             $ipaddy = ORIGIN_IP_ADDRESS;
         } else {
             $ipaddy = isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : '';
         }
     }
     $newmd5 = md5(implode('|@@!@@|', array($content, $time, $ipaddy)) . $this->salt);
     if ($content && $time > time() && $ip == $ipaddy && $newmd5 == $md5) {
         $this->data = unserialize($content);
     }
 }
开发者ID:jawngee,项目名称:HeavyMetal,代码行数:31,代码来源:session.php

示例8: decrypt_doc_url

function decrypt_doc_url($str)
{
    $enc_file = ConvertDirectoryPath(plugin_dir_path(__FILE__) . "urlencode.php");
    if (file_exists($enc_file)) {
        require_once $enc_file;
        $enc = new Encryption();
        $str = $enc->decode($str);
    }
    return $str;
}
开发者ID:Ezyva2015,项目名称:SMSF-Academy-Wordpress,代码行数:10,代码来源:templatemerge.php

示例9:

" class="input" /><span class="warning">*</span></td>
				</tr>
				<tr class="evenrow">
					<td width="35%" height="35" align="right"  class="bldTxt">Email:&nbsp;</td>
					<td width="65%" height="24" align="left" class="txt"><input type="text" name="email" id="email" value="<?php 
if (isset($line->email)) {
    echo $line->email;
}
?>
" class="input" placeholder="Enter email" /><span class="warning">*</span></td>
				</tr>
				<tr class="oddrow">
					<td width="35%" height="35" align="right"  class="bldTxt">Password:&nbsp;</td>
					<td width="65%" height="24" align="left" class="txt"><input type="password" name="password" id="password" value="<?php 
if (isset($line->password)) {
    echo $encryptObj->decode($line->password);
}
?>
" class="input" placeholder="Enter password" /><span class="warning">*</span></td>
				</tr>
				<tr class="evenrow">
					<td width="35%" height="35" align="right"  class="bldTxt">Address:&nbsp;</td>
					<td width="65%" height="24" align="left" class="txt"><textarea id="address" placeholder="Enter address." name="address" cols="27"><?php 
if (isset($line->address)) {
    echo $line->address;
}
?>
</textarea><span class="warning">*</span></td>
				</tr>
				<tr class="oddrow">
					<td width="35%" height="35" align="right"  class="bldTxt">Mobile:&nbsp;</td>
开发者ID:Aksaxena,项目名称:mlm,代码行数:31,代码来源:add_user.php

示例10: Encryption

<?php

/*******************************************************
	 *   Copyright (C) 2014  http://isvipi.org
	
		This program is free software; you can redistribute it and/or modify
		it under the terms of the GNU General Public License as published by
		the Free Software Foundation; either version 2 of the License, or
		(at your option) any later version.
	
		This program is distributed in the hope that it will be useful,
		but WITHOUT ANY WARRANTY; without even the implied warranty of
		MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
		GNU General Public License for more details.
	
		You should have received a copy of the GNU General Public License along
		with this program; if not, write to the Free Software Foundation, Inc.,
		51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
	 ******************************************************/
require_once ISVIPI_PAGES_BASE . 'm_base.php';
require_once ISVIPI_CLASSES_BASE . 'global/getFeeds_cls.php';
require_once ISVIPI_CLASSES_BASE . 'utilities/encrypt_decrypt.php';
$converter = new Encryption();
$feed_id = $converter->decode($PAGE[1]);
$loadFeed = new single_feed();
$f = $loadFeed->feed_id($feed_id);
include_once ISVIPI_ACT_THEME . 'post.php';
开发者ID:redconan,项目名称:IsVipi-OSSN,代码行数:27,代码来源:post.php

示例11: decodeAndSetCredentials

 /**
  * Gets an encrypted message and resolves the FastBill credentials 
  * to set them to their corresponding properties of the class.
  * Format of the resolved credentials 'username:API_Key'.
  *
  * @param string $message the encoded string with the credentials separated by ':'
  * @return array with the decoded username and key 
  */
 function decodeAndSetCredentials($message)
 {
     $c = Encryption::decode($message, $this->getAppId());
     $cr = explode(':', $c);
     if (sizeof($cr) != 2) {
         return $this->throwSDKException(51);
     }
     $creds = array('userName' => $cr[0], 'apiKey' => $cr[1]);
     if ($this->setCredentials($creds['userName'], $creds['apiKey'])) {
         return $creds;
     } else {
         return $this->throwSDKException(50);
     }
 }
开发者ID:plutus78,项目名称:FastBillSDK,代码行数:22,代码来源:base_fastbill.php

示例12: Encryption

         echo 1;
     } else {
         echo 0;
     }
     break;
 case 'getContract':
     $encrypt = new Encryption();
     $id = $encrypt->decode($_GET['id']);
     $db = new MysqliDb();
     $db->where('id', $id);
     $contracts = $db->getOne('contracts');
     echo json_encode($contracts);
     break;
 case 'getContractByClient':
     $encrypt = new Encryption();
     $id = $encrypt->decode($_GET['id']);
     $db = new MysqliDb();
     $db->where('id', $id);
     $cols = array("id", "ignitor_name", "ignitor_title", "client", "ignitor_email", "client_name", "client_title", "client_company", "client_name is not null as registed");
     $contracts = $db->get('contracts', null, $cols);
     echo json_encode($contracts);
     break;
 case 'saveToHistory':
     $db = new MysqliDb();
     //$db->where('id',$_GET['id']);
     $data = array('doc_id' => $_POST['index'], 'contract_id' => $_POST['id'], 'content' => $_POST['content'], 'date' => date('Y-m-d H:i:s'));
     $id = $db->insert('history', $data);
     break;
 case 'getContractContent':
     $db = new MysqliDb();
     $db->where('id', $_GET['id']);
开发者ID:aanyun,项目名称:online-contract-signing,代码行数:31,代码来源:API.php

示例13: GetCompanyInfo

Webfinance is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with Webfinance; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
*/
include "../inc/main.php";
include "../inc/Encryption.php";
$societe = GetCompanyInfo();
//PAYPAL Vars
$paypal_params = array('paypal_url_form' => 'https://www.paypal.com/cgi-bin/webscr', 'paypal_url_return' => $societe->wf_url . '/payment/return.php', 'paypal_url_cancel' => $societe->wf_url . '/payment/cancel.php', 'paypal_url_notify' => $societe->wf_url . '/payment/paypal/ipn.php', 'paypal_email_account' => 'paypal@isvtec.com', 'id_payment_type' => '2');
$converter = new Encryption();
$decoded = $converter->decode($_GET['id']);
$chain = explode('|', $decoded);
$id_invoice = $chain[0];
$id_client = $chain[1];
if (!isset($id_client) or !isset($id_invoice)) {
    echo "Missing arguments";
    exit;
}
if (!is_numeric($id_client) or !is_numeric($id_invoice)) {
    echo "Wrong arguments";
    exit;
}
$Client = new Client();
# check client and invoice
if (!$Client->exists($id_client)) {
    echo _("This client doesn't exist");
开发者ID:lopacinski,项目名称:WebFinance,代码行数:31,代码来源:index.php

示例14: Encryption

        $_SESSION['rating'] = $rating;
        $_SESSION['radius'] = $radius;
        $_SESSION['lat'] = $midlat;
        $_SESSION['lng'] = $midlong;
        $_SESSION['lat1'] = $lat1;
        $_SESSION['lng1'] = $lng1;
        $_SESSION['lat2'] = $lat2;
        $_SESSION['lng2'] = $lng2;
        $uid = $data_rendezvous->getUserId($_SESSION['username']);
        $displayName = "{$address1},{$address2}";
        $data_rendezvous->insertMeetSearch($uid, $midlat, $midlong, $rating, $radius, $displayName, $lat1, $lng1, $lat2, $lng2);
    }
}
if (isset($_GET['lat']) && isset($_GET['lng']) && isset($_GET['lat1']) && isset($_GET['lng1']) && isset($_GET['lat2']) && isset($_GET['lng2']) && isset($_GET['radius']) && isset($_GET['rating'])) {
    $encryption = new Encryption();
    $lat = $encryption->decode($_GET['lat']);
    $lng = $encryption->decode($_GET['lng']);
    $radius = $encryption->decode($_GET['radius']);
    $rating = $encryption->decode($_GET['rating']);
    $lat1 = $encryption->decode($_GET['lat1']);
    $lng1 = $encryption->decode($_GET['lng1']);
    $lat2 = $encryption->decode($_GET['lat2']);
    $lng2 = $encryption->decode($_GET['lng2']);
    unset($_GET['lat']);
    unset($_GET['lng']);
    unset($_GET['lat1']);
    unset($_GET['lng1']);
    unset($_GET['lat2']);
    unset($_GET['lng2']);
    unset($_GET['rating']);
    unset($_GET['radius']);
开发者ID:ambikamaheshwari,项目名称:Rendezvous,代码行数:31,代码来源:meethalfwayoutput.php


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