Browse Source

Cleanup /format pre-move

tags/3.5.2
Hypolite Petovan 3 years ago
parent
commit
56ee734b00
85 changed files with 516 additions and 575 deletions
  1. +1
    -1
      boot.php
  2. +2
    -2
      include/Probe.php
  3. +1
    -1
      include/api.php
  4. +1
    -1
      include/auth.php
  5. +2
    -0
      include/auth_ejabberd.php
  6. +2
    -0
      include/bb2diaspora.php
  7. +2
    -1
      include/bbcode.php
  8. +1
    -1
      include/cli_startup.php
  9. +0
    -1
      include/conversation.php
  10. +2
    -1
      include/cronjobs.php
  11. +1
    -1
      include/dbstructure.php
  12. +1
    -1
      include/delivery.php
  13. +1
    -1
      include/diaspora.php
  14. +1
    -1
      include/event.php
  15. +2
    -2
      include/items.php
  16. +1
    -3
      include/message.php
  17. +1
    -1
      include/network.php
  18. +1
    -1
      include/notifier.php
  19. +26
    -26
      include/oauth.php
  20. +2
    -2
      include/oembed.php
  21. +1
    -1
      include/plaintext.php
  22. +6
    -6
      include/plugin.php
  23. +3
    -2
      include/poller.php
  24. +2
    -1
      include/pubsubpublish.php
  25. +1
    -1
      include/shadowupdate.php
  26. +3
    -3
      include/socgraph.php
  27. +0
    -1
      include/text.php
  28. +6
    -10
      include/uimport.php
  29. +2
    -2
      index.php
  30. +1
    -1
      mod/_well_known.php
  31. +1
    -1
      mod/admin.php
  32. +3
    -4
      mod/amcd.php
  33. +12
    -13
      mod/apps.php
  34. +1
    -2
      mod/community.php
  35. +0
    -2
      mod/contactgroup.php
  36. +14
    -12
      mod/credits.php
  37. +0
    -1
      mod/delegate.php
  38. +0
    -3
      mod/dfrn_poll.php
  39. +0
    -6
      mod/directory.php
  40. +0
    -2
      mod/dirfind.php
  41. +0
    -1
      mod/display.php
  42. +0
    -1
      mod/filer.php
  43. +1
    -1
      mod/friendica.php
  44. +1
    -0
      mod/hovercard.php
  45. +2
    -2
      mod/install.php
  46. +7
    -4
      mod/login.php
  47. +1
    -1
      mod/maintenance.php
  48. +16
    -17
      mod/manifest.php
  49. +1
    -1
      mod/match.php
  50. +0
    -1
      mod/mood.php
  51. +5
    -35
      mod/newmember.php
  52. +1
    -1
      mod/nodeinfo.php
  53. +15
    -15
      mod/notice.php
  54. +0
    -1
      mod/openid.php
  55. +11
    -11
      mod/opensearch.php
  56. +1
    -1
      mod/parse_url.php
  57. +3
    -2
      mod/photos.php
  58. +1
    -1
      mod/ping.php
  59. +2
    -3
      mod/poke.php
  60. +4
    -4
      mod/pretheme.php
  61. +6
    -7
      mod/probe.php
  62. +0
    -1
      mod/profile.php
  63. +0
    -2
      mod/profile_photo.php
  64. +0
    -1
      mod/qsearch.php
  65. +0
    -2
      mod/receive.php
  66. +3
    -3
      mod/robots_txt.php
  67. +18
    -18
      mod/rsd_xml.php
  68. +4
    -5
      mod/smilies.php
  69. +16
    -15
      mod/statistics_json.php
  70. +0
    -1
      mod/subthread.php
  71. +0
    -1
      mod/tagger.php
  72. +0
    -1
      mod/toggle_mobile.php
  73. +22
    -23
      mod/uexport.php
  74. +30
    -30
      mod/uimport.php
  75. +0
    -1
      mod/videos.php
  76. +2
    -3
      mod/wall_upload.php
  77. +1
    -1
      util/db_update.php
  78. +1
    -1
      util/maintenance.php
  79. +184
    -185
      util/php2po.php
  80. +42
    -42
      util/typo.php
  81. +1
    -0
      view/theme/duepuntozero/config.php
  82. +2
    -2
      view/theme/frio/php/default.php
  83. +1
    -1
      view/theme/frio/php/frio_boot.php
  84. +1
    -0
      view/theme/quattro/config.php
  85. +3
    -4
      view/theme/smoothly/theme.php

+ 1
- 1
boot.php View File

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

require_once(__DIR__ . DIRECTORY_SEPARATOR. 'vendor' . DIRECTORY_SEPARATOR . 'autoload.php');

use \Friendica\Core\Config;
use Friendica\Core\Config;

require_once('include/config.php');
require_once('include/network.php');


+ 2
- 2
include/Probe.php View File

@@ -5,8 +5,8 @@
*
*/

use \Friendica\Core\Config;
use \Friendica\Core\PConfig;
use Friendica\Core\Config;
use Friendica\Core\PConfig;

require_once("include/feed.php");
require_once('include/email.php');


+ 1
- 1
include/api.php View File

@@ -6,7 +6,7 @@
* @todo Automatically detect if incoming data is HTML or BBCode
*/

use \Friendica\Core\Config;
use Friendica\Core\Config;

require_once 'include/HTTPExceptions.php';
require_once 'include/bbcode.php';


+ 1
- 1
include/auth.php View File

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

use \Friendica\Core\Config;
use Friendica\Core\Config;

require_once('include/security.php');
require_once('include/datetime.php');


+ 2
- 0
include/auth_ejabberd.php View File

@@ -32,6 +32,8 @@
*
*/

use Friendica\App;

if (sizeof($_SERVER["argv"]) == 0)
die();



+ 2
- 0
include/bb2diaspora.php View File

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

use Friendica\App;

use League\HTMLToMarkdown\HtmlConverter;

require_once "include/oembed.php";


+ 2
- 1
include/bbcode.php View File

@@ -1,5 +1,6 @@
<?php
use \Friendica\Core\Config;

use Friendica\Core\Config;

require_once 'include/oembed.php';
require_once 'include/event.php';


+ 1
- 1
include/cli_startup.php View File

@@ -1,6 +1,6 @@
<?php /** @file */

use \Friendica\Core\Config;
use Friendica\Core\Config;

require_once('boot.php');



+ 0
- 1
include/conversation.php View File

@@ -3,7 +3,6 @@
require_once "include/bbcode.php";
require_once "include/acl_selectors.php";


/*
* Note: the code in 'item_extract_images' and 'item_redir_and_replace_images'
* is identical to the code in mod/message.php for 'item_extract_images' and


+ 2
- 1
include/cronjobs.php View File

@@ -1,5 +1,6 @@
<?php
use \Friendica\Core\Config;

use Friendica\Core\Config;

function cronjobs_run(&$argv, &$argc){
global $a;


+ 1
- 1
include/dbstructure.php View File

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

use \Friendica\Core\Config;
use Friendica\Core\Config;

require_once("boot.php");
require_once("include/text.php");


+ 1
- 1
include/delivery.php View File

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

use \Friendica\Core\Config;
use Friendica\Core\Config;

require_once('include/queue_fn.php');
require_once('include/html2plain.php');


+ 1
- 1
include/diaspora.php View File

@@ -8,7 +8,7 @@
* This will change in the future.
*/

use \Friendica\Core\Config;
use Friendica\Core\Config;

require_once 'include/items.php';
require_once 'include/bb2diaspora.php';


+ 1
- 1
include/event.php View File

@@ -535,7 +535,7 @@ function get_event_strings() {
*
* @param array $dates Array of possibly duplicated events
* @return array Cleaned events
*
*
* @todo We should replace this with a separate update function if there is some time left
*/
function event_remove_duplicates($dates) {


+ 2
- 2
include/items.php View File

@@ -4,7 +4,7 @@
* @file include/items.php
*/

use \Friendica\ParseUrl;
use Friendica\ParseUrl;

require_once 'include/bbcode.php';
require_once 'include/oembed.php';
@@ -339,7 +339,7 @@ function add_page_info_to_body($body, $texturl = false, $no_photos = false) {
* Adds a "lang" specification in a "postopts" element of given $arr,
* if possible and not already present.
* Expects "body" element to exist in $arr.
*
*
* @todo Add a parameter to request forcing override
*/
function item_add_language_opt(&$arr) {


+ 1
- 3
include/message.php View File

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

// send a private message


// send a private message


function send_message($recipient=0, $body='', $subject='', $replyto=''){


+ 1
- 1
include/network.php View File

@@ -4,7 +4,7 @@
* @file include/network.php
*/

use \Friendica\Core\Config;
use Friendica\Core\Config;

require_once("include/xml.php");
require_once('include/Probe.php');


+ 1
- 1
include/notifier.php View File

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

use \Friendica\Core\Config;
use Friendica\Core\Config;

require_once('include/queue_fn.php');
require_once('include/html2plain.php');


+ 26
- 26
include/oauth.php View File

@@ -61,13 +61,13 @@ class FKOAuthDataStore extends OAuthDataStore {
logger(__function__.":".$consumer.", ". $callback);
$key = $this->gen_token();
$sec = $this->gen_token();
if ($consumer->key){
$k = $consumer->key;
} else {
$k = $consumer;
}
$r = q("INSERT INTO tokens (id, secret, client_id, scope, expires) VALUES ('%s','%s','%s','%s', UNIX_TIMESTAMP()+%d)",
dbesc($key),
dbesc($sec),
@@ -80,19 +80,19 @@ class FKOAuthDataStore extends OAuthDataStore {

function new_access_token($token, $consumer, $verifier = null) {
logger(__function__.":".$token.", ". $consumer.", ". $verifier);
// return a new access token attached to this consumer
// for the user associated with this token if the request token
// is authorized
// should also invalidate the request token
$ret=Null;
// get user for this verifier
$uverifier = get_config("oauth", $verifier);
logger(__function__.":".$verifier.",".$uverifier);
if (is_null($verifier) || ($uverifier!==false)){
$key = $this->gen_token();
$sec = $this->gen_token();
$r = q("INSERT INTO tokens (id, secret, client_id, scope, expires, uid) VALUES ('%s','%s','%s','%s', UNIX_TIMESTAMP()+%d, %d)",
@@ -103,13 +103,13 @@ class FKOAuthDataStore extends OAuthDataStore {
intval(ACCESS_TOKEN_DURATION),
intval($uverifier));
if ($r)
$ret = new OAuthToken($key,$sec);
$ret = new OAuthToken($key,$sec);
}
q("DELETE FROM tokens WHERE id='%s'", $token->key);
if (!is_null($ret) && $uverifier!==false){
del_config("oauth", $verifier);
/* $apps = get_pconfig($uverifier, "oauth", "apps");
@@ -117,9 +117,9 @@ class FKOAuthDataStore extends OAuthDataStore {
$apps[] = $consumer->key;
set_pconfig($uverifier, "oauth", "apps", $apps);*/
}
return $ret;
}
}

@@ -172,9 +172,9 @@ class FKOAuth1 extends OAuthServer {
intval($_SESSION['uid'])
);

call_hooks('logged_in', $a->user);
call_hooks('logged_in', $a->user);
}
}
/*
class FKOAuth2 extends OAuth2 {
@@ -190,13 +190,13 @@ class FKOAuth2 extends OAuth2 {
dbesc($client_secret),
dbesc($redirect_uri)
);
return $r;
}

protected function checkClientCredentials($client_id, $client_secret = NULL) {
$client_secret = $this->db_secret($client_secret);
$r = q("SELECT pw FROM clients WHERE client_id = '%s'",
dbesc($client_id));

@@ -218,21 +218,21 @@ class FKOAuth2 extends OAuth2 {
protected function getAccessToken($oauth_token) {
$r = q("SELECT client_id, expires, scope FROM tokens WHERE id = '%s'",
dbesc($oauth_token));
if (dbm::is_result($r))
return $r[0];
return null;
}


protected function setAccessToken($oauth_token, $client_id, $expires, $scope = NULL) {
$r = q("INSERT INTO tokens (id, client_id, expires, scope) VALUES ('%s', '%s', %d, '%s')",
dbesc($oauth_token),
dbesc($client_id),
intval($expires),
dbesc($scope));
return $r;
}

@@ -246,23 +246,23 @@ class FKOAuth2 extends OAuth2 {
protected function getAuthCode($code) {
$r = q("SELECT id, client_id, redirect_uri, expires, scope FROM auth_codes WHERE id = '%s'",
dbesc($code));
if (dbm::is_result($r))
return $r[0];
return null;
}

protected function setAuthCode($code, $client_id, $redirect_uri, $expires, $scope = NULL) {
$r = q("INSERT INTO auth_codes
(id, client_id, redirect_uri, expires, scope) VALUES
$r = q("INSERT INTO auth_codes
(id, client_id, redirect_uri, expires, scope) VALUES
('%s', '%s', '%s', %d, '%s')",
dbesc($code),
dbesc($client_id),
dbesc($redirect_uri),
intval($expires),
dbesc($scope));
return $r;
}
return $r;
}
}
*/

+ 2
- 2
include/oembed.php View File

@@ -4,8 +4,8 @@
* @file include/oembed.php
*/

use \Friendica\ParseUrl;
use \Friendica\Core\Config;
use Friendica\ParseUrl;
use Friendica\Core\Config;

function oembed_replacecb($matches){
$embedurl=$matches[1];


+ 1
- 1
include/plaintext.php View File

@@ -4,7 +4,7 @@
* @file include/plaintext.php
*/

use \Friendica\ParseUrl;
use Friendica\ParseUrl;

require_once("include/Photo.php");
require_once("include/bbcode.php");


+ 6
- 6
include/plugin.php View File

@@ -1,7 +1,7 @@
<?php
/**
* @file include/plugin.php
*
*
* @brief Some functions to handle addons and themes.
*/

@@ -164,7 +164,7 @@ function register_hook($hook,$file,$function,$priority=0) {

/**
* @brief unregisters a hook.
*
*
* @param string $hook the name of the hook
* @param string $file the name of the file that hooks into
* @param string $function the name of the function that the hook called
@@ -325,7 +325,7 @@ function get_plugin_info($plugin){

/**
* @brief Parse theme comment in search of theme infos.
*
*
* like
* \code
* ..* Name: My Theme
@@ -545,11 +545,11 @@ function upgrade_bool_message($bbcode = false) {

/**
* @brief Get the full path to relevant theme files by filename
*
*
* This function search in the theme directory (and if not present in global theme directory)
* if there is a directory with the file extension and for a file with the given
* filename.
*
* filename.
*
* @param string $file Filename
* @param string $root Full root path
* @return string Path to the file or empty string if the file isn't found


+ 3
- 2
include/poller.php View File

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

use Friendica\Core\Config;

if (!file_exists("boot.php") AND (sizeof($_SERVER["argv"]) != 0)) {
$directory = dirname($_SERVER["argv"][0]);

@@ -10,8 +13,6 @@ if (!file_exists("boot.php") AND (sizeof($_SERVER["argv"]) != 0)) {
chdir($directory);
}

use \Friendica\Core\Config;

require_once("boot.php");

function poller_run($argv, $argc){


+ 2
- 1
include/pubsubpublish.php View File

@@ -1,5 +1,6 @@
<?php
use \Friendica\Core\Config;

use Friendica\Core\Config;

require_once('include/items.php');
require_once('include/ostatus.php');


+ 1
- 1
include/shadowupdate.php View File

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

use \Friendica\Core\Config;
use Friendica\Core\Config;

require_once("boot.php");
require_once("include/threads.php");


+ 3
- 3
include/socgraph.php View File

@@ -1,13 +1,13 @@
<?php
/**
* @file include/socgraph.php
*
*
* @todo Move GNU Social URL schemata (http://server.tld/user/number) to http://server.tld/username
* @todo Fetch profile data from profile page for Redmatrix users
* @todo Detect if it is a forum
*/

use \Friendica\Core\Config;
use Friendica\Core\Config;

require_once('include/datetime.php');
require_once("include/Scrape.php");
@@ -1430,7 +1430,7 @@ function common_friends_zcid($uid,$zcid,$start = 0, $limit = 9999,$shuffle = fal
$r = q("SELECT `gcontact`.*
FROM `glink` INNER JOIN `gcontact` on `glink`.`gcid` = `gcontact`.`id`
where `glink`.`zcid` = %d
and `gcontact`.`nurl` in (select nurl from contact where uid = %d and self = 0 and blocked = 0 and hidden = 0 )
and `gcontact`.`nurl` in (select nurl from contact where uid = %d and self = 0 and blocked = 0 and hidden = 0 )
$sql_extra limit %d, %d",
intval($zcid),
intval($uid),


+ 0
- 1
include/text.php View File

@@ -6,7 +6,6 @@ require_once("include/Smilies.php");
require_once("include/map.php");
require_once("mod/proxy.php");


if(! function_exists('replace_macros')) {
/**
* This is our template processor


+ 6
- 10
include/uimport.php View File

@@ -1,11 +1,5 @@
<?php
/**
* import account file exported from mod/uexport
* args:
* $a App Friendica App Class
* $file Array array from $_FILES
*/
require_once("include/Photo.php");
define("IMPORT_DEBUG", False);
@@ -75,6 +69,12 @@ function import_cleanup($newuid) {
q("DELETE FROM `pconfig` WHERE uid = %d", $newuid);
}
/**
* @brief Import account file exported from mod/uexport
*
* @param App $a Friendica App Class
* @param array $file array from $_FILES
*/
function import_account(App $a, $file) {
logger("Start user import from " . $file['tmp_name']);
/*
@@ -255,10 +255,6 @@ function import_account(App $a, $file) {
}
}
foreach ($account['photo'] as &$photo) {
$photo['uid'] = $newuid;
$photo['data'] = hex2bin($photo['data']);


+ 2
- 2
index.php View File

@@ -13,7 +13,7 @@
*
*/

use \Friendica\Core\Config;
use Friendica\Core\Config;

require_once('boot.php');
require_once('object/BaseObject.php');
@@ -486,7 +486,7 @@ header("X-Friendica-Version: " . FRIENDICA_VERSION);
header("Content-type: text/html; charset=utf-8");

/*
* We use $_GET["mode"] for special page templates. So we will check if we have
* We use $_GET["mode"] for special page templates. So we will check if we have
* to load another page template than the default one.
* The page templates are located in /view/php/ or in the theme directory.
*/


+ 1
- 1
mod/_well_known.php View File

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

use \Friendica\Core\Config;
use Friendica\Core\Config;

require_once("mod/hostxrd.php");
require_once("mod/nodeinfo.php");


+ 1
- 1
mod/admin.php View File

@@ -6,7 +6,7 @@
* @brief Friendica admin
*/

use \Friendica\Core\Config;
use Friendica\Core\Config;

require_once("include/enotify.php");
require_once("include/text.php");


+ 3
- 4
mod/amcd.php View File

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

function amcd_content(App $a) {
//header("Content-type: text/json");
echo <<< EOT
echo <<< JSON
{
"version":1,
"sessionstatus":{
@@ -44,6 +43,6 @@ echo <<< EOT
}
}
}
EOT;
killme();
JSON;
killme();
}

+ 12
- 13
mod/apps.php View File

@@ -1,25 +1,24 @@
<?php

function apps_content(App $a) {
$privateaddons = get_config('config','private_addons');
if ($privateaddons === "1") {
if((! (local_user()))) {
info( t("You must be logged in to use addons. "));
return;};
}

$title = t('Applications');
function apps_content(App $a) {
$privateaddons = get_config('config', 'private_addons');
if ($privateaddons === "1") {
if ((!(local_user()))) {
info(t("You must be logged in to use addons. "));
return;
};
}

if(count($a->apps)==0)
notice( t('No installed applications.') . EOL);
$title = t('Applications');

if (count($a->apps) == 0) {
notice(t('No installed applications.') . EOL);
}

$tpl = get_markup_template("apps.tpl");
return replace_macros($tpl, array(
'$title' => $title,
'$apps' => $a->apps,
));



}

+ 1
- 2
mod/community.php View File

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

use \Friendica\Core\Config;
use Friendica\Core\Config;

function community_init(App $a) {
if (! local_user()) {
@@ -9,7 +9,6 @@ function community_init(App $a) {
}
}


function community_content(App $a, $update = 0) {

$o = '';


+ 0
- 2
mod/contactgroup.php View File

@@ -3,8 +3,6 @@
require_once('include/group.php');

function contactgroup_content(App $a) {


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


+ 14
- 12
mod/credits.php View File

@@ -1,20 +1,22 @@
<?php

/**
* Show a credits page for all the developers who helped with the project
* (only contributors to the git repositories for friendica core and the
* addons repository will be listed though ATM)
*/

function credits_content (App $a) {
/* fill the page with credits */
$f = fopen('util/credits.txt','r');
$names = fread($f, filesize('util/credits.txt'));
$arr = explode("\n", htmlspecialchars($names));
fclose($f);
$tpl = get_markup_template('credits.tpl');
return replace_macros( $tpl, array(
'$title' => t('Credits'),
'$thanks' => t('Friendica is a community project, that would not be possible without the help of many people. Here is a list of those who have contributed to the code or the translation of Friendica. Thank you all!'),
'$names' => $arr,
));

function credits_content(App $a) {
/* fill the page with credits */
$f = fopen('util/credits.txt', 'r');
$names = fread($f, filesize('util/credits.txt'));
$arr = explode("\n", htmlspecialchars($names));
fclose($f);
$tpl = get_markup_template('credits.tpl');
return replace_macros($tpl, array(
'$title' => t('Credits'),
'$thanks' => t('Friendica is a community project, that would not be possible without the help of many people. Here is a list of those who have contributed to the code or the translation of Friendica. Thank you all!'),
'$names' => $arr,
));
}

+ 0
- 1
mod/delegate.php View File

@@ -5,7 +5,6 @@ function delegate_init(App $a) {
return settings_init($a);
}


function delegate_content(App $a) {

if (! local_user()) {


+ 0
- 3
mod/dfrn_poll.php View File

@@ -3,10 +3,7 @@ require_once('include/items.php');
require_once('include/auth.php');
require_once('include/dfrn.php');


function dfrn_poll_init(App $a) {


$dfrn_id = ((x($_GET,'dfrn_id')) ? $_GET['dfrn_id'] : '');
$type = ((x($_GET,'type')) ? $_GET['type'] : 'data');
$last_update = ((x($_GET,'last_update')) ? $_GET['last_update'] : '');


+ 0
- 6
mod/directory.php View File

@@ -9,24 +9,18 @@ function directory_init(App $a) {
$a->page['aside'] .= findpeople_widget();

$a->page['aside'] .= follow_widget();

}
else {
unset($_SESSION['theme']);
unset($_SESSION['mobile-theme']);
}


}


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



function directory_content(App $a) {
global $db;



+ 0
- 2
mod/dirfind.php View File

@@ -21,8 +21,6 @@ function dirfind_init(App $a) {
$a->page['aside'] .= follow_widget();
}



function dirfind_content(App $a, $prefix = "") {

$community = false;


+ 0
- 1
mod/display.php View File

@@ -106,7 +106,6 @@ function display_init(App $a) {
}

profile_load($a, $nick, 0, $profiledata);

}

function display_fetchauthor($a, $item) {


+ 0
- 1
mod/filer.php View File

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


function filer_content(App $a) {

if (! local_user()) {


+ 1
- 1
mod/friendica.php View File

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

use \Friendica\Core\Config;
use Friendica\Core\Config;

function friendica_init(App $a) {
if ($a->argv[1] == "json"){


+ 1
- 0
mod/hovercard.php View File

@@ -15,6 +15,7 @@ function hovercard_init(App $a) {
// Just for testing purposes
$_GET["mode"] = "minimal";
}

function hovercard_content() {
$profileurl = (x($_REQUEST,'profileurl') ? $_REQUEST['profileurl'] : "");
$datatype = (x($_REQUEST,'datatype') ?$_REQUEST['datatype'] : "json");


+ 2
- 2
mod/install.php View File

@@ -1,8 +1,8 @@
<?php
require_once "include/Photo.php";

$install_wizard_pass=1;
require_once "include/Photo.php";

$install_wizard_pass = 1;

function install_init(App $a) {



+ 7
- 4
mod/login.php View File

@@ -1,13 +1,16 @@
<?php

function login_content(App $a) {
if(x($_SESSION,'theme'))
if (x($_SESSION, 'theme')) {
unset($_SESSION['theme']);
if(x($_SESSION,'mobile-theme'))
}
if (x($_SESSION, 'mobile-theme')) {
unset($_SESSION['mobile-theme']);
}

if(local_user())
if (local_user()) {
goaway(z_root());
}
return login(($a->config['register_policy'] == REGISTER_CLOSED) ? false : true);

}

+ 1
- 1
mod/maintenance.php View File

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

use \Friendica\Core\Config;
use Friendica\Core\Config;

function maintenance_content(App $a) {



+ 16
- 17
mod/manifest.php View File

@@ -1,26 +1,25 @@
<?php
use Friendica\Core\Config;

function manifest_content(App $a) {
use Friendica\Core\Config;

$tpl = get_markup_template('manifest.tpl');
function manifest_content(App $a) {

header('Content-type: application/manifest+json');
$tpl = get_markup_template('manifest.tpl');

$touch_icon = Config::get('system', 'touch_icon', 'images/friendica-128.png');
if ($touch_icon == '') {
$touch_icon = 'images/friendica-128.png';
}
header('Content-type: application/manifest+json');

$o = replace_macros($tpl, array(
'$baseurl' => App::get_baseurl(),
'$touch_icon' => $touch_icon,
'$title' => Config::get('config', 'sitename', 'Friendica'),
));
$touch_icon = Config::get('system', 'touch_icon', 'images/friendica-128.png');
if ($touch_icon == '') {
$touch_icon = 'images/friendica-128.png';
}

echo $o;
$o = replace_macros($tpl, array(
'$baseurl' => App::get_baseurl(),
'$touch_icon' => $touch_icon,
'$title' => Config::get('config', 'sitename', 'Friendica'),
));

killme();
echo $o;

}
?>
killme();
}

+ 1
- 1
mod/match.php View File

@@ -1,5 +1,5 @@
<?php
include_once('include/text.php');
require_once('include/text.php');
require_once('include/socgraph.php');
require_once('include/contact_widgets.php');
require_once('mod/proxy.php');


+ 0
- 1
mod/mood.php View File

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


function mood_init(App $a) {

if (! local_user()) {


+ 5
- 35
mod/newmember.php View File

@@ -1,83 +1,53 @@
<?php

function newmember_content(App $a) {

function newmember_content(App $a) {

$o = '<h1>' . t('Welcome to Friendica') . '</h1>';

$o .= '<h3>' . t('New Member Checklist') . '</h3>';

$o .= '<div style="font-size: 120%;">';

$o .= t('We would like to offer some tips and links to help make your experience enjoyable. Click any item to visit the relevant page. A link to this page will be visible from your home page for two weeks after your initial registration and then will quietly disappear.');

$o .= '<h4>' . t('Getting Started') . '</h4>';

$o .= '<ul>';

$o .= '<li> ' . '<a target="newmember" href="help/guide">' . t('Friendica Walk-Through') . '</a><br />' . t('On your <em>Quick Start</em> page - find a brief introduction to your profile and network tabs, make some new connections, and find some groups to join.') . '</li>' . EOL;

$o .= '</ul>';

$o .= '<h4>' . t('Settings') . '</h4>';

$o .= '<ul>';

$o .= '<li>' . '<a target="newmember" href="settings">' . t('Go to Your Settings') . '</a><br />' . t('On your <em>Settings</em> page - change your initial password. Also make a note of your Identity Address. This looks just like an email address - and will be useful in making friends on the free social web.') . '</li>' . EOL;

$o .= '<li>' . t('Review the other settings, particularly the privacy settings. An unpublished directory listing is like having an unlisted phone number. In general, you should probably publish your listing - unless all of your friends and potential friends know exactly how to find you.') . '</li>' . EOL;

$o .= '</ul>';

$o .= '<h4>' . t('Profile') . '</h4>';

$o .= '<ul>';

$o .= '<li>' . '<a target="newmember" href="profile_photo">' . t('Upload Profile Photo') . '</a><br />' . t('Upload a profile photo if you have not done so already. Studies have shown that people with real photos of themselves are ten times more likely to make friends than people who do not.') . '</li>' . EOL;

$o .= '<li>' . '<a target="newmember" href="profiles">' . t('Edit Your Profile') . '</a><br />' . t('Edit your <strong>default</strong> profile to your liking. Review the settings for hiding your list of friends and hiding the profile from unknown visitors.') . '</li>' . EOL;

$o .= '<li>' . '<a target="newmember" href="profiles">' . t('Profile Keywords') . '</a><br />' . t('Set some public keywords for your default profile which describe your interests. We may be able to find other people with similar interests and suggest friendships.') . '</li>' . EOL;

$o .= '</ul>';

$o .= '<h4>' . t('Connecting') . '</h4>';

$o .= '<ul>';

$mail_disabled = ((function_exists('imap_open') && (! get_config('system','imap_disabled'))) ? 0 : 1);
$mail_disabled = ((function_exists('imap_open') && (!get_config('system', 'imap_disabled'))) ? 0 : 1);

if(! $mail_disabled)
if (!$mail_disabled) {
$o .= '<li>' . '<a target="newmember" href="settings/connectors">' . t('Importing Emails') . '</a><br />' . t('Enter your email access information on your Connector Settings page if you wish to import and interact with friends or mailing lists from your email INBOX') . '</li>' . EOL;
}

$o .= '<li>' . '<a target="newmember" href="contacts">' . t('Go to Your Contacts Page') . '</a><br />' . t('Your Contacts page is your gateway to managing friendships and connecting with friends on other networks. Typically you enter their address or site URL in the <em>Add New Contact</em> dialog.') . '</li>' . EOL;

$o .= '<li>' . '<a target="newmember" href="directory">' . t("Go to Your Site's Directory") . '</a><br />' . t('The Directory page lets you find other people in this network or other federated sites. Look for a <em>Connect</em> or <em>Follow</em> link on their profile page. Provide your own Identity Address if requested.') . '</li>' . EOL;

$o .= '<li>' . '<a target="newmember" href="contacts">' . t('Finding New People') . '</a><br />' . t("On the side panel of the Contacts page are several tools to find new friends. We can match people by interest, look up people by name or interest, and provide suggestions based on network relationships. On a brand new site, friend suggestions will usually begin to be populated within 24 hours.") . '</li>' . EOL;

$o .= '</ul>';

$o .= '<h4>' . t('Groups') . '</h4>';

$o .= '<ul>';

$o .= '<li>' . '<a target="newmember" href="contacts">' . t('Group Your Contacts') . '</a><br />' . t('Once you have made some friends, organize them into private conversation groups from the sidebar of your Contacts page and then you can interact with each group privately on your Network page.') . '</li>' . EOL;

if(get_config('system', 'newuser_private')) {
if (get_config('system', 'newuser_private')) {
$o .= '<li>' . '<a target="newmember" href="help/Groups-and-Privacy">' . t("Why Aren't My Posts Public?") . '</a><br />' . t("Friendica respects your privacy. By default, your posts will only show up to people you've added as friends. For more information, see the help section from the link above.") . '</li>' . EOL;
}

$o .= '</ul>';

$o .= '<h4>' . t('Getting Help') . '</h4>';

$o .= '<ul>';

$o .= '<li>' . '<a target="newmember" href="help">' . t('Go to the Help Section') . '</a><br />' . t('Our <strong>help</strong> pages may be consulted for detail on other program features and resources.') . '</li>' . EOL;

$o .= '</ul>';

$o .= '</div>';

return $o;


+ 1
- 1
mod/nodeinfo.php View File

@@ -5,7 +5,7 @@
* Documentation: http://nodeinfo.diaspora.software/schema.html
*/

use \Friendica\Core\Config;
use Friendica\Core\Config;

require_once 'include/plugin.php';



+ 15
- 15
mod/notice.php View File

@@ -1,20 +1,20 @@
<?php
/* identi.ca -> friendica items permanent-url compatibility */

function notice_init(App $a) {
$id = $a->argv[1];
$r = q("SELECT user.nickname FROM user LEFT JOIN item ON item.uid=user.uid WHERE item.id=%d",
intval($id)
);
if (dbm::is_result($r)){
$nick = $r[0]['nickname'];
$url = App::get_baseurl()."/display/$nick/$id";
goaway($url);
} else {
$a->error = 404;
notice( t('Item not found.') . EOL);
/* identi.ca -> friendica items permanent-url compatibility */

}
return;

function notice_init(App $a) {

$id = $a->argv[1];
$r = q("SELECT `user`.`nickname` FROM `user` LEFT JOIN `item` ON `item`.`uid` = `user`.`uid` WHERE `item`.`id` = %d", intval($id));
if (dbm::is_result($r)) {
$nick = $r[0]['nickname'];
$url = App::get_baseurl() . "/display/$nick/$id";
goaway($url);
} else {
$a->error = 404;
notice(t('Item not found.') . EOL);
}

return;
}

+ 0
- 1
mod/openid.php View File

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

require_once('library/openid.php');


function openid_content(App $a) {

$noid = get_config('system','no_openid');


+ 11
- 11
mod/opensearch.php View File

@@ -1,18 +1,18 @@
<?php
function opensearch_content(App $a) {

$tpl = get_markup_template('opensearch.tpl');

header("Content-type: application/opensearchdescription+xml");
function opensearch_content(App $a) {

$o = replace_macros($tpl, array(
'$baseurl' => App::get_baseurl(),
'$nodename' => $a->get_hostname(),
));
$tpl = get_markup_template('opensearch.tpl');

echo $o;
header("Content-type: application/opensearchdescription+xml");

killme();
$o = replace_macros($tpl, array(
'$baseurl' => App::get_baseurl(),
'$nodename' => $a->get_hostname(),
));

}
?>
echo $o;

killme();
}

+ 1
- 1
mod/parse_url.php View File

@@ -10,7 +10,7 @@
* @see ParseUrl::getSiteinfo() for more information about scraping embeddable content
*/

use \Friendica\ParseUrl;
use Friendica\ParseUrl;

require_once("include/items.php");



+ 3
- 2
mod/photos.php View File

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

use Friendica\Core\Config;

require_once 'include/Photo.php';
require_once 'include/photos.php';
require_once 'include/items.php';
@@ -10,8 +13,6 @@ require_once 'include/tags.php';
require_once 'include/threads.php';
require_once 'include/Probe.php';

use \Friendica\Core\Config;

function photos_init(App $a) {

if ($a->argc > 1) {


+ 1
- 1
mod/ping.php View File

@@ -1,5 +1,5 @@
<?php
require_once("include/datetime.php");
require_once('include/datetime.php');
require_once('include/bbcode.php');
require_once('include/ForumManager.php');
require_once('include/group.php');


+ 2
- 3
mod/poke.php View File

@@ -1,7 +1,6 @@
<?php /** @file */
<?php

/**
*
* Poke, prod, finger, or otherwise do unspeakable things to somebody - who must be a connection in your address book
* This function can be invoked with the required arguments (verb and cid and private and possibly parent) silently via ajax or
* other web request. You must be logged in and connected to a profile.
@@ -13,7 +12,7 @@
* private creates a private conversation with the recipient. Otherwise your profile's default post privacy is used.
*
*/
* @file mod/poke.php
require_once('include/security.php');
require_once('include/bbcode.php');
require_once('include/items.php');


+ 4
- 4
mod/pretheme.php View File

@@ -2,21 +2,21 @@

function pretheme_init(App $a) {

if($_REQUEST['theme']) {
if ($_REQUEST['theme']) {
$theme = $_REQUEST['theme'];
$info = get_theme_info($theme);
if($info) {
if ($info) {
// unfortunately there will be no translation for this string
$desc = $info['description'];
$version = $info['version'];
$credits = $info['credits'];
}
else {
} else {
$desc = '';
$version = '';
$credits = '';
}
echo json_encode(array('img' => get_theme_screenshot($theme), 'desc' => $desc, 'version' => $version, 'credits' => $credits));
}
killme();
}

+ 6
- 7
mod/probe.php View File

@@ -5,27 +5,26 @@ require_once('include/Scrape.php');
function probe_content(App $a) {

if (!local_user()) {
http_status_exit(403,
array("title" => t("Public access denied."),
"description" => t("Only logged in users are permitted to perform a probing.")));
http_status_exit(403, array("title" => t("Public access denied."),
"description" => t("Only logged in users are permitted to perform a probing.")));
killme();
}

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

$o .= '<form action="probe" method="get">';
$o .= 'Lookup address: <input type="text" style="width: 250px;" name="addr" value="' . $_GET['addr'] .'" />';
$o .= 'Lookup address: <input type="text" style="width: 250px;" name="addr" value="' . $_GET['addr'] . '" />';
$o .= '<input type="submit" name="submit" value="Submit" /></form>';

$o .= '<br /><br />';

if(x($_GET,'addr')) {

if (x($_GET, 'addr')) {
$addr = trim($_GET['addr']);
$res = probe_url($addr);
$o .= '<pre>';
$o .= str_replace("\n",'<br />',print_r($res,true));
$o .= str_replace("\n", '<br />', print_r($res, true));
$o .= '</pre>';
}

return $o;
}

+ 0
- 1
mod/profile.php View File

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


function profile_init(App $a) {

if(! x($a->page,'aside'))


+ 0
- 2
mod/profile_photo.php View File

@@ -9,10 +9,8 @@ function profile_photo_init(App $a) {
}

profile_load($a,$a->user['nickname']);

}


function profile_photo_post(App $a) {

if (! local_user()) {


+ 0
- 1
mod/qsearch.php View File

@@ -48,4 +48,3 @@ function qsearch_init(App $a) {
echo json_encode((object) $results);
killme();
}


+ 0
- 2
mod/receive.php View File

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


function receive_post(App $a) {


$enabled = intval(get_config('system','diaspora_enabled'));
if(! $enabled) {
logger('mod-diaspora: disabled');


+ 3
- 3
mod/robots_txt.php View File

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

/**
* @file mod/robots_text.php
* @brief Module which returns the default robots.txt
@@ -13,7 +14,6 @@
*/
function robots_txt_init(App $a)
{

$allDisalloweds = array(
'/settings/',
'/admin/',
@@ -21,9 +21,9 @@ function robots_txt_init(App $a)
);

header('Content-Type: text/plain');
echo 'User-agent: *'.PHP_EOL;
echo 'User-agent: *' . PHP_EOL;
foreach ($allDisalloweds as $disallowed) {
echo 'Disallow: '.$disallowed.PHP_EOL;
echo 'Disallow: ' . $disallowed . PHP_EOL;
}
killme();
}

+ 18
- 18
mod/rsd_xml.php View File

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


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">
<service>
<engineName>Friendica</engineName>
<engineLink>http://friendica.com/</engineLink>
<apis>
<api name="Twitter" preferred="true" apiLink="'.App::get_baseurl().'/api/" blogID="">
<settings>
<docs>http://status.net/wiki/TwitterCompatibleAPI</docs>
<setting name="OAuth">false</setting>
</settings>
</api>
</apis>
</service>
</rsd>
';
die();
<rsd version="1.0" xmlns="http://archipelago.phrasewise.com/rsd">
<service>
<engineName>Friendica</engineName>
<engineLink>http://friendica.com/</engineLink>
<apis>
<api name="Twitter" preferred="true" apiLink="'.App::get_baseurl().'/api/" blogID="">
<settings>
<docs>http://status.net/wiki/TwitterCompatibleAPI</docs>
<setting name="OAuth">false</setting>
</settings>
</api>
</apis>
</service>
</rsd>';
killme();
}

+ 4
- 5
mod/smilies.php View File

@@ -7,15 +7,14 @@
require_once("include/Smilies.php");

function smilies_content(App $a) {
if ($a->argv[1]==="json"){
if ($a->argv[1] === "json") {
$tmp = Smilies::get_list();
$results = array();
for($i = 0; $i < count($tmp['texts']); $i++) {
for ($i = 0; $i < count($tmp['texts']); $i++) {
$results[] = array('text' => $tmp['texts'][$i], 'icon' => $tmp['icons'][$i]);
}
json_return_and_die($results);
}
else {
return Smilies::replace('',true);
} else {
return Smilies::replace('', true);
}
}

+ 16
- 15
mod/statistics_json.php View File

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

/**
* @file mod/statistics_json.php
*/
@@ -7,21 +8,21 @@ require_once("include/plugin.php");

function statistics_json_init(App $a) {

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

$statistics = array(
"name" => $a->config["sitename"],
"network" => FRIENDICA_PLATFORM,
"version" => FRIENDICA_VERSION."-".DB_UPDATE_VERSION,
"registrations_open" => ($a->config['register_policy'] != 0),
"total_users" => get_config('nodeinfo','total_users'),
"active_users_halfyear" => get_config('nodeinfo','active_users_halfyear'),
"active_users_monthly" => get_config('nodeinfo','active_users_monthly'),
"local_posts" => get_config('nodeinfo','local_posts')
);
"name" => $a->config["sitename"],
"network" => FRIENDICA_PLATFORM,
"version" => FRIENDICA_VERSION . "-" . DB_UPDATE_VERSION,
"registrations_open" => ($a->config['register_policy'] != 0),
"total_users" => get_config('nodeinfo', 'total_users'),
"active_users_halfyear" => get_config('nodeinfo', 'active_users_halfyear'),
"active_users_monthly" => get_config('nodeinfo', 'active_users_monthly'),
"local_posts" => get_config('nodeinfo', 'local_posts')
);

$statistics["services"] = array();
$statistics["services"]["appnet"] = plugin_enabled("appnet");
@@ -53,7 +54,7 @@ function statistics_json_init(App $a) {
$statistics["wordpress"] = $statistics["services"]["wordpress"];

header("Content-Type: application/json");
echo json_encode($statistics, JSON_PRETTY_PRINT|JSON_UNESCAPED_SLASHES);
logger("statistics_init: printed ".print_r($statistics, true), LOGGER_DATA);
echo json_encode($statistics, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES);
logger("statistics_init: printed " . print_r($statistics, true), LOGGER_DATA);
killme();
}

+ 0
- 1
mod/subthread.php View File

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


function subthread_content(App $a) {

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


+ 0
- 1
mod/tagger.php View File

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


function tagger_content(App $a) {

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


+ 0
- 1
mod/toggle_mobile.php View File

@@ -16,4 +16,3 @@ function toggle_mobile_init(App $a) {

goaway($address);
}


+ 22
- 23
mod/uexport.php View File

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

function uexport_init(App $a) {
if (! local_user()) {
if (!local_user()) {
killme();
}

@@ -14,8 +14,8 @@ function uexport_content(App $a) {

if ($a->argc > 1) {
header("Content-type: application/json");
header('Content-Disposition: attachment; filename="'.$a->user['nickname'].'.'.$a->argv[1].'"');
switch($a->argv[1]) {
header('Content-Disposition: attachment; filename="' . $a->user['nickname'] . '.' . $a->argv[1] . '"');
switch ($a->argv[1]) {
case "backup":
uexport_all($a);
killme();
@@ -51,9 +51,9 @@ function _uexport_multirow($query) {
$result = array();
$r = q($query);
if (dbm::is_result($r)) {
foreach($r as $rr){
foreach ($r as $rr) {
$p = array();
foreach($rr as $k => $v) {
foreach ($rr as $k => $v) {
$p[$k] = $v;
}
$result[] = $p;
@@ -66,8 +66,8 @@ function _uexport_row($query) {
$result = array();
$r = q($query);
if (dbm::is_result($r)) {
foreach($r as $rr) {
foreach($rr as $k => $v) {
foreach ($r as $rr) {
foreach ($rr as $k => $v) {
$result[$k] = $v;
}
}
@@ -75,39 +75,38 @@ function _uexport_row($query) {
return $result;
}


function uexport_account($a){
function uexport_account($a) {

$user = _uexport_row(
sprintf( "SELECT * FROM `user` WHERE `uid` = %d LIMIT 1", intval(local_user()) )
sprintf("SELECT * FROM `user` WHERE `uid` = %d LIMIT 1", intval(local_user()))
);

$contact = _uexport_multirow(
sprintf( "SELECT * FROM `contact` WHERE `uid` = %d ",intval(local_user()) )
sprintf("SELECT * FROM `contact` WHERE `uid` = %d ", intval(local_user()))
);


$profile =_uexport_multirow(
sprintf( "SELECT * FROM `profile` WHERE `uid` = %d ", intval(local_user()) )
$profile = _uexport_multirow(
sprintf("SELECT * FROM `profile` WHERE `uid` = %d ", intval(local_user()))
);

$photo = _uexport_multirow(
sprintf( "SELECT * FROM `photo` WHERE uid = %d AND profile = 1", intval(local_user()) )
sprintf("SELECT * FROM `photo` WHERE uid = %d AND profile = 1", intval(local_user()))
);
foreach ($photo as &$p) {
$p['data'] = bin2hex($p['data']);
}

$pconfig = _uexport_multirow(
sprintf( "SELECT * FROM `pconfig` WHERE uid = %d",intval(local_user()) )
sprintf("SELECT * FROM `pconfig` WHERE uid = %d", intval(local_user()))
);

$group = _uexport_multirow(
sprintf( "SELECT * FROM `group` WHERE uid = %d",intval(local_user()) )
sprintf("SELECT * FROM `group` WHERE uid = %d", intval(local_user()))
);

$group_member = _uexport_multirow(
sprintf( "SELECT * FROM `group_member` WHERE uid = %d",intval(local_user()) )
sprintf("SELECT * FROM `group_member` WHERE uid = %d", intval(local_user()))
);

$output = array(
@@ -150,13 +149,13 @@ function uexport_all(App $a) {
intval($x),
intval(500)
);
/*if (dbm::is_result($r)) {
foreach($r as $rr)
foreach($rr as $k => $v)
$item[][$k] = $v;
}*/
/* if (dbm::is_result($r)) {
foreach($r as $rr)
foreach($rr as $k => $v)
$item[][$k] = $v;
} */

$output = array('item' => $r);
echo json_encode($output)."\n";
echo json_encode($output) . "\n";
}
}

+ 30
- 30
mod/uimport.php View File

@@ -1,35 +1,35 @@
<?php
/**
* View for user import
* @TODO This file has DOS line endings!
*/
require_once("include/uimport.php");
function uimport_post(App $a) {
switch($a->config['register_policy']) {
case REGISTER_OPEN:
$blocked = 0;
$verified = 1;
break;
switch ($a->config['register_policy']) {
case REGISTER_OPEN:
$blocked = 0;
$verified = 1;
break;
case REGISTER_APPROVE:
$blocked = 1;
$verified = 0;
break;
case REGISTER_APPROVE:
$blocked = 1;
$verified = 0;
break;
default:
case REGISTER_CLOSED:
if ((! x($_SESSION,'authenticated') && (! x($_SESSION,'administrator')))) {
notice( t('Permission denied.') . EOL );
return;
}
$blocked = 1;
$verified = 0;
break;
default:
case REGISTER_CLOSED:
if ((!x($_SESSION, 'authenticated') && (!x($_SESSION, 'administrator')))) {
notice(t('Permission denied.') . EOL);
return;
}
$blocked = 1;
$verified = 0;
break;
}
if (x($_FILES,'accountfile')){
if (x($_FILES, 'accountfile')) {
/// @TODO Pass $blocked / $verified, send email to admin on REGISTER_APPROVE
import_account($a, $_FILES['accountfile']);
return;
@@ -38,26 +38,26 @@ function uimport_post(App $a) {
function uimport_content(App $a) {
if ((! local_user()) && ($a->config['register_policy'] == REGISTER_CLOSED)) {
if ((!local_user()) && ($a->config['register_policy'] == REGISTER_CLOSED)) {
notice("Permission denied." . EOL);
return;
}
$max_dailies = intval(get_config('system','max_daily_registrations'));
$max_dailies = intval(get_config('system', 'max_daily_registrations'));
if ($max_dailies) {
$r = q("select count(*) as total from user where register_date > UTC_TIMESTAMP - INTERVAL 1 day");
if ($r && $r[0]['total'] >= $max_dailies) {
logger('max daily registrations exceeded.');
notice( t('This site has exceeded the number of allowed daily account registrations. Please try again tomorrow.') . EOL);
notice(t('This site has exceeded the number of allowed daily account registrations. Please try again tomorrow.') . EOL);
return;
}
}
if (x($_SESSION,'theme')) {
if (x($_SESSION, 'theme')) {
unset($_SESSION['theme']);
}
if (x($_SESSION,'mobile-theme')) {
if (x($_SESSION, 'mobile-theme')) {
unset($_SESSION['mobile-theme']);
}
@@ -65,11 +65,11 @@ function uimport_content(App $a) {
return replace_macros($tpl, array(
'$regbutt' => t('Import'),
'$import' => array(
'title' => t("Move account"),
'intro' => t("You can import an account from another Friendica server."),
'instruct' => t("You need to export your account from the old server and upload it here. We will recreate your old account here with all your contacts. We will try also to inform your friends that you moved here."),
'warn' => t("This feature is experimental. We can't import contacts from the OStatus network (GNU Social/Statusnet) or from Diaspora"),
'field' => array('accountfile', t('Account file'),'<input id="id_accountfile" name="accountfile" type="file">', t('To export your account, go to "Settings->Export your personal data" and select "Export account"')),
'title' => t("Move account"),
'intro' => t("You can import an account from another Friendica server."),
'instruct' => t("You need to export your account from the old server and upload it here. We will recreate your old account here with all your contacts. We will try also to inform your friends that you moved here."),
'warn' => t("This feature is experimental. We can't import contacts from the OStatus network (GNU Social/Statusnet) or from Diaspora"),
'field' => array('accountfile', t('Account file'), '<input id="id_accountfile" name="accountfile" type="file">', t('To export your account, go to "Settings->Export your personal data" and select "Export account"')),
),
));
}

+ 0
- 1
mod/videos.php View File

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


function videos_init(App $a) {

if($a->argc > 1)


+ 2
- 3
mod/wall_upload.php View File

@@ -3,17 +3,16 @@
/**
* @file mod/wall_upload.php
* @brief Module for uploading a picture to the profile wall
*
*
* By default the picture will be stored in the photo album with the name Wall Photos.
* You can specify a different album by adding an optional query string "album="
* to the url
*/

use \Friendica\Core\Config;
use Friendica\Core\Config;

require_once 'include/Photo.php';


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

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


+ 1
- 1
util/db_update.php View File

@@ -3,7 +3,7 @@
* @package util
*/

/*
/*
* require boot.php
*/
require_once("boot.php");


+ 1
- 1
util/maintenance.php View File

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

use \Friendica\Core\Config;
use Friendica\Core\Config;

require_once("boot.php");



+ 184
- 185
util/php2po.php View File

@@ -1,204 +1,203 @@
<?php
/**
* Read strings.php file and create messages.po
*
* php utils/php2po.php <path/to/strings.php>
*
* Output to <path/to/messages.po>
*/
DEFINE("NORM_REGEXP", "|[\\\]|");
if(! class_exists('App')) {
class TmpA {
public $strings = Array();
}
$a = new TmpA();
}
/**
* Read strings.php file and create messages.po
*
* php utils/php2po.php <path/to/strings.php>
*
* Output to <path/to/messages.po>
*/

if ($argc<2 || in_array('-h', $argv) || in_array('--h', $argv)) {
print "Usage: ".$argv[0]." [-p <n>] <strings.php>\n\n";
print "Options:\n";
print "p\tNumber of plural forms. Default: 2\n";
print "\n";
return;
}

$phpfile = $argv[1];
$pofile = dirname($phpfile)."/messages.po";
DEFINE("NORM_REGEXP", "|[\\\]|");

if (!file_exists($phpfile)){
print "Unable to find '$phpfile'\n";
return;
if(! class_exists('App')) {
class TmpA {
public $strings = Array();
}
$a = new TmpA();
}

// utility functions
function startsWith($haystack, $needle) {
// search backwards starting from haystack length characters from the end
return $needle === "" || strrpos($haystack, $needle, -strlen($haystack)) !== FALSE;
}
if ($argc<2 || in_array('-h', $argv) || in_array('--h', $argv)) {
print "Usage: ".$argv[0]." [-p <n>] <strings.php>\n\n";
print "Options:\n";
print "p\tNumber of plural forms. Default: 2\n";
print "\n";
return;
}

$phpfile = $argv[1];
$pofile = dirname($phpfile)."/messages.po";

if (!file_exists($phpfile)){
print "Unable to find '$phpfile'\n";
return;
}

// utility functions
function startsWith($haystack, $needle) {
// search backwards starting from haystack length characters from the end
return $needle === "" || strrpos($haystack, $needle, -strlen($haystack)) !== FALSE;
}

// start !
include_once($phpfile);

$out = '';
$out .= "# FRIENDICA Distributed Social Network\n";
$out .= "# Copyright (C) 2010, 2011, 2012, 2013 the Friendica Project\n";
$out .= "# This file is distributed under the same license as the Friendica package.\n";
$out .= "# \n";
$out .= 'msgid ""' ."\n";
$out .= 'msgstr ""' ."\n";
$out .= '"Project-Id-Version: friendica\n"' ."\n";
$out .= '"Report-Msgid-Bugs-To: \n"' ."\n";
$out .= '"POT-Creation-Date: '. date("Y-m-d H:i:sO").'\n"' ."\n";
$out .= '"MIME-Version: 1.0\n"' ."\n";
$out .= '"Content-Type: text/plain; charset=UTF-8\n"' ."\n";
$out .= '"Content-Transfer-Encoding: 8bit\n"' ."\n";
// search for plural info
$lang = "";
$lang_logic = "";
$lang_pnum = 2;
$_idx = array_search('-p', $argv);
if ($_idx !== false) {
$lang_pnum = $argv[$_idx+1];

// start !
include_once($phpfile);

$out = '';
$out .= "# FRIENDICA Distributed Social Network\n";
$out .= "# Copyright (C) 2010, 2011, 2012, 2013 the Friendica Project\n";
$out .= "# This file is distributed under the same license as the Friendica package.\n";
$out .= "# \n";
$out .= 'msgid ""' ."\n";
$out .= 'msgstr ""' ."\n";
$out .= '"Project-Id-Version: friendica\n"' ."\n";
$out .= '"Report-Msgid-Bugs-To: \n"' ."\n";
$out .= '"POT-Creation-Date: '. date("Y-m-d H:i:sO").'\n"' ."\n";
$out .= '"MIME-Version: 1.0\n"' ."\n";
$out .= '"Content-Type: text/plain; charset=UTF-8\n"' ."\n";
$out .= '"Content-Transfer-Encoding: 8bit\n"' ."\n";

// search for plural info
$lang = "";
$lang_logic = "";
$lang_pnum = 2;

$_idx = array_search('-p', $argv);
if ($_idx !== false) {
$lang_pnum = $argv[$_idx+1];
}

$infile = file($phpfile);