• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

PHP encrypt函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中encrypt函数的典型用法代码示例。如果您正苦于以下问题:PHP encrypt函数的具体用法?PHP encrypt怎么用?PHP encrypt使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了encrypt函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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);
 }
开发者ID:highestgoodlikewater,项目名称:hrmanage,代码行数:30,代码来源:LoginController.class.php


示例2: pageinfo

 private function pageinfo()
 {
     $this->checkLogin();
     $this->result["sites"]["customer"] = "selected";
     $this->result["sites"]["title"] = "快递";
     $this->result["sites"]["url"] = encrypt("express");
 }
开发者ID:hetykai,项目名称:feidaoyu,代码行数:7,代码来源:express.class.php


示例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());
 }
开发者ID:HotwireCommunications,项目名称:skyphp,代码行数:12,代码来源:Oauth.php


示例4: encryptQRInfo

 function encryptQRInfo($data)
 {
     $CI =& get_instance();
     $key = $CI->config->item("encryption_key");
     $encrypted = encrypt($data, $key);
     return $encrypted;
 }
开发者ID:nontachaiit,项目名称:NACC-PHP,代码行数:7,代码来源:qr_encrypt_helper.php


示例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");
 }
开发者ID:hetykai,项目名称:feidaoyu,代码行数:7,代码来源:my.class.php


示例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);
}
开发者ID:dthiago,项目名称:tapatalk-mybb,代码行数:29,代码来源:get_contact.php


示例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;
}
开发者ID:kyroskoh,项目名称:oneportal-whmcs,代码行数:25,代码来源:oneportalcloud.php


示例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;
    }
}
开发者ID:Oscarmal,项目名称:o3m.director,代码行数:36,代码来源:build.menu_lateral.php


示例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&nbsp;<a href='mailto:" . $_ENV['SUPPORT_EMAIL'] . "'>" . $_ENV['SUPPORT_EMAIL'] . "</a>.", "info");
         return false;
     }
     // All Set!
     $_SESSION['user'] = $user;
     return true;
 }
开发者ID:MadeByGlutard,项目名称:GreenMountainGaming.com,代码行数:30,代码来源:Auth.php


示例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);
 }
开发者ID:camcima,项目名称:pubnub-php-api,代码行数:7,代码来源:PubnubTest.php


示例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)));
 }
开发者ID:blacknvcone,项目名称:eAgenda,代码行数:29,代码来源:ProjectLogsController.php


示例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;
}
开发者ID:Oscarmal,项目名称:o3m.director,代码行数:25,代码来源:views.vars.general.php


示例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))));
     }
 }
开发者ID:sayedharounokpay,项目名称:LikesPlanet,代码行数:32,代码来源:dizzcloud_com.php


示例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);
        }
    }
}
开发者ID:allfonso,项目名称:simpeg2,代码行数:27,代码来源:application_helper.php


示例16: RedirectDownload

 /**
  * Use this function instead of insert_location so that we can improve this feature in the future
  * 
  * @param string $link The download link of the file
  * @param string $FileName The name of the file
  * @param string $cookie The cookie value
  * @param array $post The post value will be serialized here
  * @param string $referer The page that refered to this link
  * @param string $auth In format username:password
  * @param array $params This parameter allows you to add extra _GET values to be passed on
  */
 public function RedirectDownload($link, $FileName, $cookie = 0, $post = 0, $referer = 0, $force_name = 0, $auth = "", $params = array())
 {
     global $pauth;
     if (!$referer) {
         global $Referer;
         $referer = $Referer;
     }
     $Url = parse_url($link);
     //if (substr($auth,0,6) != "&auth=") $auth = "&auth=" . $auth;
     if (!is_array($params)) {
         // Some problems with the plugin, quit it
         html_error('Plugin problem! Please report, error: "The parameter passed must be an array"');
     }
     $addon = "";
     if (count((array) $params) > 0) {
         foreach ($params as $name => $value) {
             if (is_array($value)) {
                 $value = serialize($value);
             }
             $addon .= '&' . $name . '=' . urlencode($value) . '&';
         }
         $addon = substr($addon, 0, -1);
     }
     $loc = "{$_SERVER['PHP_SELF']}?filename=" . urlencode($FileName) . "&host=" . $Url["host"] . "&port=" . $Url["port"] . "&path=" . urlencode($Url["path"] . ($Url["query"] ? "?" . $Url["query"] : "")) . "&referer=" . urlencode($referer) . "&email=" . ($_GET["domail"] ? $_GET["email"] : "") . "&partSize=" . ($_GET["split"] ? $_GET["partSize"] : "") . "&method=" . $_GET["method"] . "&proxy=" . ($_GET["useproxy"] ? $_GET["proxy"] : "") . "&saveto=" . $_GET["path"] . "&link=" . urlencode($link) . ($_GET["add_comment"] == "on" ? "&comment=" . urlencode($_GET["comment"]) : "") . ($auth ? '&auth=' . ($auth == 1 ? 1 : urlencode($auth)) : "") . ($pauth ? "&pauth={$pauth}" : "") . ($_GET["uploadlater"] ? "&uploadlater=" . $_GET["uploadlater"] . "&uploadtohost=" . $_GET['uploadtohost'] : "") . "&cookie=" . ($cookie ? urlencode(encrypt($cookie)) : 0) . "&post=" . urlencode(serialize($post)) . ($_POST["uploadlater"] ? "&uploadlater=" . $_POST["uploadlater"] . "&uploadtohost=" . urlencode($_POST['uploadtohost']) : "") . ($_POST['autoclose'] ? "&autoclose=1" : "") . (isset($_GET["audl"]) ? "&audl=doum" : "") . $addon;
     if ($force_name) {
         $loc = $loc . "&force_name=" . urlencode($force_name);
     }
     insert_location($loc);
 }
开发者ID:mewtutorial,项目名称:rapidleech-ultimate,代码行数:40,代码来源:DownloadClass.php


示例17: kwspamexperts_CreateAccount

/**
* FUNCTION kwspamexperts_CreateAccount
* Create Account
* @param array $params
* @return string
*/
function kwspamexperts_CreateAccount($params)
{
    $api = new kwspamexperts_api($params);
    $domain = !empty($params["customfields"]["Domain"]) ? $params["customfields"]["Domain"] : $params['domain'];
    $password = !empty($params['password']) ? $params["password"] : createServerPassword();
    $email = !empty($params["customfields"]["Email"]) ? $params["customfields"]["Email"] : $params['clientsdetails']['email'];
    $archiving = (int) (!empty($params["configoptions"]["archiving"]) && $params["configoptions"]["archiving"]);
    // update password
    update_query("tblhosting", array("password" => encrypt($password)), array("id" => $params['serviceid']));
    // add domain
    if (empty($domain)) {
        return "Domain cannot be empty. Please enter domain name in Domain field.";
    }
    $api->call("domain/add/domain/" . $domain . "/");
    if ($api->isError()) {
        return $api->error();
    }
    // add email
    $api->call("domainuser/add/domain/" . $domain . "/password/" . $password . "/email/" . $email . "/");
    if ($api->isError()) {
        return $api->error();
    }
    $outgoing = $params["configoption1"] != 'Incoming' ? 1 : 0;
    $incoming = $params["configoption1"] != 'Outgoing' ? 1 : 0;
    $api->call("domain/setproducts/domain/" . $domain . "/incoming/" . $incoming . "/outgoing/" . $outgoing . "/archiving/{$archiving}/");
    if ($api->isError()) {
        return $api->error();
    }
    $res = kwspamexperts_ChangePackage($params);
    if (!$res) {
        return $res;
    }
    return "success";
}
开发者ID:digideskio,项目名称:whmcs-addon,代码行数:40,代码来源:kwspamexperts.php


示例18: formjson

 function formjson($data, $iv = true)
 {
     $payload = null;
     $sha512 = null;
     $hash = base64_encode(hash("sha512", $data, true));
     global $encryption;
     //$encryption is determined by request
     //if request sends encrypted data return encrypted
     //if ENCRYPTION is true send encrytped regardless of client
     if (ENCRYPTION || $encryption) {
         $e = null;
         $d = null;
         $key = readkeyfile();
         if ($iv) {
             $iv = base64_encode(mcrypt_create_iv(32));
             $d[0] = 1;
             $d[1] = $hash;
             $d[2] = encrypt($data, $key[0], $iv);
             $d[3] = $iv;
         } else {
             $d[0] = 1;
             $d[1] = $hash;
             $d[2] = encrypt($data, $key[0], $key[1]);
         }
         $payload = json_encode($d);
     } else {
         $d[0] = 0;
         $d[1] = $hash;
         $d[2] = base64_encode($data);
         //if its in plaintext it kersplodes
         $payload = json_encode($d);
     }
     return $payload;
 }
开发者ID:qinmenghua,项目名称:pw-chat,代码行数:34,代码来源:DataHandler.php


示例19: transform_string

function transform_string($array, $array2)
{
    $res = encrypt($array, $array2);
    $res2 = implode($res);
    $array4 = str_split($res2, 2);
    return encrypt_string($array4);
}
开发者ID:jabouzi,项目名称:cms,代码行数:7,代码来源:encrtest.php


示例20: login

 /**
  * 后台登陆控制器
  */
 public function login()
 {
     $arr = array('user_login' => I('user_login'), 'user_pass' => encrypt(I('user_pass'), C('ENCRYPTION_KEY')), 'remember-me' => I('remember-me'));
     //处理下次自动登录
     if ($arr['remember-me'] == 1) {
         $account = $arr['user_login'];
         $ip = get_client_ip(0, true);
         $value = $account . '|' . $ip;
         $value = encrypt($value, C('ENCRYPTION_KEY'));
         @setcookie('remember-me', $value, time() + 7 * 24 * 3600, "/");
     }
     $user = M('user')->where(array('user_login' => $arr['user_login']))->find();
     $userinfo = D('user')->getInfo($user['id']);
     if ($user['user_status'] == 0) {
         $this->error('账号被禁用,请联系管理员...');
     }
     if ($user['user_type'] != '管理员') {
         $this->error('无权限登录...');
     }
     if (!$user || $user['user_pass'] != $arr['user_pass']) {
         $this->error('账号密码错误,请重试...');
     }
     $data = array('id' => $user['id'], 'last_login_ip' => get_client_ip(0, true), 'last_login_time' => date("Y-m-d H:i:s"));
     $result = M('user')->save($data);
     if (!$result) {
         $this->error('登录失败,请重试...');
     }
     session('uid', $user['id']);
     session('username', $userinfo['username']);
     session('last_login_time', $data['last_login_time']);
     session('last_login_ip', $data['last_login_ip']);
     $this->success('登陆成功', U('Index/index'));
 }
开发者ID:lizhi0610,项目名称:hgnu,代码行数:36,代码来源:LoginController.class.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP encryptIt函数代码示例发布时间:2022-05-15
下一篇:
PHP encripta函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap