4 function get_theme_config_file($theme){
6 $base_theme = $a->theme_info['extends'];
8 if (file_exists("view/theme/$theme/config.php")){
9 return "view/theme/$theme/config.php";
11 if (file_exists("view/theme/$base_theme/config.php")){
12 return "view/theme/$base_theme/config.php";
17 function settings_init(&$a) {
20 notice( t('Permission denied.') . EOL );
24 // APC deactivated, since there are problems with PHP 5.5
25 //if (function_exists("apc_delete")) {
26 // $toDelete = new APCIterator('user', APC_ITER_VALUE);
27 // apc_delete($toDelete);
30 // These lines provide the javascript needed by the acl selector
32 $tpl = get_markup_template("settings-head.tpl");
33 $a->page['htmlhead'] .= replace_macros($tpl,array(
34 '$ispublic' => t('everybody')
41 'label' => t('Account'),
43 'selected' => (($a->argc == 1) && ($a->argv[0] === 'settings')?'active':''),
50 'label' => t('Additional features'),
51 'url' => 'settings/features',
52 'selected' => (($a->argc > 1) && ($a->argv[1] === 'features') ? 'active' : ''),
58 'label' => t('Display'),
59 'url' => 'settings/display',
60 'selected' => (($a->argc > 1) && ($a->argv[1] === 'display')?'active':''),
65 'label' => t('Social Networks'),
66 'url' => 'settings/connectors',
67 'selected' => (($a->argc > 1) && ($a->argv[1] === 'connectors')?'active':''),
72 'label' => t('Plugins'),
73 'url' => 'settings/addon',
74 'selected' => (($a->argc > 1) && ($a->argv[1] === 'addon')?'active':''),
79 'label' => t('Delegations'),
81 'selected' => (($a->argc == 1) && ($a->argv[0] === 'delegate')?'active':''),
86 'label' => t('Connected apps'),
87 'url' => 'settings/oauth',
88 'selected' => (($a->argc > 1) && ($a->argv[1] === 'oauth')?'active':''),
93 'label' => t('Export personal data'),
95 'selected' => (($a->argc == 1) && ($a->argv[0] === 'uexport')?'active':''),
100 'label' => t('Remove account'),
102 'selected' => (($a->argc == 1) && ($a->argv[0] === 'removeme')?'active':''),
107 $tabtpl = get_markup_template("generic_links_widget.tpl");
108 $a->page['aside'] = replace_macros($tabtpl, array(
109 '$title' => t('Settings'),
110 '$class' => 'settings-widget',
117 function settings_post(&$a) {
122 if(x($_SESSION,'submanage') && intval($_SESSION['submanage']))
125 if(count($a->user) && x($a->user,'uid') && $a->user['uid'] != local_user()) {
126 notice( t('Permission denied.') . EOL);
130 $old_page_flags = $a->user['page-flags'];
132 if(($a->argc > 1) && ($a->argv[1] === 'oauth') && x($_POST,'remove')){
133 check_form_security_token_redirectOnErr('/settings/oauth', 'settings_oauth');
135 $key = $_POST['remove'];
136 q("DELETE FROM tokens WHERE id='%s' AND uid=%d",
139 goaway($a->get_baseurl(true)."/settings/oauth/");
143 if(($a->argc > 2) && ($a->argv[1] === 'oauth') && ($a->argv[2] === 'edit'||($a->argv[2] === 'add')) && x($_POST,'submit')) {
145 check_form_security_token_redirectOnErr('/settings/oauth', 'settings_oauth');
147 $name = ((x($_POST,'name')) ? $_POST['name'] : '');
148 $key = ((x($_POST,'key')) ? $_POST['key'] : '');
149 $secret = ((x($_POST,'secret')) ? $_POST['secret'] : '');
150 $redirect = ((x($_POST,'redirect')) ? $_POST['redirect'] : '');
151 $icon = ((x($_POST,'icon')) ? $_POST['icon'] : '');
152 if ($name=="" || $key=="" || $secret==""){
153 notice(t("Missing some important data!"));
156 if ($_POST['submit']==t("Update")){
157 $r = q("UPDATE clients SET
164 WHERE client_id='%s'",
173 $r = q("INSERT INTO clients
174 (client_id, pw, name, redirect_uri, icon, uid)
175 VALUES ('%s','%s','%s','%s','%s',%d)",
184 goaway($a->get_baseurl(true)."/settings/oauth/");
188 if(($a->argc > 1) && ($a->argv[1] == 'addon')) {
189 check_form_security_token_redirectOnErr('/settings/addon', 'settings_addon');
191 call_hooks('plugin_settings_post', $_POST);
195 if(($a->argc > 1) && ($a->argv[1] == 'connectors')) {
197 check_form_security_token_redirectOnErr('/settings/connectors', 'settings_connectors');
199 if(x($_POST, 'general-submit')) {
200 set_pconfig(local_user(), 'system', 'no_intelligent_shortening', intval($_POST['no_intelligent_shortening']));
201 set_pconfig(local_user(), 'system', 'ostatus_autofriend', intval($_POST['snautofollow']));
202 set_pconfig(local_user(), 'ostatus', 'legacy_contact', $_POST['legacy_contact']);
203 } elseif(x($_POST, 'imap-submit')) {
205 $mail_server = ((x($_POST,'mail_server')) ? $_POST['mail_server'] : '');
206 $mail_port = ((x($_POST,'mail_port')) ? $_POST['mail_port'] : '');
207 $mail_ssl = ((x($_POST,'mail_ssl')) ? strtolower(trim($_POST['mail_ssl'])) : '');
208 $mail_user = ((x($_POST,'mail_user')) ? $_POST['mail_user'] : '');
209 $mail_pass = ((x($_POST,'mail_pass')) ? trim($_POST['mail_pass']) : '');
210 $mail_action = ((x($_POST,'mail_action')) ? trim($_POST['mail_action']) : '');
211 $mail_movetofolder = ((x($_POST,'mail_movetofolder')) ? trim($_POST['mail_movetofolder']) : '');
212 $mail_replyto = ((x($_POST,'mail_replyto')) ? $_POST['mail_replyto'] : '');
213 $mail_pubmail = ((x($_POST,'mail_pubmail')) ? $_POST['mail_pubmail'] : '');
216 $mail_disabled = ((function_exists('imap_open') && (! get_config('system','imap_disabled'))) ? 0 : 1);
217 if(get_config('system','dfrn_only'))
220 if(! $mail_disabled) {
222 $r = q("SELECT * FROM `mailacct` WHERE `uid` = %d LIMIT 1",
226 q("INSERT INTO `mailacct` (`uid`) VALUES (%d)",
230 if(strlen($mail_pass)) {
232 openssl_public_encrypt($mail_pass,$pass,$a->user['pubkey']);
233 q("UPDATE `mailacct` SET `pass` = '%s' WHERE `uid` = %d",
234 dbesc(bin2hex($pass)),
238 $r = q("UPDATE `mailacct` SET `server` = '%s', `port` = %d, `ssltype` = '%s', `user` = '%s',
239 `action` = %d, `movetofolder` = '%s',
240 `mailbox` = 'INBOX', `reply_to` = '%s', `pubmail` = %d WHERE `uid` = %d",
245 intval($mail_action),
246 dbesc($mail_movetofolder),
247 dbesc($mail_replyto),
248 intval($mail_pubmail),
251 logger("mail: updating mailaccount. Response: ".print_r($r, true));
252 $r = q("SELECT * FROM `mailacct` WHERE `uid` = %d LIMIT 1",
257 require_once('include/email.php');
258 $mb = construct_mailbox_name($eacct);
259 if(strlen($eacct['server'])) {
261 openssl_private_decrypt(hex2bin($eacct['pass']),$dcrpass,$a->user['prvkey']);
262 $mbox = email_connect($mb,$mail_user,$dcrpass);
266 notice( t('Failed to connect with email account using the settings provided.') . EOL);
271 info( t('Email settings updated.') . EOL);
275 call_hooks('connector_settings_post', $_POST);
279 if(($a->argc > 1) && ($a->argv[1] === 'features')) {
280 check_form_security_token_redirectOnErr('/settings/features', 'settings_features');
281 foreach($_POST as $k => $v) {
282 if(strpos($k,'feature_') === 0) {
283 set_pconfig(local_user(),'feature',substr($k,8),((intval($v)) ? 1 : 0));
286 info( t('Features updated') . EOL);
290 if(($a->argc > 1) && ($a->argv[1] === 'display')) {
292 check_form_security_token_redirectOnErr('/settings/display', 'settings_display');
294 $theme = ((x($_POST,'theme')) ? notags(trim($_POST['theme'])) : $a->user['theme']);
295 $mobile_theme = ((x($_POST,'mobile_theme')) ? notags(trim($_POST['mobile_theme'])) : '');
296 $nosmile = ((x($_POST,'nosmile')) ? intval($_POST['nosmile']) : 0);
297 $first_day_of_week = ((x($_POST,'first_day_of_week')) ? intval($_POST['first_day_of_week']) : 0);
298 $noinfo = ((x($_POST,'noinfo')) ? intval($_POST['noinfo']) : 0);
299 $infinite_scroll = ((x($_POST,'infinite_scroll')) ? intval($_POST['infinite_scroll']) : 0);
300 $no_auto_update = ((x($_POST,'no_auto_update')) ? intval($_POST['no_auto_update']) : 0);
301 $browser_update = ((x($_POST,'browser_update')) ? intval($_POST['browser_update']) : 0);
302 if ($browser_update != -1) {
303 $browser_update = $browser_update * 1000;
304 if ($browser_update < 10000)
305 $browser_update = 10000;
308 $itemspage_network = ((x($_POST,'itemspage_network')) ? intval($_POST['itemspage_network']) : 40);
309 if($itemspage_network > 100)
310 $itemspage_network = 100;
311 $itemspage_mobile_network = ((x($_POST,'itemspage_mobile_network')) ? intval($_POST['itemspage_mobile_network']) : 20);
312 if($itemspage_mobile_network > 100)
313 $itemspage_mobile_network = 100;
316 if($mobile_theme !== '') {
317 set_pconfig(local_user(),'system','mobile_theme',$mobile_theme);
320 set_pconfig(local_user(),'system','update_interval', $browser_update);
321 set_pconfig(local_user(),'system','itemspage_network', $itemspage_network);
322 set_pconfig(local_user(),'system','itemspage_mobile_network', $itemspage_mobile_network);
323 set_pconfig(local_user(),'system','no_smilies',$nosmile);
324 set_pconfig(local_user(),'system','first_day_of_week',$first_day_of_week);
325 set_pconfig(local_user(),'system','ignore_info',$noinfo);
326 set_pconfig(local_user(),'system','infinite_scroll',$infinite_scroll);
327 set_pconfig(local_user(),'system','no_auto_update',$no_auto_update);
330 if ($theme == $a->user['theme']){
331 // call theme_post only if theme has not been changed
332 if( ($themeconfigfile = get_theme_config_file($theme)) != null){
333 require_once($themeconfigfile);
339 $r = q("UPDATE `user` SET `theme` = '%s' WHERE `uid` = %d",
344 call_hooks('display_settings_post', $_POST);
345 goaway('settings/display' );
346 return; // NOTREACHED
349 check_form_security_token_redirectOnErr('/settings', 'settings');
351 if (x($_POST,'resend_relocate')) {
352 proc_run('php', 'include/notifier.php', 'relocate', local_user());
353 info(t("Relocate message has been send to your contacts"));
357 call_hooks('settings_post', $_POST);
359 if((x($_POST,'password')) || (x($_POST,'confirm'))) {
361 $newpass = $_POST['password'];
362 $confirm = $_POST['confirm'];
363 $oldpass = hash('whirlpool', $_POST['opassword']);
366 if($newpass != $confirm ) {
367 notice( t('Passwords do not match. Password unchanged.') . EOL);
371 if((! x($newpass)) || (! x($confirm))) {
372 notice( t('Empty passwords are not allowed. Password unchanged.') . EOL);
376 // check if the old password was supplied correctly before
377 // changing it to the new value
378 $r = q("SELECT `password` FROM `user`WHERE `uid` = %d LIMIT 1", intval(local_user()));
379 if( $oldpass != $r[0]['password'] ) {
380 notice( t('Wrong password.') . EOL);
385 $password = hash('whirlpool',$newpass);
386 $r = q("UPDATE `user` SET `password` = '%s' WHERE `uid` = %d",
391 info( t('Password changed.') . EOL);
393 notice( t('Password update failed. Please try again.') . EOL);
398 $username = ((x($_POST,'username')) ? notags(trim($_POST['username'])) : '');
399 $email = ((x($_POST,'email')) ? notags(trim($_POST['email'])) : '');
400 $timezone = ((x($_POST,'timezone')) ? notags(trim($_POST['timezone'])) : '');
401 $language = ((x($_POST,'language')) ? notags(trim($_POST['language'])) : '');
403 $defloc = ((x($_POST,'defloc')) ? notags(trim($_POST['defloc'])) : '');
404 $openid = ((x($_POST,'openid_url')) ? notags(trim($_POST['openid_url'])) : '');
405 $maxreq = ((x($_POST,'maxreq')) ? intval($_POST['maxreq']) : 0);
406 $expire = ((x($_POST,'expire')) ? intval($_POST['expire']) : 0);
407 $def_gid = ((x($_POST,'group-selection')) ? intval($_POST['group-selection']) : 0);
410 $expire_items = ((x($_POST,'expire_items')) ? intval($_POST['expire_items']) : 0);
411 $expire_notes = ((x($_POST,'expire_notes')) ? intval($_POST['expire_notes']) : 0);
412 $expire_starred = ((x($_POST,'expire_starred')) ? intval($_POST['expire_starred']) : 0);
413 $expire_photos = ((x($_POST,'expire_photos'))? intval($_POST['expire_photos']) : 0);
414 $expire_network_only = ((x($_POST,'expire_network_only'))? intval($_POST['expire_network_only']) : 0);
416 $allow_location = (((x($_POST,'allow_location')) && (intval($_POST['allow_location']) == 1)) ? 1: 0);
417 $publish = (((x($_POST,'profile_in_directory')) && (intval($_POST['profile_in_directory']) == 1)) ? 1: 0);
418 $net_publish = (((x($_POST,'profile_in_netdirectory')) && (intval($_POST['profile_in_netdirectory']) == 1)) ? 1: 0);
419 $old_visibility = (((x($_POST,'visibility')) && (intval($_POST['visibility']) == 1)) ? 1 : 0);
420 $page_flags = (((x($_POST,'page-flags')) && (intval($_POST['page-flags']))) ? intval($_POST['page-flags']) : 0);
421 $blockwall = (((x($_POST,'blockwall')) && (intval($_POST['blockwall']) == 1)) ? 0: 1); // this setting is inverted!
422 $blocktags = (((x($_POST,'blocktags')) && (intval($_POST['blocktags']) == 1)) ? 0: 1); // this setting is inverted!
423 $unkmail = (((x($_POST,'unkmail')) && (intval($_POST['unkmail']) == 1)) ? 1: 0);
424 $cntunkmail = ((x($_POST,'cntunkmail')) ? intval($_POST['cntunkmail']) : 0);
425 $suggestme = ((x($_POST,'suggestme')) ? intval($_POST['suggestme']) : 0);
426 $hide_friends = (($_POST['hide-friends'] == 1) ? 1: 0);
427 $hidewall = (($_POST['hidewall'] == 1) ? 1: 0);
428 $post_newfriend = (($_POST['post_newfriend'] == 1) ? 1: 0);
429 $post_joingroup = (($_POST['post_joingroup'] == 1) ? 1: 0);
430 $post_profilechange = (($_POST['post_profilechange'] == 1) ? 1: 0);
432 $email_textonly = (($_POST['email_textonly'] == 1) ? 1 : 0);
436 if(x($_POST,'notify1'))
437 $notify += intval($_POST['notify1']);
438 if(x($_POST,'notify2'))
439 $notify += intval($_POST['notify2']);
440 if(x($_POST,'notify3'))
441 $notify += intval($_POST['notify3']);
442 if(x($_POST,'notify4'))
443 $notify += intval($_POST['notify4']);
444 if(x($_POST,'notify5'))
445 $notify += intval($_POST['notify5']);
446 if(x($_POST,'notify6'))
447 $notify += intval($_POST['notify6']);
448 if(x($_POST,'notify7'))
449 $notify += intval($_POST['notify7']);
450 if(x($_POST,'notify8'))
451 $notify += intval($_POST['notify8']);
453 $email_changed = false;
457 $name_change = false;
459 if($username != $a->user['username']) {
461 if(strlen($username) > 40)
462 $err .= t(' Please use a shorter name.');
463 if(strlen($username) < 3)
464 $err .= t(' Name too short.');
467 if($email != $a->user['email']) {
468 $email_changed = true;
469 // check for the correct password
470 $r = q("SELECT `password` FROM `user`WHERE `uid` = %d LIMIT 1", intval(local_user()));
471 $password = hash('whirlpool', $_POST['mpassword']);
472 if ($password != $r[0]['password']) {
473 $err .= t('Wrong Password') . EOL;
474 $email = $a->user['email'];
476 // check the email is valid
477 if(! valid_email($email))
478 $err .= t(' Not valid email.');
479 // ensure new email is not the admin mail
480 //if((x($a->config,'admin_email')) && (strcasecmp($email,$a->config['admin_email']) == 0)) {
481 if(x($a->config,'admin_email')) {
482 $adminlist = explode(",", str_replace(" ", "", strtolower($a->config['admin_email'])));
483 if (in_array(strtolower($email), $adminlist)) {
484 $err .= t(' Cannot change to that email.');
485 $email = $a->user['email'];
495 if($timezone != $a->user['timezone']) {
496 if(strlen($timezone))
497 date_default_timezone_set($timezone);
500 $str_group_allow = perms2str($_POST['group_allow']);
501 $str_contact_allow = perms2str($_POST['contact_allow']);
502 $str_group_deny = perms2str($_POST['group_deny']);
503 $str_contact_deny = perms2str($_POST['contact_deny']);
505 $openidserver = $a->user['openidserver'];
506 //$openid = normalise_openid($openid);
508 // If openid has changed or if there's an openid but no openidserver, try and discover it.
510 if($openid != $a->user['openid'] || (strlen($openid) && (! strlen($openidserver)))) {
512 if(strlen($tmp_str) && validate_url($tmp_str)) {
513 logger('updating openidserver');
514 require_once('library/openid.php');
515 $open_id_obj = new LightOpenID;
516 $open_id_obj->identity = $openid;
517 $openidserver = $open_id_obj->discover($open_id_obj->identity);
523 set_pconfig(local_user(),'expire','items', $expire_items);
524 set_pconfig(local_user(),'expire','notes', $expire_notes);
525 set_pconfig(local_user(),'expire','starred', $expire_starred);
526 set_pconfig(local_user(),'expire','photos', $expire_photos);
527 set_pconfig(local_user(),'expire','network_only', $expire_network_only);
529 set_pconfig(local_user(),'system','suggestme', $suggestme);
530 set_pconfig(local_user(),'system','post_newfriend', $post_newfriend);
531 set_pconfig(local_user(),'system','post_joingroup', $post_joingroup);
532 set_pconfig(local_user(),'system','post_profilechange', $post_profilechange);
534 set_pconfig(local_user(),'system','email_textonly', $email_textonly);
536 if($page_flags == PAGE_PRVGROUP) {
538 if((! $str_contact_allow) && (! $str_group_allow) && (! $str_contact_deny) && (! $str_group_deny)) {
540 info( t('Private forum has no privacy permissions. Using default privacy group.'). EOL);
541 $str_group_allow = '<' . $def_gid . '>';
544 notice( t('Private forum has no privacy permissions and no default privacy group.') . EOL);
550 $r = q("UPDATE `user` SET `username` = '%s', `email` = '%s',
551 `openid` = '%s', `timezone` = '%s',
552 `allow_cid` = '%s', `allow_gid` = '%s', `deny_cid` = '%s', `deny_gid` = '%s',
553 `notify-flags` = %d, `page-flags` = %d, `default-location` = '%s',
554 `allow_location` = %d, `maxreq` = %d, `expire` = %d, `openidserver` = '%s',
555 `def_gid` = %d, `blockwall` = %d, `hidewall` = %d, `blocktags` = %d,
556 `unkmail` = %d, `cntunkmail` = %d, `language` = '%s'
562 dbesc($str_contact_allow),
563 dbesc($str_group_allow),
564 dbesc($str_contact_deny),
565 dbesc($str_group_deny),
569 intval($allow_location),
572 dbesc($openidserver),
583 info( t('Settings updated.') . EOL);
585 // clear session language
586 unset($_SESSION['language']);
588 $r = q("UPDATE `profile`
593 WHERE `is-default` = 1 AND `uid` = %d",
596 intval($net_publish),
597 intval($hide_friends),
603 q("UPDATE `contact` SET `name` = '%s', `name-date` = '%s' WHERE `uid` = %d AND `self` = 1",
605 dbesc(datetime_convert()),
610 if(($old_visibility != $net_publish) || ($page_flags != $old_page_flags)) {
611 // Update global directory in background
612 $url = $_SESSION['my_url'];
613 if($url && strlen(get_config('system','directory')))
614 proc_run('php',"include/directory.php","$url");
619 require_once('include/profile_update.php');
622 //$_SESSION['theme'] = $theme;
623 if($email_changed && $a->config['register_policy'] == REGISTER_VERIFY) {
625 // FIXME - set to un-verified, blocked and redirect to logout
626 // Why? Are we verifying people or email addresses?
631 return; // NOTREACHED
635 function settings_content(&$a) {
638 nav_set_selected('settings');
641 #notice( t('Permission denied.') . EOL );
645 if(x($_SESSION,'submanage') && intval($_SESSION['submanage'])) {
646 notice( t('Permission denied.') . EOL );
652 if(($a->argc > 1) && ($a->argv[1] === 'oauth')) {
654 if(($a->argc > 2) && ($a->argv[2] === 'add')) {
655 $tpl = get_markup_template("settings_oauth_edit.tpl");
656 $o .= replace_macros($tpl, array(
657 '$form_security_token' => get_form_security_token("settings_oauth"),
658 '$title' => t('Add application'),
659 '$submit' => t('Save Settings'),
660 '$cancel' => t('Cancel'),
661 '$name' => array('name', t('Name'), '', ''),
662 '$key' => array('key', t('Consumer Key'), '', ''),
663 '$secret' => array('secret', t('Consumer Secret'), '', ''),
664 '$redirect' => array('redirect', t('Redirect'), '', ''),
665 '$icon' => array('icon', t('Icon url'), '', ''),
670 if(($a->argc > 3) && ($a->argv[2] === 'edit')) {
671 $r = q("SELECT * FROM clients WHERE client_id='%s' AND uid=%d",
676 notice(t("You can't edit this application."));
681 $tpl = get_markup_template("settings_oauth_edit.tpl");
682 $o .= replace_macros($tpl, array(
683 '$form_security_token' => get_form_security_token("settings_oauth"),
684 '$title' => t('Add application'),
685 '$submit' => t('Update'),
686 '$cancel' => t('Cancel'),
687 '$name' => array('name', t('Name'), $app['name'] , ''),
688 '$key' => array('key', t('Consumer Key'), $app['client_id'], ''),
689 '$secret' => array('secret', t('Consumer Secret'), $app['pw'], ''),
690 '$redirect' => array('redirect', t('Redirect'), $app['redirect_uri'], ''),
691 '$icon' => array('icon', t('Icon url'), $app['icon'], ''),
696 if(($a->argc > 3) && ($a->argv[2] === 'delete')) {
697 check_form_security_token_redirectOnErr('/settings/oauth', 'settings_oauth', 't');
699 $r = q("DELETE FROM clients WHERE client_id='%s' AND uid=%d",
702 goaway($a->get_baseurl(true)."/settings/oauth/");
707 $r = q("SELECT clients.*, tokens.id as oauth_token, (clients.uid=%d) AS my
709 LEFT JOIN tokens ON clients.client_id=tokens.client_id
710 WHERE clients.uid IN (%d,0)",
715 $tpl = get_markup_template("settings_oauth.tpl");
716 $o .= replace_macros($tpl, array(
717 '$form_security_token' => get_form_security_token("settings_oauth"),
718 '$baseurl' => $a->get_baseurl(true),
719 '$title' => t('Connected Apps'),
720 '$add' => t('Add application'),
721 '$edit' => t('Edit'),
722 '$delete' => t('Delete'),
723 '$consumerkey' => t('Client key starts with'),
724 '$noname' => t('No name'),
725 '$remove' => t('Remove authorization'),
732 if(($a->argc > 1) && ($a->argv[1] === 'addon')) {
733 $settings_addons = "";
735 $r = q("SELECT * FROM `hook` WHERE `hook` = 'plugin_settings' ");
737 $settings_addons = t('No Plugin settings configured');
739 call_hooks('plugin_settings', $settings_addons);
742 $tpl = get_markup_template("settings_addons.tpl");
743 $o .= replace_macros($tpl, array(
744 '$form_security_token' => get_form_security_token("settings_addon"),
745 '$title' => t('Plugin Settings'),
746 '$settings_addons' => $settings_addons
751 if(($a->argc > 1) && ($a->argv[1] === 'features')) {
754 $features = get_features();
755 foreach($features as $fname => $fdata) {
756 $arr[$fname] = array();
757 $arr[$fname][0] = $fdata[0];
758 foreach(array_slice($fdata,1) as $f) {
759 $arr[$fname][1][] = array('feature_' .$f[0],$f[1],((intval(feature_enabled(local_user(),$f[0]))) ? "1" : ''),$f[2],array(t('Off'),t('On')));
764 $tpl = get_markup_template("settings_features.tpl");
765 $o .= replace_macros($tpl, array(
766 '$form_security_token' => get_form_security_token("settings_features"),
767 '$title' => t('Additional Features'),
769 '$submit' => t('Save Settings'),
774 if(($a->argc > 1) && ($a->argv[1] === 'connectors')) {
776 $settings_connectors = '<span id="settings_general_inflated" class="settings-block fakelink" style="display: block;" onclick="openClose(\'settings_general_expanded\'); openClose(\'settings_general_inflated\');">';
777 $settings_connectors .= '<h3 class="connector">'. t('General Social Media Settings').'</h3>';
778 $settings_connectors .= '</span>';
779 $settings_connectors .= '<div id="settings_general_expanded" class="settings-block" style="display: none;">';
780 $settings_connectors .= '<span class="fakelink" onclick="openClose(\'settings_general_expanded\'); openClose(\'settings_general_inflated\');">';
781 $settings_connectors .= '<h3 class="connector">'. t('General Social Media Settings').'</h3>';
782 $settings_connectors .= '</span>';
784 $checked = ((get_pconfig(local_user(), 'system', 'no_intelligent_shortening')) ? ' checked="checked" ' : '');
786 $settings_connectors .= '<div id="no_intelligent_shortening" class="field checkbox">';
787 $settings_connectors .= '<label id="no_intelligent_shortening-label" for="shortening-checkbox">'. t('Disable intelligent shortening'). '</label>';
788 $settings_connectors .= '<input id="shortening-checkbox" type="checkbox" name="no_intelligent_shortening" value="1" ' . $checked . '/>';
789 $settings_connectors .= '<span class="field_help">'.t('Normally the system tries to find the best link to add to shortened posts. If this option is enabled then every shortened post will always point to the original friendica post.').'</span>';
790 $settings_connectors .= '</div>';
792 $checked = ((get_pconfig(local_user(), 'system', 'ostatus_autofriend')) ? ' checked="checked" ' : '');
794 $settings_connectors .= '<div id="snautofollow-wrapper" class="field checkbox">';
795 $settings_connectors .= '<label id="snautofollow-label" for="snautofollow-checkbox">'. t('Automatically follow any GNU Social (OStatus) followers/mentioners'). '</label>';
796 $settings_connectors .= '<input id="snautofollow-checkbox" type="checkbox" name="snautofollow" value="1" ' . $checked . '/>';
797 $settings_connectors .= '<span class="field_help">'.t('If you receive a message from an unknown OStatus user, this option decides what to do. If it is checked, a new contact will be created for every unknown user.').'</span>';
798 $settings_connectors .= '</div>';
800 $legacy_contact = get_pconfig(local_user(), 'ostatus', 'legacy_contact');
802 if ($legacy_contact != "")
803 $a->page['htmlhead'] = '<meta http-equiv="refresh" content="0; URL='.$a->get_baseurl().'/ostatus_subscribe?url='.urlencode($legacy_contact).'">';
805 $settings_connectors .= '<div id="legacy-contact-wrapper" class="field input">';
806 $settings_connectors .= '<label id="legacy-contact-label" for="snautofollow-checkbox">'. t('Your legacy GNU Social account'). '</label>';
807 $settings_connectors .= '<input id="legacy-contact-checkbox" name="legacy_contact" value="'.$legacy_contact.'"/>';
808 $settings_connectors .= '<span class="field_help">'.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.').'</span>';
809 $settings_connectors .= '</div>';
811 $settings_connectors .= '<p><a href="'.$a->get_baseurl().'/repair_ostatus">'.t("Repair OStatus subscriptions").'</a></p>';
813 $settings_connectors .= '<div class="settings-submit-wrapper" ><input type="submit" name="general-submit" class="settings-submit" value="' . t('Save Settings') . '" /></div>';
815 $settings_connectors .= '</div><div class="clear"></div>';
817 call_hooks('connector_settings', $settings_connectors);
819 if (is_site_admin()) {
820 $diasp_enabled = sprintf( t('Built-in support for %s connectivity is %s'), t('Diaspora'), ((get_config('system','diaspora_enabled')) ? t('enabled') : t('disabled')));
821 $ostat_enabled = sprintf( t('Built-in support for %s connectivity is %s'), t('GNU Social (OStatus)'), ((get_config('system','ostatus_disabled')) ? t('disabled') : t('enabled')));
827 $mail_disabled = ((function_exists('imap_open') && (! get_config('system','imap_disabled'))) ? 0 : 1);
828 if(get_config('system','dfrn_only'))
831 if(! $mail_disabled) {
832 $r = q("SELECT * FROM `mailacct` WHERE `uid` = %d LIMIT 1",
840 $mail_server = ((count($r)) ? $r[0]['server'] : '');
841 $mail_port = ((count($r) && intval($r[0]['port'])) ? intval($r[0]['port']) : '');
842 $mail_ssl = ((count($r)) ? $r[0]['ssltype'] : '');
843 $mail_user = ((count($r)) ? $r[0]['user'] : '');
844 $mail_replyto = ((count($r)) ? $r[0]['reply_to'] : '');
845 $mail_pubmail = ((count($r)) ? $r[0]['pubmail'] : 0);
846 $mail_action = ((count($r)) ? $r[0]['action'] : 0);
847 $mail_movetofolder = ((count($r)) ? $r[0]['movetofolder'] : '');
848 $mail_chk = ((count($r)) ? $r[0]['last_check'] : '0000-00-00 00:00:00');
851 $tpl = get_markup_template("settings_connectors.tpl");
853 if(! service_class_allows(local_user(),'email_connect')) {
854 $mail_disabled_message = upgrade_bool_message();
857 $mail_disabled_message = (($mail_disabled) ? t('Email access is disabled on this site.') : '');
861 $o .= replace_macros($tpl, array(
862 '$form_security_token' => get_form_security_token("settings_connectors"),
864 '$title' => t('Social Networks'),
866 '$diasp_enabled' => $diasp_enabled,
867 '$ostat_enabled' => $ostat_enabled,
869 '$h_imap' => t('Email/Mailbox Setup'),
870 '$imap_desc' => t("If you wish to communicate with email contacts using this service \x28optional\x29, please specify how to connect to your mailbox."),
871 '$imap_lastcheck' => array('imap_lastcheck', t('Last successful email check:'), $mail_chk,''),
872 '$mail_disabled' => $mail_disabled_message,
873 '$mail_server' => array('mail_server', t('IMAP server name:'), $mail_server, ''),
874 '$mail_port' => array('mail_port', t('IMAP port:'), $mail_port, ''),
875 '$mail_ssl' => array('mail_ssl', t('Security:'), strtoupper($mail_ssl), '', array( 'notls'=>t('None'), 'TLS'=>'TLS', 'SSL'=>'SSL')),
876 '$mail_user' => array('mail_user', t('Email login name:'), $mail_user, ''),
877 '$mail_pass' => array('mail_pass', t('Email password:'), '', ''),
878 '$mail_replyto' => array('mail_replyto', t('Reply-to address:'), $mail_replyto, 'Optional'),
879 '$mail_pubmail' => array('mail_pubmail', t('Send public posts to all email contacts:'), $mail_pubmail, ''),
880 '$mail_action' => array('mail_action', t('Action after import:'), $mail_action, '', array(0=>t('None'), /*1=>t('Delete'),*/ 2=>t('Mark as seen'), 3=>t('Move to folder'))),
881 '$mail_movetofolder' => array('mail_movetofolder', t('Move to folder:'), $mail_movetofolder, ''),
882 '$submit' => t('Save Settings'),
884 '$settings_connectors' => $settings_connectors
887 call_hooks('display_settings', $o);
894 if(($a->argc > 1) && ($a->argv[1] === 'display')) {
895 $default_theme = get_config('system','theme');
897 $default_theme = 'default';
898 $default_mobile_theme = get_config('system','mobile-theme');
899 if(! $mobile_default_theme)
900 $mobile_default_theme = 'none';
902 $allowed_themes_str = get_config('system','allowed_themes');
903 $allowed_themes_raw = explode(',',$allowed_themes_str);
904 $allowed_themes = array();
905 if(count($allowed_themes_raw))
906 foreach($allowed_themes_raw as $x)
907 if(strlen(trim($x)) && is_dir("view/theme/$x"))
908 $allowed_themes[] = trim($x);
912 $mobile_themes = array("---" => t('No special theme for mobile devices'));
913 $files = glob('view/theme/*'); /* */
914 if($allowed_themes) {
915 foreach($allowed_themes as $th) {
917 $is_experimental = file_exists('view/theme/' . $th . '/experimental');
918 $unsupported = file_exists('view/theme/' . $th . '/unsupported');
919 $is_mobile = file_exists('view/theme/' . $th . '/mobile');
920 if (!$is_experimental or ($is_experimental && (get_config('experimentals','exp_themes')==1 or get_config('experimentals','exp_themes')===false))){
921 $theme_name = (($is_experimental) ? sprintf("%s - \x28Experimental\x29", $f) : $f);
923 $mobile_themes[$f]=$theme_name;
926 $themes[$f]=$theme_name;
931 $theme_selected = (!x($_SESSION,'theme')? $default_theme : $_SESSION['theme']);
932 $mobile_theme_selected = (!x($_SESSION,'mobile-theme')? $default_mobile_theme : $_SESSION['mobile-theme']);
934 $browser_update = intval(get_pconfig(local_user(), 'system','update_interval'));
935 if (intval($browser_update) != -1)
936 $browser_update = (($browser_update == 0) ? 40 : $browser_update / 1000); // default if not set: 40 seconds
938 $itemspage_network = intval(get_pconfig(local_user(), 'system','itemspage_network'));
939 $itemspage_network = (($itemspage_network > 0 && $itemspage_network < 101) ? $itemspage_network : 40); // default if not set: 40 items
940 $itemspage_mobile_network = intval(get_pconfig(local_user(), 'system','itemspage_mobile_network'));
941 $itemspage_mobile_network = (($itemspage_mobile_network > 0 && $itemspage_mobile_network < 101) ? $itemspage_mobile_network : 20); // default if not set: 20 items
943 $nosmile = get_pconfig(local_user(),'system','no_smilies');
944 $nosmile = (($nosmile===false)? '0': $nosmile); // default if not set: 0
946 $first_day_of_week = get_pconfig(local_user(),'system','first_day_of_week');
947 $first_day_of_week = (($first_day_of_week===false)? '0': $first_day_of_week); // default if not set: 0
948 $weekdays = array(0 => t("Sunday"), 1 => t("Monday"));
950 $noinfo = get_pconfig(local_user(),'system','ignore_info');
951 $noinfo = (($noinfo===false)? '0': $noinfo); // default if not set: 0
953 $infinite_scroll = get_pconfig(local_user(),'system','infinite_scroll');
954 $infinite_scroll = (($infinite_scroll===false)? '0': $infinite_scroll); // default if not set: 0
956 $no_auto_update = get_pconfig(local_user(),'system','no_auto_update');
957 $no_auto_update = (($no_auto_update===false)? '0': $no_auto_update); // default if not set: 0
960 if( ($themeconfigfile = get_theme_config_file($theme_selected)) != null){
961 require_once($themeconfigfile);
962 $theme_config = theme_content($a);
965 $tpl = get_markup_template("settings_display.tpl");
966 $o = replace_macros($tpl, array(
967 '$ptitle' => t('Display Settings'),
968 '$form_security_token' => get_form_security_token("settings_display"),
969 '$submit' => t('Save Settings'),
970 '$baseurl' => $a->get_baseurl(true),
971 '$uid' => local_user(),
973 '$theme' => array('theme', t('Display Theme:'), $theme_selected, '', $themes, true),
974 '$mobile_theme' => array('mobile_theme', t('Mobile Theme:'), $mobile_theme_selected, '', $mobile_themes, false),
975 '$ajaxint' => array('browser_update', t("Update browser every xx seconds"), $browser_update, t('Minimum of 10 seconds. Enter -1 to disable it.')),
976 '$itemspage_network' => array('itemspage_network', t("Number of items to display per page:"), $itemspage_network, t('Maximum of 100 items')),
977 '$itemspage_mobile_network' => array('itemspage_mobile_network', t("Number of items to display per page when viewed from mobile device:"), $itemspage_mobile_network, t('Maximum of 100 items')),
978 '$nosmile' => array('nosmile', t("Don't show emoticons"), $nosmile, ''),
979 '$calendar_title' => t('Calendar'),
980 '$first_day_of_week' => array('first_day_of_week', t('Beginning of week:'), $first_day_of_week, '', $weekdays, false),
981 '$noinfo' => array('noinfo', t("Don't show notices"), $noinfo, ''),
982 '$infinite_scroll' => array('infinite_scroll', t("Infinite scroll"), $infinite_scroll, ''),
983 '$no_auto_update' => array('no_auto_update', t("Automatic updates only at the top of the network page"), $no_auto_update, 'When disabled, the network page is updated all the time, which could be confusing while reading.'),
985 'stitle' => t('Theme settings'),
986 '$theme_config' => $theme_config,
989 $tpl = get_markup_template("settings_display_end.tpl");
990 $a->page['end'] .= replace_macros($tpl, array(
991 '$theme' => array('theme', t('Display Theme:'), $theme_selected, '', $themes)
1002 require_once('include/acl_selectors.php');
1004 $p = q("SELECT * FROM `profile` WHERE `is-default` = 1 AND `uid` = %d LIMIT 1",
1005 intval(local_user())
1010 $username = $a->user['username'];
1011 $email = $a->user['email'];
1012 $nickname = $a->user['nickname'];
1013 $timezone = $a->user['timezone'];
1014 $language = $a->user['language'];
1015 $notify = $a->user['notify-flags'];
1016 $defloc = $a->user['default-location'];
1017 $openid = $a->user['openid'];
1018 $maxreq = $a->user['maxreq'];
1019 $expire = ((intval($a->user['expire'])) ? $a->user['expire'] : '');
1020 $blockwall = $a->user['blockwall'];
1021 $blocktags = $a->user['blocktags'];
1022 $unkmail = $a->user['unkmail'];
1023 $cntunkmail = $a->user['cntunkmail'];
1025 $expire_items = get_pconfig(local_user(), 'expire','items');
1026 $expire_items = (($expire_items===false)? '1' : $expire_items); // default if not set: 1
1028 $expire_notes = get_pconfig(local_user(), 'expire','notes');
1029 $expire_notes = (($expire_notes===false)? '1' : $expire_notes); // default if not set: 1
1031 $expire_starred = get_pconfig(local_user(), 'expire','starred');
1032 $expire_starred = (($expire_starred===false)? '1' : $expire_starred); // default if not set: 1
1034 $expire_photos = get_pconfig(local_user(), 'expire','photos');
1035 $expire_photos = (($expire_photos===false)? '0' : $expire_photos); // default if not set: 0
1037 $expire_network_only = get_pconfig(local_user(), 'expire','network_only');
1038 $expire_network_only = (($expire_network_only===false)? '0' : $expire_network_only); // default if not set: 0
1041 $suggestme = get_pconfig(local_user(), 'system','suggestme');
1042 $suggestme = (($suggestme===false)? '0': $suggestme); // default if not set: 0
1044 $post_newfriend = get_pconfig(local_user(), 'system','post_newfriend');
1045 $post_newfriend = (($post_newfriend===false)? '0': $post_newfriend); // default if not set: 0
1047 $post_joingroup = get_pconfig(local_user(), 'system','post_joingroup');
1048 $post_joingroup = (($post_joingroup===false)? '0': $post_joingroup); // default if not set: 0
1050 $post_profilechange = get_pconfig(local_user(), 'system','post_profilechange');
1051 $post_profilechange = (($post_profilechange===false)? '0': $post_profilechange); // default if not set: 0
1055 if(! strlen($a->user['timezone']))
1056 $timezone = date_default_timezone_get();
1060 $pageset_tpl = get_markup_template('pagetypes.tpl');
1061 $pagetype = replace_macros($pageset_tpl, array(
1062 '$user' => t("User Types"),
1063 '$community' => t("Community Types"),
1064 '$page_normal' => array('page-flags', t('Normal Account Page'), PAGE_NORMAL,
1065 t('This account is a normal personal profile'),
1066 ($a->user['page-flags'] == PAGE_NORMAL)),
1068 '$page_soapbox' => array('page-flags', t('Soapbox Page'), PAGE_SOAPBOX,
1069 t('Automatically approve all connection/friend requests as read-only fans'),
1070 ($a->user['page-flags'] == PAGE_SOAPBOX)),
1072 '$page_community' => array('page-flags', t('Community Forum/Celebrity Account'), PAGE_COMMUNITY,
1073 t('Automatically approve all connection/friend requests as read-write fans'),
1074 ($a->user['page-flags'] == PAGE_COMMUNITY)),
1076 '$page_freelove' => array('page-flags', t('Automatic Friend Page'), PAGE_FREELOVE,
1077 t('Automatically approve all connection/friend requests as friends'),
1078 ($a->user['page-flags'] == PAGE_FREELOVE)),
1080 '$page_prvgroup' => array('page-flags', t('Private Forum [Experimental]'), PAGE_PRVGROUP,
1081 t('Private forum - approved members only'),
1082 ($a->user['page-flags'] == PAGE_PRVGROUP)),
1087 $noid = get_config('system','no_openid');
1090 $openid_field = false;
1093 $openid_field = array('openid_url', t('OpenID:'),$openid, t("\x28Optional\x29 Allow this OpenID to login to this account."), "", "", "url");
1097 $opt_tpl = get_markup_template("field_yesno.tpl");
1098 if(get_config('system','publish_all')) {
1099 $profile_in_dir = '<input type="hidden" name="profile_in_directory" value="1" />';
1102 $profile_in_dir = replace_macros($opt_tpl,array(
1103 '$field' => array('profile_in_directory', t('Publish your default profile in your local site directory?'), $profile['publish'], '', array(t('No'),t('Yes'))),
1107 if(strlen(get_config('system','directory'))) {
1108 $profile_in_net_dir = replace_macros($opt_tpl,array(
1109 '$field' => array('profile_in_netdirectory', t('Publish your default profile in the global social directory?'), $profile['net-publish'], '', array(t('No'),t('Yes'))),
1113 $profile_in_net_dir = '';
1116 $hide_friends = replace_macros($opt_tpl,array(
1117 '$field' => array('hide-friends', t('Hide your contact/friend list from viewers of your default profile?'), $profile['hide-friends'], '', array(t('No'),t('Yes'))),
1120 $hide_wall = replace_macros($opt_tpl,array(
1121 '$field' => array('hidewall', t('Hide your profile details from unknown viewers?'), $a->user['hidewall'], t("If enabled, posting public messages to Diaspora and other networks isn't possible."), array(t('No'),t('Yes'))),
1125 $blockwall = replace_macros($opt_tpl,array(
1126 '$field' => array('blockwall', t('Allow friends to post to your profile page?'), (intval($a->user['blockwall']) ? '0' : '1'), '', array(t('No'),t('Yes'))),
1131 $blocktags = replace_macros($opt_tpl,array(
1132 '$field' => array('blocktags', t('Allow friends to tag your posts?'), (intval($a->user['blocktags']) ? '0' : '1'), '', array(t('No'),t('Yes'))),
1137 $suggestme = replace_macros($opt_tpl,array(
1138 '$field' => array('suggestme', t('Allow us to suggest you as a potential friend to new members?'), $suggestme, '', array(t('No'),t('Yes'))),
1143 $unkmail = replace_macros($opt_tpl,array(
1144 '$field' => array('unkmail', t('Permit unknown people to send you private mail?'), $unkmail, '', array(t('No'),t('Yes'))),
1148 $invisible = (((! $profile['publish']) && (! $profile['net-publish']))
1152 info( t('Profile is <strong>not published</strong>.') . EOL );
1155 //$subdir = ((strlen($a->get_path())) ? '<br />' . t('or') . ' ' . 'profile/' . $nickname : '');
1157 $tpl_addr = get_markup_template("settings_nick_set.tpl");
1159 $prof_addr = replace_macros($tpl_addr,array(
1160 '$desc' => sprintf(t("Your Identity Address is <strong>'%s'</strong> or '%s'."), $nickname.'@'.$a->get_hostname().$a->get_path(), $a->get_baseurl().'/profile/'.$nickname),
1161 '$basepath' => $a->get_hostname()
1164 $stpl = get_markup_template('settings.tpl');
1166 $expire_arr = array(
1167 'days' => array('expire', t("Automatically expire posts after this many days:"), $expire, t('If empty, posts will not expire. Expired posts will be deleted')),
1168 'advanced' => t('Advanced expiration settings'),
1169 'label' => t('Advanced Expiration'),
1170 'items' => array('expire_items', t("Expire posts:"), $expire_items, '', array(t('No'),t('Yes'))),
1171 'notes' => array('expire_notes', t("Expire personal notes:"), $expire_notes, '', array(t('No'),t('Yes'))),
1172 'starred' => array('expire_starred', t("Expire starred posts:"), $expire_starred, '', array(t('No'),t('Yes'))),
1173 'photos' => array('expire_photos', t("Expire photos:"), $expire_photos, '', array(t('No'),t('Yes'))),
1174 'network_only' => array('expire_network_only', t("Only expire posts by others:"), $expire_network_only, '', array(t('No'),t('Yes'))),
1177 require_once('include/group.php');
1178 $group_select = mini_group_select(local_user(),$a->user['def_gid']);
1181 // Private/public post links for the non-JS ACL form
1183 if($_REQUEST['public'])
1186 $query_str = $a->query_string;
1187 if(strpos($query_str, 'public=1') !== false)
1188 $query_str = str_replace(array('?public=1', '&public=1'), array('', ''), $query_str);
1190 // I think $a->query_string may never have ? in it, but I could be wrong
1191 // It looks like it's from the index.php?q=[etc] rewrite that the web
1192 // server does, which converts any ? to &, e.g. suggest&ignore=61 for suggest?ignore=61
1193 if(strpos($query_str, '?') === false)
1194 $public_post_link = '?public=1';
1196 $public_post_link = '&public=1';
1198 /* Installed langs */
1199 $lang_choices = get_avaiable_languages();
1201 $o .= replace_macros($stpl, array(
1202 '$ptitle' => t('Account Settings'),
1204 '$submit' => t('Save Settings'),
1205 '$baseurl' => $a->get_baseurl(true),
1206 '$uid' => local_user(),
1207 '$form_security_token' => get_form_security_token("settings"),
1208 '$nickname_block' => $prof_addr,
1210 '$h_pass' => t('Password Settings'),
1211 '$password1'=> array('password', t('New Password:'), '', ''),
1212 '$password2'=> array('confirm', t('Confirm:'), '', t('Leave password fields blank unless changing')),
1213 '$password3'=> array('opassword', t('Current Password:'), '', t('Your current password to confirm the changes')),
1214 '$password4'=> array('mpassword', t('Password:'), '', t('Your current password to confirm the changes')),
1215 '$oid_enable' => (! get_config('system','no_openid')),
1216 '$openid' => $openid_field,
1218 '$h_basic' => t('Basic Settings'),
1219 '$username' => array('username', t('Full Name:'), $username,''),
1220 '$email' => array('email', t('Email Address:'), $email, '', '', '', 'email'),
1221 '$timezone' => array('timezone_select' , t('Your Timezone:'), select_timezone($timezone), ''),
1222 '$language' => array('language', t('Your Language:'), $language, t('Set the language we use to show you friendica interface and to send you emails'), $lang_choices),
1223 '$defloc' => array('defloc', t('Default Post Location:'), $defloc, ''),
1224 '$allowloc' => array('allow_location', t('Use Browser Location:'), ($a->user['allow_location'] == 1), ''),
1227 '$h_prv' => t('Security and Privacy Settings'),
1229 '$maxreq' => array('maxreq', t('Maximum Friend Requests/Day:'), $maxreq ,t("\x28to prevent spam abuse\x29")),
1230 '$permissions' => t('Default Post Permissions'),
1231 '$permdesc' => t("\x28click to open/close\x29"),
1232 '$visibility' => $profile['net-publish'],
1233 '$aclselect' => populate_acl($a->user),
1234 '$suggestme' => $suggestme,
1235 '$blockwall'=> $blockwall, // array('blockwall', t('Allow friends to post to your profile page:'), !$blockwall, ''),
1236 '$blocktags'=> $blocktags, // array('blocktags', t('Allow friends to tag your posts:'), !$blocktags, ''),
1238 // ACL permissions box
1239 '$acl_data' => construct_acl_data($a, $a->user), // For non-Javascript ACL selector
1240 '$group_perms' => t('Show to Groups'),
1241 '$contact_perms' => t('Show to Contacts'),
1242 '$private' => t('Default Private Post'),
1243 '$public' => t('Default Public Post'),
1244 '$is_private' => $private_post,
1245 '$return_path' => $query_str,
1246 '$public_link' => $public_post_link,
1247 '$settings_perms' => t('Default Permissions for New Posts'),
1249 '$group_select' => $group_select,
1252 '$expire' => $expire_arr,
1254 '$profile_in_dir' => $profile_in_dir,
1255 '$profile_in_net_dir' => $profile_in_net_dir,
1256 '$hide_friends' => $hide_friends,
1257 '$hide_wall' => $hide_wall,
1258 '$unkmail' => $unkmail,
1259 '$cntunkmail' => array('cntunkmail', t('Maximum private messages per day from unknown people:'), $cntunkmail ,t("\x28to prevent spam abuse\x29")),
1262 '$h_not' => t('Notification Settings'),
1263 '$activity_options' => t('By default post a status message when:'),
1264 '$post_newfriend' => array('post_newfriend', t('accepting a friend request'), $post_newfriend, ''),
1265 '$post_joingroup' => array('post_joingroup', t('joining a forum/community'), $post_joingroup, ''),
1266 '$post_profilechange' => array('post_profilechange', t('making an <em>interesting</em> profile change'), $post_profilechange, ''),
1267 '$lbl_not' => t('Send a notification email when:'),
1268 '$notify1' => array('notify1', t('You receive an introduction'), ($notify & NOTIFY_INTRO), NOTIFY_INTRO, ''),
1269 '$notify2' => array('notify2', t('Your introductions are confirmed'), ($notify & NOTIFY_CONFIRM), NOTIFY_CONFIRM, ''),
1270 '$notify3' => array('notify3', t('Someone writes on your profile wall'), ($notify & NOTIFY_WALL), NOTIFY_WALL, ''),
1271 '$notify4' => array('notify4', t('Someone writes a followup comment'), ($notify & NOTIFY_COMMENT), NOTIFY_COMMENT, ''),
1272 '$notify5' => array('notify5', t('You receive a private message'), ($notify & NOTIFY_MAIL), NOTIFY_MAIL, ''),
1273 '$notify6' => array('notify6', t('You receive a friend suggestion'), ($notify & NOTIFY_SUGGEST), NOTIFY_SUGGEST, ''),
1274 '$notify7' => array('notify7', t('You are tagged in a post'), ($notify & NOTIFY_TAGSELF), NOTIFY_TAGSELF, ''),
1275 '$notify8' => array('notify8', t('You are poked/prodded/etc. in a post'), ($notify & NOTIFY_POKE), NOTIFY_POKE, ''),
1277 '$desktop_notifications' => array('desktop_notifications', t('Activate desktop notifications') , false, t('Show desktop popup on new notifications')),
1279 '$email_textonly' => array('email_textonly', t('Text-only notification emails'),
1280 get_pconfig(local_user(),'system','email_textonly'),
1281 t('Send text only notification emails, without the html part')),
1283 '$h_advn' => t('Advanced Account/Page Type Settings'),
1284 '$h_descadvn' => t('Change the behaviour of this account for special situations'),
1285 '$pagetype' => $pagetype,
1287 '$relocate' => t('Relocate'),
1288 '$relocate_text' => t("If you have moved this profile from another server, and some of your contacts don't receive your updates, try pushing this button."),
1289 '$relocate_button' => t("Resend relocate message to contacts"),
1293 call_hooks('settings_form',$o);
1295 $o .= '</form>' . "\r\n";