X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fsettings.php;h=eab4ac52e7c7906cd5905b3d774efdec93c635d4;hb=fbcb74099acfdcbc2e18a07504feb76d359ec3b4;hp=7adc5e6de35a30fc448a1909b5502e69292bde0c;hpb=511c761fec572a093e833541968635ca011cb71e;p=friendica.git diff --git a/mod/settings.php b/mod/settings.php index 7adc5e6de3..eab4ac52e7 100644 --- a/mod/settings.php +++ b/mod/settings.php @@ -15,7 +15,7 @@ function settings_post(&$a) { notice( t('Permission denied.') . EOL); return; } - if(count($a->user) && x($a->user,'uid') && $a->user['uid'] != get_uid()) { + if(count($a->user) && x($a->user,'uid') && $a->user['uid'] != local_user()) { notice( t('Permission denied.') . EOL); return; } @@ -39,7 +39,7 @@ function settings_post(&$a) { $password = hash('whirlpool',$newpass); $r = q("UPDATE `user` SET `password` = '%s' WHERE `uid` = %d LIMIT 1", dbesc($password), - intval(get_uid()) + intval(local_user()) ); if($r) notice( t('Password changed.') . EOL); @@ -54,6 +54,7 @@ function settings_post(&$a) { $timezone = notags(trim($_POST['timezone'])); $defloc = notags(trim($_POST['defloc'])); + $allow_location = (($_POST['allow_location'] == 1) ? 1: 0); $publish = (($_POST['profile_in_directory'] == 1) ? 1: 0); $net_publish = (($_POST['profile_in_netdirectory'] == 1) ? 1: 0); $old_visibility = ((intval($_POST['visibility']) == 1) ? 1 : 0); @@ -104,7 +105,7 @@ function settings_post(&$a) { $str_group_deny = perms2str($_POST['group_deny']); $str_contact_deny = perms2str($_POST['contact_deny']); - $r = q("UPDATE `user` SET `username` = '%s', `email` = '%s', `timezone` = '%s', `allow_cid` = '%s', `allow_gid` = '%s', `deny_cid` = '%s', `deny_gid` = '%s', `notify-flags` = %d, `page-flags` = %d, `default-location` = '%s', `theme` = '%s' WHERE `uid` = %d LIMIT 1", + $r = q("UPDATE `user` SET `username` = '%s', `email` = '%s', `timezone` = '%s', `allow_cid` = '%s', `allow_gid` = '%s', `deny_cid` = '%s', `deny_gid` = '%s', `notify-flags` = %d, `page-flags` = %d, `default-location` = '%s', `allow_location` = %d, `theme` = '%s' WHERE `uid` = %d LIMIT 1", dbesc($username), dbesc($email), dbesc($timezone), @@ -115,8 +116,9 @@ function settings_post(&$a) { intval($notify), intval($page_flags), dbesc($defloc), + intval($allow_location), dbesc($theme), - intval(get_uid()) + intval(local_user()) ); if($r) notice( t('Settings updated.') . EOL); @@ -126,7 +128,7 @@ function settings_post(&$a) { WHERE `is-default` = 1 AND `uid` = %d LIMIT 1", intval($publish), intval($net_publish), - intval(get_uid()) + intval(local_user()) ); if($old_visibility != $net_publish) { @@ -153,6 +155,7 @@ function settings_post(&$a) { if(! function_exists('settings_content')) { function settings_content(&$a) { + $o = ''; $o .= ''; if(! local_user()) { @@ -180,10 +183,10 @@ function settings_content(&$a) { $pageset_tpl = load_view_file('view/pagetypes.tpl'); $pagetype = replace_macros($pageset_tpl,array( - '$normal' => (($profile['page-flags'] == PAGE_NORMAL) ? " checked=\"checked\" " : ""), - '$soapbox' => (($profile['page-flags'] == PAGE_SOAPBOX) ? " checked=\"checked\" " : ""), - '$community' => (($profile['page-flags'] == PAGE_COMMUNITY) ? " checked=\"checked\" " : ""), - '$freelove' => (($profile['page-flags'] == PAGE_FREELOVE) ? " checked=\"checked\" " : ""), + '$normal' => (($a->user['page-flags'] == PAGE_NORMAL) ? " checked=\"checked\" " : ""), + '$soapbox' => (($a->user['page-flags'] == PAGE_SOAPBOX) ? " checked=\"checked\" " : ""), + '$community' => (($a->user['page-flags'] == PAGE_COMMUNITY) ? " checked=\"checked\" " : ""), + '$freelove' => (($a->user['page-flags'] == PAGE_FREELOVE) ? " checked=\"checked\" " : ""), '$page_normal' => PAGE_NORMAL, '$page_soapbox' => PAGE_SOAPBOX, '$page_community' => PAGE_COMMUNITY, @@ -208,6 +211,8 @@ function settings_content(&$a) { else $profile_in_net_dir = ''; + $loc_checked = (($a->user['allow_location'] == 1) ? " checked=\"checked\" " : ""); + $invisible = (((! $profile['publish']) && (! $profile['net-publish'])) ? true : false); @@ -259,6 +264,7 @@ function settings_content(&$a) { '$timezone' => $timezone, '$zoneselect' => select_timezone($timezone), '$defloc' => $defloc, + '$loc_checked' => $loc_checked, '$profile_in_dir' => $profile_in_dir, '$profile_in_net_dir' => $profile_in_net_dir, '$permissions' => t('Default Post Permissions'),