X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fsettings.php;h=9970d32595a9815a3792b394891790e6ff3d4143;hb=6957069fb7d12fa4c5b1d8cb6be2718cf47e70c0;hp=94b93f9b9564ce6d6483375709afbc3aa33db444;hpb=1c6535c0b45c32ccbb0e2bd49e5bb7a6d5435d27;p=friendica.git
diff --git a/mod/settings.php b/mod/settings.php
index 94b93f9b95..9970d32595 100644
--- a/mod/settings.php
+++ b/mod/settings.php
@@ -1,5 +1,8 @@
local_user()));
}
if(strlen($mail_pass)) {
$pass = '';
openssl_public_encrypt($mail_pass,$pass,$a->user['pubkey']);
- q("UPDATE `mailacct` SET `pass` = '%s' WHERE `uid` = %d",
- dbesc(bin2hex($pass)),
- intval(local_user())
- );
+ dba::update('mailacct', array('pass' => bin2hex($pass)), array('uid' => local_user()));
}
$r = q("UPDATE `mailacct` SET `server` = '%s', `port` = %d, `ssltype` = '%s', `user` = '%s',
`action` = %d, `movetofolder` = '%s',
@@ -381,15 +379,13 @@ function settings_post(App $a) {
$err = true;
}
- // check if the old password was supplied correctly before
- // changing it to the new value
- $r = q("SELECT `password` FROM `user`WHERE `uid` = %d LIMIT 1", intval(local_user()));
- if (!dbm::is_result($r)) {
- killme();
- } elseif ( $oldpass != $r[0]['password'] ) {
- notice( t('Wrong password.') . EOL);
- $err = true;
- }
+ // check if the old password was supplied correctly before
+ // changing it to the new value
+ $r = q("SELECT `password` FROM `user`WHERE `uid` = %d LIMIT 1", intval(local_user()));
+ if( $oldpass != $r[0]['password'] ) {
+ notice( t('Wrong password.') . EOL);
+ $err = true;
+ }
if(! $err) {
$password = hash('whirlpool',$newpass);
@@ -397,11 +393,10 @@ function settings_post(App $a) {
dbesc($password),
intval(local_user())
);
- if($r) {
+ if($r)
info( t('Password changed.') . EOL);
- } else {
+ else
notice( t('Password update failed. Please try again.') . EOL);
- }
}
}
@@ -463,13 +458,13 @@ function settings_post(App $a) {
$notify += intval($_POST['notify8']);
// Adjust the page flag if the account type doesn't fit to the page flag.
- if (($account_type == ACCOUNT_TYPE_PERSON) AND !in_array($page_flags, array(PAGE_NORMAL, PAGE_SOAPBOX, PAGE_FREELOVE)))
+ if (($account_type == ACCOUNT_TYPE_PERSON) && !in_array($page_flags, array(PAGE_NORMAL, PAGE_SOAPBOX, PAGE_FREELOVE)))
$page_flags = PAGE_NORMAL;
- elseif (($account_type == ACCOUNT_TYPE_ORGANISATION) AND !in_array($page_flags, array(PAGE_SOAPBOX)))
+ elseif (($account_type == ACCOUNT_TYPE_ORGANISATION) && !in_array($page_flags, array(PAGE_SOAPBOX)))
$page_flags = PAGE_SOAPBOX;
- elseif (($account_type == ACCOUNT_TYPE_NEWS) AND !in_array($page_flags, array(PAGE_SOAPBOX)))
+ elseif (($account_type == ACCOUNT_TYPE_NEWS) && !in_array($page_flags, array(PAGE_SOAPBOX)))
$page_flags = PAGE_SOAPBOX;
- elseif (($account_type == ACCOUNT_TYPE_COMMUNITY) AND !in_array($page_flags, array(PAGE_COMMUNITY, PAGE_PRVGROUP)))
+ elseif (($account_type == ACCOUNT_TYPE_COMMUNITY) && !in_array($page_flags, array(PAGE_COMMUNITY, PAGE_PRVGROUP)))
$page_flags = PAGE_COMMUNITY;
$email_changed = false;
@@ -638,8 +633,7 @@ function settings_post(App $a) {
}
}
- require_once('include/profile_update.php');
- profile_change();
+ proc_run(PRIORITY_LOW, 'include/profile_update.php', local_user());
// Update the global contact for the user
update_gcontact_for_user(local_user());
@@ -724,7 +718,7 @@ function settings_content(App $a) {
$r = q("DELETE FROM clients WHERE client_id='%s' AND uid=%d",
dbesc($a->argv[3]),
local_user());
- goaway(App::get_baseurl(true)."/settings/oauth/");
+ goaway(System::baseUrl(true)."/settings/oauth/");
return;
}
@@ -740,7 +734,7 @@ function settings_content(App $a) {
$tpl = get_markup_template("settings_oauth.tpl");
$o .= replace_macros($tpl, array(
'$form_security_token' => get_form_security_token("settings_oauth"),
- '$baseurl' => App::get_baseurl(true),
+ '$baseurl' => System::baseUrl(true),
'$title' => t('Connected Apps'),
'$add' => t('Add application'),
'$edit' => t('Edit'),
@@ -782,7 +776,7 @@ function settings_content(App $a) {
$arr[$fname] = array();
$arr[$fname][0] = $fdata[0];
foreach (array_slice($fdata,1) as $f) {
- $arr[$fname][1][] = array('feature_' .$f[0],$f[1],((intval(feature_enabled(local_user(),$f[0]))) ? "1" : ''),$f[2],array(t('Off'),t('On')));
+ $arr[$fname][1][] = array('feature_' .$f[0],$f[1],((intval(feature_enabled(local_user(),$f[0]))) ? "1" : ''),$f[2],array(t('Off'), t('On')));
}
}
@@ -830,7 +824,7 @@ function settings_content(App $a) {
/// @TODO Found to much different usage to test empty/non-empty strings (e.g. empty(), trim() == '' ) which is wanted?
if ($legacy_contact != "") {
- $a->page['htmlhead'] = '';
+ $a->page['htmlhead'] = '';
}
$settings_connectors .= '
';
@@ -839,7 +833,7 @@ function settings_content(App $a) {
$settings_connectors .= ''.t('If you enter your old GNU Social/Statusnet account name here (in the format user@domain.tld), your contacts will be added automatically. The field will be emptied when done.').'';
$settings_connectors .= '