]> git.mxchange.org Git - friendica.git/blob - mod/settings.php
tooltip for selecting items
[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         call_hooks('settings_post', $_POST);
56
57         if((x($_POST,'npassword')) || (x($_POST,'confirm'))) {
58
59                 $newpass = $_POST['npassword'];
60                 $confirm = $_POST['confirm'];
61
62                 $err = false;
63                 if($newpass != $confirm ) {
64                         notice( t('Passwords do not match. Password unchanged.') . EOL);
65                         $err = true;
66                 }
67
68                 if((! x($newpass)) || (! x($confirm))) {
69                         notice( t('Empty passwords are not allowed. Password unchanged.') . EOL);
70                         $err = true;
71                 }
72
73                 if(! $err) {
74                         $password = hash('whirlpool',$newpass);
75                         $r = q("UPDATE `user` SET `password` = '%s' WHERE `uid` = %d LIMIT 1",
76                                 dbesc($password),
77                                 intval(local_user())
78                         );
79                         if($r)
80                                 info( t('Password changed.') . EOL);
81                         else
82                                 notice( t('Password update failed. Please try again.') . EOL);
83                 }
84         }
85
86         $theme            = ((x($_POST,'theme'))      ? notags(trim($_POST['theme']))        : '');
87         $username         = ((x($_POST,'username'))   ? notags(trim($_POST['username']))     : '');
88         $email            = ((x($_POST,'email'))      ? notags(trim($_POST['email']))        : '');
89         $timezone         = ((x($_POST,'timezone'))   ? notags(trim($_POST['timezone']))     : '');
90         $defloc           = ((x($_POST,'defloc'))     ? notags(trim($_POST['defloc']))       : '');
91         $openid           = ((x($_POST,'openid_url')) ? notags(trim($_POST['openid_url']))   : '');
92         $maxreq           = ((x($_POST,'maxreq'))     ? intval($_POST['maxreq'])             : 0);
93         $expire           = ((x($_POST,'expire'))     ? intval($_POST['expire'])             : 0);
94
95         $allow_location   = (((x($_POST,'allow_location')) && (intval($_POST['allow_location']) == 1)) ? 1: 0);
96         $publish          = (((x($_POST,'profile_in_directory')) && (intval($_POST['profile_in_directory']) == 1)) ? 1: 0);
97         $net_publish      = (((x($_POST,'profile_in_netdirectory')) && (intval($_POST['profile_in_netdirectory']) == 1)) ? 1: 0);
98         $old_visibility   = (((x($_POST,'visibility')) && (intval($_POST['visibility']) == 1)) ? 1 : 0);
99         $page_flags       = (((x($_POST,'page-flags')) && (intval($_POST['page-flags']))) ? intval($_POST['page-flags']) : 0);
100         $blockwall        = (((x($_POST,'blockwall')) && (intval($_POST['blockwall']) == 1)) ? 0: 1); // this setting is inverted!
101
102         $mail_server      = ((x($_POST,'mail_server')) ? $_POST['mail_server'] : '');
103         $mail_port        = ((x($_POST,'mail_port')) ? $_POST['mail_port'] : '');
104         $mail_ssl         = ((x($_POST,'mail_ssl')) ? strtolower(trim($_POST['mail_ssl'])) : '');
105         $mail_user        = ((x($_POST,'mail_user')) ? $_POST['mail_user'] : '');
106         $mail_pass        = ((x($_POST,'mail_pass')) ? trim($_POST['mail_pass']) : '');
107         $mail_replyto     = ((x($_POST,'mail_replyto')) ? $_POST['mail_replyto'] : '');
108         $mail_pubmail     = ((x($_POST,'mail_pubmail')) ? $_POST['mail_pubmail'] : '');
109
110
111         $mail_disabled = ((function_exists('imap_open') && (! get_config('system','imap_disabled'))) ? 0 : 1);
112
113         if(! $mail_disabled) {
114                 $r = q("SELECT * FROM `mailacct` WHERE `uid` = %d LIMIT 1",
115                         intval(local_user())
116                 );
117                 if(! count($r)) {
118                         q("INSERT INTO `mailacct` (`uid`) VALUES (%d)",
119                                 intval(local_user())
120                         );
121                 }
122                 if(strlen($mail_pass)) {
123                         $pass = '';
124                         openssl_public_encrypt($mail_pass,$pass,$a->user['pubkey']);
125                         q("UPDATE `mailacct` SET `pass` = '%s' WHERE `uid` = %d LIMIT 1",
126                                         dbesc(bin2hex($pass)),
127                                         intval(local_user())
128                         );
129                 }
130                 $r = q("UPDATE `mailacct` SET `server` = '%s', `port` = %d, `ssltype` = '%s', `user` = '%s',
131                         `mailbox` = 'INBOX', `reply_to` = '%s', `pubmail` = %d WHERE `uid` = %d LIMIT 1",
132                         dbesc($mail_server),
133                         intval($mail_port),
134                         dbesc($mail_ssl),
135                         dbesc($mail_user),
136                         dbesc($mail_replyto),
137                         intval($mail_pubmail),
138                         intval(local_user())
139                 );
140                 $r = q("SELECT * FROM `mailacct` WHERE `uid` = %d LIMIT 1",
141                         intval(local_user())
142                 );
143                 if(count($r)) {
144                         $eacct = $r[0];
145                         require_once('include/email.php');
146                         $mb = construct_mailbox_name($eacct);
147                         if(strlen($eacct['server'])) {
148                                 $dcrpass = '';
149                                 openssl_private_decrypt(hex2bin($eacct['pass']),$dcrpass,$a->user['prvkey']);
150                                 $mbox = email_connect($mb,$mail_user,$dcrpass);
151                                 unset($dcrpass);
152                                 if(! $mbox)
153                                         notice( t('Failed to connect with email account using the settings provided.') . EOL);
154                         }
155                 }
156         }
157
158         $notify = 0;
159
160         if(x($_POST,'notify1'))
161                 $notify += intval($_POST['notify1']);
162         if(x($_POST,'notify2'))
163                 $notify += intval($_POST['notify2']);
164         if(x($_POST,'notify3'))
165                 $notify += intval($_POST['notify3']);
166         if(x($_POST,'notify4'))
167                 $notify += intval($_POST['notify4']);
168         if(x($_POST,'notify5'))
169                 $notify += intval($_POST['notify5']);
170
171         $email_changed = false;
172
173         $err = '';
174
175         $name_change = false;
176
177         if($username != $a->user['username']) {
178                 $name_change = true;
179                 if(strlen($username) > 40)
180                         $err .= t(' Please use a shorter name.');
181                 if(strlen($username) < 3)
182                         $err .= t(' Name too short.');
183         }
184
185         if($email != $a->user['email']) {
186                 $email_changed = true;
187         if(! valid_email($email))
188                         $err .= t(' Not valid email.');
189                 if((x($a->config,'admin_email')) && (strcasecmp($email,$a->config['admin_email']) == 0)) {
190                         $err .= t(' Cannot change to that email.');
191                         $email = $a->user['email'];
192                 }
193         }
194
195         if(strlen($err)) {
196                 notice($err . EOL);
197                 return;
198         }
199
200         if($timezone != $a->user['timezone']) {
201                 if(strlen($timezone))
202                         date_default_timezone_set($timezone);
203         }
204
205         $str_group_allow   = perms2str($_POST['group_allow']);
206         $str_contact_allow = perms2str($_POST['contact_allow']);
207         $str_group_deny    = perms2str($_POST['group_deny']);
208         $str_contact_deny  = perms2str($_POST['contact_deny']);
209
210         $openidserver = $a->user['openidserver'];
211
212         // If openid has changed or if there's an openid but no openidserver, try and discover it.
213
214         if($openid != $a->user['openid'] || (strlen($openid) && (! strlen($openidserver)))) {
215                 $tmp_str = $openid;
216                 if(strlen($tmp_str) && validate_url($tmp_str)) {
217                         logger('updating openidserver');
218                         require_once('library/openid.php');
219                         $open_id_obj = new LightOpenID;
220                         $open_id_obj->identity = $openid;
221                         $openidserver = $open_id_obj->discover($open_id_obj->identity);
222                 }
223                 else
224                         $openidserver = '';
225         }
226
227         $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  WHERE `uid` = %d LIMIT 1",
228                         dbesc($username),
229                         dbesc($email),
230                         dbesc($openid),
231                         dbesc($timezone),
232                         dbesc($str_contact_allow),
233                         dbesc($str_group_allow),
234                         dbesc($str_contact_deny),
235                         dbesc($str_group_deny),
236                         intval($notify),
237                         intval($page_flags),
238                         dbesc($defloc),
239                         intval($allow_location),
240                         dbesc($theme),
241                         intval($maxreq),
242                         intval($expire),
243                         dbesc($openidserver),
244                         intval($blockwall),
245                         intval(local_user())
246         );
247         if($r)
248                 info( t('Settings updated.') . EOL);
249
250         $r = q("UPDATE `profile` 
251                 SET `publish` = %d, `net-publish` = %d
252                 WHERE `is-default` = 1 AND `uid` = %d LIMIT 1",
253                 intval($publish),
254                 intval($net_publish),
255                 intval(local_user())
256         );
257
258
259         if($name_change) {
260                 q("UPDATE `contact` SET `name` = '%s', `name-date` = '%s' WHERE `uid` = %d AND `self` = 1 LIMIT 1",
261                         dbesc($username),
262                         dbesc(datetime_convert()),
263                         intval(local_user())
264                 );
265         }               
266
267         if($old_visibility != $net_publish) {
268                 // Update global directory in background
269                 $url = $_SESSION['my_url'];
270                 if($url && strlen(get_config('system','directory_submit_url')))
271                         proc_run('php',"include/directory.php","$url");
272         }
273
274         $_SESSION['theme'] = $theme;
275         if($email_changed && $a->config['register_policy'] == REGISTER_VERIFY) {
276
277                 // FIXME - set to un-verified, blocked and redirect to logout
278
279         }
280
281         goaway($a->get_baseurl() . '/settings' );
282         return; // NOTREACHED
283 }
284                 
285
286 if(! function_exists('settings_content')) {
287 function settings_content(&$a) {
288
289         $o = '';
290         $o .= '<script> $(document).ready(function() { $(\'#nav-settings-link\').addClass(\'nav-selected\'); });</script>';
291
292         if(! local_user()) {
293                 notice( t('Permission denied.') . EOL );
294                 return;
295         }
296
297         if(($a->argc > 1) && ($a->argv[1] === 'addon')) {
298                 $o .= '<h1>' . t('Plugin Settings') . '</h1>';
299                 $o .= '<div id="account-settings-link"><a href="settings">' . t('Account Settings') . '</a></div>';
300
301                 $o .= '<form action="settings/addon" method="post" >';
302
303                 $r = q("SELECT * FROM `hook` WHERE `hook` = 'plugin_settings' ");
304                 if(! count($r))
305                         notice( t('No Plugin settings configured') . EOL);
306
307                 call_hooks('plugin_settings', $o);
308                 $o .= '</form>';
309                 return $o;
310         }
311                 
312         require_once('include/acl_selectors.php');
313
314         $p = q("SELECT * FROM `profile` WHERE `is-default` = 1 AND `uid` = %d LIMIT 1",
315                 intval(local_user())
316         );
317         if(count($p))
318                 $profile = $p[0];
319
320         $username = $a->user['username'];
321         $email    = $a->user['email'];
322         $nickname = $a->user['nickname'];
323         $timezone = $a->user['timezone'];
324         $notify   = $a->user['notify-flags'];
325         $defloc   = $a->user['default-location'];
326         $openid   = $a->user['openid'];
327         $maxreq   = $a->user['maxreq'];
328         $expire   = ((intval($a->user['expire'])) ? $a->user['expire'] : '');
329         $blockwall = $a->user['blockwall'];
330
331         if(! strlen($a->user['timezone']))
332                 $timezone = date_default_timezone_get();
333
334
335         $mail_disabled = ((function_exists('imap_open') && (! get_config('system','imap_disabled'))) ? 0 : 1);
336
337         if(! $mail_disabled) {
338                 $r = q("SELECT * FROM `mailacct` WHERE `uid` = %d LIMIT 1",
339                         local_user()
340                 );
341         }
342         else {
343                 $r = null;
344                 $imap_disabled = (($mail_disabled) ? ' disabled="disabled" ' : '');
345         }
346
347         $mail_server  = ((count($r)) ? $r[0]['server'] : '');
348         $mail_port    = ((count($r) && intval($r[0]['port'])) ? intval($r[0]['port']) : '');
349         $mail_ssl     = ((count($r)) ? $r[0]['ssltype'] : '');
350         $mail_user    = ((count($r)) ? $r[0]['user'] : '');
351         $mail_replyto = ((count($r)) ? $r[0]['reply_to'] : '');
352         $mail_pubmail = ((count($r)) ? $r[0]['pubmail'] : 0);
353         $mail_chk     = ((count($r)) ? $r[0]['last_check'] : '0000-00-00 00:00:00');
354
355         $pageset_tpl = get_markup_template('pagetypes.tpl');
356         $pagetype = replace_macros($pageset_tpl,array(
357                 '$normal'         => (($a->user['page-flags'] == PAGE_NORMAL)      ? " checked=\"checked\" " : ""),
358                 '$soapbox'        => (($a->user['page-flags'] == PAGE_SOAPBOX)     ? " checked=\"checked\" " : ""),
359                 '$community'      => (($a->user['page-flags'] == PAGE_COMMUNITY)   ? " checked=\"checked\" " : ""),
360                 '$freelove'       => (($a->user['page-flags'] == PAGE_FREELOVE)    ? " checked=\"checked\" " : ""),
361                 '$page_normal'    => PAGE_NORMAL,
362                 '$page_soapbox'   => PAGE_SOAPBOX,
363                 '$page_community' => PAGE_COMMUNITY,
364                 '$page_freelove'  => PAGE_FREELOVE,
365                 '$n_l'            => t('Normal Account'),
366                 '$n_d'            => t('This account is a normal personal profile'),
367                 '$s_l'            => t('Soapbox Account'),
368                 '$s_d'            => t('Automatically approve all connection/friend requests as read-only fans'),
369                 '$c_l'            => t('Community/Celebrity Account'),
370                 '$c_d'            => t('Automatically approve all connection/friend requests as read-write fans'),
371                 '$f_l'            => t('Automatic Friend Account'),
372                 '$f_d'            => t('Automatically approve all connection/friend requests as friends')               
373         ));
374
375         $noid = get_config('system','no_openid');
376
377         if($noid) {
378                 $oidhtml = '';
379         }
380         else {
381                 $oidhtml = '<label id="settings-openid-label" for="settings-openid" >' . t('OpenID: ') . '</label><input type="text" id="settings-openid" class="openid" name="openid_url" value="$openid" />' . t("&nbsp;\x28Optional\x29 Allow this OpenID to login to this account.");
382         }
383
384
385         if(get_config('system','publish_all')) {
386                 $profile_in_dir = '<input type="hidden" name="profile_in_directory" value="1" />';
387         }
388         else {
389                 $opt_tpl = get_markup_template("profile-in-directory.tpl");
390                 $profile_in_dir = replace_macros($opt_tpl,array(
391                         '$desc'         => t('Publish your default profile in site directory?'),
392                         '$yes_str'      => t('Yes'),
393                         '$no_str'       => t('No'),
394                         '$yes_selected' => (($profile['publish'])      ? " checked=\"checked\" " : ""),
395                         '$no_selected'  => (($profile['publish'] == 0) ? " checked=\"checked\" " : "")
396                 ));
397         }
398
399         if(strlen(get_config('system','directory_submit_url'))) {
400                 $opt_tpl = get_markup_template("profile-in-netdir.tpl");
401
402                 $profile_in_net_dir = replace_macros($opt_tpl,array(
403                         '$desc'         => t('Publish your default profile in global social directory?'),
404                         '$yes_str'      => t('Yes'),
405                         '$no_str'       => t('No'),
406                         '$yes_selected' => (($profile['net-publish'])      ? " checked=\"checked\" " : ""),
407                         '$no_selected'  => (($profile['net-publish'] == 0) ? " checked=\"checked\" " : "")
408                 ));
409         }
410         else
411                 $profile_in_net_dir = '';
412
413         $loc_checked = (($a->user['allow_location'] == 1)      ? " checked=\"checked\" " : "");
414
415         $invisible = (((! $profile['publish']) && (! $profile['net-publish']))
416                 ? true : false);
417
418         if($invisible)
419                 info( t('Profile is <strong>not published</strong>.') . EOL );
420
421         
422         $theme_selector = '<select name="theme" id="theme-select" >';
423         $files = glob('view/theme/*');
424
425         $default_theme = get_config('system','theme');
426         if(! $default_theme)
427                 $default_theme = 'default';
428
429         if($files) {
430                 foreach($files as $file) {
431                         $f = basename($file);
432                         $selected = (($f == $_SESSION['theme']) || ($f === $default_theme && (! x($_SESSION,'theme')))
433                                 ? ' selected="selected" ' : '' );
434                         $theme_name = ((file_exists($file . '/experimental')) ?  sprintf("%s - \x28Experimental\x29", $f) : $f);
435                         $theme_selector .= '<option value="' . $f . '"' . $selected . '>' . $theme_name . '</option>';
436                 }
437         }
438
439         $theme_selector .= '</select>';
440
441         $subdir = ((strlen($a->get_path())) ? '<br />' . t('or') . ' ' . $a->get_baseurl() . '/profile/' . $nickname : '');
442
443         $tpl_addr = get_markup_template("settings_nick_set.tpl");
444
445         $prof_addr = replace_macros($tpl_addr,array(
446                 '$desc' => t('Your Identity Address is'),
447                 '$nickname' => $nickname,
448                 '$subdir' => $subdir,
449                 '$basepath' => $a->get_hostname()
450         ));
451
452         $stpl = get_markup_template('settings.tpl');
453
454         $celeb = ((($a->user['page-flags'] == PAGE_SOAPBOX) || ($a->user['page-flags'] == PAGE_COMMUNITY)) ? true : false);
455
456         $uexport = '<div id="uexport-link"><a href="uexport" >' . t('Export Personal Data') . '</a></div>';
457
458
459         $o .= replace_macros($stpl,array(
460                 '$ptitle' => t('Account Settings'),
461                 '$lbl_plug' => t('Plugin Settings'),
462                 '$lbl_basic' => t('Basic Settings'),
463                 '$lbl_fn' => t('Full Name:'),
464                 '$lbl_email' => t('Email Address:'),
465                 '$lbl_tz' => t('Your Timezone:'),
466                 '$lbl_loc1' => t('Default Post Location:'),
467                 '$lbl_loc2' => t('Use Browser Location:'),
468                 '$lbl_theme' => t('Display Theme:'),
469                 '$submit' => t('Submit'),
470                 '$lbl_prv' => t('Security and Privacy Settings'),
471                 '$lbl_maxreq' => t('Maximum Friend Requests/Day:'),
472                 '$lbl_maxrdesc' => t("\x28to prevent spam abuse\x29"),
473                 '$lbl_rempost' => t('Allow friends to post to your profile page:'),
474                 '$lbl_exp1' => t("Automatically expire \x28delete\x29 posts older than"),
475                 '$lbl_exp2' => t('days'),
476                 '$lbl_not1' => t('Notification Settings'),
477                 '$lbl_not2' => t('Send a notification email when:'),
478                 '$lbl_not3' => t('You receive an introduction'),
479                 '$lbl_not4' => t('Your introductions are confirmed'),
480                 '$lbl_not5' => t('Someone writes on your profile wall'),
481                 '$lbl_not6' => t('Someone writes a followup comment'),
482                 '$lbl_not7' => t('You receive a private message'),
483                 '$lbl_pass1' => t('Password Settings'),
484                 '$lbl_pass2' => t('Leave password fields blank unless changing'),
485                 '$lbl_pass3' => t('New Password:'),
486                 '$lbl_pass4' => t('Confirm:'),
487                 '$lbl_advn' => t('Advanced Page Settings'),
488                 '$baseurl' => $a->get_baseurl(),
489                 '$oidhtml' => $oidhtml,
490                 '$uexport' => $uexport,
491                 '$uid' => local_user(),
492                 '$username' => $username,
493                 '$openid' => $openid,
494                 '$email' => $email,
495                 '$nickname_block' => $prof_addr,
496                 '$timezone' => $timezone,
497                 '$zoneselect' => select_timezone($timezone),
498                 '$defloc' => $defloc,
499                 '$loc_checked' => $loc_checked,
500                 '$profile_in_dir' => $profile_in_dir,
501                 '$profile_in_net_dir' => $profile_in_net_dir,
502                 '$permissions' => t('Default Post Permissions'),
503                 '$permdesc' => t("\x28click to open/close\x29"),
504                 '$visibility' => $profile['net-publish'],
505                 '$aclselect' => populate_acl($a->user,$celeb),
506                 '$sel_notify1' => (($notify & NOTIFY_INTRO)   ? ' checked="checked" ' : ''),
507                 '$sel_notify2' => (($notify & NOTIFY_CONFIRM) ? ' checked="checked" ' : ''),
508                 '$sel_notify3' => (($notify & NOTIFY_WALL)    ? ' checked="checked" ' : ''),
509                 '$sel_notify4' => (($notify & NOTIFY_COMMENT) ? ' checked="checked" ' : ''),
510                 '$sel_notify5' => (($notify & NOTIFY_MAIL)    ? ' checked="checked" ' : ''),
511                 '$maxreq' => $maxreq,
512                 '$expire' => $expire,
513                 '$blockw_checked' => (($blockwall) ? '' : ' checked="checked" ' ),
514                 '$theme' => $theme_selector,
515                 '$pagetype' => $pagetype,
516                 '$lbl_imap0' => t('Email/Mailbox Setup'),
517                 '$imap_desc' => t("If you wish to communicate with email contacts using this service \x28optional\x29, please specify how to connect to your mailbox."),
518                 '$lbl_imap1' => t('IMAP server name:'),
519                 '$imap_server' => $mail_server,
520                 '$lbl_imap2' => t('IMAP port:'),
521                 '$imap_port' => $mail_port,
522                 '$lbl_imap3' => t("Security \x28TLS or SSL\x29:"),
523                 '$imap_ssl' => $mail_ssl,
524                 '$lbl_imap4' => t('Email login name:'),
525                 '$imap_user' => $mail_user,
526                 '$lbl_imap5' => t('Email password:'),
527                 '$lbl_imap6' => t("Reply-to address \x28Optional\x29:"),
528                 '$imap_replyto' => $mail_replyto,
529                 '$lbl_imap7' => t('Send public posts to all email contacts:'),
530                 '$lbl_imap8' => t('Last successful email check:'),
531                 '$lbl_imap9' => (($mail_chk === '0000-00-00 00:00:00') ? t('never') : datetime_convert('UTC', date_default_timezone_get(), $mail_chk, t('g A l F d Y'))), 
532                 '$pubmail_checked' => (($mail_pubmail) ? ' checked="checked" ' : ''),
533                 '$mail_disabled' => (($mail_disabled) ? '<div class="info-message">' . t('Email access is disabled on this site.') . '</div>' : ''),
534                 '$imap_disabled' => $imap_disabled
535         ));
536
537         call_hooks('settings_form',$o);
538
539         $o .= '</form>' . "\r\n";
540
541         return $o;
542
543 }}
544