本文整理汇总了PHP中base64_decode函数的典型用法代码示例。如果您正苦于以下问题:PHP base64_decode函数的具体用法?PHP base64_decode怎么用?PHP base64_decode使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了base64_decode函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: decode
public function decode($encrypted)
{
$decrypted = '';
// $encrypted = $_POST['merchantReciept'];
$privateKey = <<<EOD
-----BEGIN PRIVATE KEY-----
MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBAJuIUgSzNuWm3US8
0brZr/5cMSPue9f0IwUrEhka1gLlC4uQon6QjQem4TWQ8anoMKYwfYgRnCGQsbrT
KwOApwTA4Bt6dg9jKXlIE6rXqqO6g2C/uD+G2p+W4k0ZI1isuqqjjkup5ZPkNaeW
R9/961Qx3CyrWDk6n0OkzDJ6UNzLAgMBAAECgYEAh+/dv73jfVUaj7l4lZct+2MY
kA8grt7yvNGoP8j0xBLsxE7ltzkgClARBoBot9f4rUg0b3j0vWF59ZAbSDRpxJ2U
BfWEtlXWvN1V051KnKaOqE8TOkGK0PVWcc6P0JhPrbmOu9hhAN3dMu+jd7ABFKgC
4b8EIlHA8bl8po8gwAECQQDliMBTAzzyhB55FMW/pVGq9TBo2oXQsyNOjEO+rZNJ
zIwJzFrFhvuvFj7/7FekDAKmWgqpuOIk0NSYfHCR54FLAkEArXc7pdPgn386ikOc
Nn3Eils1WuP5+evoZw01he4NSZ1uXNkoNTAk8OmPJPz3PrtB6l3DUh1U/DEZjIiI
7z5igQJAFXvFNH/bFn/TMlYFZDie+jdUvpulZrE9nr52IMSyQngIq2obHN3TdMHK
R73hPhN5tAQ9d0E8uWFqZJNRHfbjHQJASY7pNV3Ov/QE0ALxqE3W3VDmJD/OjkOS
jriUPNIAwnnHBgp0OXHMCHkSYX4AHpLr1cWjARw9IKB1lBmF7+YFgQJAFqUgYj11
ioyuSf/CSotPIC7YyNEnr+TK2Ym0N/EWzqNXoOCDxDTgoWLQxM3Nfr65tWtV2097
BjCbFfbui/IyUw==
-----END PRIVATE KEY-----
EOD;
$encrypted = base64_decode($encrypted);
// decode the encrypted query string
if (!openssl_private_decrypt($encrypted, $decrypted, $privateKey)) {
die('Failed to decrypt data');
}
// echo "Decrypted value: ". $decrypted;
return $decrypted;
// $arr = explode('|', $decrypted);
// return $arr;
}
开发者ID:lahirurangitha,项目名称:easypay_final,代码行数:32,代码来源:decrypt.php
示例2: getScriptingLogAction
public function getScriptingLogAction()
{
$this->request->restrictAccess(Acl::RESOURCE_LOGS_SCRIPTING_LOGS);
$this->request->defineParams(['executionId' => ['type' => 'string']]);
$info = $this->db->GetRow("SELECT * FROM scripting_log WHERE execution_id = ? LIMIT 1", [$this->getParam('executionId')]);
if (!$info) {
throw new Exception('Script execution log not found');
}
try {
$dbServer = DBServer::LoadByID($info['server_id']);
if (!in_array($dbServer->status, [SERVER_STATUS::INIT, SERVER_STATUS::RUNNING])) {
throw new Exception();
}
} catch (Exception $e) {
throw new Exception('This server has been terminated and its logs are no longer available');
}
//Note! We should not check not-owned-farms permission here. It's approved by Igor.
if ($dbServer->envId != $this->environment->id) {
throw new \Scalr_Exception_InsufficientPermissions();
}
$logs = $dbServer->scalarizr->system->getScriptLogs($this->getParam('executionId'));
$msg = sprintf("STDERR:\n%s \n\n STDOUT:\n%s", base64_decode($logs->stderr), base64_decode($logs->stdout));
$msg = nl2br(htmlspecialchars($msg));
$this->response->data(['message' => $msg]);
}
开发者ID:mheydt,项目名称:scalr,代码行数:25,代码来源:Logs.php
示例3: __construct
public function __construct()
{
parent::__construct();
$this->_objectId = 'id';
$this->_blockGroup = 'massimporterpro';
$this->_controller = 'adminhtml_priceupdater';
$this->removeButton('back');
$helper = Mage::helper('massimporterpro');
$isValid = $helper->isValid();
$isActive = $helper->isActive();
$message = '';
if (!$isActive) {
$message = base64_decode('RXh0ZW5zaW9uIGhhcyBiZWVuIGRpc2FibGVkLiBQbGVhc2UgZW5hYmxlIGl0IGZyb20gTWFzcyBJbXBvcnRlciBQcm8gJnJhcXVvOyBNYW5hZ2UgU2V0dGluZ3M=');
} else {
if ($isActive && !$isValid) {
$message = base64_decode('UGxlYXNlIGVudGVyIGEgdmFsaWQgbGljZW5zZSBrZXkgaW4gb3JkZXIgdG8gcnVuIHRoZSBleHRlbnNpb24=');
}
}
if (!$isActive || $isActive && !$isValid) {
$this->removeButton('save');
$this->_addButton('dsave', array('label' => Mage::helper('massimporterpro')->__('Run Import'), 'onclick' => 'alert(\'' . $message . '.\')', 'class' => 'disabled'), -100);
} else {
$this->_updateButton('save', 'label', Mage::helper('massimporterpro')->__('Run Import'));
}
$this->_formScripts[] = "\n function addUploadFile(){\n\t\t\t\tvar importFile = \$('import_file_upload').value;\n\t\t\t\tif(importFile == ''){\n\t\t\t\t\talert('Please select some import file.');\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tvar ext = importFile.substring(importFile.lastIndexOf('.') + 1);\n\t\t\t\tif(ext.toLowerCase() != 'csv'){\n\t\t\t\t\talert('Please select valid import file (CSV).');\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t//tweak for required feilds: import file section, delimiter, enclosed\n\t\t\t\t\$('import_file').removeClassName('required-entry');\n\t\t\t\t\$('delimiter').removeClassName('required-entry');\n\t\t\t\t\$('enclosure').removeClassName('required-entry');\n editForm.submit('" . Mage::helper('adminhtml')->getUrl('massimporterpro/adminhtml_priceupdater/uploadCsv') . "');\n }\n ";
}
开发者ID:ksaltik,项目名称:tooldexlive,代码行数:26,代码来源:Edit.php
示例4: inflate
private function inflate()
{
$this->name = $this->raw['activityTaskScheduledEventAttributes']['activityType']['name'];
$this->version = $this->raw['activityTaskScheduledEventAttributes']['activityType']['version'];
$this->control = $this->raw['activityTaskScheduledEventAttributes']['control'];
$this->inputs = json_decode(base64_decode($this->raw['activityTaskScheduledEventAttributes']['input']), true);
}
开发者ID:lookaflyingdonkey,项目名称:phlow,代码行数:7,代码来源:ActivityTaskScheduled.php
示例5: list_ressource
function list_ressource($automount)
{
$sock = new sockets();
$datas = $sock->getFrameWork("cmd.php?B64-dirdir=" . base64_encode("/automounts/{$automount}"));
$files = unserialize(base64_decode(trim($datas)));
if (!is_array($files)) {
$_GET["cyrus-brows-comp"] = "/automounts/{$automount}";
list_ressources2();
return;
}
$html = "<table style='width:80%'>";
if (is_array($files)) {
while (list($num, $ligne) = each($files)) {
if (!preg_match("#backup\\.[0-9\\-]+#", $ligne)) {
continue;
}
$md5 = md5($num);
$ligne = str_replace("backup.", "", $ligne);
$js = "SelectMountRestoreLevel2('{$md5}','{$num}')";
$html = $html . "\n\t\t\t<tr " . CellRollOver($js, "{select_this_container}") . ">\n\t\t\t\t<td with=1%><img src='img/folder-32-sh\tare.png'>\n\t\t\t\t<td width=99%><span style='font-size:14px'>{$ligne}</td>\n\t\t\t</tr>\n\t\t\t<tr>\n\t\t\t\t<td colspan=2><div id='{$md5}'><hr></div></td>\n\t\t\t</tR>\n\t\t\t\t\t\n\t\t\t";
}
}
$html = $html . "</table>";
return $html;
}
开发者ID:BillTheBest,项目名称:1.6.x,代码行数:25,代码来源:cyrus.backup.restore.php
示例6: finish
/**
* Returns the ezcMailText part corresponding to the parsed message.
*
* @return ezcMailText
*/
public function finish()
{
$charset = "us-ascii";
// RFC 2822 default
if (isset($this->headers['Content-Type'])) {
preg_match('/\\s*charset\\s?=\\s?"?([^;"\\s]*);?/', $this->headers['Content-Type'], $parameters);
if (count($parameters) > 0) {
$charset = strtolower(trim($parameters[1], '"'));
}
}
$encoding = strtolower($this->headers['Content-Transfer-Encoding']);
if ($encoding == ezcMail::QUOTED_PRINTABLE) {
$this->text = quoted_printable_decode($this->text);
} else {
if ($encoding == ezcMail::BASE64) {
$this->text = base64_decode($this->text);
}
}
$this->text = ezcMailCharsetConverter::convertToUTF8($this->text, $charset);
$part = new ezcMailText($this->text, 'utf-8', ezcMail::EIGHT_BIT, $charset);
$part->subType = $this->subType;
$part->setHeaders($this->headers->getCaseSensitiveArray());
ezcMailPartParser::parsePartHeaders($this->headers, $part);
$part->size = strlen($this->text);
return $part;
}
开发者ID:Adeelgill,项目名称:livehelperchat,代码行数:31,代码来源:text_parser.php
示例7: cry
/**
* 位加密或解密
* @param $string 加密或解密内容
* @param $type 类型:1加密 2解密
* @param $key
* @return mixed|string
*/
private static function cry($string, $type, $key)
{
self::createKey($key);
$string = $type == 2 ? base64_decode($string) : substr(md5(self::$auth_key . $string), 0, 8) . $string;
$str_len = strlen($string);
$data = array();
$auth_key_length = strlen(self::$auth_key);
for ($i = 0; $i <= 256; $i++) {
$data[$i] = ord(self::$auth_key[$i % $auth_key_length]);
}
$tmp = '';
for ($i = $j = 1; $i < 256; $i++) {
$j = $data[($i + $data[$i]) % 256];
$tmp = $data[$i];
$data[$i] = ord($data[$j]);
$data[$j] = $tmp;
}
$code = '';
$s = '';
for ($n = $i = $j = 0; $i < $str_len; $i++) {
$tmp = ($i + $i % 256) % 256;
$j = $data[$tmp] % 256;
$n = ($tmp + $j) % 256;
$code = $data[($data[$j] + $data[$n]) % 256];
$s .= chr(ord($string[$i]) ^ $code);
}
if ($type == 1) {
return str_replace("=", "", base64_encode($s));
} else {
if (substr(md5(self::$auth_key . substr($s, 8)), 0, 8) == substr($s, 0, 8)) {
return substr($s, 8);
}
return '';
}
}
开发者ID:hdbaiyu,项目名称:HDPHP,代码行数:42,代码来源:Encry.class.php
示例8: parse
public static function parse($signature, $payload)
{
self::_validateSignature($signature, $payload);
$xml = base64_decode($payload);
$attributes = Braintree_Xml::buildArrayFromXml($xml);
return self::factory($attributes['notification']);
}
开发者ID:bobstermyang,项目名称:communityfoodshare,代码行数:7,代码来源:WebhookNotification.php
示例9: testVector
public function testVector()
{
$input = 'hello world';
$pass = 'password';
$vector = base64_decode('vusXragCy83KQFo');
$this->assertEquals($input, Otp::crypt($vector, $pass));
}
开发者ID:dopecode,项目名称:dcrypt,代码行数:7,代码来源:OtpTest.php
示例10: getAccessToken
private function getAccessToken($code)
{
$curlWrapper = new CurlWrapper();
$post_data = array("grant_type" => "authorization_code", "code" => $code, "redirect_uri" => $this->url_callback, "client_id" => $this->client_id, "client_secret" => $this->secret_id);
$curlWrapper->setPostDataUrlEncode($post_data);
$token_url = $this->getURLforService("token");
$result = $curlWrapper->get($token_url);
if ($curlWrapper->getHTTPCode() != 200) {
if (!$result) {
throw new Exception($curlWrapper->getLastError());
}
$result_array = json_decode($result, true);
throw new Exception($result_array['error']);
}
$result_array = json_decode($result, true);
$id_token = $result_array['id_token'];
$all_part = explode(".", $id_token);
$header = json_decode(base64_decode($all_part[0]), true);
$payload = json_decode(base64_decode($all_part[1]), true);
if ($payload['nonce'] != $_SESSION[self::OPENID_SESSION_NONCE]) {
throw new Exception("La nonce ne correspond pas");
}
require_once __DIR__ . "/../ext/Akita_JOSE/JWS.php";
$jws = Akita_JOSE_JWS::load($id_token, true);
$verify = $jws->verify($this->secret_id);
if (!$verify) {
throw new Exception("Vérification du token : Echec");
}
unset($_SESSION[self::OPENID_SESSION_NONCE]);
return $result_array['access_token'];
}
开发者ID:HadoDokis,项目名称:Authentification-FranceConnect-PHP,代码行数:31,代码来源:FranceConnect.class.php
示例11: readCallback
public static function readCallback($payload)
{
$crypt = new Encrypter(base64_decode(Config::get('services.etupay.key')), 'AES-256-CBC');
$payload = json_decode($crypt->decrypt($payload));
if ($payload && is_numeric($payload->service_data)) {
$paymentId = $payload->service_data;
$payment = Payment::findOrFail($paymentId);
switch ($payload->step) {
case 'INITIALISED':
$payment->state = 'returned';
break;
case 'PAID':
case 'AUTHORISATION':
$payment->state = 'paid';
break;
case 'REFUSED':
case 'CANCELED':
$payment->state = 'refused';
break;
case 'REFUNDED':
$payment->state = 'refunded';
break;
}
$payment->informations = ['transaction_id' => $payload->transaction_id];
$payment->save();
if ($payment->newcomer) {
$payment->newcomer->updateWei();
} elseif ($payment->student) {
$payment->student->updateWei();
}
return $payment;
}
return null;
}
开发者ID:ungdev,项目名称:integration-UTT,代码行数:34,代码来源:EtuPay.php
示例12: processAutoLoginCookie
/**
* {@inheritdoc}
*/
protected function processAutoLoginCookie(array $cookieParts, Request $request)
{
if (count($cookieParts) !== 4) {
throw new AuthenticationException('The cookie is invalid.');
}
list($class, $username, $expires, $hash) = $cookieParts;
if (false === ($username = base64_decode($username, true))) {
throw new AuthenticationException('$username contains a character from outside the base64 alphabet.');
}
try {
$user = $this->getUserProvider($class)->loadUserByUsername($username);
} catch (\Exception $ex) {
if (!$ex instanceof AuthenticationException) {
$ex = new AuthenticationException($ex->getMessage(), $ex->getCode(), $ex);
}
throw $ex;
}
if (!$user instanceof UserInterface) {
throw new \RuntimeException(sprintf('The UserProviderInterface implementation must return an instance of UserInterface, but returned "%s".', get_class($user)));
}
if (true !== $this->compareHashes($hash, $this->generateCookieHash($class, $username, $expires, $user->getPassword()))) {
throw new AuthenticationException('The cookie\'s hash is invalid.');
}
if ($expires < time()) {
throw new AuthenticationException('The cookie has expired.');
}
return $user;
}
开发者ID:Viduc,项目名称:tiremoidlaold,代码行数:31,代码来源:TokenBasedRememberMeServices.php
示例13: extractSalt
/**
* Extracts salt from provided hash.
*
* @param string $hash salted hash previously returned from a call to ssha::get()
* @return string salt of provided hash
*/
public static function extractSalt($hash)
{
if (substr($hash, 0, 6) === '{SSHA}') {
return substr(base64_decode(substr($hash, 6)), 20);
}
return substr($hash, 20);
}
开发者ID:cepharum,项目名称:txf,代码行数:13,代码来源:ssha.php
示例14: save
function save()
{
$sock = new sockets();
if ($_POST["ID"] == 0) {
$ligne = unserialize(base64_decode($sock->GET_INFO("DansGuardianDefaultMainRule")));
$ligne["bypass"] = $_POST["bypass"];
$ligne["BypassSecretKey"] = $_POST["BypassSecretKey"];
writelogs("Default rule, saving DansGuardianDefaultMainRule", __FUNCTION__, __FILE__, __LINE__);
$sock->SaveConfigFile(base64_encode(serialize($ligne)), "DansGuardianDefaultMainRule");
writelogs("Ask to compile rule...", __FUNCTION__, __FILE__, __LINE__);
$sock->getFrameWork("webfilter.php?compile-rules=yes");
return;
}
$q = new mysql_squid_builder();
$sql = "UPDATE webfilter_rules SET bypass='{$_POST["bypass"]}',BypassSecretKey='{$_POST["bypass"]}' WHERE ID='{$_POST["ID"]}'";
$q->QUERY_SQL($sql);
if (!$q->ok) {
if (strpos($q->mysql_error, "Unknown column") > 0) {
$q->CheckTables();
$q->QUERY_SQL($sql);
}
}
if (!$q->ok) {
echo $q->mysql_error;
return;
}
$sock->getFrameWork("webfilter.php?compile-rules=yes");
}
开发者ID:brucewu16899,项目名称:1.6.x,代码行数:28,代码来源:dansguardian2.bypass.php
示例15: createToken
public function createToken($username, $encryptedPass)
{
$nonce = $this->createNonce();
$ts = date('c');
$digest = base64_encode(sha1(base64_decode($nonce) . $ts . $this->apiSecret, true));
return sprintf('AuthToken ApiKey="%s", TokenDigest="%s", Nonce="%s", Created="%s", Username="%s", Password="%s"', $this->apiKey, $digest, $nonce, $ts, $username, base64_encode($encryptedPass));
}
开发者ID:benmahdavi,项目名称:php-authentication-sdk,代码行数:7,代码来源:Header.php
示例16: populateState
/**
* Method to auto-populate the model state.
*
* Note. Calling getState in this method will result in recursion.
*
* @return void
*
* @since 1.6
*/
protected function populateState($ordering = null, $direction = null)
{
$app = JFactory::getApplication('administrator');
// Adjust the context to support modal layouts.
if ($layout = $app->input->get('layout', 'default', 'cmd')) {
$this->context .= '.' . $layout;
}
// Load the filter state.
$search = $this->getUserStateFromRequest($this->context . '.filter.search', 'filter_search');
$this->setState('filter.search', $search);
$active = $this->getUserStateFromRequest($this->context . '.filter.active', 'filter_active');
$this->setState('filter.active', $active);
$state = $this->getUserStateFromRequest($this->context . '.filter.state', 'filter_state');
$this->setState('filter.state', $state);
$groupId = $this->getUserStateFromRequest($this->context . '.filter.group', 'filter_group_id', null, 'int');
$this->setState('filter.group_id', $groupId);
$range = $this->getUserStateFromRequest($this->context . '.filter.range', 'filter_range');
$this->setState('filter.range', $range);
$groups = json_decode(base64_decode($app->input->get('groups', '', 'BASE64')));
if (isset($groups)) {
JArrayHelper::toInteger($groups);
}
$this->setState('filter.groups', $groups);
$excluded = json_decode(base64_decode($app->input->get('excluded', '', 'BASE64')));
if (isset($excluded)) {
JArrayHelper::toInteger($excluded);
}
$this->setState('filter.excluded', $excluded);
// Load the parameters.
$params = JComponentHelper::getParams('com_users');
$this->setState('params', $params);
// List state information.
parent::populateState('a.name', 'asc');
}
开发者ID:densem-2013,项目名称:exikom,代码行数:43,代码来源:users.php
示例17: HttpAuthentication
/**
* Verifies that the authentication sent by Google Checkout matches the
* merchant id and key
*
* @param string $headers the headers from the request
*/
function HttpAuthentication($headers = null, $die = true)
{
if (!is_null($headers)) {
$_SERVER = $headers;
}
if (isset($_SERVER['PHP_AUTH_USER']) && isset($_SERVER['PHP_AUTH_PW'])) {
$compare_mer_id = $_SERVER['PHP_AUTH_USER'];
$compare_mer_key = $_SERVER['PHP_AUTH_PW'];
} else {
if (isset($_SERVER['HTTP_AUTHORIZATION'])) {
list($compare_mer_id, $compare_mer_key) = explode(':', base64_decode(substr($_SERVER['HTTP_AUTHORIZATION'], strpos($_SERVER['HTTP_AUTHORIZATION'], " ") + 1)));
} else {
if (isset($_SERVER['Authorization'])) {
list($compare_mer_id, $compare_mer_key) = explode(':', base64_decode(substr($_SERVER['Authorization'], strpos($_SERVER['Authorization'], " ") + 1)));
} else {
$this->SendFailAuthenticationStatus("Failed to Get Basic Authentication Headers", $die);
return false;
}
}
}
if ($compare_mer_id != $this->merchant_id || $compare_mer_key != $this->merchant_key) {
$this->SendFailAuthenticationStatus("Invalid Merchant Id/Key Pair", $die);
return false;
}
return true;
}
开发者ID:kidaa30,项目名称:yes,代码行数:32,代码来源:googleresponse.php
示例18: getPhotos
public static function getPhotos($params)
{
$photos = $params->get('gallery');
$photos = json_decode(base64_decode($photos));
switch ($params->get('display_order', 'ordering')) {
case 'title_asc':
for ($i = 0; $i < count($photos) - 1; $i++) {
for ($j = $i + 1; $j < count($photos); $j++) {
$temp = $photos[$i];
if (strcmp($photos[$i]->title, $photos[$j]->title) > 0) {
$photos[$i] = $photos[$j];
$photos[$j] = $temp;
}
}
}
break;
case 'title_desc':
for ($i = 0; $i < count($photos) - 1; $i++) {
for ($j = $i + 1; $j < count($photos); $j++) {
$temp = $photos[$i];
if (strcmp($photos[$i]->title, $photos[$j]->title) < 0) {
$photos[$i] = $photos[$j];
$photos[$j] = $temp;
}
}
}
break;
case 'random':
shuffle($photos);
break;
default:
break;
}
return $photos;
}
开发者ID:Tommar,项目名称:remate,代码行数:35,代码来源:helper.php
示例19: complete_invite
/**
* Completes the last stuff required for a user to become setup from an invitation. Similar to activate but without the password
*
* @return void
* @author Clark Endrizzi
**/
public function complete_invite($user_id, $timestamp){
$this->db->set('user_status', true);
$this->db->where('user_id', $user_id);
$this->db->where('timestamp', base64_decode($timestamp));
$this->db->update('cn_users');
return $this->db->affected_rows();
}
开发者ID:holsinger,项目名称:openfloor,代码行数:13,代码来源:user_model.php
示例20: createTempFile
public static function createTempFile($data)
{
$tmpFile = tmpfile();
fwrite($tmpFile, base64_decode($data));
fseek($tmpFile, 0);
return $tmpFile;
}
开发者ID:wassafr,项目名称:push-server,代码行数:7,代码来源:IosUtils.php
注:本文中的base64_decode函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论