本文整理汇总了PHP中Password::getUserId方法的典型用法代码示例。如果您正苦于以下问题:PHP Password::getUserId方法的具体用法?PHP Password::getUserId怎么用?PHP Password::getUserId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Password
的用法示例。
在下文中一共展示了Password::getUserId方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: token
function token()
{
global $instDir, $objMessages, $entryMessage;
// Get the userid
include_once $instDir . "lib/password.php";
$password = new Password();
$token = $_GET['t'];
$userid = $password->getUserId($token);
if (sizeof($userid) > 0) {
// Clear the request
$password->removeToken($token);
// Send a mail that the request was canceled.
if (!empty($_SERVER['HTTP_CLIENT_IP'])) {
$ip = $_SERVER['HTTP_CLIENT_IP'];
} elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
} else {
$ip = $_SERVER['REMOTE_ADDR'];
}
$subject = LangCancelRequestNewPasswordSubject;
$message = LangCancelRequestNewPassword1 . $ip;
$message .= LangCancelRequestNewPassword2;
$objMessages->sendEmail($subject, $message, $userid);
// Go to the DeepskyLog page and show 'Your password change request was canceled'
$entryMessage = LangCancelRequestNewPasswordSubject . ".";
}
}
示例2: change_password
function change_password()
{
global $instDir, $entryMessage, $baseURL;
include_once $instDir . "lib/password.php";
$password = new Password();
$token = $_GET['t'];
// Move this to control, only setting the password to this file.
// Only show the change password form when the token is known
if ($password->tokenExists($token)) {
$userid = $password->getUserId($token);
// Check if the token is not too old. If the token is too old, remove the token.
if ($password->isValid($token)) {
// Add form to change the password.
echo "<div id=\"main\">\n <form action=\"" . $baseURL . "index.php?indexAction=changepasswordToken\" method=\"post\">\n " . LangNewPassword . "\n <input type=\"hidden\" name=\"userid\" value=\"" . $userid . "\" />\n <input type=\"hidden\" name=\"token\" value=\"" . $token . "\" />\n <input type=\"password\" name=\"newPassword\" class=\"strength\" required>" . LangChangeAccountField6 . "\n <input type=\"password\" name=\"confirmPassword\" class=\"strength\" required data-show-meter=\"false\">\n <br />\n <input class=\"btn btn-danger\" type=\"submit\" name=\"changePasswordToken\" value=\"" . LangChangePassword . "\" />";
echo "</div>";
} else {
echo "<meta http-equiv=\"refresh\" content=\"0; url=/index.php\" />";
}
} else {
echo "<meta http-equiv=\"refresh\" content=\"0; url=/index.php\" />";
}
}