本文整理汇总了PHP中checkPass函数的典型用法代码示例。如果您正苦于以下问题:PHP checkPass函数的具体用法?PHP checkPass怎么用?PHP checkPass使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了checkPass函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: userExists
function userExists()
{
return true;
if (checkPass($this->_prefs->get('passwd'))) {
return true;
}
return $this->_tryNextUser();
}
示例2: changequestion
function changequestion()
{
global $domain, $db, $usrdata, $seo_on, $template;
if (isset($_POST['submit'])) {
$pass = clean($_POST['pass']);
$salt = $usrdata['salt'];
$pass = checkpass($pass, $salt);
$answer = clean($_POST['answer']);
$answer = checkPass($answer, $salt);
$question = clean($_POST['question']);
if (!$question || !$answer || !$pass) {
echo '<div class=\'error\'>All feilds were not filled out!</div>';
return;
}
if ($pass != $usrdata['password']) {
echo '<div class=\'error\'>Current Password is incorrect.</div>';
} else {
mysql_query("UPDATE fas_users SET `pass_question`='{$question}', `pass_answer`='{$answer}' WHERE userid='{$usrdata['userid']}'");
echo '<div class=\'msg\'>Question & answer updated.</div>';
}
}
if ($seo_on == 1) {
$surl = '' . $domain . '/myaccount/changequestion/';
} else {
$surl = '' . $domain . '/index.php?action=myaccount&cmd=changequestion';
}
$userid = $usrdata['userid'];
$ir = $db->query(sprintf('SELECT * FROM fas_users WHERE userid=\'%u\'', $userid));
$r2 = $db->fetch_row($ir);
$questionf = $r2['pass_question'];
echo '<form action=\'' . $surl . '\' method=\'POST\'>
<table width="100%">
<tr>
<td class=\'header\' colspan=\'2\'>Change password question/answer</td>
</tr>
<tr>
<td class=\'content\'>Question:</td>
<td class=\'content\'><input type=\'text\' name=\'question\' size=\'35\' value=\'' . $questionf . '\'></td>
</tr>
<tr>
<td class=\'content\'>Answer:</td>
<td class=\'content\'><input type=\'text\' name=\'answer\' size=\'35\' value=\'\'></td>
</tr>
<tr>
<td class=\'content\'>Current Password:</td>
<td class=\'content\'><input type=\'password\' name=\'pass\' size=\'35\'></td>
</tr>
<tr>
<th colspan=\'2\' class=\'content\'><input type=\'submit\' name=\'submit\' value=\'Submit\'></th>
</tr>
</table>
</form>';
}
示例3: makeNonce
<?php
require '../Code/initiateCollector.php';
require 'loginFunctions.php';
$hash_algo = 'sha256';
$nonce = $_SESSION['admin']['challenge'];
if (isset($_POST['response'])) {
$response = $_POST['response'];
if (checkPass($response, $_CONFIG->password, $nonce, $hash_algo) === true) {
$_SESSION['admin']['challenge'] = makeNonce();
$_SESSION['admin']['status'] = 'loggedIn';
$_SESSION['admin']['birth'] = time();
} else {
$_SESSION['admin']['status'] = 'failed';
$_SESSION['admin']['birth'] = time();
}
}
header('Location: ./');
// go back to root of current folder
示例4: htmlspecialchars
<?php
require 'connect.php';
$username = htmlspecialchars($_POST['username']);
$email = htmlspecialchars($_POST['email1']);
$pass1 = htmlspecialchars(md5($_POST['password1']));
$pass2 = htmlspecialchars(md5($_POST['password2']));
if (checkPass($pass1, $pass2) == true && checkEmail($email) == false) {
$database = new connect();
$query = "INSERT INTO users(name,email,password)VALUES('{$username}','{$email}','{$pass1}')";
$resultQuery = mysql_query($query);
//header("location:registration.php?success");
echo "registered";
} else {
//header("Location:registration.php?fail");
echo $username . " " . $email . " " . $pass1 . " " . $pass2;
}
/*
* checking passwords
*/
function checkPass($p1, $p2)
{
$result = false;
if ($p1 == $p2) {
$result = true;
}
return $result;
}
/*
* checking email in the database
*/
示例5: gotDTMF
function gotDTMF($text)
{
global $state;
global $mailbox;
global $collect_user;
global $collect_pass;
Yate::Debug("gotDTMF('{$text}') state: {$state}");
switch ($state) {
case "user":
if ($text == "*") {
promptUser();
return;
}
if ($text == "#") {
checkUser();
} else {
$collect_user .= $text;
}
return;
case "pass":
if ($text == "*") {
promptPass();
return;
}
if ($text == "#") {
checkPass();
} else {
$collect_pass .= $text;
}
return;
}
if ($mailbox == "") {
return;
}
navigate($text);
}
示例6: cleanAdminSession
<?php
include "dblib.inc";
include "userlib.inc";
$message = "";
if (isset($tila) && $tila == "login") {
if (empty($form[name]) || empty($form[password])) {
$message .= "Sun täytyy täyttää kaikki kentät!<br>\n";
}
if (!($row_array = checkPass($form[name], md5($form[password])))) {
$message .= "Väärä salasana, yritäs uudestaan!<br>\n";
}
if ($message == "") {
cleanAdminSession($row_array[id], $row_array[name], $row_array[password]);
header("Location: koulu.php?" . SID);
}
}
include "ylaosa.php";
?>
<br>
<h2>Login</h2>
<?php
if (message != "") {
print "<p><b>{$message}</b></p>";
}
?>
<form action="<?php
print $PHP_SELF;
?>
示例7: header
<?php
include_once "config.php";
if (loggedIn()) {
header('Location: index.php');
}
if (isset($_POST["submit"])) {
if (!($row = checkPass($_POST["login"], $_POST["password"]))) {
echo "<p>Incorrect login/password, try again</p>";
exit;
}
cleanMemberSession($_POST["login"], $_POST["password"]);
header("Location: index.php");
}
?>
<html lang="es">
<head>
<meta charset="UTF-8">
<link rel="shortcut icon" href="img/icon.ico" />
<title>Esneyder-Desarrollo MongoDB</title>
</head>
<body>
<div class="xs-11 sm-8 center contenido">
<div class="panel shadow styled tip ">
<h2 class="header">Formulario de ingreso | Programación MongoDB</h2>
<div class="body">
<form method="post"action="<?php
示例8: validUserPass
function validUserPass($user, $pass, $twofa)
{
$rep = checkPass($user, $pass, $twofa);
if ($rep != null) {
$ans = repDecode($rep);
}
usleep(500000);
// Max twice per second
if ($rep != null && $ans['STATUS'] == 'ok') {
$key = 'ckp' . rand(1000000, 9999999);
$_SESSION['ckpkey'] = $key;
$_SESSION[$key] = array('who' => $user, 'id' => $user);
return true;
}
return false;
}
示例9: mysql_real_escape_string
} else {
if (!$_POST['username'] || !$_POST['password']) {
$err[] = 'Все поля должны быть заполнены!';
}
if (!preg_match('#^[A-Za-z0-9]+$#i', $_POST['username']) || !preg_match('#^[A-Za-z0-9]+$#i', $_POST['password'])) {
$err[] = 'Разрешены только цифры и латинские буквы!';
} else {
if (!count($err)) {
$_POST['username'] = mysql_real_escape_string($_POST['username']);
}
$_POST['password'] = mysql_real_escape_string($_POST['password']);
$_POST['rememberMe'] = (int) $_POST['rememberMe'];
$row = mysql_fetch_assoc(mysql_query("SELECT {$db_columnId},{$db_columnUser},{$db_columnPass} FROM {$db_table} WHERE {$db_columnUser}='{$_POST['username']}'"));
$realPass = $row[$db_columnPass];
$postPass = $_POST['password'];
if (checkPass($realPass, $postPass)) {
$playername = $_POST['username'];
mysql_query("UPDATE {$db_table} SET {$db_columnLastLog}=NOW() WHERE {$db_columnUser} = '{$playername}'") or die("Запрос к базе завершился ощибкой.");
$_SESSION['playername'] = $row[$db_columnUser];
$_SESSION['id'] = $row[$db_columnId];
$_SESSION['rememberMe'] = $_POST['rememberMe'];
setcookie('Remember', $_POST['rememberMe']);
} else {
$select = mysql_query("SELECT {$db_Ipcolumn} FROM {$db_ErrorLogtable} WHERE {$db_Ipcolumn}='{$ip}'") or die("Запрос к базе завершился ощибкой.");
$tmp = mysql_fetch_row($select);
if ($ip == $tmp[0]) {
$result52 = mysql_query("SELECT {$db_Numcolumn} FROM {$db_ErrorLogtable} WHERE {$db_Ipcolumn}='{$ip}'") or die("Запрос к базе завершился ощибкой.");
$myrow52 = mysql_fetch_array($result52);
$col = $myrow52[0] + 1;
mysql_query("UPDATE {$db_ErrorLogtable} SET {$db_Numcolumn}={$col},{$db_Datecolumn}=NOW() WHERE {$db_Ipcolumn}='{$ip}'") or die("Запрос к базе завершился ощибкой.");
} else {
示例10: changePwForm
function changePwForm($userid = '', $cToken = '', $email = '', $msg = '')
{
if (false) {
die('changePwForm disabled');
}
if ($msg !== '') {
echo "\n <h3>\n {$msg}\n </h3>";
}
echo "\n <form method='POST' autocomplete='off' action='" . curPageURL() . "' onsubmit='return checkPassReturn();' >\n <fieldset>\n <legend>Password Reset Form</legend>\n <p>\n <label for='token'>Token</label>\n <input type='text' name='token' id='token' value='{$cToken}' class='textbox-300' readonly/>\n <input type='hidden' name='change' id='change'/>\n <input type='hidden' name='userid' id='userid' value='{$userid}'/>\n </p>\n <p>\n <label for='email'>Email</label>\n <input type='text' name='email' id='email' value='{$email}' class='textbox-300' readonly/>\n </p>\n <fieldset>\n <legend>New Password Form</legend>\n <p>\n <label for='pass1'>Password</label>\n <input type='password' name='pass1' id='pass1' value='' class='textbox-300' />\n </p>\n <p>\n <label for='pass2'>Passwor2</label>\n <input type='password' name='pass2' id='pass2' value='' class='textbox-300' onkeyup='checkPass(); return false;' />\n <span id='confirmMessage' class='confirmMessage'></span>\n </p>\n </fieldset>\n <p>\n <input type='submit'/><br>\n </p>\n </fieldset>\n </form>\n ";
echo '<script>' . checkPass() . '</script>';
exit;
die;
}
示例11: checkPass
//• Nie zawiera dwóch wielkich lub dwóch małych liter pod rząd
$password = '12345678901Aa';
function checkPass($password)
{
echo strlen($password);
if (preg_match('#.{10,15}#', $password)) {
if (preg_match('#[a-z]+#', $password)) {
if (preg_match('#[A-Z]+#', $password)) {
if (!preg_match('#[a-z][a-z]|[A-Z][A-Z]#', $password)) {
echo 'haslo prawidlowe';
} else {
throw new Exception('blad 4');
}
} else {
throw new Exception('blad 3');
}
} else {
throw new Exception('blad 2');
}
} else {
throw new Exception('blad 1');
}
}
//checkPass($password);
try {
checkPass($password);
} catch (Exception $e) {
echo 'Cought exception';
} finally {
echo 'Finnaly';
}
示例12: Exception
}
} else {
echo 'bledny url<br>';
}
} else {
echo 'bledny email<br>';
}
} else {
throw new Exception('blad 4<br>');
}
} else {
throw new Exception('blad 3<br>');
}
} else {
throw new Exception('blad 2<br>');
}
} else {
throw new Exception('blad 1<br>');
}
}
checkPass($password, $email, $url, $ip);
}
//
// try {
// checkPass($password);
// } catch (Exception $e) {
// echo 'Cought exception';
// } finally {
// echo 'Finnaly';
// }
//}
示例13: validateId
// Obtiene el id_miembro y verifica si es correcto
$id_miembro = validateId($id_miembro);
// Controla el acceso a la pagina
accessOwnMember($id_miembro);
// Comprueba si hay que actualizar los datos
if (isset($_POST['id_miembro'])) {
// SI es ADMIN no necesita la clave
if ($_SESSION['privilegios'] == ADMIN) {
// Puede actualizar cualquier campo
$canUpdate = true;
} else {
// Si NO es ADMIN comprueba la password
if (isset($_POST['password']) && strlen($_POST['password'])) {
// Obtiene si la clave es correcta
$password = $_POST['password'];
$canUpdate = checkPass($id_miembro, $password);
}
}
// Si puede actualizar, procedemos a realizar los cambios
if ($canUpdate) {
// Comprueba que haya introducido usuario
if (isset($_POST['usuario']) && strlen($_POST['usuario'])) {
// Obtiene el nombre del usuario introducido
$usuario = $_POST['usuario'];
// Comprueba que tiene caracteres válidos [A-Za-z0-9-]
if (preg_match('/^[\\w\\d-]+$/', $usuario)) {
// Si está disponible, lo actualiza
if (isUserAvailabre($id_miembro, $usuario)) {
// Cambia el nombre de usuario
updateUser($id_miembro, $usuario);
} else {
示例14: file_get_contents
} else {
return true;
}
}
//Expecting {"in" : "data", "out" : "data", "id" : "data", "auth" : "data"} from POST requests
$input = file_get_contents('php://input');
$data = json_decode($input, TRUE);
if ($data) {
$peoplein = mysqli_real_escape_string($db, $data['in']);
$peopleout = mysqli_real_escape_string($db, $data['out']);
$room_id = mysqli_real_escape_string($db, $data['id']);
$key = mysqli_real_escape_string($db, $data['auth']);
$time = date("h:i:sa");
$date = date('Y-m-d');
$query = "SELECT `room_id`, `secret_key`, `people_in`, `people_out` FROM room WHERE `room_id` = '{$room_id}'";
$results = $db->query($query);
if ($results) {
$rows = $results->fetch_assoc();
//Make sure the PI's id matches the authentication key it sent before updating records in database
if (checkPass($key, $rows['secret_key'])) {
$peoplein += $rows['people_in'];
$peopleout += $rows['people_out'];
$update = "UPDATE room SET `people_in` = '{$peoplein}', `people_out` = '{$peopleout}', `date` = '{$date}', `time` = '{$time}'\n WHERE `room_id` = '{$room_id}'";
if (!$db->query($update)) {
echo "Failed to update.";
}
}
} else {
echo "Failed to update.";
}
}
示例15: checkPass
$_SESSION['tags'] = $tags;
if (checkPremiumMT()) {
$memberstatus = "premiumMT";
} else {
if (checkClientMT()) {
$memberstatus = "clientMT";
} else {
if (checkMT()) {
$memberstatus = "MT";
} else {
$memberstatus = "newMT";
}
}
}
$_SESSION['memberstatus'] = $memberstatus;
$passstatus = checkPass();
$_SESSION['passstatus'] = $passstatus;
} else {
session_unset();
}
} else {
session_unset();
}
} else {
$memberstatus = $_SESSION['memberstatus'];
$passstatus = $_SESSION['passstatus'];
$tags = $_SESSION['tags'];
$details = $_SESSION['details'];
}
//grab origin
if (!$_SESSION['webpesanan']) {