]> git.mxchange.org Git - friendica.git/blobdiff - mod/settings.php
profile match
[friendica.git] / mod / settings.php
index 32906d86e7c9017e9b31d91a081da06a94740f37..6a2733d7c9fc6a40075d8fea29e39e44e1c91d24 100644 (file)
@@ -63,12 +63,14 @@ function settings_post(&$a) {
        $defloc           = ((x($_POST,'defloc'))     ? notags(trim($_POST['defloc']))       : '');
        $openid           = ((x($_POST,'openid_url')) ? notags(trim($_POST['openid_url']))   : '');
        $maxreq           = ((x($_POST,'maxreq'))     ? intval($_POST['maxreq'])             : 0);
+       $expire           = ((x($_POST,'expire'))     ? intval($_POST['expire'])             : 0);
 
        $allow_location   = (((x($_POST,'allow_location')) && (intval($_POST['allow_location']) == 1)) ? 1: 0);
        $publish          = (((x($_POST,'profile_in_directory')) && (intval($_POST['profile_in_directory']) == 1)) ? 1: 0);
        $net_publish      = (((x($_POST,'profile_in_netdirectory')) && (intval($_POST['profile_in_netdirectory']) == 1)) ? 1: 0);
        $old_visibility   = (((x($_POST,'visibility')) && (intval($_POST['visibility']) == 1)) ? 1 : 0);
        $page_flags       = (((x($_POST,'page-flags')) && (intval($_POST['page-flags']))) ? intval($_POST['page-flags']) : 0);
+       $blockwall        = (((x($_POST,'blockwall')) && (intval($_POST['blockwall']) == 1)) ? 0: 1); // this setting is inverted!
 
        $notify = 0;
 
@@ -139,7 +141,7 @@ function settings_post(&$a) {
                        $openidserver = '';
        }
 
-       $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, `openidserver` = '%s'  WHERE `uid` = %d LIMIT 1",
+       $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",
                        dbesc($username),
                        dbesc($email),
                        dbesc($openid),
@@ -154,7 +156,9 @@ function settings_post(&$a) {
                        intval($allow_location),
                        dbesc($theme),
                        intval($maxreq),
+                       intval($expire),
                        dbesc($openidserver),
+                       intval($blockwall),
                        intval(local_user())
        );
        if($r)
@@ -179,11 +183,9 @@ function settings_post(&$a) {
 
        if($old_visibility != $net_publish) {
                // Update global directory in background
-               $php_path = ((strlen($a->config['php_path'])) ? $a->config['php_path'] : 'php');
                $url = $_SESSION['my_url'];
                if($url && strlen(get_config('system','directory_submit_url')))
-                       proc_close(proc_open("\"$php_path\" \"include/directory.php\" \"$url\" &",
-                               array(),$foo));
+                       proc_run('php',"include/directory.php","$url");
        }
 
        $_SESSION['theme'] = $theme;
@@ -240,6 +242,8 @@ function settings_content(&$a) {
        $defloc   = $a->user['default-location'];
        $openid   = $a->user['openid'];
        $maxreq   = $a->user['maxreq'];
+       $expire   = ((intval($a->user['expire'])) ? $a->user['expire'] : '');
+       $blockwall = $a->user['blockwall'];
 
        if(! strlen($a->user['timezone']))
                $timezone = date_default_timezone_get();
@@ -360,6 +364,8 @@ function settings_content(&$a) {
                '$sel_notify4' => (($notify & NOTIFY_COMMENT) ? ' checked="checked" ' : ''),
                '$sel_notify5' => (($notify & NOTIFY_MAIL)    ? ' checked="checked" ' : ''),
                '$maxreq' => $maxreq,
+               '$expire' => $expire,
+               '$blockw_checked' => (($blockwall) ? '' : ' checked="checked" ' ),
                '$theme' => $theme_selector,
                '$pagetype' => $pagetype
        ));