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

PHP get_password函数代码示例

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

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



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

示例1: checkLogin

 /**
  * checkLogin
  * 登陆入口首页验证方法
  * @access public
  * @return html
  * @author copoet
  * 用户状态status设置:1表示开启,2表示禁用,状态默认为1
  *
  */
 public function checkLogin()
 {
     $name = trim(I('post.username'));
     $pass = trim(I('post.password'));
     if (empty($name) || empty($pass)) {
         $this->error('用户名密码不能为空!', './index');
     }
     $info['name'] = $name;
     $info['password'] = get_password($name, $pass);
     $m = D('Manager');
     $User = $m->get_manager($info);
     if ($info['password'] == $User['password']) {
         if ($User['status'] == 10) {
             $data['last_time'] = time();
             $data['up_ip'] = get_client_ip();
             $m->updateManager($data, $User['id']);
             session('LOGIN_STATUS', 'TRUE');
             session('LOGIN_NAME', $User['name']);
             session('LOGIN_ID', $User['id']);
             $this->success('登陆成功!', './index');
         } else {
             $this->error('用户已被禁用,请联系管理员!', './index');
         }
     } else {
         $this->error('用户名或密码错误!', './index');
     }
 }
开发者ID:Copoet,项目名称:Copoet,代码行数:36,代码来源:PassportController.class.php


示例2: auth_error

function auth_error($exception = null)
{
    global $connection, $adminer, $has_token;
    $session_name = session_name();
    $error = "";
    if (!$_COOKIE[$session_name] && $_GET[$session_name] && ini_bool("session.use_only_cookies")) {
        $error = lang('Session support must be enabled.');
    } elseif (isset($_GET["username"])) {
        if (($_COOKIE[$session_name] || $_GET[$session_name]) && !$has_token) {
            $error = lang('Session expired, please login again.');
        } else {
            $password = get_password();
            if ($password !== null) {
                $error = h($exception ? $exception->getMessage() : (is_string($connection) ? $connection : lang('Invalid credentials.')));
                if ($password === false) {
                    $error .= '<br>' . lang('Master password expired. <a href="http://www.adminer.org/en/extension/" target="_blank">Implement</a> %s method to make it permanent.', '<code>permanentLogin()</code>');
                }
                set_password(DRIVER, SERVER, $_GET["username"], null);
            }
            unset_permanent();
        }
    }
    $params = session_get_cookie_params();
    cookie("adminer_key", $_COOKIE["adminer_key"] ? $_COOKIE["adminer_key"] : rand_string(), $params["lifetime"]);
    page_header(lang('Login'), $error, null);
    echo "<form action='' method='post'>\n";
    $adminer->loginForm();
    echo "<div>";
    hidden_fields($_POST, array("auth"));
    // expired session
    echo "</div>\n";
    echo "</form>\n";
    page_footer("auth");
}
开发者ID:amit0773,项目名称:manaslake,代码行数:34,代码来源:auth.inc.php


示例3: login

 public function login()
 {
     if (IS_POST) {
         $_username = $this->input->post("username");
         $_password = $this->input->post("password");
         $this->load->model("sys_user_model");
         //print_r($_username);exit();
         $_admin = $this->sys_user_model->getEntity(array("username" => $_username));
         if (!empty($_admin)) {
             if (get_password($_password, $_admin['id']) == $_admin['password']) {
                 if ($_admin['flag_valid'] == 1) {
                     if ($_admin['flag_valid'] == 1) {
                         $this->session->set_userdata(array("admin" => $_admin));
                         header("Location: /" . ADMIN_THEME . "/main");
                         return;
                     } else {
                         $this->put("result", "账号已停用");
                     }
                 } else {
                     $this->put("result", "账号已经停用");
                 }
             } else {
                 $this->put("result", "账号或密码错误");
             }
         } else {
             $this->put("result", "账号或密码错误");
         }
     }
     $this->render('login.html');
 }
开发者ID:johnlion,项目名称:srcms,代码行数:30,代码来源:main.php


示例4: get_password

function get_password()
{
    $site_password = common::readSingleline('Enter system user password, and hit return: ');
    $site_password2 = common::readSingleline('Retype system user password, and hit return: ');
    if ($site_password == $site_password2) {
        return $site_password;
    } else {
        get_password();
    }
}
开发者ID:gpawlik,项目名称:suited-php-classes,代码行数:10,代码来源:prompt_install.php


示例5: edit

 public function edit()
 {
     $_id = $this->input->get('id');
     if (IS_POST) {
         $_check = $this->sys_user_model->getCount(array('username' => $this->input->post('username'), 'id <>' => $_id));
         if ($_check == 0) {
             $_password = $this->input->post('password');
             $_data = $this->parseData(array('username', 'truename', 'email', 'flag_valid', 'sys_group_id'));
             $_data['id'] = $_id;
             if (notBlank($_password)) {
                 $_data['password'] = get_password($_password, $_id);
             }
             $this->handleResult($this->sys_user_model->updateEntityByID($_data, $_id));
         } else {
             $this->handleResult(false, '账户号名已存在,不能重复!');
         }
     }
     $this->put("group_list", $this->sys_user_group_model->getSysGroupArray());
     $this->put('entity', $this->sys_user_model->getEntityByID($_id));
     $this->render('sys_user_edit.html');
 }
开发者ID:johnlion,项目名称:srcms,代码行数:21,代码来源:sys_user.php


示例6: request

 $tmpquery = "WHERE mem.login = '{$un}'";
 $existsUser = new request();
 $existsUser->openMembers($tmpquery);
 $comptExistsUser = count($existsUser->mem_id);
 if ($comptExistsUser != "0") {
     $error = $strings["user_already_exists"];
 } else {
     // test if 2 passwords match
     if ($pw != $pwa || $pw == "") {
         $error = $strings["new_password_error"];
     } else {
         // replace quotes by html code in name and address
         $fn = convertData($fn);
         $tit = convertData($tit);
         $c = convertData($c);
         $pw = get_password($pw);
         $tmpquery1 = "INSERT INTO " . $tableCollab["members"] . "(organization,login,name,title,email_work,phone_work,phone_home,mobile,fax,comments,password,profil,created,timezone) VALUES('{$clod}','{$un}','{$fn}','{$tit}','{$em}','{$wp}','{$hp}','{$mp}','{$fax}','{$c}','{$pw}','3','{$dateheure}','0')";
         connectSql("{$tmpquery1}");
         $tmpquery = $tableCollab["members"];
         last_id($tmpquery);
         $num = $lastId[0];
         unset($lastId);
         $tmpquery3 = "INSERT INTO " . $tableCollab["notifications"] . "(member,taskAssignment,removeProjectTeam,addProjectTeam,newTopic,newPost,statusTaskChange,priorityTaskChange,duedateTaskChange,clientAddTask) VALUES ('{$num}','0','0','0','0','0','0','0','0','0')";
         connectSql("{$tmpquery3}");
         // if mantis bug tracker enabled
         if ($enableMantis == "true") {
             // Call mantis function for new user creation!!!
             $f_access_level = $client_user_level;
             // Reporter
             require_once "../mantis/create_new_user.php";
         }
开发者ID:jgatica,项目名称:Netoffice,代码行数:31,代码来源:addclientuser.php


示例7: request

require_once '../includes/library.php';
$pageSection = 'login';
// test send query
if ($action == 'send') {
    $tmpquery = "WHERE mem.login = '{$loginForm}'";
    $userDetail = new request();
    $userDetail->openMembers($tmpquery);
    $comptUserDetail = count($userDetail->mem_id);
    // test if user exists
    if ($comptUserDetail == "0") {
        $error = $strings["no_login"];
    } else {
        if ($userDetail->mem_email_work[0] != "") {
            // test if email of user exists
            password_generator();
            $pw = get_password($pass_g);
            $tmpquery = 'UPDATE ' . $tableCollab['members'] . " SET password='{$pw}' WHERE login = '{$loginForm}'";
            connectSql($tmpquery);
            $body = $strings['user_name'] . ' : ' . $userDetail->mem_login[0] . "\n\n" . $strings['password'] . " : {$pass_g}";
            $mail = new notification();
            $mail->getUserinfo('1', 'from');
            $subject = 'NetOffice ' . $strings['password'];
            $mail->Subject = $subject;
            $mail->Priority = '1';
            $mail->Body = $body;
            $mail->AddAddress($userDetail->mem_email_work[0], $userDetail->mem_name[0]);
            $mail->Send();
            $mail->ClearAddresses();
            // redirect to login page with message
            header('Location: ../general/login.php?msg=emailpwd');
            exit;
开发者ID:TICanalyste,项目名称:netOffice--remix-,代码行数:31,代码来源:sendpassword.php


示例8: get_user

/**
 * Requests the user information, including username and email.
 */
function get_user()
{
    $username = get_input('Username (e.g. first.last)?', '/[A-Za-z0-9]*\\.[A-Za-z0-9]*/');
    $email = get_input('Email address (e.g. ' . $username . '@domain.com)?', '/[A-Za-z0-9]*\\.[A-Za-z0-9]*@.*\\..*/');
    $role = get_role();
    $password = get_password();
    $user = new User($username, $email, $role, $password);
    if (DEBUG) {
        print_line('User specified: ' . $user->username . ' (' . $user->email . ', ' . $user->role . ', ' . $user->get_formatted_password() . ')', DEBUG);
    }
    return $user;
}
开发者ID:KCarlile,项目名称:cdt,代码行数:15,代码来源:account.php


示例9: get_token

<?php

require_once 'functions.php';
require_once 'connect.php';
require_once 'lib/safemysql.class.php';
if ($_GET['state'] == 'vk_reg') {
    $token = get_token($_GET['code'], $g_url);
    if (!empty($token)) {
        $mysql_check = $db_connect->getRow("SELECT user_id FROM sf_user WHERE user_id='" . $user_id . "'");
        if (count($mysql_check) > 0) {
            $l_msg = 'Вы уже зарегистрированны!';
        } else {
            $user_name = get_name($user_id);
            $user_login = $user_id;
            $user_pass = get_password(12);
            $db_input = $db_connect->query("INSERT INTO sf_user (user_id, name, user_group, email, login, pass) VALUES ('{$user_id}','{$user_name}','1','[email protected]','{$user_login}','{$user_pass}')");
            if ($db_input == 1) {
                $l_msg = 'Вы успешно зарегистрированны';
            } else {
                $l_msg = 'В процессе регистрации возникла ошибка, попробуйте ещё раз!';
            }
        }
    }
}
if ($_GET['state'] == 'login_reg') {
    $user_login = $_POST['login'];
    $user_pass = $_POST['pass'];
    $user_mail = $_POST['mail'];
    $md5_pass = md5($user_pass);
    if (!empty($user_login) and !empty($user_pass) and !empty($user_mail)) {
        $mysql_check = $db_connect->getRow("SELECT login FROM sf_user WHERE login='" . $user_login . "'");
开发者ID:jade58,项目名称:sf-cms,代码行数:31,代码来源:registration.php


示例10: verify_hash

        $stmt->execute();
        $stmt->bind_result($password);
        $stmt->fetch();
        $stmt->close();
        return $password;
    }
}
function verify_hash($password, $hash, $salt)
{
    $md5 = md5($salt . $password);
    return $md5 == $hash;
}
$protocol = $_SERVER["HTTP_AUTH_PROTOCOL"];
if ($_SERVER["HTTP_AUTH_METHOD"] == "apop") {
    $username = $_SERVER["HTTP_AUTH_USER"];
    $userpass = get_password($username);
    if ($userpass) {
        $hash = $_SERVER["HTTP_AUTH_PASS"];
        $salt = $_SERVER["HTTP_AUTH_SALT"];
        if (verify_hash($userpass, $hash, $salt)) {
            get_mailserver($DBMAIL, $protocol);
            header("Auth-Pass: {$userpass}");
        } else {
            fail();
        }
    } else {
        fail();
    }
} else {
    get_mailserver($DBMAIL, $protocol);
}
开发者ID:Alexander-KI,项目名称:dbmail,代码行数:31,代码来源:auth.php


示例11: connectSql

                }
            }
            $tmpquery = "UPDATE " . $tableCollab["members"] . " SET password='{$cnpw}' WHERE id = '" . $_SESSION['idSession'] . "'";
            connectSql("{$tmpquery}");
            // if CVS repository enabled
            if ($enable_cvs == "true") {
                $query = "WHERE tea.member = '" . $_SESSION['idSession'] . "'";
                $cvsMembers = new request();
                $cvsMembers->openTeams($query);
                // change the password in every repository
                for ($i = 0; $i < count($cvsMembers->tea_id); $i++) {
                    cvs_change_password($cvsMembers->tea_mem_login[$i], $cnpw, $cvsMembers->tea_pro_id[$i]);
                }
            }
            // encrypt the new password using the defined loginMethod
            $npw = get_password($npw);
            $_SESSION['passwordSession'] = $npw;
            header('Location: changepassword.php?msg=update');
            exit;
        }
    }
}
$tmpquery = "WHERE mem.id = '" . $_SESSION['idSession'] . "'";
$userDetail = new request();
$userDetail->openMembers($tmpquery);
$comptUserDetail = count($userDetail->mem_id);
if ($comptUserDetail == "0") {
    header('Location: userlist.php?msg=blankUser');
    exit;
}
$titlePage = $strings["change_password"];
开发者ID:TICanalyste,项目名称:netOffice--remix-,代码行数:31,代码来源:changepassword.php


示例12: credentials

 function credentials()
 {
     return array('localhost', $_GET["username"], get_password());
 }
开发者ID:ukoloff,项目名称:nginx-windows,代码行数:4,代码来源:fpm.php


示例13: change_password

function change_password($id, $oldPassword, $newPassword)
{
    if ($GLOBALS['$connected'] == False) {
        connect_to_db();
    }
    $hash = get_password($id);
    //Unhashing the password to see if it matches what was entered.
    if (password_verify($oldPassword, $hash)) {
        $newHash = password_hash($newPassword, PASSWORD_DEFAULT);
        $sql1 = mysql_query("UPDATE users SET password='{$newHash}' WHERE id='{$id}'");
        echo '<script>';
        echo 'alert("Password Update Successfull");';
        echo '</script>';
    } else {
        echo '<script>';
        echo 'alert("Old Password is invalid");';
        echo '</script>';
    }
}
开发者ID:patthickey,项目名称:software_engineering,代码行数:19,代码来源:sql_calls.php


示例14: get_connection

function get_connection()
{
    static $pdo;
    if (empty($pdo)) {
        echo get_dsn();
        echo "\n";
        echo get_username();
        echo "\n";
        echo get_password();
        echo "\n";
        $pdo = new PDO(get_dsn(), get_username(), get_password());
        $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
    }
    return $pdo;
}
开发者ID:jlbooker,项目名称:homestead,代码行数:15,代码来源:createfakestudents.php


示例15: while

    while ($res = @mysql_fetch_row($tmp)) {
        $submit_problems[$res[0]] = $res[1];
    }
    return $submit_problems;
}
$key = $_GET['key'];
if ($key == $api_key) {
    $task = $_GET['task'];
    if ($task == 'account') {
        $user_id = $_GET['user_id'];
        if (check_user_id($user_id) == 0) {
            //no user
            echo json_encode(array('error' => 'no_such_user'));
            exit;
        }
        $password = get_password($user_id);
        $json = array('password' => $password);
        echo json_encode($json);
    } else {
        if ($task == 'submit_problems') {
            $user_id = $_GET['user_id'];
            if (check_user_id($user_id) == 0) {
                //no user
                echo json_encode(array('error' => 'no_such_user'));
                exit;
            }
            $submit_problems = get_submit_problems($user_id);
            echo json_encode(array('submit_problems' => $submit_problems));
        } else {
            echo json_encode(array('error' => 'no_such_task'));
        }
开发者ID:thezawad,项目名称:LavidaOnlineJudge,代码行数:31,代码来源:api.php


示例16: connect_and_bind

function connect_and_bind($options = array())
{
    $ldapServer = isset($options['host']) ? $options['host'] : "ldap.netsoc.dit.ie";
    $ldapPort = isset($options['port']) ? $options['port'] : "389";
    if (isset($options['bindDN'])) {
        $ldapBindDN = $options['bindDN'];
    } elseif (isset($options['username'])) {
        $ldapBindDN = "cn=" . $options['username'] . ",ou=members,ou=users,dc=netsoc,dc=dit,dc=ie";
    } else {
        $ldapBindDN = 'cn=admin,dc=netsoc,dc=dit,dc=ie';
    }
    $ldapPass = isset($options['password']) ? $options['password'] : get_password($ldapBindDN);
    $ldapConnection = ldap_connect($ldapServer, $ldapPort);
    ldap_set_option($ldapConnection, LDAP_OPT_PROTOCOL_VERSION, 3);
    ldap_set_option($ldapConnection, LDAP_OPT_NETWORK_TIMEOUT, 1);
    $bindResult = @ldap_bind($ldapConnection, $ldapBindDN, $ldapPass);
    if (!$bindResult) {
        echo "Error, " . ldap_error($ldapConnection) . ". Server: {$ldapServer}\n";
        exit;
    }
    return $ldapConnection;
}
开发者ID:netsocDIT,项目名称:ldap-scripts,代码行数:22,代码来源:machine-manage.php


示例17: get_password

					<br>
					<label>Word Cases:</label>
					<div class="br">
						<br>
					</div>
					<select name="cases" class="form-box">
						<option value="start">First Letter Capitalized</option>
  						<option value="upper">All Upper Case</option>
  						<option value="lower">All Lower Case</option>
					</select> 
					<br>
					<input type="submit" class="btn btn-primary" value="Generate Password">
				</form>
				<div class="password">
					<p><?php 
echo get_password($words, $symbols_list);
?>
</p>
				</div>
				<div class="row">
					<div class="col-lg-2 col-md-2 col-sm-0 col-xs-0"></div>
					<div class="col-lg-8 col-md-8 col-sm-12 col-xs-12">
						<a href="http://xkcd.com/936/" target="_blank" id="comic"><img src="images/password_comic.png" alt="Password comic." class="img-responsive img-border"></a>
					</div>
					<div class="col-lg-2 col-md-2 col-sm-0 col-xs-0"></div>
				</div>
				<footer>Copyright &copy; 2015 Hannah Riggs</footer>
			</div>
			<div class="col-lg-2 col-md-2 col-sm-2 col-xs-2"></div>
		</div> <!-- end main row -->
	</div> <!-- end container-fluid -->
开发者ID:hriggs,项目名称:dwa-project2,代码行数:31,代码来源:index.php


示例18: array

 * 
 */
if ($_GET['type'] === "student") {
    $alunni = array();
    // file di log
    $log_file = fopen("../tmp/studenti" . date("Ymd"), "w+");
    $index = 0;
    $incompleti = 0;
    $sel = "SELECT id_alunno, nome, cognome, username, password FROM alunni WHERE attivo = 1";
    $res = $db->execute($sel);
    while ($_alunno = $res->fetch_assoc()) {
        if ($_alunno['username'] == '') {
            $al = new Alunno($_alunno);
            $incompleti++;
            $al->username = get_login($db, $al->nome, $al->cognome);
            $al->password = get_password($al->nome, $al->cognome, &$al->clean_pwd);
            //print ($al->username).":".$al->password."<br/>";
            $upd = "UPDATE alunni SET username = '" . $al->username . "', password = '" . $al->password . "' WHERE id_alunno = " . $al->id_alunno;
            $r = $db->execute($upd);
            $str_log = $al->nome . " " . $al->cognome . ":" . $al->username . ":" . $al->password . ":" . $al->clean_pwd . "\n";
            fwrite($log_file, $str_log);
        }
    }
} else {
}
?>

<html>
<head>
<title>Creazione account</title>
<link rel="stylesheet" type="text/css" href="../css/Underground.css">
开发者ID:jamleh,项目名称:e-schoolbook,代码行数:31,代码来源:accounts_maker.php


示例19: changePassword

 function changePassword()
 {
     $user = $this->session->userdata('user');
     $this->db->where('use_id', $user['use_id']);
     $this->db->where('use_pass', get_password($this->input->post('password_old')));
     $data = $this->db->get(TABLE_PREFIX . 'users');
     if ($data->num_rows() > 0) {
         $this->db->where('use_id', $user['use_id']);
         $this->db->where('use_pass', get_password($this->input->post('password_old')));
         $this->db->set('use_pass', get_password($this->input->post('use_pass')));
         $this->db->set('use_modified', "NOW()", false);
         return $this->db->update(TABLE_PREFIX . 'users');
     }
     return false;
 }
开发者ID:kumarsivarajan,项目名称:ume-system,代码行数:15,代码来源:m_accounts.php


示例20: get_password

} else {
    //test blank fields in form
    if ($auth == "test") {
        if ($loginForm == "" && $passwordForm == "") {
            $error = $strings["login_username"] . "<br/>" . $strings["login_password"];
        } else {
            if ($loginForm == "") {
                $error = $strings["login_username"];
            } else {
                if ($passwordForm == "") {
                    $error = $strings["login_password"];
                } else {
                    $auth = "on";
                    if ($rememberForm == "on") {
                        $oneyear = 22896000;
                        $storePwd = get_password($passwordForm);
                        setcookie("loginCookie", $loginForm, time() + $oneyear);
                        setcookie("passwordCookie", $storePwd, time() + $oneyear);
                    } else {
                        setcookie("loginCookie");
                        setcookie("passwordCookie");
                    }
                }
            }
        }
    }
    if ($forcedLogin == "false") {
        if ($auth == "on" && !$loginForm && !$passwordForm) {
            $auth = "off";
            $error = "Detecting variables poisoning ;-)";
        }
开发者ID:ColBT,项目名称:php_tut,代码行数:31,代码来源:login.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP get_password_reset_key函数代码示例发布时间:2022-05-15
下一篇:
PHP get_passage函数代码示例发布时间: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