From ace8f753ac81caaf3385c4c37b58551a8b10fdfd Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Tue, 20 Dec 2016 11:56:34 +0100 Subject: [PATCH] added much more curly braces + space between "if" and brace MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder Conflicts: mod/bookmarklet.php mod/community.php mod/contacts.php mod/crepair.php mod/events.php mod/network.php mod/suggest.php mod/uexport.php view/theme/duepuntozero/config.php view/theme/frio/config.php view/theme/quattro/config.php view/theme/vier/config.php --- doc/themes.md | 3 +- include/acl_selectors.php | 5 +- include/contact_widgets.php | 15 ++++-- include/group.php | 2 +- mod/allfriends.php | 11 ++-- mod/api.php | 4 +- mod/bookmarklet.php | 2 +- mod/community.php | 2 +- mod/contactgroup.php | 2 +- mod/contacts.php | 15 +++--- mod/content.php | 2 +- mod/crepair.php | 9 ++-- mod/delegate.php | 2 +- mod/dirfind.php | 2 +- mod/editpost.php | 6 +-- mod/events.php | 8 +-- mod/filer.php | 2 +- mod/filerm.php | 2 +- mod/follow.php | 4 +- mod/fsuggest.php | 7 +-- mod/group.php | 4 +- mod/ignored.php | 14 +++-- mod/invite.php | 4 +- mod/manage.php | 5 +- mod/match.php | 3 +- mod/message.php | 4 +- mod/mood.php | 5 +- mod/network.php | 4 +- mod/nogroup.php | 8 +-- mod/notes.php | 5 +- mod/notifications.php | 4 +- mod/oexchange.php | 4 +- mod/ostatus_subscribe.php | 2 +- mod/poke.php | 14 +++-- mod/profile_photo.php | 6 +-- mod/profiles.php | 9 ++-- mod/profperm.php | 5 +- mod/qsearch.php | 3 +- mod/regmod.php | 11 ++-- mod/repair_ostatus.php | 2 +- mod/settings.php | 7 +-- mod/starred.php | 9 ++-- mod/suggest.php | 11 ++-- mod/tagrm.php | 8 +-- mod/uexport.php | 5 +- mod/viewsrc.php | 2 +- view/theme/duepuntozero/config.php | 85 ++++++++++++++++-------------- view/theme/frio/config.php | 9 +++- view/theme/quattro/config.php | 18 ++++--- view/theme/vier/config.php | 15 ++++-- 50 files changed, 225 insertions(+), 165 deletions(-) diff --git a/doc/themes.md b/doc/themes.md index add44c776b..0d3c6eb3d6 100644 --- a/doc/themes.md +++ b/doc/themes.md @@ -124,8 +124,9 @@ The selected 1st part will be saved in the database by the theme_post function. function theme_post(&$a){ // non local users shall not pass - if(! local_user()) + if (! local_user()) { return; + } // if the one specific submit button was pressed then proceed if (isset($_POST['duepuntozero-settings-submit'])){ // and save the selection key into the personal config of the user diff --git a/include/acl_selectors.php b/include/acl_selectors.php index ed9c634c23..2be0303049 100644 --- a/include/acl_selectors.php +++ b/include/acl_selectors.php @@ -392,8 +392,9 @@ function construct_acl_data(&$a, $user) { function acl_lookup(&$a, $out_type = 'json') { - if(!local_user()) - return ""; + if (!local_user()) { + return ''; + } $start = (x($_REQUEST,'start') ? $_REQUEST['start'] : 0); $count = (x($_REQUEST,'count') ? $_REQUEST['count'] : 100); diff --git a/include/contact_widgets.php b/include/contact_widgets.php index a74080e75b..71a75d431e 100644 --- a/include/contact_widgets.php +++ b/include/contact_widgets.php @@ -80,11 +80,13 @@ function networks_widget($baseurl,$selected = '') { $a = get_app(); - if(!local_user()) + if (!local_user()) { return ''; + } - if(!feature_enabled(local_user(),'networks')) + if (!feature_enabled(local_user(),'networks')) { return ''; + } $extra_sql = unavailable_networks(); @@ -116,15 +118,18 @@ function networks_widget($baseurl,$selected = '') { } function fileas_widget($baseurl,$selected = '') { - if(! local_user()) + if (! local_user()) { return ''; + } - if(! feature_enabled(local_user(),'filing')) + if (! feature_enabled(local_user(),'filing')) { return ''; + } $saved = get_pconfig(local_user(),'system','filetags'); - if(! strlen($saved)) + if (! strlen($saved)) { return; + } $matches = false; $terms = array(); diff --git a/include/group.php b/include/group.php index 67712aae7c..a2a55c4440 100644 --- a/include/group.php +++ b/include/group.php @@ -234,7 +234,7 @@ function group_side($every="contacts",$each="group",$editmode = "standard", $gro $o = ''; - if(! local_user()) + if (! local_user()) return ''; $groups = array(); diff --git a/mod/allfriends.php b/mod/allfriends.php index e4f067eaf7..420bd8690f 100644 --- a/mod/allfriends.php +++ b/mod/allfriends.php @@ -8,16 +8,18 @@ require_once('mod/contacts.php'); function allfriends_content(&$a) { $o = ''; - if(! local_user()) { + if (! local_user()) { notice( t('Permission denied.') . EOL); return; } - if($a->argc > 1) + if ($a->argc > 1) { $cid = intval($a->argv[1]); + } - if(! $cid) + if (! $cid) { return; + } $uid = $a->user[uid]; @@ -26,7 +28,8 @@ function allfriends_content(&$a) { intval(local_user()) ); - if(! count($c)) + if (! count($c)) { + } return; $a->page['aside'] = ""; diff --git a/mod/api.php b/mod/api.php index 406ef26c1c..caa1cba2a6 100644 --- a/mod/api.php +++ b/mod/api.php @@ -22,7 +22,7 @@ function oauth_get_client($request){ function api_post(&$a) { - if(! local_user()) { + if (! local_user()) { notice( t('Permission denied.') . EOL); return; } @@ -84,7 +84,7 @@ function api_content(&$a) { } - if(! local_user()) { + if (! local_user()) { /// @TODO We need login form to redirect to this page notice( t('Please login to continue.') . EOL ); return login(false,$request->get_parameters()); diff --git a/mod/bookmarklet.php b/mod/bookmarklet.php index cb8320013f..86a73a7884 100644 --- a/mod/bookmarklet.php +++ b/mod/bookmarklet.php @@ -8,7 +8,7 @@ function bookmarklet_init(&$a) { } function bookmarklet_content(&$a) { - if(!local_user()) { + if (!local_user()) { $o = '

'.t('Login').'

'; $o .= login(($a->config['register_policy'] == REGISTER_CLOSED) ? false : true); return $o; diff --git a/mod/community.php b/mod/community.php index c8f04d8bd6..d7fd2bb933 100644 --- a/mod/community.php +++ b/mod/community.php @@ -1,7 +1,7 @@ argv[1]==="batch") { contacts_batch_actions($a); @@ -147,15 +149,16 @@ function contacts_post(&$a) { } $contact_id = intval($a->argv[1]); - if(! $contact_id) + if (! $contact_id) { return; + } $orig_record = q("SELECT * FROM `contact` WHERE `id` = %d AND `uid` = %d LIMIT 1", intval($contact_id), intval(local_user()) ); - if(! count($orig_record)) { + if (! count($orig_record)) { notice( t('Could not access contact record.') . EOL); goaway('contacts'); return; // NOTREACHED @@ -164,7 +167,7 @@ function contacts_post(&$a) { call_hooks('contact_edit_post', $_POST); $profile_id = intval($_POST['profile-assign']); - if($profile_id) { + if ($profile_id) { $r = q("SELECT `id` FROM `profile` WHERE `id` = %d AND `uid` = %d LIMIT 1", intval($profile_id), intval(local_user()) @@ -346,7 +349,7 @@ function contacts_content(&$a) { nav_set_selected('contacts'); - if(! local_user()) { + if (! local_user()) { notice( t('Permission denied.') . EOL); return; } diff --git a/mod/content.php b/mod/content.php index 1a3fb10952..2377032a79 100644 --- a/mod/content.php +++ b/mod/content.php @@ -23,7 +23,7 @@ function content_content(&$a, $update = 0) { // Currently security is based on the logged in user - if(! local_user()) { + if (! local_user()) { return; } diff --git a/mod/crepair.php b/mod/crepair.php index 66faadb06a..59b92df0a7 100644 --- a/mod/crepair.php +++ b/mod/crepair.php @@ -3,8 +3,9 @@ require_once("include/contact_selectors.php"); require_once("mod/contacts.php"); function crepair_init(&$a) { - if(! local_user()) + if (! local_user()) { return; + } $contact_id = 0; @@ -29,10 +30,10 @@ function crepair_init(&$a) { } } - function crepair_post(&$a) { - if(! local_user()) + if (! local_user()) { return; + } $cid = (($a->argc > 1) ? intval($a->argv[1]) : 0); @@ -97,7 +98,7 @@ function crepair_post(&$a) { function crepair_content(&$a) { - if(! local_user()) { + if (! local_user()) { notice( t('Permission denied.') . EOL); return; } diff --git a/mod/delegate.php b/mod/delegate.php index 94e641068d..3bd1c85ed7 100644 --- a/mod/delegate.php +++ b/mod/delegate.php @@ -8,7 +8,7 @@ function delegate_init(&$a) { function delegate_content(&$a) { - if(! local_user()) { + if (! local_user()) { notice( t('Permission denied.') . EOL); return; } diff --git a/mod/dirfind.php b/mod/dirfind.php index 1e3f6f354a..8cb0e1a083 100644 --- a/mod/dirfind.php +++ b/mod/dirfind.php @@ -7,7 +7,7 @@ require_once('mod/contacts.php'); function dirfind_init(&$a) { - if(! local_user()) { + if (! local_user()) { notice( t('Permission denied.') . EOL ); return; } diff --git a/mod/editpost.php b/mod/editpost.php index eccd498d15..54b50bc36d 100644 --- a/mod/editpost.php +++ b/mod/editpost.php @@ -6,14 +6,14 @@ function editpost_content(&$a) { $o = ''; - if(! local_user()) { + if (! local_user()) { notice( t('Permission denied.') . EOL); return; } $post_id = (($a->argc > 1) ? intval($a->argv[1]) : 0); - if(! $post_id) { + if (! $post_id) { notice( t('Item not found') . EOL); return; } @@ -23,7 +23,7 @@ function editpost_content(&$a) { intval(local_user()) ); - if(! count($itm)) { + if (! count($itm)) { notice( t('Item not found') . EOL); return; } diff --git a/mod/events.php b/mod/events.php index 44e6dd4cf0..a20934222f 100644 --- a/mod/events.php +++ b/mod/events.php @@ -9,8 +9,9 @@ require_once('include/event.php'); require_once('include/items.php'); function events_init(&$a) { - if(! local_user()) + if (! local_user()) { return; + } if($a->argc == 1) { // if it's a json request abort here becaus we don't @@ -33,8 +34,9 @@ function events_post(&$a) { logger('post: ' . print_r($_REQUEST,true)); - if(! local_user()) + if (! local_user()) { return; + } $event_id = ((x($_POST,'event_id')) ? intval($_POST['event_id']) : 0); $cid = ((x($_POST,'cid')) ? intval($_POST['cid']) : 0); @@ -186,7 +188,7 @@ function events_post(&$a) { function events_content(&$a) { - if(! local_user()) { + if (! local_user()) { notice( t('Permission denied.') . EOL); return; } diff --git a/mod/filer.php b/mod/filer.php index 4e79f337dc..eac3260591 100644 --- a/mod/filer.php +++ b/mod/filer.php @@ -7,7 +7,7 @@ require_once('include/items.php'); function filer_content(&$a) { - if(! local_user()) { + if (! local_user()) { killme(); } diff --git a/mod/filerm.php b/mod/filerm.php index c266082c8f..2f504b80fb 100644 --- a/mod/filerm.php +++ b/mod/filerm.php @@ -2,7 +2,7 @@ function filerm_content(&$a) { - if(! local_user()) { + if (! local_user()) { killme(); } diff --git a/mod/follow.php b/mod/follow.php index 1f56caea50..f805296790 100644 --- a/mod/follow.php +++ b/mod/follow.php @@ -7,7 +7,7 @@ require_once('include/contact_selectors.php'); function follow_content(&$a) { - if(! local_user()) { + if (! local_user()) { notice( t('Permission denied.') . EOL); goaway($_SESSION['return_url']); // NOTREACHED @@ -151,7 +151,7 @@ function follow_content(&$a) { function follow_post(&$a) { - if(! local_user()) { + if (! local_user()) { notice( t('Permission denied.') . EOL); goaway($_SESSION['return_url']); // NOTREACHED diff --git a/mod/fsuggest.php b/mod/fsuggest.php index 4370952ca1..66871653dd 100644 --- a/mod/fsuggest.php +++ b/mod/fsuggest.php @@ -3,12 +3,13 @@ function fsuggest_post(&$a) { - if(! local_user()) { + if (! local_user()) { return; } - if($a->argc != 2) + if ($a->argc != 2) { return; + } $contact_id = intval($a->argv[1]); @@ -74,7 +75,7 @@ function fsuggest_content(&$a) { require_once('include/acl_selectors.php'); - if(! local_user()) { + if (! local_user()) { notice( t('Permission denied.') . EOL); return; } diff --git a/mod/group.php b/mod/group.php index da5f4df521..8a744d1e11 100644 --- a/mod/group.php +++ b/mod/group.php @@ -15,7 +15,7 @@ function group_init(&$a) { function group_post(&$a) { - if(! local_user()) { + if (! local_user()) { notice( t('Permission denied.') . EOL); return; } @@ -73,7 +73,7 @@ function group_post(&$a) { function group_content(&$a) { $change = false; - if(! local_user()) { + if (! local_user()) { notice( t('Permission denied') . EOL); return; } diff --git a/mod/ignored.php b/mod/ignored.php index 4aeeb21e6b..5e8411e376 100644 --- a/mod/ignored.php +++ b/mod/ignored.php @@ -5,12 +5,15 @@ function ignored_init(&$a) { $ignored = 0; - if(! local_user()) + if (! local_user()) { killme(); - if($a->argc > 1) + } + if ($a->argc > 1) { $message_id = intval($a->argv[1]); - if(! $message_id) + } + if (! $message_id) { killme(); + } $r = q("SELECT `ignored` FROM `thread` WHERE `uid` = %d AND `iid` = %d LIMIT 1", intval(local_user()), @@ -20,8 +23,9 @@ function ignored_init(&$a) { killme(); } - if(! intval($r[0]['ignored'])) + if (! intval($r[0]['ignored'])) { $ignored = 1; + } $r = q("UPDATE `thread` SET `ignored` = %d WHERE `uid` = %d and `iid` = %d", intval($ignored), @@ -31,7 +35,7 @@ function ignored_init(&$a) { // See if we've been passed a return path to redirect to $return_path = ((x($_REQUEST,'return')) ? $_REQUEST['return'] : ''); - if($return_path) { + if ($return_path) { $rand = '_=' . time(); if(strpos($return_path, '?')) $rand = "&$rand"; else $rand = "?$rand"; diff --git a/mod/invite.php b/mod/invite.php index 5964acac43..ae08c387eb 100644 --- a/mod/invite.php +++ b/mod/invite.php @@ -11,7 +11,7 @@ require_once('include/email.php'); function invite_post(&$a) { - if(! local_user()) { + if (! local_user()) { notice( t('Permission denied.') . EOL); return; } @@ -97,7 +97,7 @@ function invite_post(&$a) { function invite_content(&$a) { - if(! local_user()) { + if (! local_user()) { notice( t('Permission denied.') . EOL); return; } diff --git a/mod/manage.php b/mod/manage.php index 2138595bee..bb9dfc313c 100644 --- a/mod/manage.php +++ b/mod/manage.php @@ -5,8 +5,9 @@ require_once("include/text.php"); function manage_post(&$a) { - if(! local_user()) + if (! local_user()) { return; + } $uid = local_user(); $orig_record = $a->user; @@ -93,7 +94,7 @@ function manage_post(&$a) { function manage_content(&$a) { - if(! local_user()) { + if (! local_user()) { notice( t('Permission denied.') . EOL); return; } diff --git a/mod/match.php b/mod/match.php index 69bf3c1101..6eb24338c2 100644 --- a/mod/match.php +++ b/mod/match.php @@ -16,8 +16,9 @@ require_once('mod/proxy.php'); function match_content(&$a) { $o = ''; - if(! local_user()) + if (! local_user()) { return; + } $a->page['aside'] .= findpeople_widget(); $a->page['aside'] .= follow_widget(); diff --git a/mod/message.php b/mod/message.php index b0d0ba95ca..f926352590 100644 --- a/mod/message.php +++ b/mod/message.php @@ -42,7 +42,7 @@ function message_init(&$a) { function message_post(&$a) { - if(! local_user()) { + if (! local_user()) { notice( t('Permission denied.') . EOL); return; } @@ -178,7 +178,7 @@ function message_content(&$a) { $o = ''; nav_set_selected('messages'); - if(! local_user()) { + if (! local_user()) { notice( t('Permission denied.') . EOL); return; } diff --git a/mod/mood.php b/mod/mood.php index e378b9d0a4..ec318f85fd 100644 --- a/mod/mood.php +++ b/mod/mood.php @@ -7,8 +7,9 @@ require_once('include/items.php'); function mood_init(&$a) { - if(! local_user()) + if (! local_user()) { return; + } $uid = local_user(); $verb = notags(trim($_GET['verb'])); @@ -110,7 +111,7 @@ function mood_init(&$a) { function mood_content(&$a) { - if(! local_user()) { + if (! local_user()) { notice( t('Permission denied.') . EOL); return; } diff --git a/mod/network.php b/mod/network.php index c040a547a4..ba97148009 100644 --- a/mod/network.php +++ b/mod/network.php @@ -1,6 +1,6 @@ query_string; return login(false); } diff --git a/mod/nogroup.php b/mod/nogroup.php index 0a014c0676..f2a5a3b33b 100644 --- a/mod/nogroup.php +++ b/mod/nogroup.php @@ -6,14 +6,16 @@ require_once('include/contact_selectors.php'); function nogroup_init(&$a) { - if(! local_user()) + if (! local_user()) { return; + } require_once('include/group.php'); require_once('include/contact_widgets.php'); - if(! x($a->page,'aside')) + if (! x($a->page,'aside')) { $a->page['aside'] = ''; + } $a->page['aside'] .= group_side('contacts','group','extended',0,$contact_id); } @@ -21,7 +23,7 @@ function nogroup_init(&$a) { function nogroup_content(&$a) { - if(! local_user()) { + if (! local_user()) { notice( t('Permission denied.') . EOL); return ''; } diff --git a/mod/notes.php b/mod/notes.php index 74ab18a6f9..d9222dca51 100644 --- a/mod/notes.php +++ b/mod/notes.php @@ -2,8 +2,9 @@ function notes_init(&$a) { - if(! local_user()) + if (! local_user()) { return; + } $profile = 0; @@ -18,7 +19,7 @@ function notes_init(&$a) { function notes_content(&$a,$update = false) { - if(! local_user()) { + if (! local_user()) { notice( t('Permission denied.') . EOL); return; } diff --git a/mod/notifications.php b/mod/notifications.php index 3e0bd9cc47..4c56453350 100644 --- a/mod/notifications.php +++ b/mod/notifications.php @@ -11,7 +11,7 @@ require_once("include/network.php"); function notifications_post(&$a) { - if(! local_user()) { + if (! local_user()) { goaway(z_root()); } @@ -67,7 +67,7 @@ function notifications_post(&$a) { function notifications_content(&$a) { - if(! local_user()) { + if (! local_user()) { notice( t('Permission denied.') . EOL); return; } diff --git a/mod/oexchange.php b/mod/oexchange.php index b25c418e4c..6eb380dff4 100644 --- a/mod/oexchange.php +++ b/mod/oexchange.php @@ -16,12 +16,12 @@ function oexchange_init(&$a) { function oexchange_content(&$a) { - if(! local_user()) { + if (! local_user()) { $o = login(false); return $o; } - if(($a->argc > 1) && $a->argv[1] === 'done') { + if (($a->argc > 1) && $a->argv[1] === 'done') { info( t('Post successful.') . EOL); return; } diff --git a/mod/ostatus_subscribe.php b/mod/ostatus_subscribe.php index 2e09bfc0d6..963f436939 100644 --- a/mod/ostatus_subscribe.php +++ b/mod/ostatus_subscribe.php @@ -5,7 +5,7 @@ require_once('include/follow.php'); function ostatus_subscribe_content(&$a) { - if(! local_user()) { + if (! local_user()) { notice( t('Permission denied.') . EOL); goaway($_SESSION['return_url']); // NOTREACHED diff --git a/mod/poke.php b/mod/poke.php index fea5c0c0d8..af8eed35a0 100644 --- a/mod/poke.php +++ b/mod/poke.php @@ -21,25 +21,29 @@ require_once('include/items.php'); function poke_init(&$a) { - if(! local_user()) + if (! local_user()) { return; + } $uid = local_user(); $verb = notags(trim($_GET['verb'])); - if(! $verb) + if (! $verb) { return; + } $verbs = get_poke_verbs(); - if(! array_key_exists($verb,$verbs)) + if (! array_key_exists($verb,$verbs)) { return; + } $activity = ACTIVITY_POKE . '#' . urlencode($verbs[$verb][0]); $contact_id = intval($_GET['cid']); - if(! $contact_id) + if (! $contact_id) { return; + } $parent = ((x($_GET,'parent')) ? intval($_GET['parent']) : 0); @@ -146,7 +150,7 @@ function poke_init(&$a) { function poke_content(&$a) { - if(! local_user()) { + if (! local_user()) { notice( t('Permission denied.') . EOL); return; } diff --git a/mod/profile_photo.php b/mod/profile_photo.php index 70ea45afa4..2aca9801d2 100644 --- a/mod/profile_photo.php +++ b/mod/profile_photo.php @@ -4,7 +4,7 @@ require_once("include/Photo.php"); function profile_photo_init(&$a) { - if(! local_user()) { + if (! local_user()) { return; } @@ -15,7 +15,7 @@ function profile_photo_init(&$a) { function profile_photo_post(&$a) { - if(! local_user()) { + if (! local_user()) { notice ( t('Permission denied.') . EOL ); return; } @@ -172,7 +172,7 @@ function profile_photo_post(&$a) { if(! function_exists('profile_photo_content')) { function profile_photo_content(&$a) { - if(! local_user()) { + if (! local_user()) { notice( t('Permission denied.') . EOL ); return; } diff --git a/mod/profiles.php b/mod/profiles.php index 5aa41c90d8..4e29b93fd2 100644 --- a/mod/profiles.php +++ b/mod/profiles.php @@ -6,7 +6,7 @@ function profiles_init(&$a) { nav_set_selected('profiles'); - if(! local_user()) { + if (! local_user()) { return; } @@ -162,7 +162,7 @@ function profile_clean_keywords($keywords) { function profiles_post(&$a) { - if(! local_user()) { + if (! local_user()) { notice( t('Permission denied.') . EOL); return; } @@ -595,14 +595,15 @@ function profile_activity($changed, $value) { $arr['deny_gid'] = $a->user['deny_gid']; $i = item_store($arr); - if($i) + if ($i) { proc_run(PRIORITY_HIGH, "include/notifier.php", "activity", $i); + } } function profiles_content(&$a) { - if(! local_user()) { + if (! local_user()) { notice( t('Permission denied.') . EOL); return; } diff --git a/mod/profperm.php b/mod/profperm.php index aa610d3a93..0a4b3e9a47 100644 --- a/mod/profperm.php +++ b/mod/profperm.php @@ -2,8 +2,9 @@ function profperm_init(&$a) { - if(! local_user()) + if (! local_user()) { return; + } $which = $a->user['nickname']; $profile = $a->argv[1]; @@ -15,7 +16,7 @@ function profperm_init(&$a) { function profperm_content(&$a) { - if(! local_user()) { + if (! local_user()) { notice( t('Permission denied') . EOL); return; } diff --git a/mod/qsearch.php b/mod/qsearch.php index a440ea708f..b976e1a585 100644 --- a/mod/qsearch.php +++ b/mod/qsearch.php @@ -2,8 +2,9 @@ function qsearch_init(&$a) { - if(! local_user()) + if (! local_user()) { killme(); + } $limit = (get_config('system','qsearch_limit') ? intval(get_config('system','qsearch_limit')) : 100); diff --git a/mod/regmod.php b/mod/regmod.php index 92433b6d82..34d29a77ce 100644 --- a/mod/regmod.php +++ b/mod/regmod.php @@ -101,32 +101,33 @@ function regmod_content(&$a) { $_SESSION['return_url'] = $a->cmd; - if(! local_user()) { + if (! local_user()) { info( t('Please login.') . EOL); $o .= '

' . login(($a->config['register_policy'] == REGISTER_CLOSED) ? 0 : 1); return $o; } - if((!is_site_admin()) || (x($_SESSION,'submanage') && intval($_SESSION['submanage']))) { + if ((!is_site_admin()) || (x($_SESSION,'submanage') && intval($_SESSION['submanage']))) { notice( t('Permission denied.') . EOL); return ''; } - if($a->argc != 3) + if ($a->argc != 3) { killme(); + } $cmd = $a->argv[1]; $hash = $a->argv[2]; - if($cmd === 'deny') { + if ($cmd === 'deny') { user_deny($hash); goaway(App::get_baseurl()."/admin/users/"); killme(); } - if($cmd === 'allow') { + if ($cmd === 'allow') { user_allow($hash); goaway(App::get_baseurl()."/admin/users/"); killme(); diff --git a/mod/repair_ostatus.php b/mod/repair_ostatus.php index 7a454a4ae0..ba8a071756 100755 --- a/mod/repair_ostatus.php +++ b/mod/repair_ostatus.php @@ -5,7 +5,7 @@ require_once('include/follow.php'); function repair_ostatus_content(&$a) { - if(! local_user()) { + if (! local_user()) { notice( t('Permission denied.') . EOL); goaway($_SESSION['return_url']); // NOTREACHED diff --git a/mod/settings.php b/mod/settings.php index b4546d8bff..e67ea9bc6a 100644 --- a/mod/settings.php +++ b/mod/settings.php @@ -18,7 +18,7 @@ function get_theme_config_file($theme){ function settings_init(&$a) { - if(! local_user()) { + if (! local_user()) { notice( t('Permission denied.') . EOL ); return; } @@ -118,8 +118,9 @@ function settings_init(&$a) { function settings_post(&$a) { - if(! local_user()) + if (! local_user()) { return; + } if (x($_SESSION,'submanage') && intval($_SESSION['submanage'])) { return; @@ -658,7 +659,7 @@ function settings_content(&$a) { $o = ''; nav_set_selected('settings'); - if(! local_user()) { + if (! local_user()) { #notice( t('Permission denied.') . EOL ); return; } diff --git a/mod/starred.php b/mod/starred.php index 0e5e75d167..7ee531e447 100644 --- a/mod/starred.php +++ b/mod/starred.php @@ -7,12 +7,15 @@ function starred_init(&$a) { $starred = 0; - if(! local_user()) + if (! local_user()) { killme(); - if($a->argc > 1) + } + if ($a->argc > 1) { $message_id = intval($a->argv[1]); - if(! $message_id) + } + if (! $message_id) { killme(); + } $r = q("SELECT starred FROM item WHERE uid = %d AND id = %d LIMIT 1", intval(local_user()), diff --git a/mod/suggest.php b/mod/suggest.php index 73f5ffe4b2..a328b9768b 100644 --- a/mod/suggest.php +++ b/mod/suggest.php @@ -5,12 +5,13 @@ require_once('include/contact_widgets.php'); function suggest_init(&$a) { - if(! local_user()) + if (! local_user()) { return; + } - if(x($_GET,'ignore') && intval($_GET['ignore'])) { + if (x($_GET,'ignore') && intval($_GET['ignore'])) { // Check if we should do HTML-based delete confirmation - if($_REQUEST['confirm']) { + if ($_REQUEST['confirm']) { //
can't take arguments in its "action" parameter // so add any arguments as hidden inputs $query = explode_querystring($a->query_string); @@ -35,7 +36,7 @@ function suggest_init(&$a) { return; } // Now check how the user responded to the confirmation query - if(!$_REQUEST['canceled']) { + if (!$_REQUEST['canceled']) { q("INSERT INTO `gcign` ( `uid`, `gcid` ) VALUES ( %d, %d ) ", intval(local_user()), intval($_GET['ignore']) @@ -54,7 +55,7 @@ function suggest_content(&$a) { require_once("mod/proxy.php"); $o = ''; - if(! local_user()) { + if (! local_user()) { notice( t('Permission denied.') . EOL); return; } diff --git a/mod/tagrm.php b/mod/tagrm.php index d6e57d36a9..c39b4ba51e 100644 --- a/mod/tagrm.php +++ b/mod/tagrm.php @@ -4,7 +4,7 @@ require_once('include/bbcode.php'); function tagrm_post(&$a) { - if(! local_user()) + if (! local_user()) goaway(App::get_baseurl() . '/' . $_SESSION['photo_return']); @@ -52,7 +52,7 @@ function tagrm_content(&$a) { $o = ''; - if(! local_user()) { + if (! local_user()) { goaway(App::get_baseurl() . '/' . $_SESSION['photo_return']); // NOTREACHED } @@ -63,7 +63,6 @@ function tagrm_content(&$a) { // NOTREACHED } - $r = q("SELECT * FROM `item` WHERE `id` = %d AND `uid` = %d LIMIT 1", intval($item), intval(local_user()) @@ -75,8 +74,9 @@ function tagrm_content(&$a) { $arr = explode(',', $r[0]['tag']); - if(! count($arr)) + if (! count($arr)) { goaway(App::get_baseurl() . '/' . $_SESSION['photo_return']); + } $o .= '

' . t('Remove Item Tag') . '

'; diff --git a/mod/uexport.php b/mod/uexport.php index d9bd5ae01e..140f19a59b 100644 --- a/mod/uexport.php +++ b/mod/uexport.php @@ -1,11 +1,12 @@ t('default'), - 'greenzero'=>t('greenzero'), - 'purplezero'=>t('purplezero'), - 'easterbunny'=>t('easterbunny'), - 'darkzero'=>t('darkzero'), - 'comix'=>t('comix'), - 'slackr'=>t('slackr'), - ); - if ($user) { - $color = get_pconfig(local_user(), 'duepuntozero', 'colorset'); - } else { - $color = get_config( 'duepuntozero', 'colorset'); - } - $t = get_markup_template("theme_settings.tpl" ); - $o .= replace_macros($t, array( - '$submit' => t('Submit'), - '$baseurl' => App::get_baseurl(), - '$title' => t("Theme settings"), - '$colorset' => array('duepuntozero_colorset', t('Variations'), $color, '', $colorset), - )); - return $o; + $colorset = array( + 'default'=>t('default'), + 'greenzero'=>t('greenzero'), + 'purplezero'=>t('purplezero'), + 'easterbunny'=>t('easterbunny'), + 'darkzero'=>t('darkzero'), + 'comix'=>t('comix'), + 'slackr'=>t('slackr'), + ); + + if ($user) { + $color = get_pconfig(local_user(), 'duepuntozero', 'colorset'); + } else { + $color = get_config( 'duepuntozero', 'colorset'); + } + + $t = get_markup_template("theme_settings.tpl" ); + /// @TODO No need for adding string here, $o is not defined + $o .= replace_macros($t, array( + '$submit' => t('Submit'), + '$baseurl' => App::get_baseurl(), + '$title'=> t("Theme settings"), + '$colorset' => array('duepuntozero_colorset', t('Variations'), $color, '', $colorset), + )); + + return $o; } diff --git a/view/theme/frio/config.php b/view/theme/frio/config.php index 589f1591a0..edd16bd71f 100644 --- a/view/theme/frio/config.php +++ b/view/theme/frio/config.php @@ -2,7 +2,9 @@ require_once('view/theme/frio/php/Image.php'); function theme_content(&$a) { - if(!local_user()) { return;} + if (!local_user()) { + return; + } $arr = array(); $arr["schema"] = get_pconfig(local_user(),'frio', 'schema'); @@ -18,7 +20,10 @@ function theme_content(&$a) { } function theme_post(&$a) { - if(!local_user()) { return;} + if (!local_user()) { + return; + } + if (isset($_POST['frio-settings-submit'])) { set_pconfig(local_user(), 'frio', 'schema', $_POST["frio_schema"]); set_pconfig(local_user(), 'frio', 'nav_bg', $_POST["frio_nav_bg"]); diff --git a/view/theme/quattro/config.php b/view/theme/quattro/config.php index 2a32b9f05a..9a08adbaf9 100644 --- a/view/theme/quattro/config.php +++ b/view/theme/quattro/config.php @@ -6,21 +6,23 @@ function theme_content(&$a){ - if(!local_user()) - return; - + if (!local_user()) { + return; + } + $align = get_pconfig(local_user(), 'quattro', 'align' ); $color = get_pconfig(local_user(), 'quattro', 'color' ); - $tfs = get_pconfig(local_user(),"quattro","tfs"); - $pfs = get_pconfig(local_user(),"quattro","pfs"); - + $tfs = get_pconfig(local_user(),"quattro","tfs"); + $pfs = get_pconfig(local_user(),"quattro","pfs"); + return quattro_form($a,$align, $color, $tfs, $pfs); } function theme_post(&$a){ - if(! local_user()) + if (! local_user()) { return; - + } + if (isset($_POST['quattro-settings-submit'])){ set_pconfig(local_user(), 'quattro', 'align', $_POST['quattro_align']); set_pconfig(local_user(), 'quattro', 'color', $_POST['quattro_color']); diff --git a/view/theme/vier/config.php b/view/theme/vier/config.php index 0f07ff9a1e..2989f6c5cf 100644 --- a/view/theme/vier/config.php +++ b/view/theme/vier/config.php @@ -6,19 +6,23 @@ function theme_content(&$a){ - if(!local_user()) + if (!local_user()) { return; + } - if (!function_exists('get_vier_config')) + if (!function_exists('get_vier_config')) { return; + } $style = get_pconfig(local_user(), 'vier', 'style'); - if ($style == "") + if ($style == "") { $style = get_config('vier', 'style'); + } - if ($style == "") + if ($style == "") { $style = "plus"; + } $show_pages = get_vier_config('show_pages', true); $show_profiles = get_vier_config('show_profiles', true); @@ -32,8 +36,9 @@ function theme_content(&$a){ } function theme_post(&$a){ - if(! local_user()) + if (! local_user()) { return; + } if (isset($_POST['vier-settings-submit'])){ set_pconfig(local_user(), 'vier', 'style', $_POST['vier_style']); -- 2.39.5