}
check_form_security_token_redirectOnErr('/settings', 'settings');
-
+
+ if (x($_POST,'resend_relocate')) {
+ proc_run('php', 'include/notifier.php', 'relocate', local_user());
+ info(t("Relocate message has been send to your contacts"));
+ goaway($a->get_baseurl(true) . '/settings');
+ }
-
++
call_hooks('settings_post', $_POST);
- if((x($_POST,'npassword')) || (x($_POST,'confirm'))) {
+ if((x($_POST,'password')) || (x($_POST,'confirm'))) {
- $newpass = $_POST['npassword'];
+ $newpass = $_POST['password'];
$confirm = $_POST['confirm'];
$oldpass = hash('whirlpool', $_POST['opassword']);
if($email != $a->user['email']) {
$email_changed = true;
- // check for the correct password
- $r = q("SELECT `password` FROM `user`WHERE `uid` = %d LIMIT 1", intval(local_user()));
- $password = hash('whirlpool', $_POST['mpassword']);
- if ($password != $r[0]['password']) {
- $err .= t('Wrong Password') . EOL;
- $email = $a->user['email'];
- }
- // check the email is valid
- if(! valid_email($email))
- $err .= t(' Not valid email.');
- // ensure new email is not the admin mail
- if((x($a->config,'admin_email')) && (strcasecmp($email,$a->config['admin_email']) == 0)) {
- $err .= t(' Cannot change to that email.');
+ // check for the correct password
+ $r = q("SELECT `password` FROM `user`WHERE `uid` = %d LIMIT 1", intval(local_user()));
- $password = hash('whirlpool', $_POST['password']);
++ $password = hash('whirlpool', $_POST['mpassword']);
+ if ($password != $r[0]['password']) {
+ $err .= t('Wrong Password') . EOL;
$email = $a->user['email'];
}
+ // check the email is valid
+ if(! valid_email($email))
+ $err .= t(' Not valid email.');
+ // ensure new email is not the admin mail
+ //if((x($a->config,'admin_email')) && (strcasecmp($email,$a->config['admin_email']) == 0)) {
+ if(x($a->config,'admin_email')) {
+ $adminlist = explode(",", str_replace(" ", "", strtolower($a->config['admin_email'])));
+ if (in_array(strtolower($email), $adminlist)) {
+ $err .= t(' Cannot change to that email.');
+ $email = $a->user['email'];
+ }
+ }
}
if(strlen($err)) {
'$uid' => local_user(),
'$form_security_token' => get_form_security_token("settings"),
'$nickname_block' => $prof_addr,
--
++
'$h_pass' => t('Password Settings'),
- '$password1'=> array('npassword', t('New Password:'), '', ''),
+ '$password1'=> array('password', t('New Password:'), '', ''),
'$password2'=> array('confirm', t('Confirm:'), '', t('Leave password fields blank unless changing')),
'$password3'=> array('opassword', t('Current Password:'), '', t('Your current password to confirm the changes')),
- '$password4'=> array('password', t('Password:'), '', t('Your current password to confirm the changes')),
+ '$password4'=> array('mpassword', t('Password:'), '', t('Your current password to confirm the changes')),
'$oid_enable' => (! get_config('system','no_openid')),
'$openid' => $openid_field,
--
++
'$h_basic' => t('Basic Settings'),
'$username' => array('username', t('Full Name:'), $username,''),
'$email' => array('email', t('Email Address:'), $email, ''),
'$timezone' => array('timezone_select' , t('Your Timezone:'), select_timezone($timezone), ''),
'$defloc' => array('defloc', t('Default Post Location:'), $defloc, ''),
'$allowloc' => array('allow_location', t('Use Browser Location:'), ($a->user['allow_location'] == 1), ''),
--
++
'$h_prv' => t('Security and Privacy Settings'),