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;
}
$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);
$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);
$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),
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);
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) {
if(! function_exists('settings_content')) {
function settings_content(&$a) {
+ $o = '';
$o .= '<script> $(document).ready(function() { $(\'#nav-settings-link\').addClass(\'nav-selected\'); });</script>';
if(! local_user()) {
$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,
else
$profile_in_net_dir = '';
+ $loc_checked = (($a->user['allow_location'] == 1) ? " checked=\"checked\" " : "");
+
$invisible = (((! $profile['publish']) && (! $profile['net-publish']))
? true : false);
'$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'),