X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fsettings.php;h=b20f4d11b88a5ed2b3d4dd5c20ca9c5af97240b1;hb=f20464112f274d720649c2f92480cc235df4db19;hp=32906d86e7c9017e9b31d91a081da06a94740f37;hpb=4c717b38ae8eccaf9fa2ab4e6411b10c2d24afdf;p=friendica.git diff --git a/mod/settings.php b/mod/settings.php index 32906d86e7..b20f4d11b8 100644 --- a/mod/settings.php +++ b/mod/settings.php @@ -5,6 +5,7 @@ function settings_init(&$a) { if(local_user()) { profile_load($a,$a->user['nickname']); } + } @@ -63,12 +64,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 +142,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 +157,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 +184,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 +243,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(); @@ -337,9 +342,13 @@ function settings_content(&$a) { $celeb = ((($a->user['page-flags'] == PAGE_SOAPBOX) || ($a->user['page-flags'] == PAGE_COMMUNITY)) ? true : false); + $uexport = ''; + + $o .= replace_macros($stpl,array( '$baseurl' => $a->get_baseurl(), '$oidhtml' => $oidhtml, + '$uexport' => $uexport, '$uid' => local_user(), '$username' => $username, '$openid' => $openid, @@ -360,6 +369,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 ));