]> git.mxchange.org Git - friendica.git/blob - mod/settings.php
stuff
[friendica.git] / mod / settings.php
1 <?php
2
3
4 function settings_init(&$a) {
5         if(local_user()) {
6                 profile_load($a,$a->user['nickname']);
7         }
8
9         $a->page['htmlhead'] .= "<script> var ispublic = '" . t('everybody') . "';" ;
10
11         $a->page['htmlhead'] .= <<< EOT
12
13         $(document).ready(function() {
14
15                 $('#contact_allow, #contact_deny, #group_allow, #group_deny').change(function() {
16                         var selstr;
17                         $('#contact_allow option:selected, #contact_deny option:selected, #group_allow option:selected, #group_deny option:selected').each( function() {
18                                 selstr = $(this).text();
19                                 $('#jot-perms-icon').removeClass('unlock').addClass('lock');
20                                 $('#jot-public').hide();
21                         });
22                         if(selstr == null) { 
23                                 $('#jot-perms-icon').removeClass('lock').addClass('unlock');
24                                 $('#jot-public').show();
25                         }
26
27                 }).trigger('change');
28
29         });
30
31         </script>
32 EOT;
33
34
35 }
36
37
38 function settings_post(&$a) {
39
40         if(! local_user()) {
41                 notice( t('Permission denied.') . EOL);
42                 return;
43         }
44
45         if(count($a->user) && x($a->user,'uid') && $a->user['uid'] != local_user()) {
46                 notice( t('Permission denied.') . EOL);
47                 return;
48         }
49
50         if(($a->argc > 1) && ($a->argv[1] == 'addon')) {
51                 call_hooks('plugin_settings_post', $_POST);
52                 return;
53         }
54
55         if(($a->argc > 1) && ($a->argv[1] == 'connectors')) {
56
57                 if(x($_POST['imap-submit'])) {
58                         $mail_server      = ((x($_POST,'mail_server')) ? $_POST['mail_server'] : '');
59                         $mail_port        = ((x($_POST,'mail_port')) ? $_POST['mail_port'] : '');
60                         $mail_ssl         = ((x($_POST,'mail_ssl')) ? strtolower(trim($_POST['mail_ssl'])) : '');
61                         $mail_user        = ((x($_POST,'mail_user')) ? $_POST['mail_user'] : '');
62                         $mail_pass        = ((x($_POST,'mail_pass')) ? trim($_POST['mail_pass']) : '');
63                         $mail_replyto     = ((x($_POST,'mail_replyto')) ? $_POST['mail_replyto'] : '');
64                         $mail_pubmail     = ((x($_POST,'mail_pubmail')) ? $_POST['mail_pubmail'] : '');
65
66
67                         $mail_disabled = ((function_exists('imap_open') && (! get_config('system','imap_disabled'))) ? 0 : 1);
68                         if(get_config('system','dfrn_only'))
69                                 $mail_disabled = 1;
70
71                         if(! $mail_disabled) {
72                                 $failed = false;
73                                 $r = q("SELECT * FROM `mailacct` WHERE `uid` = %d LIMIT 1",
74                                         intval(local_user())
75                                 );
76                                 if(! count($r)) {
77                                         q("INSERT INTO `mailacct` (`uid`) VALUES (%d)",
78                                                 intval(local_user())
79                                         );
80                                 }
81                                 if(strlen($mail_pass)) {
82                                         $pass = '';
83                                         openssl_public_encrypt($mail_pass,$pass,$a->user['pubkey']);
84                                         q("UPDATE `mailacct` SET `pass` = '%s' WHERE `uid` = %d LIMIT 1",
85                                                 dbesc(bin2hex($pass)),
86                                                 intval(local_user())
87                                         );
88                                 }
89                                 $r = q("UPDATE `mailacct` SET `server` = '%s', `port` = %d, `ssltype` = '%s', `user` = '%s',
90                                         `mailbox` = 'INBOX', `reply_to` = '%s', `pubmail` = %d WHERE `uid` = %d LIMIT 1",
91                                         dbesc($mail_server),
92                                         intval($mail_port),
93                                         dbesc($mail_ssl),
94                                         dbesc($mail_user),
95                                         dbesc($mail_replyto),
96                                         intval($mail_pubmail),
97                                         intval(local_user())
98                                 );
99                                 $r = q("SELECT * FROM `mailacct` WHERE `uid` = %d LIMIT 1",
100                                         intval(local_user())
101                                 );
102                                 if(count($r)) {
103                                         $eacct = $r[0];
104                                         require_once('include/email.php');
105                                         $mb = construct_mailbox_name($eacct);
106                                         if(strlen($eacct['server'])) {
107                                                 $dcrpass = '';
108                                                 openssl_private_decrypt(hex2bin($eacct['pass']),$dcrpass,$a->user['prvkey']);
109                                                 $mbox = email_connect($mb,$mail_user,$dcrpass);
110                                                 unset($dcrpass);
111                                                 if(! $mbox) {
112                                                         $failed = true;
113                                                         notice( t('Failed to connect with email account using the settings provided.') . EOL);
114                                                 }
115                                         }
116                                 }
117                                 if(! $failed)
118                                         info( t('Email settings updated.') . EOL);
119                         }
120                 }
121
122                 call_hooks('connector_settings_post', $_POST);
123                 return;
124         }
125
126
127         call_hooks('settings_post', $_POST);
128
129         if((x($_POST,'npassword')) || (x($_POST,'confirm'))) {
130
131                 $newpass = $_POST['npassword'];
132                 $confirm = $_POST['confirm'];
133
134                 $err = false;
135                 if($newpass != $confirm ) {
136                         notice( t('Passwords do not match. Password unchanged.') . EOL);
137                         $err = true;
138                 }
139
140                 if((! x($newpass)) || (! x($confirm))) {
141                         notice( t('Empty passwords are not allowed. Password unchanged.') . EOL);
142                         $err = true;
143                 }
144
145                 if(! $err) {
146                         $password = hash('whirlpool',$newpass);
147                         $r = q("UPDATE `user` SET `password` = '%s' WHERE `uid` = %d LIMIT 1",
148                                 dbesc($password),
149                                 intval(local_user())
150                         );
151                         if($r)
152                                 info( t('Password changed.') . EOL);
153                         else
154                                 notice( t('Password update failed. Please try again.') . EOL);
155                 }
156         }
157
158         $theme            = ((x($_POST,'theme'))      ? notags(trim($_POST['theme']))        : '');
159         $username         = ((x($_POST,'username'))   ? notags(trim($_POST['username']))     : '');
160         $email            = ((x($_POST,'email'))      ? notags(trim($_POST['email']))        : '');
161         $timezone         = ((x($_POST,'timezone'))   ? notags(trim($_POST['timezone']))     : '');
162         $defloc           = ((x($_POST,'defloc'))     ? notags(trim($_POST['defloc']))       : '');
163         $openid           = ((x($_POST,'openid_url')) ? notags(trim($_POST['openid_url']))   : '');
164         $maxreq           = ((x($_POST,'maxreq'))     ? intval($_POST['maxreq'])             : 0);
165         $expire           = ((x($_POST,'expire'))     ? intval($_POST['expire'])             : 0);
166
167         $allow_location   = (((x($_POST,'allow_location')) && (intval($_POST['allow_location']) == 1)) ? 1: 0);
168         $publish          = (((x($_POST,'profile_in_directory')) && (intval($_POST['profile_in_directory']) == 1)) ? 1: 0);
169         $net_publish      = (((x($_POST,'profile_in_netdirectory')) && (intval($_POST['profile_in_netdirectory']) == 1)) ? 1: 0);
170         $old_visibility   = (((x($_POST,'visibility')) && (intval($_POST['visibility']) == 1)) ? 1 : 0);
171         $page_flags       = (((x($_POST,'page-flags')) && (intval($_POST['page-flags']))) ? intval($_POST['page-flags']) : 0);
172         $blockwall        = (((x($_POST,'blockwall')) && (intval($_POST['blockwall']) == 1)) ? 0: 1); // this setting is inverted!
173
174         $hide_friends = (($_POST['hide-friends'] == 1) ? 1: 0);
175         $hidewall = (($_POST['hidewall'] == 1) ? 1: 0);
176
177
178         $notify = 0;
179
180         if(x($_POST,'notify1'))
181                 $notify += intval($_POST['notify1']);
182         if(x($_POST,'notify2'))
183                 $notify += intval($_POST['notify2']);
184         if(x($_POST,'notify3'))
185                 $notify += intval($_POST['notify3']);
186         if(x($_POST,'notify4'))
187                 $notify += intval($_POST['notify4']);
188         if(x($_POST,'notify5'))
189                 $notify += intval($_POST['notify5']);
190
191         $email_changed = false;
192
193         $err = '';
194
195         $name_change = false;
196
197         if($username != $a->user['username']) {
198                 $name_change = true;
199                 if(strlen($username) > 40)
200                         $err .= t(' Please use a shorter name.');
201                 if(strlen($username) < 3)
202                         $err .= t(' Name too short.');
203         }
204
205         if($email != $a->user['email']) {
206                 $email_changed = true;
207         if(! valid_email($email))
208                         $err .= t(' Not valid email.');
209                 if((x($a->config,'admin_email')) && (strcasecmp($email,$a->config['admin_email']) == 0)) {
210                         $err .= t(' Cannot change to that email.');
211                         $email = $a->user['email'];
212                 }
213         }
214
215         if(strlen($err)) {
216                 notice($err . EOL);
217                 return;
218         }
219
220         if($timezone != $a->user['timezone']) {
221                 if(strlen($timezone))
222                         date_default_timezone_set($timezone);
223         }
224
225         $str_group_allow   = perms2str($_POST['group_allow']);
226         $str_contact_allow = perms2str($_POST['contact_allow']);
227         $str_group_deny    = perms2str($_POST['group_deny']);
228         $str_contact_deny  = perms2str($_POST['contact_deny']);
229
230         $openidserver = $a->user['openidserver'];
231
232         // If openid has changed or if there's an openid but no openidserver, try and discover it.
233
234         if($openid != $a->user['openid'] || (strlen($openid) && (! strlen($openidserver)))) {
235                 $tmp_str = $openid;
236                 if(strlen($tmp_str) && validate_url($tmp_str)) {
237                         logger('updating openidserver');
238                         require_once('library/openid.php');
239                         $open_id_obj = new LightOpenID;
240                         $open_id_obj->identity = $openid;
241                         $openidserver = $open_id_obj->discover($open_id_obj->identity);
242                 }
243                 else
244                         $openidserver = '';
245         }
246
247         $r = q("UPDATE `user` SET `username` = '%s', `email` = '%s', `openid` = '%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', `maxreq` = %d, `expire` = %d, `openidserver` = '%s', `blockwall` = %d, `hidewall` = %d  WHERE `uid` = %d LIMIT 1",
248                         dbesc($username),
249                         dbesc($email),
250                         dbesc($openid),
251                         dbesc($timezone),
252                         dbesc($str_contact_allow),
253                         dbesc($str_group_allow),
254                         dbesc($str_contact_deny),
255                         dbesc($str_group_deny),
256                         intval($notify),
257                         intval($page_flags),
258                         dbesc($defloc),
259                         intval($allow_location),
260                         dbesc($theme),
261                         intval($maxreq),
262                         intval($expire),
263                         dbesc($openidserver),
264                         intval($blockwall),
265                         intval($hidewall),
266                         intval(local_user())
267         );
268         if($r)
269                 info( t('Settings updated.') . EOL);
270
271         $r = q("UPDATE `profile` 
272                 SET `publish` = %d, 
273                 `net-publish` = %d,
274                 `hide-friends` = %d
275                 WHERE `is-default` = 1 AND `uid` = %d LIMIT 1",
276                 intval($publish),
277                 intval($net_publish),
278                 intval($hide_friends),
279                 intval(local_user())
280         );
281
282
283         if($name_change) {
284                 q("UPDATE `contact` SET `name` = '%s', `name-date` = '%s' WHERE `uid` = %d AND `self` = 1 LIMIT 1",
285                         dbesc($username),
286                         dbesc(datetime_convert()),
287                         intval(local_user())
288                 );
289         }               
290
291         if($old_visibility != $net_publish) {
292                 // Update global directory in background
293                 $url = $_SESSION['my_url'];
294                 if($url && strlen(get_config('system','directory_submit_url')))
295                         proc_run('php',"include/directory.php","$url");
296         }
297
298         $_SESSION['theme'] = $theme;
299         if($email_changed && $a->config['register_policy'] == REGISTER_VERIFY) {
300
301                 // FIXME - set to un-verified, blocked and redirect to logout
302
303         }
304
305         goaway($a->get_baseurl() . '/settings' );
306         return; // NOTREACHED
307 }
308                 
309
310 if(! function_exists('settings_content')) {
311 function settings_content(&$a) {
312
313         $o = '';
314         nav_set_selected('settings');
315
316         if(! local_user()) {
317                 notice( t('Permission denied.') . EOL );
318                 return;
319         }
320         
321         $tabs = array(
322                 array(
323                         'label' => t('Account settings'),
324                         'url'   => $a->get_baseurl().'/settings',
325                         'sel'   => (($a->argc == 1)?'active':''),
326                 ),      
327                 array(
328                         'label' => t('Connector settings'),
329                         'url'   => $a->get_baseurl().'/settings/connectors',
330                         'sel'   => (($a->argc > 1) && ($a->argv[1] === 'connectors')?'active':''),
331                 ),
332                 array(
333                         'label' => t('Plugin settings'),
334                         'url'   => $a->get_baseurl().'/settings/addon',
335                         'sel'   => (($a->argc > 1) && ($a->argv[1] === 'addon')?'active':''),
336                 ),
337                 array(
338                         'label' => t('Export personal data'),
339                         'url' => $a->get_baseurl() . '/uexport',
340                         'sel' => ''
341                 )
342         );
343         
344         $tabtpl = get_markup_template("common_tabs.tpl");
345         $tabs = replace_macros($tabtpl, array(
346                 '$tabs' => $tabs,
347         ));
348                 
349         
350
351         if(($a->argc > 1) && ($a->argv[1] === 'addon')) {
352                 $settings_addons = "";
353                 
354                 $r = q("SELECT * FROM `hook` WHERE `hook` = 'plugin_settings' ");
355                 if(! count($r))
356                         $settings_addons = t('No Plugin settings configured');
357
358                 call_hooks('plugin_settings', $settings_addons);
359                 
360                 
361                 $tpl = get_markup_template("settings_addons.tpl");
362                 $o .= replace_macros($tpl, array(
363                         '$title'        => t('Plugin Settings'),
364                         '$tabs'         => $tabs,
365                         '$settings_addons' => $settings_addons
366                 ));
367                 return $o;
368         }
369
370         if(($a->argc > 1) && ($a->argv[1] === 'connectors')) {
371
372                 $settings_connectors = "";
373                 
374                 call_hooks('connector_settings', $settings_connectors);
375
376                 $diasp_enabled = sprintf( t('Built-in support for %s connectivity is %s'), t('Diaspora'), ((get_config('system','diaspora_enabled')) ? t('enabled') : t('disabled')));
377                 $ostat_enabled = sprintf( t('Built-in support for %s connectivity is %s'), t('StatusNet'), ((get_config('system','ostatus_disabled')) ? t('disabled') : t('enabled')));
378
379         $mail_disabled = ((function_exists('imap_open') && (! get_config('system','imap_disabled'))) ? 0 : 1);
380         if(get_config('system','dfrn_only'))
381                 $mail_disabled = 1;
382
383         if(! $mail_disabled) {
384                 $r = q("SELECT * FROM `mailacct` WHERE `uid` = %d LIMIT 1",
385                         local_user()
386                 );
387         }
388         else {
389                 $r = null;
390         }
391
392         $mail_server  = ((count($r)) ? $r[0]['server'] : '');
393         $mail_port    = ((count($r) && intval($r[0]['port'])) ? intval($r[0]['port']) : '');
394         $mail_ssl     = ((count($r)) ? $r[0]['ssltype'] : '');
395         $mail_user    = ((count($r)) ? $r[0]['user'] : '');
396         $mail_replyto = ((count($r)) ? $r[0]['reply_to'] : '');
397         $mail_pubmail = ((count($r)) ? $r[0]['pubmail'] : 0);
398         $mail_chk     = ((count($r)) ? $r[0]['last_check'] : '0000-00-00 00:00:00');
399
400                 
401         $tpl = get_markup_template("settings_connectors.tpl");
402                 $o .= replace_macros($tpl, array(
403                         '$title'        => t('Connector Settings'),
404                         '$tabs'         => $tabs,
405                 
406                 '$diasp_enabled' => $diasp_enabled,
407                 '$ostat_enabled' => $ostat_enabled,
408                 
409                 '$h_imap' => t('Email/Mailbox Setup'),
410                 '$imap_desc' => t("If you wish to communicate with email contacts using this service \x28optional\x29, please specify how to connect to your mailbox."),
411                 '$imap_lastcheck' => array('imap_lastcheck', t('Last successful email check:'), $mail_chk,''),
412                 '$mail_disabled' => (($mail_disabled) ? t('Email access is disabled on this site.') : ''),
413                 '$mail_server'  => array('mail_server',  t('IMAP server name:'), $mail_server, ''),
414                 '$mail_port'    => array('mail_port',    t('IMAP port:'), $mail_port, ''),
415                 '$mail_ssl'             => array('mail_ssl',     t('Security:'), strtoupper($mail_ssl), '', array( ''=>t('None'), 'TSL'=>'TSL', 'SSL'=>'SSL')),
416                 '$mail_user'    => array('mail_user',    t('Email login name:'), $mail_user, ''),
417                 '$mail_pass'    => array('mail_pass',    t('Email password:'), '', ''),
418                 '$mail_replyto' => array('mail_replyto', t('Reply-to address:'), '', 'Optional'),
419                 '$mail_pubmail' => array('mail_pubmail', t('Send public posts to all email contacts:'), $mail_pubmail, ''),
420                 '$submit' => t('Submit'),               
421                 
422
423
424                         '$settings_connectors' => $settings_connectors
425                 ));
426                 return $o;
427         }
428
429                 
430         require_once('include/acl_selectors.php');
431
432         $p = q("SELECT * FROM `profile` WHERE `is-default` = 1 AND `uid` = %d LIMIT 1",
433                 intval(local_user())
434         );
435         if(count($p))
436                 $profile = $p[0];
437
438         $username = $a->user['username'];
439         $email    = $a->user['email'];
440         $nickname = $a->user['nickname'];
441         $timezone = $a->user['timezone'];
442         $notify   = $a->user['notify-flags'];
443         $defloc   = $a->user['default-location'];
444         $openid   = $a->user['openid'];
445         $maxreq   = $a->user['maxreq'];
446         $expire   = ((intval($a->user['expire'])) ? $a->user['expire'] : '');
447         $blockwall = $a->user['blockwall'];
448
449         if(! strlen($a->user['timezone']))
450                 $timezone = date_default_timezone_get();
451
452
453
454         $pageset_tpl = get_markup_template('pagetypes.tpl');
455         $pagetype = replace_macros($pageset_tpl,array(
456                 '$page_normal'  => array('page-flags', t('Normal Account'), PAGE_NORMAL, 
457                                                                         t('This account is a normal personal profile'), 
458                                                                         ($a->user['page-flags'] == PAGE_NORMAL)),
459                                                                 
460                 '$page_soapbox'         => array('page-flags', t('Soapbox Account'), PAGE_SOAPBOX, 
461                                                                         t('Automatically approve all connection/friend requests as read-only fans'), 
462                                                                         ($a->user['page-flags'] == PAGE_SOAPBOX)),
463                                                                         
464                 '$page_community'       => array('page-flags', t('Community/Celebrity Account'), PAGE_COMMUNITY, 
465                                                                         t('Automatically approve all connection/friend requests as read-write fans'), 
466                                                                         ($a->user['page-flags'] == PAGE_COMMUNITY)),
467                                                                         
468                 '$page_freelove'        => array('page-flags', t('Automatic Friend Account'), PAGE_FREELOVE, 
469                                                                         t('Automatically approve all connection/friend requests as friends'), 
470                                                                         ($a->user['page-flags'] == PAGE_FREELOVE)),
471         ));
472
473         $noid = get_config('system','no_openid');
474
475         if($noid) {
476                 $openid_field = false;
477         }
478         else {
479                 $openid_field = array('openid_url', t('OpenID:'),$openid, t("\x28Optional\x29 Allow this OpenID to login to this account."));
480         }
481
482
483         $opt_tpl = get_markup_template("field_yesno.tpl");
484         if(get_config('system','publish_all')) {
485                 $profile_in_dir = '<input type="hidden" name="profile_in_directory" value="1" />';
486         }
487         else {
488                 $profile_in_dir = replace_macros($opt_tpl,array(
489                         '$field'        => array('profile_in_directory', t('Publish your default profile in your local site directory?'), $profile['publish'], '', array(t('No'),t('Yes'))),
490                 ));
491         }
492
493         if(strlen(get_config('system','directory_submit_url'))) {
494                 $profile_in_net_dir = replace_macros($opt_tpl,array(
495                         '$field'        => array('profile_in_netdirectory', t('Publish your default profile in the global social directory?'), $profile['net-publish'], '', array(t('No'),t('Yes'))),
496                 ));
497         }
498         else
499                 $profile_in_net_dir = '';
500
501
502         $hide_friends = replace_macros($opt_tpl,array(
503                         '$field'        => array('hide-friends', t('Hide your contact/friend list from viewers of your default profile?'), $profile['hide-friends'], '', array(t('No'),t('Yes'))),
504         ));
505
506         $hide_wall = replace_macros($opt_tpl,array(
507                         '$field'        => array('hidewall',  t('Hide profile details and all your messages from unknown viewers?'), $a->user['hidewall'], '', array(t('No'),t('Yes'))),
508
509         ));
510
511
512         $invisible = (((! $profile['publish']) && (! $profile['net-publish']))
513                 ? true : false);
514
515         if($invisible)
516                 info( t('Profile is <strong>not published</strong>.') . EOL );
517
518         
519         $default_theme = get_config('system','theme');
520         if(! $default_theme)
521                 $default_theme = 'default';
522         
523         $themes = array();
524         $files = glob('view/theme/*');
525         if($files) {
526                 foreach($files as $file) {
527                         $f = basename($file);
528                         $theme_name = ((file_exists($file . '/experimental')) ?  sprintf("%s - \x28Experimental\x29", $f) : $f);
529                         $themes[$f]=$theme_name;
530                 }
531         }
532         $theme_selected = (!x($_SESSION,'theme')? $default_theme : $_SESSION['theme']);
533
534
535         $subdir = ((strlen($a->get_path())) ? '<br />' . t('or') . ' ' . $a->get_baseurl() . '/profile/' . $nickname : '');
536
537         $tpl_addr = get_markup_template("settings_nick_set.tpl");
538
539         $prof_addr = replace_macros($tpl_addr,array(
540                 '$desc' => t('Your Identity Address is'),
541                 '$nickname' => $nickname,
542                 '$subdir' => $subdir,
543                 '$basepath' => $a->get_hostname()
544         ));
545
546         $stpl = get_markup_template('settings.tpl');
547
548         $celeb = ((($a->user['page-flags'] == PAGE_SOAPBOX) || ($a->user['page-flags'] == PAGE_COMMUNITY)) ? true : false);
549
550         
551
552         $o .= replace_macros($stpl,array(
553                 '$tabs'         => $tabs,
554                 '$ptitle'       => t('Account Settings'),
555
556                 '$submit'       => t('Submit'),
557                 '$baseurl' => $a->get_baseurl(),
558                 '$uid' => local_user(),
559                 
560                 '$nickname_block' => $prof_addr,
561                 
562                 '$h_pass'       => t('Password Settings'),
563                 '$password1'=> array('npassword', t('New Password:'), '', ''),
564                 '$password2'=> array('confirm', t('Confirm:'), '', t('Leave password fields blank unless changing')),
565                 '$oid_enable' => (! get_config('system','no_openid')),
566                 '$openid'       => $openid_field,
567                 
568                 '$h_basic'      => t('Basic Settings'),
569                 '$username' => array('username',  t('Full Name:'), $username,''),
570                 '$email'        => array('email', t('Email Address:'), $email, ''),
571                 '$timezone' => array('timezone_select' , t('Your Timezone:'), select_timezone($timezone), ''),
572                 '$defloc'       => array('defloc', t('Default Post Location:'), $defloc, ''),
573                 '$allowloc' => array('allow_location', t('Use Browser Location:'), ($a->user['allow_location'] == 1), ''),
574                 '$theme'        => array('theme', t('Display Theme:'), $theme_selected, '', $themes),
575
576
577
578                 '$h_prv'        => t('Security and Privacy Settings'),
579
580                 '$maxreq'       => array('maxreq', t('Maximum Friend Requests/Day:'), $maxreq ,t("\x28to prevent spam abuse\x29")),
581                 '$permissions' => t('Default Post Permissions'),
582                 '$permdesc' => t("\x28click to open/close\x29"),
583                 '$visibility' => $profile['net-publish'],
584                 '$aclselect' => populate_acl($a->user,$celeb),
585
586                 '$blockwall'=> array('blockwall', t('Allow friends to post to your profile page:'), !$blockwall, ''),
587                 '$expire'       => array('expire', t("Automatically expire posts after days:"), $expire, t('If empty, posts will not expire. Expired posts will be deleted')),
588
589                 '$profile_in_dir' => $profile_in_dir,
590                 '$profile_in_net_dir' => $profile_in_net_dir,
591                 '$hide_friends' => $hide_friends,
592                 '$hide_wall' => $hide_wall,
593                 
594                 
595                 
596                 '$h_not'        => t('Notification Settings'),
597                 '$lbl_not'      => t('Send a notification email when:'),
598                 '$notify1'      => array('notify1', t('You receive an introduction'), ($notify & NOTIFY_INTRO), NOTIFY_INTRO, ''),
599                 '$notify2'      => array('notify2', t('Your introductions are confirmed'), ($notify & NOTIFY_CONFIRM), NOTIFY_CONFIRM, ''),
600                 '$notify3'      => array('notify3', t('Someone writes on your profile wall'), ($notify & NOTIFY_WALL), NOTIFY_WALL, ''),
601                 '$notify4'      => array('notify4', t('Someone writes a followup comment'), ($notify & NOTIFY_COMMENT), NOTIFY_COMMENT, ''),
602                 '$notify5'      => array('notify5', t('You receive a private message'), ($notify & NOTIFY_MAIL), NOTIFY_MAIL, ''),
603                 
604                 
605                 
606                 '$h_advn' => t('Advanced Page Settings'),
607                 '$pagetype' => $pagetype,
608                 
609
610                 
611                 
612
613                 
614
615
616
617
618                 
619
620         ));
621
622         call_hooks('settings_form',$o);
623
624         $o .= '</form>' . "\r\n";
625
626         return $o;
627
628 }}
629