本文整理汇总了PHP中createPassword函数的典型用法代码示例。如果您正苦于以下问题:PHP createPassword函数的具体用法?PHP createPassword怎么用?PHP createPassword使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了createPassword函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: newUserSession
public function newUserSession()
{
/* @var $identity LSUserIdentity */
$sUser = $this->getUserName();
$oUser = $this->api->getUserByName($sUser);
if (is_null($oUser)) {
if (function_exists("hook_get_auth_webserver_profile")) {
// If defined this function returns an array
// describing the default profile for this user
$aUserProfile = hook_get_auth_webserver_profile($sUser);
} elseif ($this->api->getConfigKey('auth_webserver_autocreate_user')) {
$aUserProfile = $this->api->getConfigKey('auth_webserver_autocreate_profile');
}
} else {
$this->setAuthSuccess($oUser);
return;
}
if ($this->api->getConfigKey('auth_webserver_autocreate_user') && isset($aUserProfile) && is_null($oUser)) {
// user doesn't exist but auto-create user is set
$oUser = new User();
$oUser->users_name = $sUser;
$oUser->password = hash('sha256', createPassword());
$oUser->full_name = $aUserProfile['full_name'];
$oUser->parent_id = 1;
$oUser->lang = $aUserProfile['lang'];
$oUser->email = $aUserProfile['email'];
if ($oUser->save()) {
$permission = new Permission();
$permission->setPermissions($oUser->uid, 0, 'global', $this->api->getConfigKey('auth_webserver_autocreate_permissions'), true);
// read again user from newly created entry
$this->setAuthSuccess($oUser);
return;
} else {
$this->setAuthFailure(self::ERROR_USERNAME_INVALID);
}
}
}
示例2: createNewUser
/**
* Create a DB user
*
* @return unknown_type
*/
public function createNewUser()
{
// Do nothing if the user to be added is not DB type
if (flattenText(Yii::app()->request->getPost('user_type')) != 'DB') {
return;
}
$oEvent = $this->getEvent();
$new_user = flattenText(Yii::app()->request->getPost('new_user'), false, true);
$new_email = flattenText(Yii::app()->request->getPost('new_email'), false, true);
if (!validateEmailAddress($new_email)) {
$oEvent->set('errorCode', self::ERROR_INVALID_EMAIL);
$oEvent->set('errorMessageTitle', gT("Failed to add user"));
$oEvent->set('errorMessageBody', gT("The email address is not valid."));
return;
}
$new_full_name = flattenText(Yii::app()->request->getPost('new_full_name'), false, true);
$new_pass = createPassword();
$iNewUID = User::model()->insertUser($new_user, $new_pass, $new_full_name, Yii::app()->session['loginID'], $new_email);
if (!$iNewUID) {
$oEvent->set('errorCode', self::ERROR_ALREADY_EXISTING_USER);
$oEvent->set('errorMessageTitle', '');
$oEvent->set('errorMessageBody', gT("Failed to add user"));
return;
}
Permission::model()->setGlobalPermission($iNewUID, 'auth_db');
$oEvent->set('newUserID', $iNewUID);
$oEvent->set('newPassword', $new_pass);
$oEvent->set('newEmail', $new_email);
$oEvent->set('newFullName', $new_full_name);
$oEvent->set('errorCode', self::ERROR_NONE);
}
示例3: newUserSession
public function newUserSession()
{
// Do nothing if this user is not Authwebserver type
$identity = $this->getEvent()->get('identity');
if ($identity->plugin != 'Authwebserver') {
return;
}
/* @var $identity LSUserIdentity */
$sUser = $this->getUserName();
$oUser = $this->api->getUserByName($sUser);
if (is_null($oUser)) {
if (function_exists("hook_get_auth_webserver_profile")) {
// If defined this function returns an array
// describing the default profile for this user
$aUserProfile = hook_get_auth_webserver_profile($sUser);
} elseif ($this->api->getConfigKey('auth_webserver_autocreate_user')) {
$aUserProfile = $this->api->getConfigKey('auth_webserver_autocreate_profile');
}
} else {
if (Permission::model()->hasGlobalPermission('auth_webserver', 'read', $oUser->uid)) {
$this->setAuthSuccess($oUser);
return;
} else {
$this->setAuthFailure(self::ERROR_AUTH_METHOD_INVALID, gT('Web server authentication method is not allowed for this user'));
return;
}
}
if ($this->api->getConfigKey('auth_webserver_autocreate_user') && isset($aUserProfile) && is_null($oUser)) {
// user doesn't exist but auto-create user is set
$oUser = new User();
$oUser->users_name = $sUser;
$oUser->password = hash('sha256', createPassword());
$oUser->full_name = $aUserProfile['full_name'];
$oUser->parent_id = 1;
$oUser->lang = $aUserProfile['lang'];
$oUser->email = $aUserProfile['email'];
if ($oUser->save()) {
$permission = new Permission();
$permission->setPermissions($oUser->uid, 0, 'global', $this->api->getConfigKey('auth_webserver_autocreate_permissions'), true);
Permission::model()->setGlobalPermission($oUser->uid, 'auth_webserver');
// read again user from newly created entry
$this->setAuthSuccess($oUser);
return;
} else {
$this->setAuthFailure(self::ERROR_USERNAME_INVALID);
}
}
}
示例4: _sendPasswordEmail
/**
* Send the forgot password email
*
* @param string $sEmailAddr
* @param array $aFields
*/
private function _sendPasswordEmail($sEmailAddr, $aFields)
{
$clang = $this->getController()->lang;
$sFrom = Yii::app()->getConfig("siteadminname") . " <" . Yii::app()->getConfig("siteadminemail") . ">";
$sTo = $sEmailAddr;
$sSubject = $clang->gT('User data');
$sNewPass = createPassword();
$sSiteName = Yii::app()->getConfig('sitename');
$sSiteAdminBounce = Yii::app()->getConfig('siteadminbounce');
$username = sprintf($clang->gT('Username: %s'), $aFields[0]['users_name']);
$email = sprintf($clang->gT('Email: %s'), $sEmailAddr);
$password = sprintf($clang->gT('New password: %s'), $sNewPass);
$body = array();
$body[] = sprintf($clang->gT('Your user data for accessing %s'), Yii::app()->getConfig('sitename'));
$body[] = $username;
$body[] = $password;
$body = implode("\n", $body);
if (SendEmailMessage($body, $sSubject, $sTo, $sFrom, $sSiteName, false, $sSiteAdminBounce)) {
User::model()->updatePassword($aFields[0]['uid'], $sNewPass);
$sMessage = $username . '<br />' . $email . '<br /><br />' . $clang->gT('An email with your login data was sent to you.');
} else {
$sTmp = str_replace("{NAME}", '<strong>' . $aFields[0]['users_name'] . '</strong>', $clang->gT("Email to {NAME} ({EMAIL}) failed."));
$sMessage = str_replace("{EMAIL}", $sEmailAddr, $sTmp) . '<br />';
}
return $sMessage;
}
示例5: isset
isset($_POST['lastname']) ? $lastname = $_POST['lastname'] : ($lastname = "");
isset($_POST['email']) ? $email = $_POST['email'] : ($email = "");
$captchaKey = substr($_SESSION['key'], 0, 5);
$formKey = $_POST['formKey'];
if ($formKey == $captchaKey) {
if ($firstname && $lastname) {
include 'library/opendb.php';
include 'include/common/common.php';
$firstname = $dbSocket->escapeSimple($firstname);
$lastname = $dbSocket->escapeSimple($lastname);
$email = $dbSocket->escapeSimple($email);
/* let's generate a random username and password
of length 4 and with username prefix 'guest' */
$rand = createPassword($configValues['CONFIG_USERNAME_LENGTH'], $configValues['CONFIG_USER_ALLOWEDRANDOMCHARS']);
$username = $configValues['CONFIG_USERNAME_PREFIX'] . $rand;
$password = createPassword($configValues['CONFIG_PASSWORD_LENGTH'], $configValues['CONFIG_USER_ALLOWEDRANDOMCHARS']);
/* adding the user to the radcheck table */
$sql = "INSERT INTO " . $configValues['CONFIG_DB_TBL_RADCHECK'] . " (id, Username, Attribute, op, Value) " . " VALUES (0, '{$username}', 'User-Password', '==', '{$password}')";
$res = $dbSocket->query($sql);
/* adding user information to the userinfo table */
$sql = "INSERT INTO " . $configValues['CONFIG_DB_TBL_DALOUSERINFO'] . " (username, firstname, lastname, email) " . " VALUES ('{$username}', '{$firstname}', '{$lastname}', '{$email}')";
$res = $dbSocket->query($sql);
/* adding the user to the default group defined */
if (isset($configValues['CONFIG_GROUP_NAME']) && $configValues['CONFIG_GROUP_NAME'] != "") {
$sql = "INSERT INTO " . $configValues['CONFIG_DB_TBL_RADUSERGROUP'] . " (UserName, GroupName, priority) " . " VALUES ('{$username}', '" . $configValues['CONFIG_GROUP_NAME'] . "', '" . $configValues['CONFIG_GROUP_PRIORITY'] . "')";
$res = $dbSocket->query($sql);
}
include 'library/closedb.php';
$status = "success";
} else {
$status = "fieldsFailure";
示例6: switch
// we do not create users and continue with the batch loop process
// if batch_history creation failed.
if ($sql_batch_id == 0) {
break;
}
switch ($createBatchUsersType) {
case "createRandomUsers":
$username = createPassword($length_user, $configValues['CONFIG_USER_ALLOWEDRANDOMCHARS']);
break;
case "createIncrementUsers":
$username = $startingIndex + $i;
break;
}
// append the prefix to the username
$username = $username_prefix . $username;
$password = createPassword($length_pass, $configValues['CONFIG_USER_ALLOWEDRANDOMCHARS']);
$sql = "SELECT * FROM " . $configValues['CONFIG_DB_TBL_RADCHECK'] . " WHERE UserName='" . $dbSocket->escapeSimple($username) . "'";
$res = $dbSocket->query($sql);
$logDebugSQL .= $sql . "\n";
if ($res->numRows() > 0) {
$actionMsgBadUsernames = $actionMsgBadUsernames . $username . ", ";
$failureMsg = "skipping matching entry: <b> {$actionMsgBadUsernames} </b>";
} else {
// insert username/password
$actionMsgGoodUsernames .= $username;
if ($i + 1 != $number) {
$actionMsgGoodUsernames .= ", ";
}
$sql = "INSERT INTO " . $configValues['CONFIG_DB_TBL_RADCHECK'] . " VALUES (0, '" . $dbSocket->escapeSimple($username) . "', 'User-Password', ':=', '" . $dbSocket->escapeSimple($password) . "')";
$res = $dbSocket->query($sql);
$logDebugSQL .= $sql . "\n";
示例7: pg_escape_string
* First check if user exist
*/
$query = "SELECT userid FROM users WHERE email='" . pg_escape_string(strtolower($_POST['email'])) . "'";
$result = pg_query($dbh, $query) or die('{"error":{"message":"Error : registering is currently unavailable"}}');
$userid = -1;
while ($user = pg_fetch_row($result)) {
$userid = $user[0];
}
/**
* User does not exist => generate a password and insert new user within database
*/
if ($userid == -1) {
/*
* Create a new password
*/
$password = createPassword(6);
$email = pg_escape_string($dbh, strtolower($_POST['email']));
$username = pg_escape_string($dbh, strtolower($_POST['username']));
$query = "INSERT INTO users (username,password,email,registrationdate) VALUES ('" . $username . "','" . md5($password) . "','" . $email . "', now())";
$result = pg_query($dbh, $query) or die('{"error":{"message":"Error : registering is currently unavailable"}}');
} else {
pg_close($dbh);
die('{"error":{"message":"Error : email adress is already registered"}}');
}
/*
* Prepare message
*/
$to = $email;
$subject = "[mapshup] Requested password for user " . $email;
$message = "Hi,\r\n\r\n" . "You have requested a password for mapshup application at " . MSP_DOMAIN . "\r\n\r\n" . "Your password is " . $password . "\r\n\r\n" . "Regards" . "\r\n\r\n" . "The mapshup team";
$headers = "From: " . MSP_ADMIN_EMAIL . "\r\n" . "Reply-To: " . MSP_ADMIN_EMAIL . "\r\n" . "X-Mailer: PHP/" . phpversion();
示例8: header
/**
* This script returns GeoJSON
*/
header("Pragma: no-cache");
header("Expires: 0");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-cache, must-revalidate");
header("Content-type: application/json; charset=utf-8");
/**
* TODO : allow only ws.geonames.net to idenfied user ?
* $url = 'http://ws.geonames.org/wikipediaSearch?';
*/
$url = 'http://ws.geonames.net/wikipediaSearch?username=jrom&';
/*
* Search terms
*/
$q = isset($_REQUEST["q"]) ? $_REQUEST["q"] : "";
/*
* Lang
*/
$lang = isset($_REQUEST["lang"]) ? $_REQUEST["lang"] : "en";
/*
* Number of results
*/
$maxRows = isset($_REQUEST["maxRows"]) ? $_REQUEST["maxRows"] : MSP_RESULTS_PER_PAGE;
/**
* NB: tags are comma separated
*/
$url = $url . "q=" . $q . "&maxRows=" . $maxRows . "&lang=" . $lang;
echo toGeoJSON(saveFile(getRemoteData($url, null, false), MSP_UPLOAD_DIR . "wikipedia_" . createPassword(10) . ".xml"));
示例9: addcslashes
/**
* Create the autoconf.php file.
*/
case "write_config":
include "../includes/func.php";
// special characters " and $ are escaped
$database = $_REQUEST['database'];
$hostname = $_REQUEST['hostname'];
$username = $_REQUEST['username'];
$password = $_REQUEST['password'];
$timezone = $_REQUEST['timezone'];
$db_layer = $_REQUEST['db_layer'];
$db_type = $_REQUEST['db_type'];
$prefix = addcslashes($_REQUEST['prefix'], '"$');
$lang = $_REQUEST['lang'];
$salt = createPassword(20);
write_config_file($database, $hostname, $username, $password, $db_layer, $db_type, $prefix, $lang, $salt, $timezone);
break;
/**
* Create the database.
*/
/**
* Create the database.
*/
case "make_database":
$databaseName = $_REQUEST['database'];
$hostname = $_REQUEST['hostname'];
$username = $_REQUEST['username'];
$password = $_REQUEST['password'];
$server_type = $_REQUEST['db_type'];
$db_layer = $_REQUEST['db_layer'];
示例10: die
die($kga['lang']['updater'][130]);
/*
* Reset all passwords
*/
$new_passwords = array();
$users = $database->queryAll("SELECT * FROM ${p}usr");
foreach ($users as $user) {
if ($user['usr_name'] == 'admin')
$new_password = 'changeme';
else
$new_password = createPassword(8);
exec_query("UPDATE ${p}usr SET pw = '".
md5($kga['password_salt'].$new_password.$kga['password_salt']).
"' WHERE usr_ID = $user[usr_ID]");
if ($result)
$new_passwords[$user['usr_name']] = $new_password;
}
}
if ((int)$revisionDB < 1068) {
Logger::logfile("-- update to r1068");
exec_query("ALTER TABLE `${p}usr` CHANGE `autoselection` `autoselection` TINYINT( 1 ) NOT NULL default '0';");
}
if ((int)$revisionDB < 1077) {
示例11: newUserSession
public function newUserSession() {
if ($this->ssp->isAuthenticated()) {
$sUser = $this->getUserName();
$_SERVER['REMOTE_USER'] = $sUser;
$password = createPassword();
$this->setPassword($password);
$name = $this->getUserCommonName();
$mail = $this->getUserMail();
$oUser = $this->api->getUserByName($sUser);
if (is_null($oUser)) {
// Create user
$auto_create_users = $this->get('auto_create_users', null, null, true);
if ($auto_create_users) {
$iNewUID = User::model()->insertUser($sUser, $password, $name, 1, $mail);
if ($iNewUID) {
Permission::model()->insertSomeRecords(array('uid' => $iNewUID, 'permission' => Yii::app()->getConfig("defaulttemplate"), 'entity' => 'template', 'read_p' => 1));
// Set permissions: Label Sets
$auto_create_labelsets = $this->get('auto_create_labelsets', null, null, true);
if ($auto_create_labelsets) {
Permission::model()->insertSomeRecords(array('uid' => $iNewUID, 'permission' => 'labelsets', 'entity' => 'global', 'create_p' => 1, 'read_p' => 1, 'update_p' => 1, 'delete_p' => 1, 'import_p' => 1, 'export_p' => 1));
}
// Set permissions: Particiapnt Panel
$auto_create_participant_panel = $this->get('auto_create_participant_panel', null, null, true);
if ($auto_create_participant_panel) {
Permission::model()->insertSomeRecords(array('uid' => $iNewUID, 'permission' => 'participantpanel', 'entity' => 'global', 'create_p' => 1, 'read_p' => 0, 'update_p' => 0, 'delete_p' => 0, 'export_p' => 0));
}
// Set permissions: Settings & Plugins
$auto_create_settings_plugins = $this->get('auto_create_settings_plugins', null, null, true);
if ($auto_create_settings_plugins) {
Permission::model()->insertSomeRecords(array('uid' => $iNewUID, 'permission' => 'settings', 'entity' => 'global', 'create_p' => 0, 'read_p' => 1, 'update_p' => 1, 'delete_p' => 0, 'import_p' => 1, 'export_p' => 0));
}
// Set permissions: surveys
$auto_create_surveys = $this->get('auto_create_surveys', null, null, true);
if ($auto_create_surveys) {
Permission::model()->insertSomeRecords(array('uid' => $iNewUID, 'permission' => 'surveys', 'entity' => 'global', 'create_p' => 1, 'read_p' => 0, 'update_p' => 0, 'delete_p' => 0, 'export_p' => 0));
}
// Set permissions: Templates
$auto_create_templates = $this->get('auto_create_templates', null, null, true);
if ($auto_create_templates) {
Permission::model()->insertSomeRecords(array('uid' => $iNewUID, 'permission' => 'templates', 'entity' => 'global', 'create_p' => 1, 'read_p' => 1, 'update_p' => 1, 'delete_p' => 1, 'import_p' => 1, 'export_p' => 1));
}
// Set permissions: User Groups
$auto_create_user_groups = $this->get('auto_create_user_groups', null, null, true);
if ($auto_create_user_groups) {
Permission::model()->insertSomeRecords(array('uid' => $iNewUID, 'permission' => 'usergroups', 'entity' => 'global', 'create_p' => 1, 'read_p' => 1, 'update_p' => 1, 'delete_p' => 1, 'export_p' => 0));
}
// read again user from newly created entry
$oUser = $this->api->getUserByName($sUser);
$this->setAuthSuccess($oUser);
} else {
$this->setAuthFailure(self::ERROR_USERNAME_INVALID);
}
} else {
$this->setAuthFailure(self::ERROR_USERNAME_INVALID);
}
} else {
// Update user?
$auto_update_users = $this->get('auto_update_users', null, null, true);
if ($auto_update_users) {
$changes = array(
'full_name' => $name,
'email' => $mail,
);
User::model()->updateByPk($oUser->uid, $changes);
$oUser = $this->api->getUserByName($sUser);
}
$this->setAuthSuccess($oUser);
}
}
}
示例12: setError
} else {
$checkEmail = UserPeer::loadUserByEmailAddress($emailAddress);
if ($checkEmail) {
// username exists
setError(t("email_address_already_exists", "Email address already exists on another account"));
} else {
$checkUser = UserPeer::loadUserByUsername($username);
if ($checkUser) {
// username exists
setError(t("username_already_exists", "Username already exists on another account"));
}
}
}
// create the account
if (!isErrors()) {
$newPassword = createPassword();
$newUser = UserPeer::create($username, $newPassword, $emailAddress, $title, $firstname, $lastname);
if ($newUser) {
$subject = "Account details for " . SITE_CONFIG_SITE_NAME;
$plainMsg = "Dear " . $firstname . ",\n\n";
$plainMsg .= "Your account on " . SITE_CONFIG_SITE_NAME . " has be created. Use the details below to login to your new account:\n\n";
$plainMsg .= "<strong>Url:</strong> <a href='" . WEB_ROOT . "'>" . WEB_ROOT . "</a>\n";
$plainMsg .= "<strong>Username:</strong> " . $username . "\n";
$plainMsg .= "<strong>Password:</strong> " . $newPassword . "\n\n";
$plainMsg .= "Feel free to contact us if you need any support with your account.\n\n";
$plainMsg .= "Regards,\n";
$plainMsg .= SITE_CONFIG_SITE_NAME . " Admin\n";
send_html_mail($emailAddress, $subject, str_replace("\n", "<br/>", $plainMsg), SITE_CONFIG_DEFAULT_EMAIL_ADDRESS_FROM, strip_tags($plainMsg));
redirect(WEB_ROOT . "/register_complete." . SITE_CONFIG_PAGE_EXTENSION);
} else {
setError(t("problem_creating_your_account_try_again_later", "There was a problem creating your account, please try again later"));
示例13: isset
// for later retreiving of the transaction details
$status = "firstload";
$errorMissingFields = false;
$userPIN = "";
if (isset($_POST['submit'])) {
isset($_POST['firstName']) ? $firstName = $_POST['firstName'] : ($firstName = "");
isset($_POST['lastName']) ? $lastName = $_POST['lastName'] : ($lastName = "");
isset($_POST['address']) ? $address = $_POST['address'] : ($address = "");
isset($_POST['city']) ? $city = $_POST['city'] : ($city = "");
isset($_POST['state']) ? $state = $_POST['state'] : ($state = "");
isset($_POST['planId']) ? $planId = $_POST['planId'] : ($planId = "");
if ($firstName != "" && $lastName != "" && $address != "" && $city != "" && $state != "" && $planId != "") {
// all paramteres have been set, save it in the database
$currDate = date('Y-m-d H:i:s');
$currBy = "2Checkout-webinterface";
$userPIN = createPassword($configValues['CONFIG_USERNAME_LENGTH'], $configValues['CONFIG_USER_ALLOWEDRANDOMCHARS']);
// lets create some random data for user pin
$planId = $dbSocket->escapeSimple($planId);
// grab information about a plan from the table
$sql = "SELECT planId,planName,planCost,planTax,planCurrency FROM " . $configValues['CONFIG_DB_TBL_DALOBILLINGPLANS'] . " WHERE (planType='2Checkout') AND (planId='{$planId}') ";
$res = $dbSocket->query($sql);
$row = $res->fetchRow();
$planId = $row[0];
$planName = $row[1];
$planCost = $row[2];
$planTax = $row[3];
$planCurrency = $row[4];
// lets add user information to the database
$sql = "INSERT INTO " . $configValues['CONFIG_DB_TBL_DALOUSERINFO'] . " (id, username, firstname, lastname, creationdate, creationby)" . " VALUES (0,'{$userPIN}','" . $dbSocket->escapeSimple($firstName) . "','" . $dbSocket->escapeSimple($lastName) . "'," . "'{$currDate}','{$currBy}'" . ")";
$res = $dbSocket->query($sql);
// lets add user billing information to the database
示例14: postRemoteData
</Constraint>
</csw:Query>
</GetRecords>';
/**
* Send a post $request at $url
*
* If headers is set to false, do not force headers
* during POST request
*/
if (isset($_REQUEST["headers"]) && $_REQUEST["headers"] == "false") {
$theData = postRemoteData($url, $request, false);
} else {
$theData = postRemoteData($url, $request, true);
}
/**
* Store request and response
*/
if (MSP_DEBUG) {
$tmp = createPassword(10);
saveFile($request, MSP_UPLOAD_DIR . "csw_" . $tmp . "_request.xml");
$resultFileURI = saveFile($theData, MSP_UPLOAD_DIR . "csw_" . $tmp . "_response.xml");
}
/**
* Check if a SOAP Fault occured
*/
$error = OWSExceptionToJSON($theData);
if ($error) {
echo $error;
} else {
echo outputToGeoJSON($theData);
}
示例15: changePassword
function changePassword($userid, $token, $email)
{
$tokenSQL = "SELECT EXISTS (\n SELECT * FROM pwReset where user_id = {$userid} AND token='{$token}' AND ts + INTERVAL 20 MINUTE > NOW())";
$tokenData = db::executeSqlColumn($tokenSQL);
if ($tokenData[0] === 0) {
resetForm($email);
}
if (!isset($_POST['pass1']) || !isset($_POST['pass2'])) {
changePwForm($userid, $token, $email, 'Passwords not set, it must be at least 8 characters');
}
if ($_POST['pass1'] !== $_POST['pass2'] && strlen($_POST['pass1']) < 8) {
changePwForm($userid, $token, $email, 'Passwords do not match or is less than 8 characters');
}
$uPass = createPassword($_POST['pass1']);
$sql = "UPDATE `users` set " . "`password`= '" . $uPass['pass'] . "', " . " `salt` = '" . $uPass['salt'] . "' " . " WHERE " . " id = " . $userid;
//~ db::executeISql();
$pwChanged = db::executeISql($sql);
if ($pwChanged) {
echo '<p>Password has been reset.</p>';
} else {
die('Unknown Error Occured please contact support');
}
exit;
die;
}