本文整理汇总了PHP中Encrypt::decrypt方法的典型用法代码示例。如果您正苦于以下问题:PHP Encrypt::decrypt方法的具体用法?PHP Encrypt::decrypt怎么用?PHP Encrypt::decrypt使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Encrypt
的用法示例。
在下文中一共展示了Encrypt::decrypt方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: cookie
/**
* Get or set our $_COOKIE var via . sperated array access
*
* @param key string A period seperated string of array keys and values
* @param value string The value to be set
*
* @return string
*/
static function cookie($key, $value = null)
{
$key = ID . '_' . $key;
if (!is_null($value)) {
//set the cookie expirey to 24 hours time
setcookie($key, Encrypt::encrypt($value), time() + 3600 * 24);
return;
}
return Encrypt::decrypt($_COOKIE[$key]);
}
示例2: foreach
foreach ($dataQuery->rows as $dataRow) {
$line = array();
$line[] = $dataRow->signed;
foreach ($result->rows as $row) {
$field = NULL;
if (in_array($row->fieldID, $skipFields)) {
continue;
}
if (isset($dataRow->{$row->dl_name})) {
$field = $dataRow->{$row->dl_name};
} elseif (isset($dataRow->{$row->finalFieldName})) {
$field = $dataRow->{$row->finalFieldName};
}
if (in_array($row->fieldID, $encryptedFields) && !is_null($field)) {
$td = new Encrypt($_SESSION['user']->getKey());
$field = $td->decrypt($field);
if (!$encrypted && $row->fieldName === 'age') {
if ($field > 90) {
$field = 'Over 90';
}
}
}
switch ($row->type) {
case 'checkbox':
$sql = "SELECT {$row->fieldName}_id as cbVal FROM {$row->pages_name}{$row->fieldName} WHERE {$row->pages_name}_id = ?";
$pA = array('i', $dataRow->{$row->pages_name . '_id'});
$cbVal = DB::query($sql, $pA);
$field = $cbVal->getArray('cbVal');
foreach ($cbFields[$row->pages_name][$row->fieldName] as $cb) {
if (emptyInput($field)) {
$line[] = "";
示例3: email
/**
* email defaults and SMTP connections details
*
* @return array
*/
public static function email()
{
return array('header' => MODULE_PATH . '/views/partials/email-header.php', 'footer' => MODULE_PATH . '/views/partials/email-footer.php', 'from-address' => 'prwhitehead@gmail.com', 'from-name' => 'Test Testingsom', 'smtp' => false, 'smtp-port' => '465', 'smtp-username' => 'prwhitehead@gmail.com', 'smtp-password' => Encrypt::decrypt('LQScrjgIlXBPd85JJWOJgoK5iH+1jYrgEiVd/Jl7BWErBKAKQoq6mHwfWXgCuHcenRbGmv2drbncgqvrlORFiA=='), 'smtp-host' => 'ssl://smtp.gmail.com');
}
示例4: foreach
echo "<li>Accessed by {$auditUser} from {$session['userip']} on \n {$date} at {$time} <i data-toggle=\"collapse\" \n href=\"#collapse{$counter}\" class=\"list-toggle icon-expand\"></i></label></li>";
echo "<ul id=\"collapse{$counter}\" class=\"collapse\">";
foreach ($session['audit'] as $row) {
if ($row->field == 'complete') {
continue;
}
$field = $trial->record->getFieldData($row->tableName, $row->field);
if (is_null($field)) {
continue;
}
if ($field->encrypted) {
if (!$user->isCentralAdmin()) {
continue;
}
$td = new Encrypt($user->getKey());
$row->old_value = $td->decrypt($row->old_value);
$row->new_value = $td->decrypt($row->new_value);
}
$dt = splitDateTime($row->time);
$time = $dt['time'];
$sql = "SELECT value FROM formVal WHERE formFields_id = ? AND operator = 'IN LIST' ORDER BY groupNum";
$pA = array('i', $field->id);
$ruleSearch = DB::query($sql, $pA);
if ($ruleSearch->getRows()) {
$rule = $ruleSearch->value;
} else {
$rule = NULL;
}
if ($row->old_value) {
$ov = $trial->record->displayFieldValue($row->old_value, $field->type, $rule);
if ($field->type == 'checkbox') {
示例5: decrypt_obj
protected function decrypt_obj()
{
foreach ($this->_encrypted as $e) {
if (isset($this->{$e}) && !empty($this->{$e})) {
if (!isset($td)) {
$td = new Encrypt($_SESSION['user']->getKey());
}
$this->{$e} = $this->{'old_' . $e} = $td->decrypt($this->{$e});
}
}
}
示例6: setKey
public function setKey($pass, $key)
{
$td = new Encrypt($pass);
$this->key = $td->decrypt($key);
}