function theme_post(App &$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
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);
$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();
}
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();
$o = '';
- if(! local_user())
+ if (! local_user())
return '';
$groups = array();
function allfriends_content(App &$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'];
intval(local_user())
);
- if(! count($c))
+ if (! count($c)) {
+ }
return;
$a->page['aside'] = "";
function api_post(App &$a) {
- if(! local_user()) {
+ if (! local_user()) {
notice( t('Permission denied.') . EOL);
return;
}
}
- 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());
}
function bookmarklet_content(App &$a) {
- if(!local_user()) {
+ if (!local_user()) {
$o = '<h2>'.t('Login').'</h2>';
$o .= login(($a->config['register_policy'] == REGISTER_CLOSED) ? false : true);
return $o;
<?php
function community_init(App &$a) {
- if(! local_user()) {
+ if (! local_user()) {
unset($_SESSION['theme']);
unset($_SESSION['mobile-theme']);
}
function contactgroup_content(App &$a) {
- if(! local_user()) {
+ if (! local_user()) {
killme();
}
require_once('include/Photo.php');
function contacts_init(App &$a) {
- if(! local_user())
+ if (! local_user()) {
return;
+ }
$contact_id = 0;
function contacts_post(App &$a) {
- if(! local_user())
+ if (! local_user()) {
return;
+ }
if ($a->argv[1]==="batch") {
contacts_batch_actions($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
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())
nav_set_selected('contacts');
- if(! local_user()) {
+ if (! local_user()) {
notice( t('Permission denied.') . EOL);
return;
}
// Currently security is based on the logged in user
- if(! local_user()) {
+ if (! local_user()) {
return;
}
require_once("mod/contacts.php");
function crepair_init(App &$a) {
- if(! local_user())
+ if (! local_user()) {
return;
+ }
$contact_id = 0;
function crepair_post(App &$a) {
- if(! local_user())
+ if (! local_user()) {
return;
+ }
$cid = (($a->argc > 1) ? intval($a->argv[1]) : 0);
function crepair_content(App &$a) {
- if(! local_user()) {
+ if (! local_user()) {
notice( t('Permission denied.') . EOL);
return;
}
function delegate_content(App &$a) {
- if(! local_user()) {
+ if (! local_user()) {
notice( t('Permission denied.') . EOL);
return;
}
function dirfind_init(App &$a) {
- if(! local_user()) {
+ if (! local_user()) {
notice( t('Permission denied.') . EOL );
return;
}
$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;
}
intval(local_user())
);
- if(! count($itm)) {
+ if (! count($itm)) {
notice( t('Item not found') . EOL);
return;
}
require_once('include/items.php');
function events_init(App &$a) {
- if(! local_user())
+ if (! local_user()) {
return;
+ }
if ($a->argc == 1) {
// if it's a json request abort here becaus we don't
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);
function events_content(App &$a) {
- if(! local_user()) {
+ if (! local_user()) {
notice( t('Permission denied.') . EOL);
return;
}
function filer_content(App &$a) {
- if(! local_user()) {
+ if (! local_user()) {
killme();
}
function filerm_content(App &$a) {
- if(! local_user()) {
+ if (! local_user()) {
killme();
}
function follow_content(App &$a) {
- if(! local_user()) {
+ if (! local_user()) {
notice( t('Permission denied.') . EOL);
goaway($_SESSION['return_url']);
// NOTREACHED
function follow_post(App &$a) {
- if(! local_user()) {
+ if (! local_user()) {
notice( t('Permission denied.') . EOL);
goaway($_SESSION['return_url']);
// NOTREACHED
function fsuggest_post(App &$a) {
- if(! local_user()) {
+ if (! local_user()) {
return;
}
- if($a->argc != 2)
+ if ($a->argc != 2) {
return;
+ }
$contact_id = intval($a->argv[1]);
require_once('include/acl_selectors.php');
- if(! local_user()) {
+ if (! local_user()) {
notice( t('Permission denied.') . EOL);
return;
}
function group_post(App &$a) {
- if(! local_user()) {
+ if (! local_user()) {
notice( t('Permission denied.') . EOL);
return;
}
function group_content(App &$a) {
$change = false;
- if(! local_user()) {
+ if (! local_user()) {
notice( t('Permission denied') . EOL);
return;
}
$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()),
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),
// 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";
function invite_post(App &$a) {
- if(! local_user()) {
+ if (! local_user()) {
notice( t('Permission denied.') . EOL);
return;
}
function invite_content(App &$a) {
- if(! local_user()) {
+ if (! local_user()) {
notice( t('Permission denied.') . EOL);
return;
}
function manage_post(App &$a) {
- if(! local_user())
+ if (! local_user()) {
return;
+ }
$uid = local_user();
$orig_record = $a->user;
function manage_content(App &$a) {
- if(! local_user()) {
+ if (! local_user()) {
notice( t('Permission denied.') . EOL);
return;
}
function match_content(App &$a) {
$o = '';
- if(! local_user())
+ if (! local_user()) {
return;
+ }
$a->page['aside'] .= findpeople_widget();
$a->page['aside'] .= follow_widget();
function message_post(App &$a) {
- if(! local_user()) {
+ if (! local_user()) {
notice( t('Permission denied.') . EOL);
return;
}
$o = '';
nav_set_selected('messages');
- if(! local_user()) {
+ if (! local_user()) {
notice( t('Permission denied.') . EOL);
return;
}
function mood_init(App &$a) {
- if(! local_user())
+ if (! local_user()) {
return;
+ }
$uid = local_user();
$verb = notags(trim($_GET['verb']));
function mood_content(App &$a) {
- if(! local_user()) {
+ if (! local_user()) {
notice( t('Permission denied.') . EOL);
return;
}
<?php
function network_init(App &$a) {
- if(! local_user()) {
+ if (! local_user()) {
notice( t('Permission denied.') . EOL);
return;
}
require_once('include/conversation.php');
- if(! local_user()) {
+ if (! local_user()) {
$_SESSION['return_url'] = $a->query_string;
return login(false);
}
function nogroup_init(App &$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);
}
function nogroup_content(App &$a) {
- if(! local_user()) {
+ if (! local_user()) {
notice( t('Permission denied.') . EOL);
return '';
}
function notes_init(App &$a) {
- if(! local_user())
+ if (! local_user()) {
return;
+ }
$profile = 0;
function notes_content(&$a,$update = false) {
- if(! local_user()) {
+ if (! local_user()) {
notice( t('Permission denied.') . EOL);
return;
}
function notifications_post(App &$a) {
- if(! local_user()) {
+ if (! local_user()) {
goaway(z_root());
}
function notifications_content(App &$a) {
- if(! local_user()) {
+ if (! local_user()) {
notice( t('Permission denied.') . EOL);
return;
}
function oexchange_content(App &$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;
}
function ostatus_subscribe_content(App &$a) {
- if(! local_user()) {
+ if (! local_user()) {
notice( t('Permission denied.') . EOL);
goaway($_SESSION['return_url']);
// NOTREACHED
function poke_init(App &$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);
function poke_content(App &$a) {
- if(! local_user()) {
+ if (! local_user()) {
notice( t('Permission denied.') . EOL);
return;
}
function profile_photo_init(App &$a) {
- if(! local_user()) {
+ if (! local_user()) {
return;
}
function profile_photo_post(App &$a) {
- if(! local_user()) {
+ if (! local_user()) {
notice ( t('Permission denied.') . EOL );
return;
}
if(! function_exists('profile_photo_content')) {
function profile_photo_content(App &$a) {
- if(! local_user()) {
+ if (! local_user()) {
notice( t('Permission denied.') . EOL );
return;
}
nav_set_selected('profiles');
- if(! local_user()) {
+ if (! local_user()) {
return;
}
function profiles_post(App &$a) {
- if(! local_user()) {
+ if (! local_user()) {
notice( t('Permission denied.') . EOL);
return;
}
$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(App &$a) {
- if(! local_user()) {
+ if (! local_user()) {
notice( t('Permission denied.') . EOL);
return;
}
function profperm_init(App &$a) {
- if(! local_user())
+ if (! local_user()) {
return;
+ }
$which = $a->user['nickname'];
$profile = $a->argv[1];
function profperm_content(App &$a) {
- if(! local_user()) {
+ if (! local_user()) {
notice( t('Permission denied') . EOL);
return;
}
function qsearch_init(App &$a) {
- if(! local_user())
+ if (! local_user()) {
killme();
+ }
$limit = (get_config('system','qsearch_limit') ? intval(get_config('system','qsearch_limit')) : 100);
$_SESSION['return_url'] = $a->cmd;
- if(! local_user()) {
+ if (! local_user()) {
info( t('Please login.') . EOL);
$o .= '<br /><br />' . 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();
function repair_ostatus_content(App &$a) {
- if(! local_user()) {
+ if (! local_user()) {
notice( t('Permission denied.') . EOL);
goaway($_SESSION['return_url']);
// NOTREACHED
function settings_init(App &$a) {
- if(! local_user()) {
+ if (! local_user()) {
notice( t('Permission denied.') . EOL );
return;
}
function settings_post(App &$a) {
- if(! local_user())
+ if (! local_user()) {
return;
+ }
if (x($_SESSION,'submanage') && intval($_SESSION['submanage'])) {
return;
$o = '';
nav_set_selected('settings');
- if(! local_user()) {
+ if (! local_user()) {
#notice( t('Permission denied.') . EOL );
return;
}
$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()),
function suggest_init(App &$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']) {
// <form> can't take arguments in its "action" parameter
// so add any arguments as hidden inputs
$query = explode_querystring($a->query_string);
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'])
require_once("mod/proxy.php");
$o = '';
- if(! local_user()) {
+ if (! local_user()) {
notice( t('Permission denied.') . EOL);
return;
}
function tagrm_post(App &$a) {
- if(! local_user())
+ if (! local_user())
goaway(App::get_baseurl() . '/' . $_SESSION['photo_return']);
$o = '';
- if(! local_user()) {
+ if (! local_user()) {
goaway(App::get_baseurl() . '/' . $_SESSION['photo_return']);
// NOTREACHED
}
// NOTREACHED
}
-
$r = q("SELECT * FROM `item` WHERE `id` = %d AND `uid` = %d LIMIT 1",
intval($item),
intval(local_user())
$arr = explode(',', $r[0]['tag']);
- if(! count($arr))
+ if (! count($arr)) {
goaway(App::get_baseurl() . '/' . $_SESSION['photo_return']);
+ }
$o .= '<h3>' . t('Remove Item Tag') . '</h3>';
<?php
function uexport_init(App &$a){
- if(! local_user())
+ if (! local_user()) {
killme();
+ }
require_once("mod/settings.php");
- settings_init($a);
+ settings_init($a);
}
function uexport_content(App &$a){
function viewsrc_content(App &$a) {
- if(! local_user()) {
+ if (! local_user()) {
notice( t('Access denied.') . EOL);
return;
}
function theme_content(App &$a){
- if(!local_user())
- return;
+ if (!local_user()) {
+ return;
+ }
- $colorset = get_pconfig( local_user(), 'duepuntozero', 'colorset');
- $user = true;
+ $colorset = get_pconfig( local_user(), 'duepuntozero', 'colorset');
+ $user = true;
- return clean_form($a, $colorset, $user);
+ return clean_form($a, $colorset, $user);
}
function theme_post(App &$a){
- if(! local_user())
- return;
-
- if (isset($_POST['duepuntozero-settings-submit'])){
- set_pconfig(local_user(), 'duepuntozero', 'colorset', $_POST['duepuntozero_colorset']);
- }
+ if (! local_user()) {
+ return;
+ }
+
+ if (isset($_POST['duepuntozero-settings-submit'])){
+ set_pconfig(local_user(), 'duepuntozero', 'colorset', $_POST['duepuntozero_colorset']);
+ }
}
function theme_admin(App &$a){
- $colorset = get_config( 'duepuntozero', 'colorset');
- $user = false;
+ $colorset = get_config( 'duepuntozero', 'colorset');
+ $user = false;
- return clean_form($a, $colorset, $user);
+ return clean_form($a, $colorset, $user);
}
function theme_admin_post(App &$a){
- if (isset($_POST['duepuntozero-settings-submit'])){
- set_config('duepuntozero', 'colorset', $_POST['duepuntozero_colorset']);
- }
+ if (isset($_POST['duepuntozero-settings-submit'])){
+ set_config('duepuntozero', 'colorset', $_POST['duepuntozero_colorset']);
+ }
}
/// @TODO $a is no longer used
function clean_form(&$a, &$colorset, $user){
- $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" );
- $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;
}
require_once('view/theme/frio/php/Image.php');
function theme_content(App &$a) {
- if(!local_user()) { return;}
+ if (!local_user()) {
+ return;
+ }
$arr = array();
$arr["schema"] = get_pconfig(local_user(),'frio', 'schema');
}
function theme_post(App &$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"]);
function theme_content(App &$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(App &$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']);
function theme_content(App &$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);
}
function theme_post(App &$a){
- if(! local_user())
+ if (! local_user()) {
return;
+ }
if (isset($_POST['vier-settings-submit'])){
set_pconfig(local_user(), 'vier', 'style', $_POST['vier_style']);