aboutsummaryrefslogtreecommitdiffstats
path: root/mod/settings.php
diff options
context:
space:
mode:
Diffstat (limited to 'mod/settings.php')
-rw-r--r--mod/settings.php47
1 files changed, 33 insertions, 14 deletions
diff --git a/mod/settings.php b/mod/settings.php
index da6cf709c..0cca41810 100644
--- a/mod/settings.php
+++ b/mod/settings.php
@@ -1,5 +1,6 @@
-<?php
+<?php /** @file */
+require_once('include/zot.php');
function get_theme_config_file($theme){
@@ -14,6 +15,11 @@ function get_theme_config_file($theme){
return null;
}
+function settings_init(&$a) {
+ $a->profile_uid = local_user();
+}
+
+
function settings_aside(&$a) {
@@ -115,13 +121,6 @@ function settings_post(&$a) {
return;
-// if(count($a->user) && x($a->user,'uid') && $a->user['uid'] != local_user()) {
-// notice( t('Permission denied.') . EOL);
-// return;
-// }
-
- $old_page_flags = $a->user['page-flags'];
-
if((argc() > 1) && (argv(1) === 'oauth') && x($_POST,'remove')){
check_form_security_token_redirectOnErr('/settings/oauth', 'settings_oauth');
@@ -182,6 +181,7 @@ function settings_post(&$a) {
check_form_security_token_redirectOnErr('/settings/featured', 'settings_featured');
call_hooks('feature_settings_post', $_POST);
+ build_sync_packet();
return;
}
@@ -194,6 +194,7 @@ function settings_post(&$a) {
set_pconfig(local_user(),'feature',substr($k,8),((intval($v)) ? 1 : 0));
}
}
+ build_sync_packet();
return;
}
@@ -237,6 +238,7 @@ function settings_post(&$a) {
);
call_hooks('display_settings_post', $_POST);
+ build_sync_packet();
goaway($a->get_baseurl(true) . '/settings/display' );
return; // NOTREACHED
}
@@ -292,7 +294,7 @@ function settings_post(&$a) {
$errs[] = t('Not valid email.');
$adm = trim(get_config('system','admin_email'));
if(($adm) && (strcasecmp($email,$adm) == 0)) {
- $errs[] = t('Protected email. Cannot change to that email.');
+ $errs[] = t('Protected email address. Cannot change to that email.');
$email = $a->user['email'];
}
if(! $errs) {
@@ -334,6 +336,7 @@ function settings_post(&$a) {
$expire_network_only = ((x($_POST,'expire_network_only'))? intval($_POST['expire_network_only']) : 0);
$allow_location = (((x($_POST,'allow_location')) && (intval($_POST['allow_location']) == 1)) ? 1: 0);
+
$publish = (((x($_POST,'profile_in_directory')) && (intval($_POST['profile_in_directory']) == 1)) ? 1: 0);
$page_flags = (((x($_POST,'page-flags')) && (intval($_POST['page-flags']))) ? intval($_POST['page-flags']) : 0);
$blockwall = (((x($_POST,'blockwall')) && (intval($_POST['blockwall']) == 1)) ? 0: 1); // this setting is inverted!
@@ -456,6 +459,8 @@ function settings_post(&$a) {
set_pconfig(local_user(),'system','post_newfriend', $post_newfriend);
set_pconfig(local_user(),'system','post_joingroup', $post_joingroup);
set_pconfig(local_user(),'system','post_profilechange', $post_profilechange);
+ set_pconfig(local_user(),'system','blocktags',$blocktags);
+
/*
if($page_flags == PAGE_PRVGROUP) {
@@ -500,9 +505,11 @@ function settings_post(&$a) {
);
*/
- $r = q("update channel set channel_name = '%s', channel_timezone = '%s', channel_max_anon_mail = %d, channel_max_friend_req = %d, channel_expire_days = %d, channel_r_stream = %d, channel_r_profile = %d, channel_r_photos = %d, channel_r_abook = %d, channel_w_stream = %d, channel_w_wall = %d, channel_w_tagwall = %d, channel_w_comment = %d, channel_w_mail = %d, channel_w_photos = %d, channel_w_chat = %d, channel_a_delegate = %d, channel_r_storage = %d, channel_w_storage = %d, channel_r_pages = %d, channel_w_pages = %d where channel_id = %d limit 1",
+ $r = q("update channel set channel_name = '%s', channel_timezone = '%s', channel_location = '%s', channel_notifyflags = %d, channel_max_anon_mail = %d, channel_max_friend_req = %d, channel_expire_days = %d, channel_r_stream = %d, channel_r_profile = %d, channel_r_photos = %d, channel_r_abook = %d, channel_w_stream = %d, channel_w_wall = %d, channel_w_tagwall = %d, channel_w_comment = %d, channel_w_mail = %d, channel_w_photos = %d, channel_w_chat = %d, channel_a_delegate = %d, channel_r_storage = %d, channel_w_storage = %d, channel_r_pages = %d, channel_w_pages = %d where channel_id = %d limit 1",
dbesc($username),
dbesc($timezone),
+ dbesc($defloc),
+ intval($notify),
intval($unkmail),
intval($maxreq),
intval($expire),
@@ -547,11 +554,12 @@ function settings_post(&$a) {
dbesc($username),
intval($channel['channel_id'])
);
- // we really need to send out notifications to all our friends
}
proc_run('php','include/directory.php',local_user());
+ build_sync_packet();
+
//$_SESSION['theme'] = $theme;
if($email_changed && $a->config['system']['register_policy'] == REGISTER_VERIFY) {
@@ -578,6 +586,11 @@ function settings_content(&$a) {
return;
}
+
+ $channel = $a->get_channel();
+ if($channel)
+ head_set_icon($channel['xchan_photo_s']);
+
// if(x($_SESSION,'submanage') && intval($_SESSION['submanage'])) {
// notice( t('Permission denied.') . EOL );
// return;
@@ -716,7 +729,6 @@ function settings_content(&$a) {
if((argc() > 1) && (argv(1) === 'features')) {
-
$arr = array();
$features = get_features();
@@ -736,6 +748,7 @@ function settings_content(&$a) {
'$submit' => t('Submit'),
'$field_yesno' => 'field_yesno.tpl',
));
+
return $o;
}
@@ -905,7 +918,6 @@ function settings_content(&$a) {
$expire = $channel['channel_expire_days'];
$blockwall = $a->user['blockwall'];
- $blocktags = $a->user['blocktags'];
$unkmail = $a->user['unkmail'];
$cntunkmail = $a->user['cntunkmail'];
@@ -937,6 +949,8 @@ function settings_content(&$a) {
$post_profilechange = get_pconfig(local_user(), 'system','post_profilechange');
$post_profilechange = (($post_profilechange===false)? '0': $post_profilechange); // default if not set: 0
+ $blocktags = get_pconfig(local_user(),'system','blocktags');
+ $blocktags = (($blocktags===false) ? '0' : $blocktags);
$timezone = date_default_timezone_get();
@@ -1005,11 +1019,16 @@ function settings_content(&$a) {
'$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:'), (intval(get_pconfig(local_user(),'system','use_browser_location')) == 1), ''),
+ '$allowloc' => array('allow_location', t('Use Browser Location:'), ((get_pconfig(local_user(),'system','use_browser_location')) ? 1 : ''), ''),
'$h_prv' => t('Security and Privacy Settings'),
+ '$lbl_pmacro' => t('Quick Privacy Settings:'),
+ '$pmacro3' => t('Very Public - extremely permissive'),
+ '$pmacro2' => t('Typical - default public, privacy when desired'),
+ '$pmacro1' => t('Private - default private, rarely open or public'),
+ '$pmacro0' => t('Blocked - default blocked to/from everybody'),
'$permiss_arr' => $permiss,
'$maxreq' => array('maxreq', t('Maximum Friend Requests/Day:'), intval($channel['channel_max_friend_req']) , t('May reduce spam activity')),