From: Michael Vogel Date: Sun, 1 Dec 2013 23:33:46 +0000 (+0100) Subject: Merge remote-tracking branch 'upstream/master' X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=e0cf2c5167f29efcd8923f40bade346fe44c4ef3;p=friendica.git Merge remote-tracking branch 'upstream/master' Conflicts: mod/admin.php mod/settings.php --- e0cf2c5167f29efcd8923f40bade346fe44c4ef3 diff --cc mod/admin.php index c5b862ee59,4cbc13d91a..dd9a0d475f --- a/mod/admin.php +++ b/mod/admin.php @@@ -508,7 -572,8 +572,7 @@@ function admin_page_site(&$a) '$corporate' => t('Policies'), '$advanced' => t('Advanced'), '$performance' => t('Performance'), - + '$relocate'=> t('Relocate - WARNING: advanced function. Could make this server unreachable.'), - '$baseurl' => $a->get_baseurl(true), // name, label, value, help string, extra data... '$sitename' => array('sitename', t("Site name"), htmlentities($a->config['sitename'], ENT_QUOTES), 'UTF-8'), diff --cc mod/settings.php index 0038216345,a19c51f7d4..c8fcf39146 --- a/mod/settings.php +++ b/mod/settings.php @@@ -305,12 -305,18 +305,18 @@@ function settings_post(&$a) } 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']); @@@ -414,25 -420,21 +420,25 @@@ 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)) { @@@ -1080,22 -1082,22 +1086,22 @@@ function settings_content(&$a) '$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'),