本文整理汇总了PHP中emailExists函数的典型用法代码示例。如果您正苦于以下问题:PHP emailExists函数的具体用法?PHP emailExists怎么用?PHP emailExists使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了emailExists函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: __construct
function __construct($user, $display, $pass, $email, $country, $state, $city, $address, $zip, $phone)
{
//Used for display only
$this->displayname = $display;
//Sanitize
$this->clean_email = sanitize($email);
$this->clean_password = trim($pass);
$this->username = sanitize($user);
$this->user_country = sanitize($country);
$this->user_state = sanitize($state);
$this->user_city = sanitize($city);
$this->user_address = sanitize($address);
$this->user_zip = sanitize($zip);
$this->user_phone = sanitize($phone);
if (usernameExists($this->username)) {
$this->username_taken = true;
} else {
if (displayNameExists($this->displayname)) {
$this->displayname_taken = true;
} else {
if (emailExists($this->clean_email)) {
$this->email_taken = true;
} else {
//No problems have been found.
$this->status = true;
}
}
}
}
开发者ID:marwyre,项目名称:perunioWebs,代码行数:29,代码来源:class.newuser.php
示例2: __construct
function __construct($user, $display, $pass, $email, $pin, $location, $about)
{
//Used for display only
$this->displayname = $display;
//Sanitize
$this->clean_email = sanitize($email);
$this->clean_password = trim($pass);
$this->username = sanitize($user);
$this->clean_pin = trim($pin);
$this->location = trim($location);
$this->about = trim($about);
if (usernameExists($this->username)) {
$this->username_taken = true;
} else {
if (displayNameExists($this->displayname)) {
$this->displayname_taken = true;
} else {
if (emailExists($this->clean_email)) {
$this->email_taken = true;
} else {
//No problems have been found.
$this->status = true;
}
}
}
}
开发者ID:khalid-ali,项目名称:DogePos,代码行数:26,代码来源:class.newuser.php
示例3: __construct
function __construct($user, $display, $pass, $email, $colist, $contact)
{
//Used for display only
$this->displayname = $display;
//Sanitize
$this->clean_email = sanitize($email);
$this->clean_password = trim($pass);
$this->username = sanitize($user);
$this->colist_agent = $colist;
$this->contact_person = $contact;
if (usernameExists($this->username)) {
$this->username_taken = true;
} else {
if (displayNameExists($this->displayname)) {
$this->displayname_taken = true;
} else {
if (emailExists($this->clean_email)) {
$this->email_taken = true;
} else {
//No problems have been found.
$this->status = true;
}
}
}
}
开发者ID:realfoto,项目名称:realfoto-2.0,代码行数:25,代码来源:class.newuser.php
示例4: __construct
function __construct($user, $pass, $email, $group_id = 2)
{
//Used for display only
$this->unclean_username = $user;
//Sanitize
$this->clean_email = sanitize($email);
$this->clean_password = trim($pass);
$this->group_id = trim($group_id);
$this->clean_username = sanitize($user);
if (usernameExists($this->clean_username)) {
$this->username_taken = true;
} elseif (emailExists($this->clean_email)) {
$this->email_taken = true;
} else {
//No problems have been found.
$this->status = true;
}
}
开发者ID:davidvdtak,项目名称:AIRdb,代码行数:18,代码来源:class.newuser.php
示例5: sendNewPassw
function sendNewPassw($email_address)
{
//if email exists find user and make new pass. send new pass through email
$userid = emailExists($email_address);
if ($userid == 0) {
return false;
} else {
$newpass = resetPassword($userid);
$subject = MSG00165 . ' ' . szName();
$message = MSG00167 . ' ' . szName() . "\r\n" . MSG00168 . ' ' . szUrl() . "\r\n" . MSG00166 . ': ' . $newpass;
$headers = 'From: ' . szEmail() . "\r\n" . 'Bcc: ' . szCronEmail() . "\r\n";
if (sendEmail($email_address, $subject, $message, $headers)) {
return true;
} else {
return false;
}
}
}
开发者ID:hscale,项目名称:SiteZilla,代码行数:18,代码来源:user_functions.php
示例6: die
<body>
<a href="admin.php" class="uppercase admin-button">Admin</a>
<?php
if (count($_POST) > 0) {
// 1.Honeypot
if ($_POST['name'] != '') {
die('Spammeur !');
}
// 2.Nettoyage
$email = trim(strip_tags($_POST['email']));
// 3.Validation
$errors = array();
if (!is_valid_email($email)) {
$errors['email'] = 'Vous devez entrer une adresse email valide.';
} else {
if (emailExists($connexion, $email)) {
$errors['email'] = 'Cette adresse email est déjà dans notre base de données.';
}
}
if (count($errors) < 1) {
$uniqid = uniqid();
include 'mail.inc.php';
$sql = 'INSERT INTO users(user_id, email, date, state) VALUES(:user_id, :email, now(), :state)';
$preparedStatement = $connexion->prepare($sql);
$preparedStatement->bindValue('user_id', $uniqid);
$preparedStatement->bindValue('email', $email);
$preparedStatement->bindValue('state', 'off');
$preparedStatement->execute();
}
}
?>
开发者ID:OliviaPaquay,项目名称:php-exam,代码行数:31,代码来源:index.php
示例7: validate_email
public function validate_email($value)
{
if (filter_var($value, FILTER_VALIDATE_REGEXP, array('options' => array('regexp' => '/^[a-z0-9._%+-]+@(?:[a-z0-9-]+\\.)+([a-z]{2}|com|net|org|edu|gov|mil|tel|biz|info|name|mobi|asia)$/'))) === false) {
$this->set_specific_error('password', lang("ACCOUNT_INVALID_EMAIL"));
} else {
if (emailExists($value)) {
$this->set_specific_error('email', lang("ACCOUNT_EMAIL_IN_USE", array($value)));
}
}
}
开发者ID:skarabasakis,项目名称:alumniclub_usercake,代码行数:10,代码来源:class.validator.php
示例8: lang
$errors[] = lang("SQL_ERROR");
} else {
$successes[] = lang("FORGOTPASS_REQUEST_CANNED");
}
}
}
//Forms posted
if (!empty($_POST)) {
$email = $_POST["email"];
$username = sanitize($_POST["username"]);
//Perform some validation
//Feel free to edit / change as required
if (trim($email) == "") {
$errors[] = lang("ACCOUNT_SPECIFY_EMAIL");
} else {
if (!isValidEmail($email) || !emailExists($email)) {
$errors[] = lang("ACCOUNT_INVALID_EMAIL");
}
}
if (trim($username) == "") {
$errors[] = lang("ACCOUNT_SPECIFY_USERNAME");
} else {
if (!usernameExists($username)) {
$errors[] = lang("ACCOUNT_INVALID_USERNAME");
}
}
if (count($errors) == 0) {
//Check that the username / email are associated to the same account
if (!emailUsernameLinked($email, $username)) {
$errors[] = lang("ACCOUNT_USER_OR_EMAIL_INVALID");
} else {
开发者ID:fEDUntu,项目名称:ladolcenoteca,代码行数:31,代码来源:forgot-password.php
示例9: method_sign_in
function method_sign_in()
{
global $db_prefix, $context, $user_profile, $modSettings, $register, $sourcedir, $user_info, $boardurl, $txt;
require_once $sourcedir . '/Register.php';
require_once $sourcedir . '/Subs-Members.php';
require_once $sourcedir . '/Subs-Auth.php';
$token = $context['mob_request']['params'][0][0];
$code = $context['mob_request']['params'][1][0];
$email = isset($context['mob_request']['params'][2][0]) ? base64_decode($context['mob_request']['params'][2][0]) : '';
$username = isset($context['mob_request']['params'][3][0]) ? base64_decode($context['mob_request']['params'][3][0]) : '';
$password = isset($context['mob_request']['params'][4][0]) ? base64_decode($context['mob_request']['params'][4][0]) : '';
// verify tapatalk token and code first
$ttid = TapatalkSsoVerification($token, $code);
if (empty($ttid)) {
get_error('Tapatalk authorization verify failed, please login with your username and password.');
}
$tapatalk_id_email = $ttid->email;
$result_status = true;
$register = false;
$result_text = '';
if (!$ttid->result || empty($tapatalk_id_email)) {
get_error($ttid->result_text ? $ttid->result_text : 'Tapatalk authorization verify failed, please login with your username and password');
}
// sign in with email or register an account
$login_id = emailExists($tapatalk_id_email);
if (empty($login_id)) {
if (empty($username)) {
get_error('Invalid Parameters', 2);
} else {
if (isReservedName($username, 0, true, false)) {
get_error($txt[473], 1);
} else {
if (empty($password)) {
$password = tt_generatePassword();
}
$_POST['user'] = $username;
$_POST['email'] = $tapatalk_id_email;
$_POST['passwrd1'] = $password;
$_POST['passwrd2'] = $password;
$_POST['regagree'] = 'on';
$_POST['regSubmit'] = 'Register';
$_POST['skip_coppa'] = 1;
$_SESSION['old_url'] = $boardurl;
$modSettings['disable_visual_verification'] = 1;
$modSettings['recaptcha_enabled'] = 0;
$modSettings['recaptcha_enable'] = 0;
$modSettings['captchaenable'] = 0;
// compatibility with old CAPTCHA Mod
$modSettings['anti_spam_ver_enable'] = false;
if ($modSettings['registration_method'] == 1) {
$modSettings['registration_method'] = 0;
}
$login_id = Register2();
$register = true;
$result_status = $modSettings['registration_method'] == 2 ? false : true;
$result_text = $modSettings['registration_method'] == 2 ? $txt['approval_after_registration'] : '';
if (empty($login_id)) {
get_error('Register failed');
}
}
}
}
// do login
if ($login_id) {
$request = db_query("\n SELECT passwd, ID_MEMBER AS id_member, is_activated, ID_GROUP AS id_group, emailAddress AS email_address, additionalGroups AS additional_groups, memberName AS member_name,\n passwordSalt AS password_salt, ID_POST_GROUP\n FROM {$db_prefix}members\n WHERE ID_MEMBER = '{$login_id}'\n ", __FILE__, __LINE__);
$user = mysql_fetch_assoc($request);
if ($user['is_activated'] == 3 && !$register) {
fatal_lang_error('still_awaiting_approval');
}
// Set the login cookie
setLoginCookie(60 * $modSettings['cookieTime'], $login_id, sha1($user['passwd'] . $user['password_salt']));
loadMemberData($user['id_member'], false, 'profile');
$user_info = $user_profile[$user['id_member']];
$user_info['is_guest'] = false;
$user_info['is_admin'] = $user['id_group'] == 1 || in_array(1, explode(',', $user['additional_groups']));
$user_info['id'] = $user['id_member'];
if (empty($user_info['additionalGroups'])) {
$user_info['groups'] = array($user_info['ID_GROUP'], $user_info['ID_POST_GROUP']);
} else {
$user_info['groups'] = array_merge(array($user_info['ID_GROUP'], $user_info['ID_POST_GROUP']), explode(',', $user_info['additionalGroups']));
}
$user_info['groups'] = array_unique(array_map('intval', $user_info['groups']));
// Banned?
is_not_banned(true);
// Don't stick the language or theme after this point.
unset($_SESSION['language']);
unset($_SESSION['ID_THEME']);
// You've logged in, haven't you?
updateMemberData($user_info['id'], array('lastLogin' => time(), 'memberIP' => '\'' . $user_info['ip'] . '\'', 'memberIP2' => '\'' . $_SERVER['BAN_CHECK_IP'] . '\''));
// Get rid of the online entry for that old guest....
db_query("\n DELETE FROM {$db_prefix}log_online\n WHERE session = 'ip{$user_info['ip']}'\n LIMIT 1", __FILE__, __LINE__);
$_SESSION['log_time'] = 0;
loadPermissions();
update_push();
// We got this far? return a positive response....
outputRPCLogin($result_status, $result_text);
} else {
get_error('Sign In Failed');
}
}
开发者ID:keweiliu6,项目名称:test_smf1,代码行数:100,代码来源:Mobiquo-Functions.php
示例10: setToken
// CSRF対策
setToken();
} else {
$_POST = arrayString($_POST);
checkToken();
$emailre = '/^(?!(?:(?:\\x22?\\x5C[\\x00-\\x7E]\\x22?)|(?:\\x22?[^\\x5C\\x22]\\x22?)){255,})(?!(?:(?:\\x22?\\x5C[\\x00-\\x7E]\\x22?)|(?:\\x22?[^\\x5C\\x22]\\x22?)){65,}@)(?:(?:[\\x21\\x23-\\x27\\x2A\\x2B\\x2D\\x2F-\\x39\\x3D\\x3F\\x5E-\\x7E]+)|(?:\\x22(?:[\\x01-\\x08\\x0B\\x0C\\x0E-\\x1F\\x21\\x23-\\x5B\\x5D-\\x7F]|(?:\\x5C[\\x00-\\x7F]))*\\x22))(?:\\.(?:(?:[\\x21\\x23-\\x27\\x2A\\x2B\\x2D\\x2F-\\x39\\x3D\\x3F\\x5E-\\x7E]+)|(?:\\x22(?:[\\x01-\\x08\\x0B\\x0C\\x0E-\\x1F\\x21\\x23-\\x5B\\x5D-\\x7F]|(?:\\x5C[\\x00-\\x7F]))*\\x22)))*@(?:(?:(?!.*[^.]{64,})(?:(?:(?:xn--)?[a-z0-9]+(?:-[a-z0-9]+)*\\.){1,126}){1,}(?:(?:[a-z][a-z0-9]*)|(?:(?:xn--)[a-z0-9]+))(?:-[a-z0-9]+)*)|(?:\\[(?:(?:IPv6:(?:(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){7})|(?:(?!(?:.*[a-f0-9][:\\]]){7,})(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){0,5})?::(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){0,5})?)))|(?:(?:IPv6:(?:(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){5}:)|(?:(?!(?:.*[a-f0-9]:){5,})(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){0,3})?::(?:[a-f0-9]{1,4}(?::[a-f0-9]{1,4}){0,3}:)?)))?(?:(?:25[0-5])|(?:2[0-4][0-9])|(?:1[0-9]{2})|(?:[1-9]?[0-9]))(?:\\.(?:(?:25[0-5])|(?:2[0-4][0-9])|(?:1[0-9]{2})|(?:[1-9]?[0-9]))){3}))\\]))$/iD';
$passre = '/^[0-9a-zA-Z]{6,20}$/';
$birthre = '/\\d{4}\\-\\d{2}\\-\\d{2}/';
$error = [];
if (1 > strlen($_POST['name']) || strlen($_POST['name']) > 20) {
$error[] = '名前は1文字以上20文字以内';
}
if (!preg_match($emailre, $_POST['email'])) {
$error[] = '不正なメールアドレス';
} else {
if (emailExists($_POST['email']) != 0) {
$error[] = 'このメールアドレスは既に登録されています';
}
}
if (!preg_match($passre, $_POST['password'])) {
$error[] = 'パスワードは英数字6文字以上20文字以内';
} else {
if ($_POST['password'] != $_POST['repassword']) {
$error[] = '二つのパスワードが異なっています';
} else {
if (!preg_match($birthre, $_POST['birthyear'] . '-' . $_POST['birthmonth'] . '-' . $_POST['birthday'])) {
$error[] = '誕生日の入力が不正です';
} else {
if ($_POST['gender'] != '0' && $_POST['gender'] != '1') {
$error[] = '性別の入力が不正です';
}
开发者ID:MeYururi,项目名称:gs,代码行数:31,代码来源:signup.php
示例11: lang
}
//Activate account
if (isset($_POST['activate']) && $_POST['activate'] == "activate") {
if (setUserActive($userdetails['activation_token'])) {
$successes[] = lang("ACCOUNT_MANUALLY_ACTIVATED", array($displayname));
} else {
$errors[] = lang("SQL_ERROR");
}
}
//Update email
if ($userdetails['email'] != $_POST['email']) {
$email = trim($_POST["email"]);
//Validate email
if (!isValidEmail($email)) {
$errors[] = lang("ACCOUNT_INVALID_EMAIL");
} elseif (emailExists($email)) {
$errors[] = lang("ACCOUNT_EMAIL_IN_USE", array($email));
} else {
if (updateEmail($userId, $email)) {
$successes[] = lang("ACCOUNT_EMAIL_UPDATED");
} else {
$errors[] = lang("SQL_ERROR");
}
}
}
//Update title
if ($userdetails['title'] != $_POST['title']) {
$title = trim($_POST['title']);
//Validate title
if (minMaxRange(1, 50, $title)) {
$errors[] = lang("ACCOUNT_TITLE_CHAR_LIMIT", array(1, 50));
开发者ID:marwyre,项目名称:PerunioCMS,代码行数:31,代码来源:user.php
示例12: elseif
$errors[] = "Unable to update " . $row['Username'] . "'s username because selected name is not between 5 and 25 characters.";
} elseif (usernameExists($newusername)) {
$errors[] = "Unable to change " . $row['Username'] . "'s name because selected username is already in use.";
} else {
$sql = "UPDATE " . $db_table_prefix . "Users SET Username = '" . $newusername . "', Username_clean = '" . sanitize($newusername) . "' WHERE User_ID='" . $row['User_ID'] . "'";
$db->sql_query($sql);
}
}
if ($row['Email'] != $newemail) {
if (trim($newemail) == "") {
$errors[] = "Unable to update " . $row['Username'] . "'s email because no address was entered.";
} else {
if (!isValidEmail($newemail)) {
$errors[] = "Unable to update " . $row['Username'] . "'s email because address is invalid.";
} else {
if (emailExists($newemail)) {
$errors[] = "Unable to update " . $row['Username'] . "'s email because address is already in use.";
} else {
$sql = "UPDATE " . $db_table_prefix . "Users SET Email = '" . $newemail . "' WHERE User_ID='" . $row['User_ID'] . "'";
$db->sql_query($sql);
}
}
}
}
if ($newgroup != $row['Group_ID']) {
$sql = "UPDATE " . $db_table_prefix . "Users SET Group_ID = '" . $newgroup . "' WHERE User_ID='" . $row['User_ID'] . "'";
$db->sql_query($sql);
}
}
}
}
开发者ID:rizaus,项目名称:SCRTC-Timesheet,代码行数:31,代码来源:manage-users.php
示例13: updateLastActivationRequest
function updateLastActivationRequest($new_activation_token, $user_name, $email)
{
// Check that email, user_name exist and are linked
if (!(emailExists($email) && usernameExists($user_name) && emailUsernameLinked($email, $user_name))) {
addAlert("danger", "Invalid email/username specified.");
return false;
}
try {
global $db_table_prefix;
$db = pdoConnect();
$sqlVars = array();
$query = "UPDATE " . $db_table_prefix . "users\n SET activation_token = :token,\n last_activation_request = :time,\n lost_password_timestamp = :time_password\n WHERE email = :email\n AND\n user_name = :user_name";
$stmt = $db->prepare($query);
$sqlVars['token'] = $new_activation_token;
$sqlVars['time'] = time();
$sqlVars['time_password'] = time();
$sqlVars['email'] = $email;
$sqlVars['user_name'] = $user_name;
if (!$stmt->execute($sqlVars)) {
// Error: column does not exist
return false;
}
return true;
} catch (PDOException $e) {
addAlert("danger", "Oops, looks like our database encountered an error.");
error_log("Error in " . $e->getFile() . " on line " . $e->getLine() . ": " . $e->getMessage());
return false;
} catch (ErrorException $e) {
addAlert("danger", "Oops, looks like our server might have goofed. If you're an admin, please check the PHP error logs.");
return false;
} catch (RuntimeException $e) {
addAlert("danger", "Oops, looks like our server might have goofed. If you're an admin, please check the PHP error logs.");
error_log("Error in " . $e->getFile() . " on line " . $e->getLine() . ": " . $e->getMessage());
return false;
}
}
开发者ID:Vaibhav95g,项目名称:Bitsmun-user-management-portal,代码行数:36,代码来源:db_functions.php
示例14: connectDb
$user_name = $_POST['user_name'];
$email = $_POST['email'];
$password = $_POST['password'];
$db = connectDb();
//ユーザの文字数チェック
if (mb_strlen($user_name) < 3 || mb_strlen($user_name) > 15) {
$error['user_name'] = '3文字以上15文字以下にしてください';
}
//メールアドレスが入力されているかのチェック
if ($email === '') {
$error['email'] = 'メールアドレスを入力してください';
//メールアドレスの形式が正しいかどうかチェック
} elseif (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
$error['email'] = 'メールアドレスの形式が正しくないです';
//メールアドレスが既に登録されているかどうかチェック
} elseif (emailExists($email, $db)) {
$error['email'] = 'このメールアドレスは既に登録されています';
}
//パスワードが英数字であることかつ文字数チェック
if (!preg_match('/^[a-zA-Z0-9]{4,8}$/', $password)) {
$error['password'] = '4文字以上8文字以下の英数字にしてください';
}
if (empty($error)) {
# code...
$hash = password_hash($password, PASSWORD_DEFAULT);
$sql = 'INSERT INTO users (user_name, email, password) VALUES (:user_name, :email, :password)';
$statement = $db->prepare($sql);
$statement->bindValue(':user_name', $user_name, PDO::PARAM_STR);
$statement->bindValue(':email', $email, PDO::PARAM_STR);
$statement->bindValue(':password', $hash, PDO::PARAM_STR);
if ($statement->execute()) {
开发者ID:dhacks,项目名称:team-e,代码行数:31,代码来源:signup.php
示例15: mob_update_password
function mob_update_password($rpcmsg)
{
global $txt, $modSettings;
global $cookiename, $context;
global $sourcedir, $scripturl, $db_prefix;
global $ID_MEMBER, $user_info;
global $newpassemail, $user_profile, $validationCode;
loadLanguage('Profile');
// Start with no updates and no errors.
$profile_vars = array();
$post_errors = array();
$good_password = false;
// reset directly with tapatalk id credential
if ($rpcmsg->getParam(2)) {
$_POST['passwrd1'] = $rpcmsg->getParam(0) ? $rpcmsg->getScalarValParam(0) : '';
$_POST['passwrd1'] = utf8ToAscii($_POST['passwrd1']);
$token = $rpcmsg->getParam(1) ? $rpcmsg->getScalarValParam(1) : '';
$code = $rpcmsg->getParam(2) ? $rpcmsg->getScalarValParam(2) : '';
// verify Tapatalk Authorization
if ($token && $code) {
$ttid = TapatalkSsoVerification($token, $code);
if ($ttid && $ttid->result) {
$tapatalk_id_email = $ttid->email;
if (empty($ID_MEMBER) && ($ID_MEMBER = emailExists($tapatalk_id_email))) {
loadMemberData($ID_MEMBER, false, 'profile');
$user_info = $user_profile[$ID_MEMBER];
$user_info['is_guest'] = false;
$user_info['is_admin'] = $user_info['id_group'] == 1 || in_array(1, explode(',', $user_info['additionalGroups']));
$user_info['id'] = $ID_MEMBER;
if (empty($user_info['additionalGroups'])) {
$user_info['groups'] = array($user_info['ID_GROUP'], $user_info['ID_POST_GROUP']);
} else {
$user_info['groups'] = array_merge(array($user_info['ID_GROUP'], $user_info['ID_POST_GROUP']), explode(',', $user_info['additionalGroups']));
}
$user_info['groups'] = array_unique(array_map('intval', $user_info['groups']));
loadPermissions();
}
if (strtolower($user_info['emailAddress']) == strtolower($tapatalk_id_email) && $user_info['ID_GROUP'] != 1) {
$good_password = true;
}
}
}
if (!$good_password) {
get_error('Failed to update password');
}
} else {
$_POST['oldpasswrd'] = $rpcmsg->getParam(0) ? $rpcmsg->getScalarValParam(0) : '';
$_POST['passwrd1'] = $rpcmsg->getParam(1) ? $rpcmsg->getScalarValParam(1) : '';
$_POST['passwrd1'] = utf8ToAscii($_POST['passwrd1']);
}
// Clean up the POST variables.
$_POST = htmltrim__recursive($_POST);
$_POST = stripslashes__recursive($_POST);
$_POST = htmlspecialchars__recursive($_POST);
$_POST = addslashes__recursive($_POST);
$memberResult = loadMemberData($ID_MEMBER, false, 'profile');
if (!is_array($memberResult)) {
fatal_lang_error(453, false);
}
$memID = $ID_MEMBER;
$context['user']['is_owner'] = true;
isAllowedTo(array('manage_membergroups', 'profile_identity_any', 'profile_identity_own'));
// You didn't even enter a password!
if (trim($_POST['oldpasswrd']) == '' && !$good_password) {
fatal_error($txt['profile_error_no_password']);
}
// Since the password got modified due to all the $_POST cleaning, lets undo it so we can get the correct password
$_POST['oldpasswrd'] = addslashes(un_htmlspecialchars(stripslashes($_POST['oldpasswrd'])));
// Does the integration want to check passwords?
if (isset($modSettings['integrate_verify_password']) && function_exists($modSettings['integrate_verify_password'])) {
if (call_user_func($modSettings['integrate_verify_password'], $user_profile[$memID]['memberName'], $_POST['oldpasswrd'], false) === true) {
$good_password = true;
}
}
// Bad password!!!
if (!$good_password && $user_info['passwd'] != sha1(strtolower($user_profile[$memID]['memberName']) . $_POST['oldpasswrd'])) {
fatal_error($txt['profile_error_bad_password']);
}
// Let's get the validation function into play...
require_once $sourcedir . '/Subs-Auth.php';
$passwordErrors = validatePassword($_POST['passwrd1'], $user_info['username'], array($user_info['name'], $user_info['email']));
// Were there errors?
if ($passwordErrors != null) {
fatal_error($txt['profile_error_password_' . $passwordErrors]);
}
// Set up the new password variable... ready for storage.
$profile_vars['passwd'] = '\'' . sha1(strtolower($user_profile[$memID]['memberName']) . un_htmlspecialchars(stripslashes($_POST['passwrd1']))) . '\'';
// If we've changed the password, notify any integration that may be listening in.
if (isset($modSettings['integrate_reset_pass']) && function_exists($modSettings['integrate_reset_pass'])) {
call_user_func($modSettings['integrate_reset_pass'], $user_profile[$memID]['memberName'], $user_profile[$memID]['memberName'], $_POST['passwrd1']);
}
updateMemberData($memID, $profile_vars);
require_once $sourcedir . '/Subs-Auth.php';
setLoginCookie(60 * $modSettings['cookieTime'], $memID, sha1(sha1(strtolower($user_profile[$memID]['memberName']) . un_htmlspecialchars(stripslashes($_POST['passwrd1']))) . $user_profile[$memID]['passwordSalt']));
$response = array('result' => new xmlrpcval(true, 'boolean'), 'result_text' => new xmlrpcval('', 'base64'));
return new xmlrpcresp(new xmlrpcval($response, 'struct'));
}
开发者ID:keweiliu6,项目名称:test_smf1,代码行数:97,代码来源:user.php
示例16: array
<?php
require_once __DIR__ . '/db.php';
//response for json
$response = array();
if (isset($_POST['FirstName']) && isset($_POST['LastName']) && isset($_POST['Username']) && isset($_POST['Password']) && isset($_POST['Email'])) {
$fname = $_POST['FirstName'];
$lname = $_POST['LastName'];
$username = $_POST['Username'];
$password = $_POST['Password'];
$email = $_POST['Email'];
require_once __DIR__ . '/ifExists.php';
if (!usernameExists($username)) {
if (!emailExists($email)) {
$db = new DB();
$db->bind('FirstName', $fname);
$db->bind('LastName', $lname);
$db->bind('Username', $username);
$db->bind('Password', $password);
$db->bind('Email', $email);
$result = $db->query("INSERT INTO `users`(FirstName, LastName, Username, Password, Email) " . "VALUES (:FirstName, :LastName, :Username, :Password, :Email)");
if ($result) {
//successful
$response["success"] = 1;
$response["message"] = "User successfully registered.";
echo json_encode($response);
} else {
$response["success"] = 0;
$response["message"] = 'An error occurred.';
echo json_encode($response);
}
开发者ID:stamlercas,项目名称:socialmediaprojectREST,代码行数:31,代码来源:register.php
示例17: index
public function index()
{
/*
UserCake (Via CupCake) Version: 2.0.2
http://usercake.com
*/
global $baseURL;
$baseURL = getcwd();
require_once "{$baseURL}/application/third_party/user_cake/models/config.php";
if (!securePage($_SERVER['PHP_SELF'])) {
die;
}
//User has confirmed they want their password changed
if (!empty($_GET["confirm"])) {
$token = trim($_GET["confirm"]);
if ($token == "" || !validateActivationToken($token, TRUE)) {
$errors[] = lang("FORGOTPASS_INVALID_TOKEN");
} else {
$rand_pass = getUniqueCode(15);
//Get unique code
$secure_pass = generateHash($rand_pass);
//Generate random hash
$userdetails = fetchUserDetails(NULL, $token);
//Fetchs user details
$mail = new userCakeMail();
//Setup our custom hooks
$hooks = array("searchStrs" => array("#GENERATED-PASS#", "#USERNAME#"), "subjectStrs" => array($rand_pass, $userdetails["display_name"]));
if (!$mail->newTemplateMsg("{$baseURL}/application/third_party/user_cake/mail-templates/your-lost-password.txt", $hooks)) {
$errors[] = lang("MAIL_TEMPLATE_BUILD_ERROR");
} else {
if (!$mail->sendMail($userdetails["email"], "Your new password")) {
$errors[] = lang("MAIL_ERROR");
} else {
if (!updatePasswordFromToken($secure_pass, $token)) {
$errors[] = lang("SQL_ERROR");
} else {
if (!flagLostPasswordRequest($userdetails["user_name"], 0)) {
$errors[] = lang("SQL_ERROR");
} else {
$successes[] = lang("FORGOTPASS_NEW_PASS_EMAIL");
}
}
}
}
}
}
//User has denied this request
if (!empty($_GET["deny"])) {
$token = trim($_GET["deny"]);
if ($token == "" || !validateActivationToken($token, TRUE)) {
$errors[] = lang("FORGOTPASS_INVALID_TOKEN");
} else {
$userdetails = fetchUserDetails(NULL, $token);
if (!flagLostPasswordRequest($userdetails["user_name"], 0)) {
$errors[] = lang("SQL_ERROR");
} else {
$successes[] = lang("FORGOTPASS_REQUEST_CANNED");
}
}
}
//Forms posted
if (!empty($_POST)) {
$email = $_POST["email"];
$username = sanitize($_POST["username"]);
//Perform some validation
//Feel free to edit / change as required
if (trim($email) == "") {
$errors[] = lang("ACCOUNT_SPECIFY_EMAIL");
} else {
if (!isValidEmail($email) || !emailExists($email)) {
$errors[] = lang("ACCOUNT_INVALID_EMAIL");
}
}
if (trim($username) == "") {
$errors[] = lang("ACCOUNT_SPECIFY_USERNAME");
} else {
if (!usernameExists($username)) {
$errors[] = lang("ACCOUNT_INVALID_USERNAME");
}
}
if (count($errors) == 0) {
//Check that the username / email are associated to the same account
if (!emailUsernameLinked($email, $username)) {
$errors[] = lang("ACCOUNT_USER_OR_EMAIL_INVALID");
} else {
//Check if the user has any outstanding lost password requests
$userdetails = fetchUserDetails($username);
if ($userdetails["lost_password_request"] == 1) {
$errors[] = lang("FORGOTPASS_REQUEST_EXISTS");
} else {
//Email the user asking to confirm this change password request
//We can use the template builder here
//We use the activation token again for the url key it gets regenerated everytime it's used.
$mail = new userCakeMail();
$confirm_url = lang("CONFIRM") . "\n" . $websiteUrl . "forgot-password.php?confirm=" . $userdetails["activation_token"];
$deny_url = lang("DENY") . "\n" . $websiteUrl . "forgot-password.php?deny=" . $userdetails["activation_token"];
//Setup our custom hooks
$hooks = array("searchStrs" => array("#CONFIRM-URL#", "#DENY-URL#", "#USERNAME#"), "subjectStrs" => array($confirm_url, $deny_url, $userdetails["user_name"]));
if (!$mail->newTemplateMsg("{$baseURL}/application/third_party/user_cake/mail-templates/lost-password-request.txt", $hooks)) {
$errors[] = lang("MAIL_TEMPLATE_BUILD_ERROR");
//.........这里部分代码省略.........
开发者ID:AdwayLele,项目名称:CupCake,代码行数:101,代码来源:forgot_password.php
示例18: index
public function index()
{
/*
UserCake (Via CupCake) Version: 2.0.2
http://usercake.com
*/
global $baseURL;
require_once "{$baseURL}/application/third_party/user_cake/models/config.php";
if (!securePage($_SERVER['PHP_SELF'])) {
die;
}
$userId = $_GET['id'];
//Check if selected user exists
if (!userIdExists($userId)) {
header("Location: " . str_replace('index.php/', '', site_url('admin_users')));
die;
}
$userdetails = fetchUserDetails(NULL, NULL, $userId);
//Fetch user details
//Forms posted
if (!empty($_POST)) {
//Delete selected account
if (!empty($_POST['delete'])) {
$deletions = $_POST['delete'];
if ($deletion_count = deleteUsers($deletions)) {
$successes[] = lang("ACCOUNT_DELETIONS_SUCCESSFUL", array($deletion_count));
} else {
$errors[] = lang("SQL_ERROR");
}
} else {
//Update display name
if ($userdetails['display_name'] != $_POST['display']) {
$displayname = trim($_POST['display']);
//Validate display name
if (displayNameExists($displayname)) {
$errors[] = lang("ACCOUNT_DISPLAYNAME_IN_USE", array($displayname));
} elseif (minMaxRange(5, 25, $displayname)) {
$errors[] = lang("ACCOUNT_DISPLAY_CHAR_LIMIT", array(5, 25));
} elseif (!ctype_alnum($displayname)) {
$errors[] = lang("ACCOUNT_DISPLAY_INVALID_CHARACTERS");
} else {
if (updateDisplayName($userId, $displayname)) {
$successes[] = lang("ACCOUNT_DISPLAYNAME_UPDATED", array($displayname));
} else {
$errors[] = lang("SQL_ERROR");
}
}
} else {
$displayname = $userdetails['display_name'];
}
//Activate account
if (isset($_POST['activate']) && $_POST['activate'] == "activate") {
if (setUserActive($userdetails['activation_token'])) {
$successes[] = lang("ACCOUNT_MANUALLY_ACTIVATED", array($displayname));
} else {
$errors[] = lang("SQL_ERROR");
}
}
//Update email
if ($userdetails['email'] != $_POST['email']) {
$email = trim($_POST["email"]);
//Validate email
if (!isValidEmail($email)) {
$errors[] = lang("ACCOUNT_INVALID_EMAIL");
} elseif (emailExists($email)) {
$errors[] = lang("ACCOUNT_EMAIL_IN_USE", array($email));
} else {
if (updateEmail($userId, $email)) {
$successes[] = lang("ACCOUNT_EMAIL_UPDATED");
} else {
$errors[] = lang("SQL_ERROR");
}
}
}
//Update title
if ($userdetails['title'] != $_POST['title']) {
$title = trim($_POST['title']);
//Validate title
if (minMaxRange(1, 50, $title)) {
$errors[] = lang("ACCOUNT_TITLE_CHAR_LIMIT", array(1, 50));
} else {
if (updateTitle($userId, $title)) {
$successes[] = lang("ACCOUNT_TITLE_UPDATED", array($displayname, $title));
} else {
$errors[] = lang("SQL_ERROR");
}
}
}
//Remove permission level
if (!empty($_POST['removePermission'])) {
$remove = $_POST['removePermission'];
if ($deletion_count = removePermission($remove, $userId)) {
$successes[] = lang("ACCOUNT_PERMISSION_REMOVED", array($deletion_count));
} else {
$errors[] = lang("SQL_ERROR");
}
}
if (!empty($_POST['addPermission'])) {
$add = $_POST['addPermission'];
if ($addition_count = addPermission($add, $userId)) {
//.........这里部分代码省略.........
开发者ID:AdwayLele,项目名称:CupCake,代码行数:101,代码来源:admin_user.php
-
theindianappguy/machine_learning_flutter_app: Learn how to build a tensorflow mo
阅读:815|2022-08-18
-
samaxes/minify-maven-plugin: Combine and minimize JavaScript and CSS files for f
阅读:765|2022-08-16
-
挨打的读音是什么?很多人在拼音的时候导致错误,这是因为挨为多音字,读i,还有读音ā
阅读:1061|2022-11-06
-
js文件中数据: wxml 中读取数据:
阅读:785|2022-07-18
-
nacika-ins/nanachibot: nanachibot is Rust based Mastodon bot client.
阅读:855|2022-08-18
-
Use of insufficiently random values vulnerability exists in Vnet/IP communicatio
阅读:799|2022-07-08
-
日常中马赫是表示飞机速度的量词,马赫数一,即一倍音速,通常指天上飞行器的速度,如
阅读:553|2022-07-30
-
satoru-takeuchi/linux-in-practice
阅读:814|2022-08-15
-
doka-guide/content: Контент Доки: статьи, картинки, д
阅读:737|2022-08-18
-
Matlab读取 .txt文件 这里提供两种方法:1,load()函数。2,importdata()函数。 一、
阅读:536|2022-07-18
|
请发表评论