本文整理汇总了PHP中Access::create_hash方法的典型用法代码示例。如果您正苦于以下问题:PHP Access::create_hash方法的具体用法?PHP Access::create_hash怎么用?PHP Access::create_hash使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Access
的用法示例。
在下文中一共展示了Access::create_hash方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: elseif
</td>
</tr>
</table>
</form>
</div>
<?php
require 'footer.php';
die;
} else {
Gadget::redirect('index');
die;
}
} elseif (isset($_REQUEST['submit_new_pass'])) {
// Insert new password and set expires to 0
$request = dbi()->q_1("SELECT * FROM password_reset_requests WHERE token_id = '" . $_SESSION['token_id'] . "'");
dbi()->update('Customers', array('Password' => Access::create_hash($_REQUEST['new_pass'], 'strong')), 'CustomerID = ' . $request->CustomerID);
dbi()->update('password_reset_requests', array('expires' => '0000-00-00 00:00:00'), 'token_id = \'' . $_SESSION['token_id'] . '\'');
unset($_SESSION['token_id']);
Gadget::add_message('Your password has been reset!');
Gadget::redirect('login');
die;
}
require 'header.php';
?>
<div class="content-padding">
<form name="forgot-form" class="user-form" id="forgot-form" action="forgot" method="post">
<table>
<tr>
<td>
<label for="forgot-email">email:</label>
</td>
示例2: set_password
public function set_password($new_pass)
{
$this->Password = Access::create_hash($new_pass, 'strong');
$this->update();
}
示例3: array
'one_of' => array($password),
),
array(
'name' => 'Zip',
'value' => $zip,
'required' => true,
'match' => '/^[0-9]{5}$/',
),
));
if($validation->errors){
Gadget::add_message($validation->get_errors());
}else{
$insert_data = array(
'Email' => $email,
'Password' => Access::create_hash($password, 'strong'),
'DeliveryZip' => $zip
);
$dbi->insert('Customers', $insert_data);
if($dbi->errno == 1062){
Gadget::add_message('This email address is already registered.');
}else{
Gadget::add_message('Your account has been created.');
Gadget::redirect('login');
}
}
}
require 'header.php';
?>
<div class="content-padding">
示例4: json_encode
echo json_encode(array('result' => true, 'msg' => 'Successfully Logged In', 'extra' => json_encode($customer)));
break;
case 1:
echo json_encode(array('result' => false, 'msg' => "Incorrect Password"));
break;
case 2:
echo json_encode(array('result' => false, 'msg' => "Invalid Email"));
break;
}
} else {
echo json_encode(array('result' => false, 'msg' => "Invalid username or password."));
}
break;
case 'register':
if (isset($_REQUEST['user']) && isset($_REQUEST['pass'])) {
$insert_data = array('Email' => $_REQUEST['user'], 'Password' => Access::create_hash($_REQUEST['pass'], 'strong'));
$dbi->insert('Customers', $insert_data);
Access::log_user_in_ajax($_REQUEST['user'], $_REQUEST['pass']);
echo json_encode(array('result' => true, 'msg' => "Your account has been created", 'extra' => Customer::get_current()));
} else {
echo json_encode(array('result' => false, 'msg' => "Invalid email or password"));
}
break;
default:
$_SESSION['loggedin'] = false;
echo json_encode(array('result' => false, 'code' => '1', 'msg' => "Requested action not defined"));
break;
}
} else {
echo json_encode(array('result' => false, 'msg' => "Error: No action was defined."));
}
示例5: debug
require 'includes/global.inc.php';
debug(0, 0, 0);
$page = Page::get_from_alias('register');
$page->add_js('js/register.js');
if ($_POST) {
$email = strtolower(trim($_POST['register-email']));
$password = $_POST['register-password'];
$password2 = $_POST['confirm-password'];
$zip = $_POST['register-zip'];
$validation = new Validation();
$validation->validate_array(array(array('name' => 'Email', 'value' => $email, 'match' => '/^[A-Z0-9._%+-]+\\@[A-Z0-9.-]+\\.[A-Z]{2,4}(\\.[A-Z]{2,4})?$/i', 'required' => true), array('name' => 'Password', 'value' => $password, 'required' => true), array('name' => 'Password Confirmation', 'value' => $password2, 'required' => true, 'one_of' => array($password)), array('name' => 'Zip', 'value' => $zip, 'required' => true, 'match' => '/^[0-9]{5}$/')));
if ($validation->errors) {
Gadget::add_message($validation->get_errors());
} else {
$insert_data = array('Email' => $email, 'Password' => Access::create_hash($password, 'strong'), 'DeliveryZip' => $zip);
$dbi->insert('Customers', $insert_data);
if ($dbi->errno == 1062) {
Gadget::add_message('This email address is already registered.');
} else {
Gadget::add_message('Your account has been created.');
Gadget::redirect('login');
}
}
}
require 'header.php';
?>
<div class="content-padding">
<form class="user-form" name="register-form" id="register-form" action="register" method="post" onsubmit="return validateForm();">
<table>
<tr>