本文整理汇总了PHP中admin::setPassword方法的典型用法代码示例。如果您正苦于以下问题:PHP admin::setPassword方法的具体用法?PHP admin::setPassword怎么用?PHP admin::setPassword使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类admin
的用法示例。
在下文中一共展示了admin::setPassword方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: admin
<?php
session_start();
require_once '../classes/connection.class.php';
require_once '../classes/admin.class.php';
$objValidate = new admin();
$username = mysqli_real_escape_string($objValidate->conxn, $_POST['username']);
$password = mysqli_real_escape_string($objValidate->conxn, $_POST['password']);
//$password=crypt($password);
$objValidate->setUsername($username);
$objValidate->setPassword($password);
$flag = $objValidate->validateAdmin();
/*echo $objValidate->sql;
exit;*/
// echo '<pre>';
// print_r ($objValidate);
// echo '</pre>';
// exit;
if ($flag) {
$_SESSION['username'] = $username;
//$_SESSION['adminid']=$user_id;
header('location:../index.php?homepage');
} else {
header('location:../login.php?err=.base64_decode("invalid username and password")');
$_SESSION['msg'] = $adduserobj->msg = "Sorry incorrect username and password";
}
示例2: creaAdminDaArray
/**
* Crea un addetto ordini da una riga del db
* @param type $row
* @return \admin
*/
public function creaAdminDaArray($row)
{
$admin = new admin();
$admin->setId($row['admin_id']);
$admin->setNome($row['admin_nome']);
$admin->setCognome($row['admin_cognome']);
$admin->setVia($row['admin_via']);
$admin->setCivico($row['admin_civico']);
$admin->setCitta($row['admin_citta']);
$admin->setCap($row['admin_cap']);
$admin->setTelefono($row['admin_telefono']);
$admin->setRuolo(User::admin);
$admin->setUsername($row['admin_username']);
$admin->setPassword($row['admin_password']);
return $admin;
}
示例3: header
include_once $_SERVER['DOCUMENT_ROOT'] . "/core/init.inc.php";
if (!admin::isSession()) {
header("Location: /admin/login.php");
}
if (!empty($_POST)) {
$authToken = isset($_POST['authenticity_token']) ? $_POST['authenticity_token'] : '';
$current_passw = isset($_POST['current_passw']) ? $_POST['current_passw'] : '';
$new_passw = isset($_POST['new_passw']) ? $_POST['new_passw'] : '';
$current_passw = helper::clearText($current_passw);
$current_passw = helper::escapeText($current_passw);
$new_passw = helper::clearText($new_passw);
$new_passw = helper::escapeText($new_passw);
if ($authToken === helper::getAuthenticityToken() && !APP_DEMO) {
$admin = new admin($dbo);
$admin->setId(admin::getCurrentAdminId());
$result = $admin->setPassword($current_passw, $new_passw);
if ($result['error'] === false) {
header("Location: /admin/settings.php/?result=success");
exit;
} else {
header("Location: /admin/settings.php/?result=error");
exit;
}
}
header("Location: /admin/settings.php");
exit;
}
$stats = new stats($dbo);
$page_id = "settings";
$error = false;
$error_message = '';