本文整理汇总了PHP中encrypt函数的典型用法代码示例。如果您正苦于以下问题:PHP encrypt函数的具体用法?PHP encrypt怎么用?PHP encrypt使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了encrypt函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: login
/**
* 登陆
*/
public function login()
{
$userInput = trim(I('post.username'));
$pwdInput = trim(I('post.password'));
$jsonObj = null;
if ($userInput == '' || $userInput == null) {
$resultstring = $this->_savelog(-1, -1);
$jsonObj = $this->jsonResult(0, $resultstring);
$this->json2Response($jsonObj);
return;
} else {
if ($pwdInput == '' || $pwdInput == null) {
$resultstring = $this->_savelog(-1, -2);
$jsonObj = $this->jsonResult(0, $resultstring);
$this->json2Response($jsonObj);
return;
}
}
//验证图片
//$this->vertifyHandle();
$map = array();
$map['username'] = $userInput;
$map['password'] = encrypt($pwdInput);
$UserEvent = new UserEvent();
$loginRes = $UserEvent->auth($map);
$this->json2Response($loginRes);
}
示例2: pageinfo
private function pageinfo()
{
$this->checkLogin();
$this->result["sites"]["customer"] = "selected";
$this->result["sites"]["title"] = "快递";
$this->result["sites"]["url"] = encrypt("express");
}
示例3: generateNewToken
/**
* Generates oauth_token
* @return string
* @throws Exception
*/
public function generateNewToken()
{
if (!$this->person_id) {
throw new \Exception('Unknown user.');
}
return encrypt($this->person_id . $this->ct_api_app_id . time());
}
示例4: encryptQRInfo
function encryptQRInfo($data)
{
$CI =& get_instance();
$key = $CI->config->item("encryption_key");
$encrypted = encrypt($data, $key);
return $encrypted;
}
示例5: _globals
private function _globals()
{
$this->loadModel(array("User", "Basic"));
$this->result["sites"]["system"] = "selected";
$this->result["sites"]["title"] = "我的设置";
$this->result["sites"]["url"] = encrypt("my");
}
示例6: get_contact_func
function get_contact_func($xmlrpc_params)
{
global $db, $lang, $theme, $plugins, $mybb, $session, $settings, $cache, $time, $mybbgroups, $parser, $displaygroupfields;
$lang->load("member");
$input = Tapatalk_Input::filterXmlInput(array('user_id' => Tapatalk_Input::STRING), $xmlrpc_params);
if (isset($input['user_id']) && !empty($input['user_id'])) {
$uid = $input['user_id'];
} else {
$uid = $mybb->user['uid'];
}
if ($mybb->user['uid'] != $uid) {
$member = get_user($uid);
} else {
$member = $mybb->user;
}
if (!$member['uid']) {
error($lang->error_nomember);
}
// Guests or those without permission can't email other users
if ($mybb->usergroup['cansendemail'] == 0 || !$mybb->user['uid']) {
error_no_permission();
}
if ($member['hideemail'] != 0) {
error($lang->error_hideemail);
}
$user_info = array('result' => new xmlrpcval(true, 'boolean'), 'user_id' => new xmlrpcval($member['uid']), 'display_name' => new xmlrpcval(basic_clean($member['username']), 'base64'), 'enc_email' => new xmlrpcval(base64_encode(encrypt($member['email'], loadAPIKey()))));
$xmlrpc_user_info = new xmlrpcval($user_info, 'struct');
return new xmlrpcresp($xmlrpc_user_info);
}
示例7: oneportalcloud_ChangePassword
function oneportalcloud_ChangePassword($params)
{
if (!isset($_POST['ac'])) {
return 'success';
}
$op = new OnePortalCloud($params['configoption1'], $params['configoption2'], $params['configoption3']);
$server_id = $params['customfields']['Server ID'];
if (empty($server_id)) {
return 'Unable to determine Server ID to suspend';
}
if (substr(strtoupper($server_id), 0, 3) != 'LSN') {
$server_id = 'LSN-' . $server_id;
}
$ret = $op->changePassword($server_id, $_POST['ac']);
if (!$ret->error) {
include '../../../configuration.php';
# Path to WHMCS configuration file. If change password does not work then make sure this is correct
$where = array('id' => $params['serviceid']);
update_query('tblhosting', array('password' => encrypt($_POST['ac'], $cc_encryption_hash)), $where);
$res = 'success';
} else {
$res = $ret->error;
}
return $res;
}
示例8: buildMenuLateral
/**
* Descripción: Crea las opciones del MENU principal del sistema
* @author: Oscar Maldonado - O3M
* Creación: 2013-02-16
* Modificación: 2015-10-14;
**/
function buildMenuLateral($id_menu)
{
global $cfg, $Path, $usuario, $dic;
#Extraccion de datos de la DB-tabla de menú
$menuData = array(id_menu => $id_menu, id_grupo => false, nivel => false);
$menus = select_menus_lateral($menuData);
if ($menus) {
$menus = !is_array($menus[0]) ? array($menus) : $menus;
#Construcción de menu
foreach ($menus as $menu_element) {
#Link
$e = explode('/', $menu_element[link]);
$enlace = $cfg[encrypt_onoff] ? encrypt(strtoupper($e[0]), 1) . '/' . encrypt(strtoupper($e[1]), 1) : strtolower($menu_element[link]);
$link = $Path['url'] . $enlace;
#Texto
$texto = $dic[menulateral][$menu_element[texto]];
#Imagen
$imagen = !empty($menu_element[ico]) ? '<img src="' . $Path[img] . $menu_element[ico] . '" alt="' . utf8_encode($menu_element[texto]) . '" class="icono_dos"/>' : '';
#onClick
$onclick = !empty($menu_element[link]) ? 'onclick="location.href=\'' . $link . '\';"' : '';
#Elemento final
$html = $margen . $imagen . $texto;
$menu_array[] = array(id_menu => $menu_element[id_menu], id_grupo => $menu_element[id_grupo], menu => $menu_element[menu], texto => $menu_element[texto], nivel => $menu_element[nivel], html => $html, onclick => $onclick);
}
$menu_html = build_ul_menu($menu_array);
return $menu_html;
} else {
return false;
}
}
示例9: attempt
public static function attempt($credentials)
{
$user = User::query();
foreach ($credentials as $field => $value) {
if ($field != 'password') {
$user->where($field, $value);
}
}
$user = $user->first();
// Bad Email
if (!$user) {
$_SESSION['ALERT'] = alert('Oh Snap!', 'No accounts found with that email address...', 'error');
return false;
}
// Bad Password
if ($user->password != encrypt($credentials['password'])) {
$_SESSION['ALERT'] = alert('Oh Snap!', 'That doesn\'t look like the right password...', 'error');
return false;
}
// Not Verified
if (!$user->verified) {
// Send Verification Email (Always)
static::sendVerifyToken($user->email);
$_SESSION['ALERT'] = alert("Housekeeping!", "We're trying to make sure we have a way to contact all of our players. You should have received an email at {$user->email} with a link to confirm you account. If you did not receive this email, please contact us at <a href='mailto:" . $_ENV['SUPPORT_EMAIL'] . "'>" . $_ENV['SUPPORT_EMAIL'] . "</a>.", "info");
return false;
}
// All Set!
$_SESSION['user'] = $user;
return true;
}
示例10: testEncryption
public function testEncryption()
{
$plain_text = "yay!";
$cipher_text = "q/xJqqN6qbiZMXYmiQC1Fw==";
$this->assertEquals(decrypt($cipher_text, self::$configs['cipher']['cipher_key']), $plain_text);
$this->assertEquals(encrypt($plain_text, self::$configs['cipher']['cipher_key']), $cipher_text);
}
示例11: content_56b8d838c04995_38877246
function content_56b8d838c04995_38877246($_smarty_tpl)
{
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title></title>
<link rel="stylesheet" href="">
</head>
<body>
<td><a href="insert">Insertar</a></td>
<table>
<tr>
<th>Name</th>
<th>Document</th>
<th>Email</th>
<th></th>
<th></th>
</tr>
<?php
$_smarty_tpl->tpl_vars['person'] = new Smarty_Variable();
$_smarty_tpl->tpl_vars['person']->_loop = false;
$_from = $_smarty_tpl->tpl_vars['persons']->value;
if (!is_array($_from) && !is_object($_from)) {
settype($_from, 'array');
}
foreach ($_from as $_smarty_tpl->tpl_vars['person']->key => $_smarty_tpl->tpl_vars['person']->value) {
$_smarty_tpl->tpl_vars['person']->_loop = true;
?>
<tr>
<td><?php
echo $_smarty_tpl->tpl_vars['person']->value['name'];
?>
</td>
<td><?php
echo $_smarty_tpl->tpl_vars['person']->value['document'];
?>
</td>
<td><?php
echo $_smarty_tpl->tpl_vars['person']->value['email'];
?>
</td>
<td><a href="edit/<?php
echo encrypt($_smarty_tpl->tpl_vars['person']->value['id']);
?>
">Editar</a></td>
<td><a href="delete/<?php
echo encrypt($_smarty_tpl->tpl_vars['person']->value['id']);
?>
">Eliminar</a></td>
</tr>
<?php
}
?>
</table>
</body>
</html><?php
}
开发者ID:julianbarrerar,项目名称:Moe-Framework,代码行数:60,代码来源:2511f8286571633e65e499ee9a7cde4719558e20.file.list.html.php
示例12: update
public function update()
{
$btn_sta = Input::get('btn_sta');
$inputs = Input::get('check');
$idRed = Input::get('project_id');
switch ($btn_sta[0]) {
case 1:
foreach ($inputs as $key => $id) {
DB::table('project_logs')->where('id', $id)->delete();
}
Session::flash('flash_message', "Sukses Menghapus Data !!");
break;
case 2:
foreach ($inputs as $key => $id) {
DB::table('project_logs')->where('id', $id)->update(['status' => "Done"]);
}
Session::flash('flash_message', "Sukses Memperbaharui Status !!");
break;
case 3:
foreach ($inputs as $key => $id) {
DB::table('project_logs')->where('id', $id)->update(['status' => "Undone"]);
}
Session::flash('flash_message', "Sukses Memperbaharui Status !!");
break;
default:
break;
}
return redirect(\URL::to('project/detail', encrypt($idRed)));
}
示例13: vars_login
function vars_login($urlParams)
{
global $Path, $dic, $cfg;
define(SECCION, 'LOGIN');
$modulo = strtolower(MODULO) . '/';
$seccion = encrypt(SECCION, 1);
## Logica de negocio ##
// Mensajes via URL
switch ($urlParams[e]) {
case 1:
$msj = $dic[login][msj_noauth];
break;
case 2:
$msj = $dic[login][msj_salir];
break;
default:
$msj = $dic[login][msj_entrar];
break;
}
## Envio de valores ##
$negocio = array(MORE => incJs($Path[srcjs] . $modulo . 'login.js'), MODULE => strtolower(MODULO), SECTION => strtolower($seccion), FOLDER => $cfg[app_folder]);
$texto = array(APP_TITLE => $cfg[app_title], login => $dic[comun][login], usuario => $dic[comun][usuario], clave => $dic[comun][clave], txt_entrar => $dic[comun][entrar], txt_olvido_clave => $dic[login][olvido_clave], MSJ => $msj, txt_footer => $cfg[app_own], ANIO => '2009-' . date('Y'));
$data = array_merge($negocio, $texto);
return $data;
}
示例14: FreeDL
private function FreeDL()
{
if (empty($_POST['step']) || $_POST['step'] != '1') {
if (!preg_match('@https?://(?:[^/]+\\.)?(?:(?:google\\.com/recaptcha/api)|(?:recaptcha\\.net))/(?:(?:challenge)|(?:noscript))\\?k=([\\w|\\-]+)@i', $this->page, $pid)) {
$pid = array(1 => '6LcEvs0SAAAAAAykpzcaaxpegnSndWcEWYsSMs0M');
}
$data = $this->DefaultParamArr($this->link, empty($this->cookie) ? 0 : encrypt(CookiesToStr($this->cookie)));
$data['step'] = '1';
$this->Show_reCaptcha($pid[1], $data);
exit;
} else {
if (empty($_POST['recaptcha_response_field'])) {
html_error('You didn\'t enter the image verification code.');
}
if (!empty($_POST['cookie'])) {
$this->cookie = StrToCookies(decrypt(urldecode($_POST['cookie'])));
}
$query = array();
$query['type'] = 'recaptcha';
$query['challenge'] = $_POST['recaptcha_challenge_field'];
$query['capture'] = $_POST['recaptcha_response_field'];
$page = $this->GetPage($this->link . '?' . http_build_query($query), $this->cookie);
$reply = $this->Get_Reply($page);
if (!empty($reply['err'])) {
html_error('Error: ' . htmlentities($reply['err']));
}
if (empty($reply['href'])) {
html_error('Error: Download link not found.');
}
$this->RedirectDownload($reply['href'], urldecode(basename(parse_url($reply['href'], PHP_URL_PATH))));
}
}
示例15: set_log
function set_log($str)
{
$ci =& get_instance();
$ci->load->library('user_agent');
$now = date('Y-m-d H:i:s');
$thismonth = date('m');
$thisyear = date('Y');
$tablename = "sys_log_" . $thismonth . "_" . $thisyear;
$data = array();
$data['datetime'] = time();
$data['action'] = strip_tags(addslashes($str));
$data['ip'] = $ci->input->ip_address();
$data['browser'] = $ci->agent->browser();
$data['platform'] = $ci->agent->agent_string();
$data['url'] = $ci->uri->uri_string();
$data['postdata'] = isset($_POST) ? encrypt(json_encode($_POST)) : "";
$is_exists = $ci->db->table_exists($tablename);
if ($is_exists) {
$ci->db->insert($tablename, $data);
} else {
$query = "CREATE TABLE IF NOT EXISTS `{$tablename}` (\n\t\t\t\t\t `id` int(11) NOT NULL AUTO_INCREMENT,\n\t\t\t\t\t `datetime` varchar(255) DEFAULT NULL,\n\t\t\t\t\t `action` text,\n\t\t\t\t\t `ip` varchar(255) DEFAULT NULL,\n\t\t\t\t\t `browser` text,\n\t\t\t\t\t `url` text,\n\t\t\t\t\t `platform` text,\n\t\t\t\t\t `postdata` text,\n\t\t\t\t\t PRIMARY KEY (`id`)\n\t\t\t\t\t) ENGINE=InnoDB DEFAULT CHARSET=latin1";
$create_table = $ci->db->query($query);
if ($create_table) {
$ci->db->insert($tablename, $data);
}
}
}