added much more curly braces + space between "if" and brace

Signed-off-by: Roland Häder <roland@mxchange.org>

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
This commit is contained in:
Roland Häder 2016-12-20 11:56:34 +01:00
parent 5f41375ad3
commit ace8f753ac
50 changed files with 225 additions and 165 deletions

View file

@ -124,8 +124,9 @@ The selected 1st part will be saved in the database by the theme_post function.
function theme_post(&$a){ function theme_post(&$a){
// non local users shall not pass // non local users shall not pass
if(! local_user()) if (! local_user()) {
return; return;
}
// if the one specific submit button was pressed then proceed // if the one specific submit button was pressed then proceed
if (isset($_POST['duepuntozero-settings-submit'])){ if (isset($_POST['duepuntozero-settings-submit'])){
// and save the selection key into the personal config of the user // and save the selection key into the personal config of the user

View file

@ -392,8 +392,9 @@ function construct_acl_data(&$a, $user) {
function acl_lookup(&$a, $out_type = 'json') { function acl_lookup(&$a, $out_type = 'json') {
if(!local_user()) if (!local_user()) {
return ""; return '';
}
$start = (x($_REQUEST,'start') ? $_REQUEST['start'] : 0); $start = (x($_REQUEST,'start') ? $_REQUEST['start'] : 0);
$count = (x($_REQUEST,'count') ? $_REQUEST['count'] : 100); $count = (x($_REQUEST,'count') ? $_REQUEST['count'] : 100);

View file

@ -80,11 +80,13 @@ function networks_widget($baseurl,$selected = '') {
$a = get_app(); $a = get_app();
if(!local_user()) if (!local_user()) {
return ''; return '';
}
if(!feature_enabled(local_user(),'networks')) if (!feature_enabled(local_user(),'networks')) {
return ''; return '';
}
$extra_sql = unavailable_networks(); $extra_sql = unavailable_networks();
@ -116,15 +118,18 @@ function networks_widget($baseurl,$selected = '') {
} }
function fileas_widget($baseurl,$selected = '') { function fileas_widget($baseurl,$selected = '') {
if(! local_user()) if (! local_user()) {
return ''; return '';
}
if(! feature_enabled(local_user(),'filing')) if (! feature_enabled(local_user(),'filing')) {
return ''; return '';
}
$saved = get_pconfig(local_user(),'system','filetags'); $saved = get_pconfig(local_user(),'system','filetags');
if(! strlen($saved)) if (! strlen($saved)) {
return; return;
}
$matches = false; $matches = false;
$terms = array(); $terms = array();

View file

@ -234,7 +234,7 @@ function group_side($every="contacts",$each="group",$editmode = "standard", $gro
$o = ''; $o = '';
if(! local_user()) if (! local_user())
return ''; return '';
$groups = array(); $groups = array();

View file

@ -8,16 +8,18 @@ require_once('mod/contacts.php');
function allfriends_content(&$a) { function allfriends_content(&$a) {
$o = ''; $o = '';
if(! local_user()) { if (! local_user()) {
notice( t('Permission denied.') . EOL); notice( t('Permission denied.') . EOL);
return; return;
} }
if($a->argc > 1) if ($a->argc > 1) {
$cid = intval($a->argv[1]); $cid = intval($a->argv[1]);
}
if(! $cid) if (! $cid) {
return; return;
}
$uid = $a->user[uid]; $uid = $a->user[uid];
@ -26,7 +28,8 @@ function allfriends_content(&$a) {
intval(local_user()) intval(local_user())
); );
if(! count($c)) if (! count($c)) {
}
return; return;
$a->page['aside'] = ""; $a->page['aside'] = "";

View file

@ -22,7 +22,7 @@ function oauth_get_client($request){
function api_post(&$a) { function api_post(&$a) {
if(! local_user()) { if (! local_user()) {
notice( t('Permission denied.') . EOL); notice( t('Permission denied.') . EOL);
return; 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 /// @TODO We need login form to redirect to this page
notice( t('Please login to continue.') . EOL ); notice( t('Please login to continue.') . EOL );
return login(false,$request->get_parameters()); return login(false,$request->get_parameters());

View file

@ -8,7 +8,7 @@ function bookmarklet_init(&$a) {
} }
function bookmarklet_content(&$a) { function bookmarklet_content(&$a) {
if(!local_user()) { if (!local_user()) {
$o = '<h2>'.t('Login').'</h2>'; $o = '<h2>'.t('Login').'</h2>';
$o .= login(($a->config['register_policy'] == REGISTER_CLOSED) ? false : true); $o .= login(($a->config['register_policy'] == REGISTER_CLOSED) ? false : true);
return $o; return $o;

View file

@ -1,7 +1,7 @@
<?php <?php
function community_init(&$a) { function community_init(&$a) {
if(! local_user()) { if (! local_user()) {
unset($_SESSION['theme']); unset($_SESSION['theme']);
unset($_SESSION['mobile-theme']); unset($_SESSION['mobile-theme']);
} }

View file

@ -5,7 +5,7 @@ require_once('include/group.php');
function contactgroup_content(&$a) { function contactgroup_content(&$a) {
if(! local_user()) { if (! local_user()) {
killme(); killme();
} }

View file

@ -8,8 +8,9 @@ require_once('mod/proxy.php');
require_once('include/Photo.php'); require_once('include/Photo.php');
function contacts_init(&$a) { function contacts_init(&$a) {
if(! local_user()) if (! local_user()) {
return; return;
}
$contact_id = 0; $contact_id = 0;
@ -138,8 +139,9 @@ function contacts_batch_actions(&$a){
function contacts_post(&$a) { function contacts_post(&$a) {
if(! local_user()) if (! local_user()) {
return; return;
}
if ($a->argv[1]==="batch") { if ($a->argv[1]==="batch") {
contacts_batch_actions($a); contacts_batch_actions($a);
@ -147,15 +149,16 @@ function contacts_post(&$a) {
} }
$contact_id = intval($a->argv[1]); $contact_id = intval($a->argv[1]);
if(! $contact_id) if (! $contact_id) {
return; return;
}
$orig_record = q("SELECT * FROM `contact` WHERE `id` = %d AND `uid` = %d LIMIT 1", $orig_record = q("SELECT * FROM `contact` WHERE `id` = %d AND `uid` = %d LIMIT 1",
intval($contact_id), intval($contact_id),
intval(local_user()) intval(local_user())
); );
if(! count($orig_record)) { if (! count($orig_record)) {
notice( t('Could not access contact record.') . EOL); notice( t('Could not access contact record.') . EOL);
goaway('contacts'); goaway('contacts');
return; // NOTREACHED return; // NOTREACHED
@ -164,7 +167,7 @@ function contacts_post(&$a) {
call_hooks('contact_edit_post', $_POST); call_hooks('contact_edit_post', $_POST);
$profile_id = intval($_POST['profile-assign']); $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", $r = q("SELECT `id` FROM `profile` WHERE `id` = %d AND `uid` = %d LIMIT 1",
intval($profile_id), intval($profile_id),
intval(local_user()) intval(local_user())
@ -346,7 +349,7 @@ function contacts_content(&$a) {
nav_set_selected('contacts'); nav_set_selected('contacts');
if(! local_user()) { if (! local_user()) {
notice( t('Permission denied.') . EOL); notice( t('Permission denied.') . EOL);
return; return;
} }

View file

@ -23,7 +23,7 @@ function content_content(&$a, $update = 0) {
// Currently security is based on the logged in user // Currently security is based on the logged in user
if(! local_user()) { if (! local_user()) {
return; return;
} }

View file

@ -3,8 +3,9 @@ require_once("include/contact_selectors.php");
require_once("mod/contacts.php"); require_once("mod/contacts.php");
function crepair_init(&$a) { function crepair_init(&$a) {
if(! local_user()) if (! local_user()) {
return; return;
}
$contact_id = 0; $contact_id = 0;
@ -29,10 +30,10 @@ function crepair_init(&$a) {
} }
} }
function crepair_post(&$a) { function crepair_post(&$a) {
if(! local_user()) if (! local_user()) {
return; return;
}
$cid = (($a->argc > 1) ? intval($a->argv[1]) : 0); $cid = (($a->argc > 1) ? intval($a->argv[1]) : 0);
@ -97,7 +98,7 @@ function crepair_post(&$a) {
function crepair_content(&$a) { function crepair_content(&$a) {
if(! local_user()) { if (! local_user()) {
notice( t('Permission denied.') . EOL); notice( t('Permission denied.') . EOL);
return; return;
} }

View file

@ -8,7 +8,7 @@ function delegate_init(&$a) {
function delegate_content(&$a) { function delegate_content(&$a) {
if(! local_user()) { if (! local_user()) {
notice( t('Permission denied.') . EOL); notice( t('Permission denied.') . EOL);
return; return;
} }

View file

@ -7,7 +7,7 @@ require_once('mod/contacts.php');
function dirfind_init(&$a) { function dirfind_init(&$a) {
if(! local_user()) { if (! local_user()) {
notice( t('Permission denied.') . EOL ); notice( t('Permission denied.') . EOL );
return; return;
} }

View file

@ -6,14 +6,14 @@ function editpost_content(&$a) {
$o = ''; $o = '';
if(! local_user()) { if (! local_user()) {
notice( t('Permission denied.') . EOL); notice( t('Permission denied.') . EOL);
return; return;
} }
$post_id = (($a->argc > 1) ? intval($a->argv[1]) : 0); $post_id = (($a->argc > 1) ? intval($a->argv[1]) : 0);
if(! $post_id) { if (! $post_id) {
notice( t('Item not found') . EOL); notice( t('Item not found') . EOL);
return; return;
} }
@ -23,7 +23,7 @@ function editpost_content(&$a) {
intval(local_user()) intval(local_user())
); );
if(! count($itm)) { if (! count($itm)) {
notice( t('Item not found') . EOL); notice( t('Item not found') . EOL);
return; return;
} }

View file

@ -9,8 +9,9 @@ require_once('include/event.php');
require_once('include/items.php'); require_once('include/items.php');
function events_init(&$a) { function events_init(&$a) {
if(! local_user()) if (! local_user()) {
return; return;
}
if($a->argc == 1) { if($a->argc == 1) {
// if it's a json request abort here becaus we don't // 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)); logger('post: ' . print_r($_REQUEST,true));
if(! local_user()) if (! local_user()) {
return; return;
}
$event_id = ((x($_POST,'event_id')) ? intval($_POST['event_id']) : 0); $event_id = ((x($_POST,'event_id')) ? intval($_POST['event_id']) : 0);
$cid = ((x($_POST,'cid')) ? intval($_POST['cid']) : 0); $cid = ((x($_POST,'cid')) ? intval($_POST['cid']) : 0);
@ -186,7 +188,7 @@ function events_post(&$a) {
function events_content(&$a) { function events_content(&$a) {
if(! local_user()) { if (! local_user()) {
notice( t('Permission denied.') . EOL); notice( t('Permission denied.') . EOL);
return; return;
} }

View file

@ -7,7 +7,7 @@ require_once('include/items.php');
function filer_content(&$a) { function filer_content(&$a) {
if(! local_user()) { if (! local_user()) {
killme(); killme();
} }

View file

@ -2,7 +2,7 @@
function filerm_content(&$a) { function filerm_content(&$a) {
if(! local_user()) { if (! local_user()) {
killme(); killme();
} }

View file

@ -7,7 +7,7 @@ require_once('include/contact_selectors.php');
function follow_content(&$a) { function follow_content(&$a) {
if(! local_user()) { if (! local_user()) {
notice( t('Permission denied.') . EOL); notice( t('Permission denied.') . EOL);
goaway($_SESSION['return_url']); goaway($_SESSION['return_url']);
// NOTREACHED // NOTREACHED
@ -151,7 +151,7 @@ function follow_content(&$a) {
function follow_post(&$a) { function follow_post(&$a) {
if(! local_user()) { if (! local_user()) {
notice( t('Permission denied.') . EOL); notice( t('Permission denied.') . EOL);
goaway($_SESSION['return_url']); goaway($_SESSION['return_url']);
// NOTREACHED // NOTREACHED

View file

@ -3,12 +3,13 @@
function fsuggest_post(&$a) { function fsuggest_post(&$a) {
if(! local_user()) { if (! local_user()) {
return; return;
} }
if($a->argc != 2) if ($a->argc != 2) {
return; return;
}
$contact_id = intval($a->argv[1]); $contact_id = intval($a->argv[1]);
@ -74,7 +75,7 @@ function fsuggest_content(&$a) {
require_once('include/acl_selectors.php'); require_once('include/acl_selectors.php');
if(! local_user()) { if (! local_user()) {
notice( t('Permission denied.') . EOL); notice( t('Permission denied.') . EOL);
return; return;
} }

View file

@ -15,7 +15,7 @@ function group_init(&$a) {
function group_post(&$a) { function group_post(&$a) {
if(! local_user()) { if (! local_user()) {
notice( t('Permission denied.') . EOL); notice( t('Permission denied.') . EOL);
return; return;
} }
@ -73,7 +73,7 @@ function group_post(&$a) {
function group_content(&$a) { function group_content(&$a) {
$change = false; $change = false;
if(! local_user()) { if (! local_user()) {
notice( t('Permission denied') . EOL); notice( t('Permission denied') . EOL);
return; return;
} }

View file

@ -5,12 +5,15 @@ function ignored_init(&$a) {
$ignored = 0; $ignored = 0;
if(! local_user()) if (! local_user()) {
killme(); killme();
if($a->argc > 1) }
if ($a->argc > 1) {
$message_id = intval($a->argv[1]); $message_id = intval($a->argv[1]);
if(! $message_id) }
if (! $message_id) {
killme(); killme();
}
$r = q("SELECT `ignored` FROM `thread` WHERE `uid` = %d AND `iid` = %d LIMIT 1", $r = q("SELECT `ignored` FROM `thread` WHERE `uid` = %d AND `iid` = %d LIMIT 1",
intval(local_user()), intval(local_user()),
@ -20,8 +23,9 @@ function ignored_init(&$a) {
killme(); killme();
} }
if(! intval($r[0]['ignored'])) if (! intval($r[0]['ignored'])) {
$ignored = 1; $ignored = 1;
}
$r = q("UPDATE `thread` SET `ignored` = %d WHERE `uid` = %d and `iid` = %d", $r = q("UPDATE `thread` SET `ignored` = %d WHERE `uid` = %d and `iid` = %d",
intval($ignored), intval($ignored),
@ -31,7 +35,7 @@ function ignored_init(&$a) {
// See if we've been passed a return path to redirect to // See if we've been passed a return path to redirect to
$return_path = ((x($_REQUEST,'return')) ? $_REQUEST['return'] : ''); $return_path = ((x($_REQUEST,'return')) ? $_REQUEST['return'] : '');
if($return_path) { if ($return_path) {
$rand = '_=' . time(); $rand = '_=' . time();
if(strpos($return_path, '?')) $rand = "&$rand"; if(strpos($return_path, '?')) $rand = "&$rand";
else $rand = "?$rand"; else $rand = "?$rand";

View file

@ -11,7 +11,7 @@ require_once('include/email.php');
function invite_post(&$a) { function invite_post(&$a) {
if(! local_user()) { if (! local_user()) {
notice( t('Permission denied.') . EOL); notice( t('Permission denied.') . EOL);
return; return;
} }
@ -97,7 +97,7 @@ function invite_post(&$a) {
function invite_content(&$a) { function invite_content(&$a) {
if(! local_user()) { if (! local_user()) {
notice( t('Permission denied.') . EOL); notice( t('Permission denied.') . EOL);
return; return;
} }

View file

@ -5,8 +5,9 @@ require_once("include/text.php");
function manage_post(&$a) { function manage_post(&$a) {
if(! local_user()) if (! local_user()) {
return; return;
}
$uid = local_user(); $uid = local_user();
$orig_record = $a->user; $orig_record = $a->user;
@ -93,7 +94,7 @@ function manage_post(&$a) {
function manage_content(&$a) { function manage_content(&$a) {
if(! local_user()) { if (! local_user()) {
notice( t('Permission denied.') . EOL); notice( t('Permission denied.') . EOL);
return; return;
} }

View file

@ -16,8 +16,9 @@ require_once('mod/proxy.php');
function match_content(&$a) { function match_content(&$a) {
$o = ''; $o = '';
if(! local_user()) if (! local_user()) {
return; return;
}
$a->page['aside'] .= findpeople_widget(); $a->page['aside'] .= findpeople_widget();
$a->page['aside'] .= follow_widget(); $a->page['aside'] .= follow_widget();

View file

@ -42,7 +42,7 @@ function message_init(&$a) {
function message_post(&$a) { function message_post(&$a) {
if(! local_user()) { if (! local_user()) {
notice( t('Permission denied.') . EOL); notice( t('Permission denied.') . EOL);
return; return;
} }
@ -178,7 +178,7 @@ function message_content(&$a) {
$o = ''; $o = '';
nav_set_selected('messages'); nav_set_selected('messages');
if(! local_user()) { if (! local_user()) {
notice( t('Permission denied.') . EOL); notice( t('Permission denied.') . EOL);
return; return;
} }

View file

@ -7,8 +7,9 @@ require_once('include/items.php');
function mood_init(&$a) { function mood_init(&$a) {
if(! local_user()) if (! local_user()) {
return; return;
}
$uid = local_user(); $uid = local_user();
$verb = notags(trim($_GET['verb'])); $verb = notags(trim($_GET['verb']));
@ -110,7 +111,7 @@ function mood_init(&$a) {
function mood_content(&$a) { function mood_content(&$a) {
if(! local_user()) { if (! local_user()) {
notice( t('Permission denied.') . EOL); notice( t('Permission denied.') . EOL);
return; return;
} }

View file

@ -1,6 +1,6 @@
<?php <?php
function network_init(&$a) { function network_init(&$a) {
if(! local_user()) { if (! local_user()) {
notice( t('Permission denied.') . EOL); notice( t('Permission denied.') . EOL);
return; return;
} }
@ -308,7 +308,7 @@ function network_content(&$a, $update = 0) {
require_once('include/conversation.php'); require_once('include/conversation.php');
if(! local_user()) { if (! local_user()) {
$_SESSION['return_url'] = $a->query_string; $_SESSION['return_url'] = $a->query_string;
return login(false); return login(false);
} }

View file

@ -6,14 +6,16 @@ require_once('include/contact_selectors.php');
function nogroup_init(&$a) { function nogroup_init(&$a) {
if(! local_user()) if (! local_user()) {
return; return;
}
require_once('include/group.php'); require_once('include/group.php');
require_once('include/contact_widgets.php'); require_once('include/contact_widgets.php');
if(! x($a->page,'aside')) if (! x($a->page,'aside')) {
$a->page['aside'] = ''; $a->page['aside'] = '';
}
$a->page['aside'] .= group_side('contacts','group','extended',0,$contact_id); $a->page['aside'] .= group_side('contacts','group','extended',0,$contact_id);
} }
@ -21,7 +23,7 @@ function nogroup_init(&$a) {
function nogroup_content(&$a) { function nogroup_content(&$a) {
if(! local_user()) { if (! local_user()) {
notice( t('Permission denied.') . EOL); notice( t('Permission denied.') . EOL);
return ''; return '';
} }

View file

@ -2,8 +2,9 @@
function notes_init(&$a) { function notes_init(&$a) {
if(! local_user()) if (! local_user()) {
return; return;
}
$profile = 0; $profile = 0;
@ -18,7 +19,7 @@ function notes_init(&$a) {
function notes_content(&$a,$update = false) { function notes_content(&$a,$update = false) {
if(! local_user()) { if (! local_user()) {
notice( t('Permission denied.') . EOL); notice( t('Permission denied.') . EOL);
return; return;
} }

View file

@ -11,7 +11,7 @@ require_once("include/network.php");
function notifications_post(&$a) { function notifications_post(&$a) {
if(! local_user()) { if (! local_user()) {
goaway(z_root()); goaway(z_root());
} }
@ -67,7 +67,7 @@ function notifications_post(&$a) {
function notifications_content(&$a) { function notifications_content(&$a) {
if(! local_user()) { if (! local_user()) {
notice( t('Permission denied.') . EOL); notice( t('Permission denied.') . EOL);
return; return;
} }

View file

@ -16,12 +16,12 @@ function oexchange_init(&$a) {
function oexchange_content(&$a) { function oexchange_content(&$a) {
if(! local_user()) { if (! local_user()) {
$o = login(false); $o = login(false);
return $o; return $o;
} }
if(($a->argc > 1) && $a->argv[1] === 'done') { if (($a->argc > 1) && $a->argv[1] === 'done') {
info( t('Post successful.') . EOL); info( t('Post successful.') . EOL);
return; return;
} }

View file

@ -5,7 +5,7 @@ require_once('include/follow.php');
function ostatus_subscribe_content(&$a) { function ostatus_subscribe_content(&$a) {
if(! local_user()) { if (! local_user()) {
notice( t('Permission denied.') . EOL); notice( t('Permission denied.') . EOL);
goaway($_SESSION['return_url']); goaway($_SESSION['return_url']);
// NOTREACHED // NOTREACHED

View file

@ -21,25 +21,29 @@ require_once('include/items.php');
function poke_init(&$a) { function poke_init(&$a) {
if(! local_user()) if (! local_user()) {
return; return;
}
$uid = local_user(); $uid = local_user();
$verb = notags(trim($_GET['verb'])); $verb = notags(trim($_GET['verb']));
if(! $verb) if (! $verb) {
return; return;
}
$verbs = get_poke_verbs(); $verbs = get_poke_verbs();
if(! array_key_exists($verb,$verbs)) if (! array_key_exists($verb,$verbs)) {
return; return;
}
$activity = ACTIVITY_POKE . '#' . urlencode($verbs[$verb][0]); $activity = ACTIVITY_POKE . '#' . urlencode($verbs[$verb][0]);
$contact_id = intval($_GET['cid']); $contact_id = intval($_GET['cid']);
if(! $contact_id) if (! $contact_id) {
return; return;
}
$parent = ((x($_GET,'parent')) ? intval($_GET['parent']) : 0); $parent = ((x($_GET,'parent')) ? intval($_GET['parent']) : 0);
@ -146,7 +150,7 @@ function poke_init(&$a) {
function poke_content(&$a) { function poke_content(&$a) {
if(! local_user()) { if (! local_user()) {
notice( t('Permission denied.') . EOL); notice( t('Permission denied.') . EOL);
return; return;
} }

View file

@ -4,7 +4,7 @@ require_once("include/Photo.php");
function profile_photo_init(&$a) { function profile_photo_init(&$a) {
if(! local_user()) { if (! local_user()) {
return; return;
} }
@ -15,7 +15,7 @@ function profile_photo_init(&$a) {
function profile_photo_post(&$a) { function profile_photo_post(&$a) {
if(! local_user()) { if (! local_user()) {
notice ( t('Permission denied.') . EOL ); notice ( t('Permission denied.') . EOL );
return; return;
} }
@ -172,7 +172,7 @@ function profile_photo_post(&$a) {
if(! function_exists('profile_photo_content')) { if(! function_exists('profile_photo_content')) {
function profile_photo_content(&$a) { function profile_photo_content(&$a) {
if(! local_user()) { if (! local_user()) {
notice( t('Permission denied.') . EOL ); notice( t('Permission denied.') . EOL );
return; return;
} }

View file

@ -6,7 +6,7 @@ function profiles_init(&$a) {
nav_set_selected('profiles'); nav_set_selected('profiles');
if(! local_user()) { if (! local_user()) {
return; return;
} }
@ -162,7 +162,7 @@ function profile_clean_keywords($keywords) {
function profiles_post(&$a) { function profiles_post(&$a) {
if(! local_user()) { if (! local_user()) {
notice( t('Permission denied.') . EOL); notice( t('Permission denied.') . EOL);
return; return;
} }
@ -595,14 +595,15 @@ function profile_activity($changed, $value) {
$arr['deny_gid'] = $a->user['deny_gid']; $arr['deny_gid'] = $a->user['deny_gid'];
$i = item_store($arr); $i = item_store($arr);
if($i) if ($i) {
proc_run(PRIORITY_HIGH, "include/notifier.php", "activity", $i); proc_run(PRIORITY_HIGH, "include/notifier.php", "activity", $i);
}
} }
function profiles_content(&$a) { function profiles_content(&$a) {
if(! local_user()) { if (! local_user()) {
notice( t('Permission denied.') . EOL); notice( t('Permission denied.') . EOL);
return; return;
} }

View file

@ -2,8 +2,9 @@
function profperm_init(&$a) { function profperm_init(&$a) {
if(! local_user()) if (! local_user()) {
return; return;
}
$which = $a->user['nickname']; $which = $a->user['nickname'];
$profile = $a->argv[1]; $profile = $a->argv[1];
@ -15,7 +16,7 @@ function profperm_init(&$a) {
function profperm_content(&$a) { function profperm_content(&$a) {
if(! local_user()) { if (! local_user()) {
notice( t('Permission denied') . EOL); notice( t('Permission denied') . EOL);
return; return;
} }

View file

@ -2,8 +2,9 @@
function qsearch_init(&$a) { function qsearch_init(&$a) {
if(! local_user()) if (! local_user()) {
killme(); killme();
}
$limit = (get_config('system','qsearch_limit') ? intval(get_config('system','qsearch_limit')) : 100); $limit = (get_config('system','qsearch_limit') ? intval(get_config('system','qsearch_limit')) : 100);

View file

@ -101,32 +101,33 @@ function regmod_content(&$a) {
$_SESSION['return_url'] = $a->cmd; $_SESSION['return_url'] = $a->cmd;
if(! local_user()) { if (! local_user()) {
info( t('Please login.') . EOL); info( t('Please login.') . EOL);
$o .= '<br /><br />' . login(($a->config['register_policy'] == REGISTER_CLOSED) ? 0 : 1); $o .= '<br /><br />' . login(($a->config['register_policy'] == REGISTER_CLOSED) ? 0 : 1);
return $o; 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); notice( t('Permission denied.') . EOL);
return ''; return '';
} }
if($a->argc != 3) if ($a->argc != 3) {
killme(); killme();
}
$cmd = $a->argv[1]; $cmd = $a->argv[1];
$hash = $a->argv[2]; $hash = $a->argv[2];
if($cmd === 'deny') { if ($cmd === 'deny') {
user_deny($hash); user_deny($hash);
goaway(App::get_baseurl()."/admin/users/"); goaway(App::get_baseurl()."/admin/users/");
killme(); killme();
} }
if($cmd === 'allow') { if ($cmd === 'allow') {
user_allow($hash); user_allow($hash);
goaway(App::get_baseurl()."/admin/users/"); goaway(App::get_baseurl()."/admin/users/");
killme(); killme();

View file

@ -5,7 +5,7 @@ require_once('include/follow.php');
function repair_ostatus_content(&$a) { function repair_ostatus_content(&$a) {
if(! local_user()) { if (! local_user()) {
notice( t('Permission denied.') . EOL); notice( t('Permission denied.') . EOL);
goaway($_SESSION['return_url']); goaway($_SESSION['return_url']);
// NOTREACHED // NOTREACHED

View file

@ -18,7 +18,7 @@ function get_theme_config_file($theme){
function settings_init(&$a) { function settings_init(&$a) {
if(! local_user()) { if (! local_user()) {
notice( t('Permission denied.') . EOL ); notice( t('Permission denied.') . EOL );
return; return;
} }
@ -118,8 +118,9 @@ function settings_init(&$a) {
function settings_post(&$a) { function settings_post(&$a) {
if(! local_user()) if (! local_user()) {
return; return;
}
if (x($_SESSION,'submanage') && intval($_SESSION['submanage'])) { if (x($_SESSION,'submanage') && intval($_SESSION['submanage'])) {
return; return;
@ -658,7 +659,7 @@ function settings_content(&$a) {
$o = ''; $o = '';
nav_set_selected('settings'); nav_set_selected('settings');
if(! local_user()) { if (! local_user()) {
#notice( t('Permission denied.') . EOL ); #notice( t('Permission denied.') . EOL );
return; return;
} }

View file

@ -7,12 +7,15 @@ function starred_init(&$a) {
$starred = 0; $starred = 0;
if(! local_user()) if (! local_user()) {
killme(); killme();
if($a->argc > 1) }
if ($a->argc > 1) {
$message_id = intval($a->argv[1]); $message_id = intval($a->argv[1]);
if(! $message_id) }
if (! $message_id) {
killme(); killme();
}
$r = q("SELECT starred FROM item WHERE uid = %d AND id = %d LIMIT 1", $r = q("SELECT starred FROM item WHERE uid = %d AND id = %d LIMIT 1",
intval(local_user()), intval(local_user()),

View file

@ -5,12 +5,13 @@ require_once('include/contact_widgets.php');
function suggest_init(&$a) { function suggest_init(&$a) {
if(! local_user()) if (! local_user()) {
return; return;
}
if(x($_GET,'ignore') && intval($_GET['ignore'])) { if (x($_GET,'ignore') && intval($_GET['ignore'])) {
// Check if we should do HTML-based delete confirmation // Check if we should do HTML-based delete confirmation
if($_REQUEST['confirm']) { if ($_REQUEST['confirm']) {
// <form> can't take arguments in its "action" parameter // <form> can't take arguments in its "action" parameter
// so add any arguments as hidden inputs // so add any arguments as hidden inputs
$query = explode_querystring($a->query_string); $query = explode_querystring($a->query_string);
@ -35,7 +36,7 @@ function suggest_init(&$a) {
return; return;
} }
// Now check how the user responded to the confirmation query // 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 ) ", q("INSERT INTO `gcign` ( `uid`, `gcid` ) VALUES ( %d, %d ) ",
intval(local_user()), intval(local_user()),
intval($_GET['ignore']) intval($_GET['ignore'])
@ -54,7 +55,7 @@ function suggest_content(&$a) {
require_once("mod/proxy.php"); require_once("mod/proxy.php");
$o = ''; $o = '';
if(! local_user()) { if (! local_user()) {
notice( t('Permission denied.') . EOL); notice( t('Permission denied.') . EOL);
return; return;
} }

View file

@ -4,7 +4,7 @@ require_once('include/bbcode.php');
function tagrm_post(&$a) { function tagrm_post(&$a) {
if(! local_user()) if (! local_user())
goaway(App::get_baseurl() . '/' . $_SESSION['photo_return']); goaway(App::get_baseurl() . '/' . $_SESSION['photo_return']);
@ -52,7 +52,7 @@ function tagrm_content(&$a) {
$o = ''; $o = '';
if(! local_user()) { if (! local_user()) {
goaway(App::get_baseurl() . '/' . $_SESSION['photo_return']); goaway(App::get_baseurl() . '/' . $_SESSION['photo_return']);
// NOTREACHED // NOTREACHED
} }
@ -63,7 +63,6 @@ function tagrm_content(&$a) {
// NOTREACHED // NOTREACHED
} }
$r = q("SELECT * FROM `item` WHERE `id` = %d AND `uid` = %d LIMIT 1", $r = q("SELECT * FROM `item` WHERE `id` = %d AND `uid` = %d LIMIT 1",
intval($item), intval($item),
intval(local_user()) intval(local_user())
@ -75,8 +74,9 @@ function tagrm_content(&$a) {
$arr = explode(',', $r[0]['tag']); $arr = explode(',', $r[0]['tag']);
if(! count($arr)) if (! count($arr)) {
goaway(App::get_baseurl() . '/' . $_SESSION['photo_return']); goaway(App::get_baseurl() . '/' . $_SESSION['photo_return']);
}
$o .= '<h3>' . t('Remove Item Tag') . '</h3>'; $o .= '<h3>' . t('Remove Item Tag') . '</h3>';

View file

@ -1,11 +1,12 @@
<?php <?php
function uexport_init(&$a){ function uexport_init(&$a){
if(! local_user()) if (! local_user()) {
killme(); killme();
}
require_once("mod/settings.php"); require_once("mod/settings.php");
settings_init($a); settings_init($a);
} }
function uexport_content(&$a){ function uexport_content(&$a){

View file

@ -3,7 +3,7 @@
function viewsrc_content(&$a) { function viewsrc_content(&$a) {
if(! local_user()) { if (! local_user()) {
notice( t('Access denied.') . EOL); notice( t('Access denied.') . EOL);
return; return;
} }

View file

@ -6,60 +6,67 @@
function theme_content(&$a){ function theme_content(&$a){
if(!local_user()) if (!local_user()) {
return; return;
}
$colorset = get_pconfig( local_user(), 'duepuntozero', 'colorset'); $colorset = get_pconfig( local_user(), 'duepuntozero', 'colorset');
$user = true; $user = true;
return clean_form($a, $colorset, $user); return clean_form($a, $colorset, $user);
} }
function theme_post(&$a){ function theme_post(&$a){
if(! local_user())
return; if (! local_user()) {
return;
if (isset($_POST['duepuntozero-settings-submit'])){ }
set_pconfig(local_user(), 'duepuntozero', 'colorset', $_POST['duepuntozero_colorset']);
} if (isset($_POST['duepuntozero-settings-submit'])){
set_pconfig(local_user(), 'duepuntozero', 'colorset', $_POST['duepuntozero_colorset']);
}
} }
function theme_admin(&$a){ function theme_admin(&$a){
$colorset = get_config( 'duepuntozero', 'colorset'); $colorset = get_config( 'duepuntozero', 'colorset');
$user = false; $user = false;
return clean_form($a, $colorset, $user); return clean_form($a, $colorset, $user);
} }
function theme_admin_post(&$a){ function theme_admin_post(&$a){
if (isset($_POST['duepuntozero-settings-submit'])){ if (isset($_POST['duepuntozero-settings-submit'])){
set_config('duepuntozero', 'colorset', $_POST['duepuntozero_colorset']); set_config('duepuntozero', 'colorset', $_POST['duepuntozero_colorset']);
} }
} }
/// @TODO $a is no longer used /// @TODO $a is no longer used
function clean_form(&$a, &$colorset, $user){ function clean_form(&$a, &$colorset, $user){
$colorset = array( $colorset = array(
'default'=>t('default'), 'default'=>t('default'),
'greenzero'=>t('greenzero'), 'greenzero'=>t('greenzero'),
'purplezero'=>t('purplezero'), 'purplezero'=>t('purplezero'),
'easterbunny'=>t('easterbunny'), 'easterbunny'=>t('easterbunny'),
'darkzero'=>t('darkzero'), 'darkzero'=>t('darkzero'),
'comix'=>t('comix'), 'comix'=>t('comix'),
'slackr'=>t('slackr'), 'slackr'=>t('slackr'),
); );
if ($user) {
$color = get_pconfig(local_user(), 'duepuntozero', 'colorset'); if ($user) {
} else { $color = get_pconfig(local_user(), 'duepuntozero', 'colorset');
$color = get_config( 'duepuntozero', 'colorset'); } else {
} $color = get_config( 'duepuntozero', 'colorset');
$t = get_markup_template("theme_settings.tpl" ); }
$o .= replace_macros($t, array(
'$submit' => t('Submit'), $t = get_markup_template("theme_settings.tpl" );
'$baseurl' => App::get_baseurl(), /// @TODO No need for adding string here, $o is not defined
'$title' => t("Theme settings"), $o .= replace_macros($t, array(
'$colorset' => array('duepuntozero_colorset', t('Variations'), $color, '', $colorset), '$submit' => t('Submit'),
)); '$baseurl' => App::get_baseurl(),
return $o; '$title'=> t("Theme settings"),
'$colorset' => array('duepuntozero_colorset', t('Variations'), $color, '', $colorset),
));
return $o;
} }

View file

@ -2,7 +2,9 @@
require_once('view/theme/frio/php/Image.php'); require_once('view/theme/frio/php/Image.php');
function theme_content(&$a) { function theme_content(&$a) {
if(!local_user()) { return;} if (!local_user()) {
return;
}
$arr = array(); $arr = array();
$arr["schema"] = get_pconfig(local_user(),'frio', 'schema'); $arr["schema"] = get_pconfig(local_user(),'frio', 'schema');
@ -18,7 +20,10 @@ function theme_content(&$a) {
} }
function theme_post(&$a) { function theme_post(&$a) {
if(!local_user()) { return;} if (!local_user()) {
return;
}
if (isset($_POST['frio-settings-submit'])) { if (isset($_POST['frio-settings-submit'])) {
set_pconfig(local_user(), 'frio', 'schema', $_POST["frio_schema"]); set_pconfig(local_user(), 'frio', 'schema', $_POST["frio_schema"]);
set_pconfig(local_user(), 'frio', 'nav_bg', $_POST["frio_nav_bg"]); set_pconfig(local_user(), 'frio', 'nav_bg', $_POST["frio_nav_bg"]);

View file

@ -6,21 +6,23 @@
function theme_content(&$a){ function theme_content(&$a){
if(!local_user()) if (!local_user()) {
return; return;
}
$align = get_pconfig(local_user(), 'quattro', 'align' ); $align = get_pconfig(local_user(), 'quattro', 'align' );
$color = get_pconfig(local_user(), 'quattro', 'color' ); $color = get_pconfig(local_user(), 'quattro', 'color' );
$tfs = get_pconfig(local_user(),"quattro","tfs"); $tfs = get_pconfig(local_user(),"quattro","tfs");
$pfs = get_pconfig(local_user(),"quattro","pfs"); $pfs = get_pconfig(local_user(),"quattro","pfs");
return quattro_form($a,$align, $color, $tfs, $pfs); return quattro_form($a,$align, $color, $tfs, $pfs);
} }
function theme_post(&$a){ function theme_post(&$a){
if(! local_user()) if (! local_user()) {
return; return;
}
if (isset($_POST['quattro-settings-submit'])){ if (isset($_POST['quattro-settings-submit'])){
set_pconfig(local_user(), 'quattro', 'align', $_POST['quattro_align']); set_pconfig(local_user(), 'quattro', 'align', $_POST['quattro_align']);
set_pconfig(local_user(), 'quattro', 'color', $_POST['quattro_color']); set_pconfig(local_user(), 'quattro', 'color', $_POST['quattro_color']);

View file

@ -6,19 +6,23 @@
function theme_content(&$a){ function theme_content(&$a){
if(!local_user()) if (!local_user()) {
return; return;
}
if (!function_exists('get_vier_config')) if (!function_exists('get_vier_config')) {
return; return;
}
$style = get_pconfig(local_user(), 'vier', 'style'); $style = get_pconfig(local_user(), 'vier', 'style');
if ($style == "") if ($style == "") {
$style = get_config('vier', 'style'); $style = get_config('vier', 'style');
}
if ($style == "") if ($style == "") {
$style = "plus"; $style = "plus";
}
$show_pages = get_vier_config('show_pages', true); $show_pages = get_vier_config('show_pages', true);
$show_profiles = get_vier_config('show_profiles', true); $show_profiles = get_vier_config('show_profiles', true);
@ -32,8 +36,9 @@ function theme_content(&$a){
} }
function theme_post(&$a){ function theme_post(&$a){
if(! local_user()) if (! local_user()) {
return; return;
}
if (isset($_POST['vier-settings-submit'])){ if (isset($_POST['vier-settings-submit'])){
set_pconfig(local_user(), 'vier', 'style', $_POST['vier_style']); set_pconfig(local_user(), 'vier', 'style', $_POST['vier_style']);