本文整理匯總了PHP中Install::postauth_update方法的典型用法代碼示例。如果您正苦於以下問題:PHP Install::postauth_update方法的具體用法?PHP Install::postauth_update怎麽用?PHP Install::postauth_update使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Install
的用法示例。
在下文中一共展示了Install::postauth_update方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: dirname
*/
# functions
require dirname(__FILE__) . '/../../functions/functions.php';
# objects
$Database = new Database_PDO();
$Admin = new Admin($Database, false);
$Install = new Install($Database);
$User = new User($Database);
$Result = new Result();
# only permit if Admin user has default pass !!!
$admin = $Admin->fetch_object("users", "username", "Admin");
if ($admin->password != '$6$rounds=3000$JQEE6dL9NpvjeFs4$RK5X3oa28.Uzt/h5VAfdrsvlVe.7HgQUYKMXTJUsud8dmWfPzZQPbRbk8xJn1Kyyt4.dWm4nJIYhAV2mbOZ3g.') {
$Result->show("danger", "Not allowed!", true);
} else {
# check lenghts
if (strlen($_POST['password1']) < 8) {
$Result->show("danger", _("Password must be at least 8 characters long!"), true);
}
if (strlen($_POST['password2']) < 8) {
$Result->show("danger", _("Password must be at least 8 characters long!"), true);
}
# check password match
if ($_POST['password1'] != $_POST['password2']) {
$Result->show("danger", _("Passwords do not match"), true);
}
# Crypt password
$_POST['password1'] = $User->crypt_user_pass($_POST['password1']);
# all good, update password!
$Install->postauth_update($_POST['password1'], $_POST['siteTitle'], $_POST['siteURL']);
$Result->show("success", "Settings updated, installation complete!<hr><a class='btn btn-sm btn-default' href='" . create_link("login") . "'>Proceed to login</a>", false);
}