Browse Source

Normalize App parameter declaration (mod folder, 3 out of 3)

tags/3.5.1
Hypolite Petovan 3 years ago
parent
commit
a7ce601580
41 changed files with 78 additions and 78 deletions
  1. +3
    -3
      mod/profiles.php
  2. +4
    -4
      mod/profperm.php
  3. +4
    -4
      mod/pubsub.php
  4. +1
    -1
      mod/pubsubhubbub.php
  5. +1
    -1
      mod/qsearch.php
  6. +1
    -1
      mod/randprof.php
  7. +1
    -1
      mod/receive.php
  8. +3
    -3
      mod/redir.php
  9. +2
    -2
      mod/register.php
  10. +1
    -1
      mod/regmod.php
  11. +2
    -2
      mod/removeme.php
  12. +1
    -1
      mod/repair_ostatus.php
  13. +1
    -1
      mod/rsd_xml.php
  14. +2
    -2
      mod/salmon.php
  15. +3
    -3
      mod/search.php
  16. +1
    -1
      mod/session.php
  17. +3
    -3
      mod/settings.php
  18. +3
    -3
      mod/share.php
  19. +1
    -1
      mod/smilies.php
  20. +1
    -1
      mod/starred.php
  21. +1
    -1
      mod/statistics_json.php
  22. +2
    -2
      mod/subthread.php
  23. +2
    -2
      mod/suggest.php
  24. +1
    -1
      mod/tagger.php
  25. +3
    -3
      mod/tagrm.php
  26. +1
    -1
      mod/toggle_mobile.php
  27. +3
    -3
      mod/uexport.php
  28. +6
    -6
      mod/uimport.php
  29. +1
    -1
      mod/update_community.php
  30. +1
    -1
      mod/update_display.php
  31. +1
    -1
      mod/update_network.php
  32. +1
    -1
      mod/update_notes.php
  33. +1
    -1
      mod/update_profile.php
  34. +3
    -3
      mod/videos.php
  35. +2
    -2
      mod/viewcontacts.php
  36. +2
    -2
      mod/viewsrc.php
  37. +1
    -1
      mod/wall_attach.php
  38. +1
    -1
      mod/wall_upload.php
  39. +4
    -4
      mod/wallmessage.php
  40. +1
    -1
      mod/webfinger.php
  41. +1
    -1
      mod/xrd.php

+ 3
- 3
mod/profiles.php View File

@@ -2,7 +2,7 @@
require_once("include/Contact.php");
require_once('include/Probe.php');

function profiles_init(App &$a) {
function profiles_init(App $a) {

nav_set_selected('profiles');

@@ -160,7 +160,7 @@ function profile_clean_keywords($keywords) {
return $keywords;
}

function profiles_post(App &$a) {
function profiles_post(App $a) {

if (! local_user()) {
notice( t('Permission denied.') . EOL);
@@ -601,7 +601,7 @@ function profile_activity($changed, $value) {
}


function profiles_content(App &$a) {
function profiles_content(App $a) {

if (! local_user()) {
notice( t('Permission denied.') . EOL);


+ 4
- 4
mod/profperm.php View File

@@ -1,6 +1,6 @@
<?php

function profperm_init(App &$a) {
function profperm_init(App $a) {

if (! local_user()) {
return;
@@ -14,7 +14,7 @@ function profperm_init(App &$a) {
}


function profperm_content(App &$a) {
function profperm_content(App $a) {

if (! local_user()) {
notice( t('Permission denied') . EOL);
@@ -109,9 +109,9 @@ function profperm_content(App &$a) {
}

$o .= '<div id="prof-update-wrapper">';
if($change)
if($change)
$o = '';
$o .= '<div id="prof-members-title">';
$o .= '<h3>' . t('Visible To') . '</h3>';
$o .= '</div>';


+ 4
- 4
mod/pubsub.php View File

@@ -26,7 +26,7 @@ function hub_post_return() {



function pubsub_init(App &$a) {
function pubsub_init(App $a) {

$nick = (($a->argc > 1) ? notags(trim($a->argv[1])) : '');
$contact_id = (($a->argc > 2) ? intval($a->argv[2]) : 0 );
@@ -57,7 +57,7 @@ function pubsub_init(App &$a) {

$sql_extra = ((strlen($hub_verify)) ? sprintf(" AND `hub-verify` = '%s' ", dbesc($hub_verify)) : '');

$r = q("SELECT * FROM `contact` WHERE `id` = %d AND `uid` = %d
$r = q("SELECT * FROM `contact` WHERE `id` = %d AND `uid` = %d
AND `blocked` = 0 AND `pending` = 0 $sql_extra LIMIT 1",
intval($contact_id),
intval($owner['uid'])
@@ -75,7 +75,7 @@ function pubsub_init(App &$a) {

$contact = $r[0];

// We must initiate an unsubscribe request with a verify_token.
// We must initiate an unsubscribe request with a verify_token.
// Don't allow outsiders to unsubscribe us.

if($hub_mode === 'unsubscribe') {
@@ -98,7 +98,7 @@ function pubsub_init(App &$a) {

require_once('include/security.php');

function pubsub_post(App &$a) {
function pubsub_post(App $a) {

$xml = file_get_contents('php://input');



+ 1
- 1
mod/pubsubhubbub.php View File

@@ -4,7 +4,7 @@ function post_var($name) {
return (x($_POST, $name)) ? notags(trim($_POST[$name])) : '';
}

function pubsubhubbub_init(App &$a) {
function pubsubhubbub_init(App $a) {
// PuSH subscription must be considered "public" so just block it
// if public access isn't enabled.
if (get_config('system', 'block_public')) {


+ 1
- 1
mod/qsearch.php View File

@@ -1,6 +1,6 @@
<?php

function qsearch_init(App &$a) {
function qsearch_init(App $a) {

if (! local_user()) {
killme();


+ 1
- 1
mod/randprof.php View File

@@ -1,7 +1,7 @@
<?php


function randprof_init(App &$a) {
function randprof_init(App $a) {
require_once('include/Contact.php');

$x = random_profile();


+ 1
- 1
mod/receive.php View File

@@ -10,7 +10,7 @@ require_once('include/crypto.php');
require_once('include/diaspora.php');


function receive_post(App &$a) {
function receive_post(App $a) {


$enabled = intval(get_config('system','diaspora_enabled'));


+ 3
- 3
mod/redir.php View File

@@ -1,6 +1,6 @@
<?php

function redir_init(App &$a) {
function redir_init(App $a) {

$url = ((x($_GET,'url')) ? $_GET['url'] : '');
$quiet = ((x($_GET,'quiet')) ? '&quiet=1' : '');
@@ -57,9 +57,9 @@ function redir_init(App &$a) {
intval(time() + 45)
);

logger('mod_redir: ' . $r[0]['name'] . ' ' . $sec, LOGGER_DEBUG);
logger('mod_redir: ' . $r[0]['name'] . ' ' . $sec, LOGGER_DEBUG);
$dest = (($url) ? '&destination_url=' . $url : '');
goaway ($r[0]['poll'] . '?dfrn_id=' . $dfrn_id
goaway ($r[0]['poll'] . '?dfrn_id=' . $dfrn_id
. '&dfrn_version=' . DFRN_PROTOCOL_VERSION . '&type=profile&sec=' . $sec . $dest . $quiet );
}



+ 2
- 2
mod/register.php View File

@@ -5,7 +5,7 @@ require_once('include/bbcode.php');
require_once('include/user.php');

if(! function_exists('register_post')) {
function register_post(App &$a) {
function register_post(App $a) {

global $lang;

@@ -172,7 +172,7 @@ function register_post(App &$a) {


if(! function_exists('register_content')) {
function register_content(App &$a) {
function register_content(App $a) {

// logged in users can register others (people/pages/groups)
// even with closed registrations, unless specifically prohibited by site policy.


+ 1
- 1
mod/regmod.php View File

@@ -97,7 +97,7 @@ function user_deny($hash) {

}

function regmod_content(App &$a) {
function regmod_content(App $a) {

global $lang;



+ 2
- 2
mod/removeme.php View File

@@ -1,6 +1,6 @@
<?php

function removeme_post(App &$a) {
function removeme_post(App $a) {

if (! local_user()) {
return;
@@ -32,7 +32,7 @@ function removeme_post(App &$a) {

}

function removeme_content(App &$a) {
function removeme_content(App $a) {

if (! local_user()) {
goaway(z_root());


+ 1
- 1
mod/repair_ostatus.php View File

@@ -3,7 +3,7 @@
require_once('include/Scrape.php');
require_once('include/follow.php');

function repair_ostatus_content(App &$a) {
function repair_ostatus_content(App $a) {

if (! local_user()) {
notice( t('Permission denied.') . EOL);


+ 1
- 1
mod/rsd_xml.php View File

@@ -2,7 +2,7 @@



function rsd_xml_content(App &$a) {
function rsd_xml_content(App $a) {
header ("Content-Type: text/xml");
echo '<?xml version="1.0" encoding="UTF-8"?>
<rsd version="1.0" xmlns="http://archipelago.phrasewise.com/rsd">


+ 2
- 2
mod/salmon.php View File

@@ -19,7 +19,7 @@ function salmon_return($val) {

}

function salmon_post(App &$a) {
function salmon_post(App $a) {

$xml = file_get_contents('php://input');

@@ -156,7 +156,7 @@ function salmon_post(App &$a) {
if(get_pconfig($importer['uid'],'system','ostatus_autofriend')) {
$result = new_contact($importer['uid'],$author_link);
if($result['success']) {
$r = q("SELECT * FROM `contact` WHERE `network` = '%s' AND ( `url` = '%s' OR `alias` = '%s')
$r = q("SELECT * FROM `contact` WHERE `network` = '%s' AND ( `url` = '%s' OR `alias` = '%s')
AND `uid` = %d LIMIT 1",
dbesc(NETWORK_OSTATUS),
dbesc($author_link),


+ 3
- 3
mod/search.php View File

@@ -43,7 +43,7 @@ function search_saved_searches() {
}


function search_init(App &$a) {
function search_init(App $a) {

$search = ((x($_GET,'search')) ? notags(trim(rawurldecode($_GET['search']))) : '');

@@ -81,13 +81,13 @@ function search_init(App &$a) {



function search_post(App &$a) {
function search_post(App $a) {
if(x($_POST,'search'))
$a->data['search'] = $_POST['search'];
}


function search_content(App &$a) {
function search_content(App $a) {

if((get_config('system','block_public')) && (! local_user()) && (! remote_user())) {
notice( t('Public access denied.') . EOL);


+ 1
- 1
mod/session.php View File

@@ -1,5 +1,5 @@
<?php

function session_content(&$a) {
function session_content(App $a) {

}

+ 3
- 3
mod/settings.php View File

@@ -16,7 +16,7 @@ function get_theme_config_file($theme){
return null;
}

function settings_init(App &$a) {
function settings_init(App $a) {

if (! local_user()) {
notice( t('Permission denied.') . EOL );
@@ -116,7 +116,7 @@ function settings_init(App &$a) {
}


function settings_post(App &$a) {
function settings_post(App $a) {

if (! local_user()) {
return;
@@ -654,7 +654,7 @@ function settings_post(App &$a) {
}


function settings_content(App &$a) {
function settings_content(App $a) {

$o = '';
nav_set_selected('settings');


+ 3
- 3
mod/share.php View File

@@ -1,12 +1,12 @@
<?php
function share_init(App &$a) {
function share_init(App $a) {

$post_id = (($a->argc > 1) ? intval($a->argv[1]) : 0);
if((! $post_id) || (! local_user()))
killme();

$r = q("SELECT item.*, contact.network FROM `item`
inner join contact on `item`.`contact-id` = `contact`.`id`
$r = q("SELECT item.*, contact.network FROM `item`
inner join contact on `item`.`contact-id` = `contact`.`id`
WHERE `item`.`id` = %d AND `item`.`uid` = %d LIMIT 1",

intval($post_id),


+ 1
- 1
mod/smilies.php View File

@@ -6,7 +6,7 @@

require_once("include/Smilies.php");

function smilies_content(App &$a) {
function smilies_content(App $a) {
if ($a->argv[1]==="json"){
$tmp = Smilies::get_list();
$results = array();


+ 1
- 1
mod/starred.php View File

@@ -1,7 +1,7 @@
<?php


function starred_init(App &$a) {
function starred_init(App $a) {

require_once("include/threads.php");



+ 1
- 1
mod/statistics_json.php View File

@@ -5,7 +5,7 @@

require_once("include/plugin.php");

function statistics_json_init(App &$a) {
function statistics_json_init(App $a) {

if (!get_config("system", "nodeinfo")) {
http_status_exit(404);


+ 2
- 2
mod/subthread.php View File

@@ -5,7 +5,7 @@ require_once('include/bbcode.php');
require_once('include/items.php');


function subthread_content(App &$a) {
function subthread_content(App $a) {

if(! local_user() && ! remote_user()) {
return;
@@ -49,7 +49,7 @@ function subthread_content(App &$a) {
}
}

// this represents the post owner on this system.
// this represents the post owner on this system.

$r = q("SELECT `contact`.*, `user`.`nickname` FROM `contact` LEFT JOIN `user` ON `contact`.`uid` = `user`.`uid`
WHERE `contact`.`self` = 1 AND `contact`.`uid` = %d LIMIT 1",


+ 2
- 2
mod/suggest.php View File

@@ -3,7 +3,7 @@
require_once('include/socgraph.php');
require_once('include/contact_widgets.php');

function suggest_init(App &$a) {
function suggest_init(App $a) {
if (! local_user()) {
return;
}
@@ -49,7 +49,7 @@ function suggest_init(App &$a) {



function suggest_content(App &$a) {
function suggest_content(App $a) {

require_once("mod/proxy.php");



+ 1
- 1
mod/tagger.php View File

@@ -5,7 +5,7 @@ require_once('include/bbcode.php');
require_once('include/items.php');


function tagger_content(App &$a) {
function tagger_content(App $a) {

if(! local_user() && ! remote_user()) {
return;


+ 3
- 3
mod/tagrm.php View File

@@ -2,7 +2,7 @@

require_once('include/bbcode.php');

function tagrm_post(App &$a) {
function tagrm_post(App $a) {

if (! local_user()) {
goaway(App::get_baseurl() . '/' . $_SESSION['photo_return']);
@@ -42,14 +42,14 @@ function tagrm_post(App &$a) {

info( t('Tag removed') . EOL );
goaway(App::get_baseurl() . '/' . $_SESSION['photo_return']);
// NOTREACHED

}



function tagrm_content(App &$a) {
function tagrm_content(App $a) {

$o = '';



+ 1
- 1
mod/toggle_mobile.php View File

@@ -1,6 +1,6 @@
<?php

function toggle_mobile_init(App &$a) {
function toggle_mobile_init(App $a) {

if (isset($_GET['off'])) {
$_SESSION['show-mobile'] = false;


+ 3
- 3
mod/uexport.php View File

@@ -1,6 +1,6 @@
<?php

function uexport_init(App &$a){
function uexport_init(App $a) {
if (! local_user()) {
killme();
}
@@ -10,7 +10,7 @@ function uexport_init(App &$a){
}

/// @TODO Change space -> tab where wanted
function uexport_content(App &$a){
function uexport_content(App $a) {

if ($a->argc > 1) {
header("Content-type: application/json");
@@ -124,7 +124,7 @@ function uexport_account($a){
/**
* echoes account data and items as separated json, one per line
*/
function uexport_all(App &$a) {
function uexport_all(App $a) {

uexport_account($a);
echo "\n";


+ 6
- 6
mod/uimport.php View File

@@ -6,7 +6,7 @@
require_once("include/uimport.php");
function uimport_post(App &$a) {
function uimport_post(App $a) {
switch($a->config['register_policy']) {
case REGISTER_OPEN:
$blocked = 0;
@@ -28,7 +28,7 @@ function uimport_post(App &$a) {
$verified = 0;
break;
}
if (x($_FILES,'accountfile')){
/// @TODO Pass $blocked / $verified, send email to admin on REGISTER_APPROVE
import_account($a, $_FILES['accountfile']);
@@ -36,8 +36,8 @@ function uimport_post(App &$a) {
}
}
function uimport_content(App &$a) {
function uimport_content(App $a) {
if((! local_user()) && ($a->config['register_policy'] == REGISTER_CLOSED)) {
notice("Permission denied." . EOL);
return;
@@ -52,8 +52,8 @@ function uimport_content(App &$a) {
return;
}
}
if(x($_SESSION,'theme'))
unset($_SESSION['theme']);
if(x($_SESSION,'mobile-theme'))


+ 1
- 1
mod/update_community.php View File

@@ -4,7 +4,7 @@

require_once("mod/community.php");

function update_community_content(App &$a) {
function update_community_content(App $a) {

header("Content-type: text/html");
echo "<!DOCTYPE html><html><body>\r\n";


+ 1
- 1
mod/update_display.php View File

@@ -5,7 +5,7 @@
require_once("mod/display.php");
require_once("include/group.php");

function update_display_content(App &$a) {
function update_display_content(App $a) {

$profile_uid = intval($_GET["p"]);



+ 1
- 1
mod/update_network.php View File

@@ -5,7 +5,7 @@
require_once("mod/network.php");
require_once("include/group.php");

function update_network_content(App &$a) {
function update_network_content(App $a) {

$profile_uid = intval($_GET["p"]);



+ 1
- 1
mod/update_notes.php View File

@@ -7,7 +7,7 @@

require_once("mod/notes.php");

function update_notes_content(App &$a) {
function update_notes_content(App $a) {

$profile_uid = intval($_GET["p"]);



+ 1
- 1
mod/update_profile.php View File

@@ -7,7 +7,7 @@

require_once("mod/profile.php");

function update_profile_content(App &$a) {
function update_profile_content(App $a) {

$profile_uid = intval($_GET["p"]);



+ 3
- 3
mod/videos.php View File

@@ -6,7 +6,7 @@ require_once('include/security.php');
require_once('include/redir.php');


function videos_init(App &$a) {
function videos_init(App $a) {

if($a->argc > 1)
auto_redir($a, $a->argv[1]);
@@ -102,7 +102,7 @@ function videos_init(App &$a) {



function videos_post(App &$a) {
function videos_post(App $a) {

$owner_uid = $a->data['user']['uid'];

@@ -182,7 +182,7 @@ function videos_post(App &$a) {



function videos_content(App &$a) {
function videos_content(App $a) {

// URLs (most aren't currently implemented):
// videos/name


+ 2
- 2
mod/viewcontacts.php View File

@@ -2,7 +2,7 @@
require_once('include/Contact.php');
require_once('include/contact_selectors.php');

function viewcontacts_init(App &$a) {
function viewcontacts_init(App $a) {

if((get_config('system','block_public')) && (! local_user()) && (! remote_user())) {
return;
@@ -29,7 +29,7 @@ function viewcontacts_init(App &$a) {
}


function viewcontacts_content(App &$a) {
function viewcontacts_content(App $a) {
require_once("mod/proxy.php");

if((get_config('system','block_public')) && (! local_user()) && (! remote_user())) {


+ 2
- 2
mod/viewsrc.php View File

@@ -1,7 +1,7 @@
<?php


function viewsrc_content(App &$a) {
function viewsrc_content(App $a) {

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

$r = q("SELECT `item`.`body` FROM `item`
$r = q("SELECT `item`.`body` FROM `item`
WHERE `item`.`uid` = %d AND `item`.`visible` = 1 AND `item`.`deleted` = 0
and `item`.`moderated` = 0
AND `item`.`id` = '%s' LIMIT 1",


+ 1
- 1
mod/wall_attach.php View File

@@ -3,7 +3,7 @@
require_once('include/attach.php');
require_once('include/datetime.php');

function wall_attach_post(App &$a) {
function wall_attach_post(App $a) {

$r_json = (x($_GET,'response') && $_GET['response']=='json');



+ 1
- 1
mod/wall_upload.php View File

@@ -2,7 +2,7 @@

require_once('include/Photo.php');

function wall_upload_post(&$a, $desktopmode = true) {
function wall_upload_post(App $a, $desktopmode = true) {

logger("wall upload: starting new upload", LOGGER_DEBUG);



+ 4
- 4
mod/wallmessage.php View File

@@ -2,7 +2,7 @@

require_once('include/message.php');

function wallmessage_post(App &$a) {
function wallmessage_post(App $a) {

$replyto = get_my_url();
if(! $replyto) {
@@ -73,7 +73,7 @@ function wallmessage_post(App &$a) {
}


function wallmessage_content(App &$a) {
function wallmessage_content(App $a) {

if(! get_my_url()) {
notice( t('Permission denied.') . EOL);
@@ -134,9 +134,9 @@ function wallmessage_content(App &$a) {
'$nickname' => $user['nickname'],
'$linkurl' => t('Please enter a link URL:')
));



$tpl = get_markup_template('wallmessage.tpl');
$o .= replace_macros($tpl,array(
'$header' => t('Send Private Message'),


+ 1
- 1
mod/webfinger.php View File

@@ -1,7 +1,7 @@
<?php
require_once("include/Probe.php");

function webfinger_content(App &$a) {
function webfinger_content(App $a) {

$o .= '<h3>Webfinger Diagnostic</h3>';



+ 1
- 1
mod/xrd.php View File

@@ -2,7 +2,7 @@

require_once('include/crypto.php');

function xrd_init(App &$a) {
function xrd_init(App $a) {

$uri = urldecode(notags(trim($_GET['uri'])));



Loading…
Cancel
Save