From: Michael Date: Thu, 12 Jan 2017 07:25:44 +0000 (+0000) Subject: Merge remote-tracking branch 'upstream/develop' into 1701-curl-range X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=e67133ef5653448003ceac29147cda41a4c9e017;p=friendica.git Merge remote-tracking branch 'upstream/develop' into 1701-curl-range Conflicts: mod/oexchange.php mod/uimport.php --- e67133ef5653448003ceac29147cda41a4c9e017 diff --cc include/network.php index 6bec9934ed,969f583828..b7839de218 --- a/include/network.php +++ b/include/network.php @@@ -4,9 -4,6 +4,8 @@@ * @file include/network.php */ +use \Friendica\Core\Config; - use \Friendica\Core\PConfig; + require_once("include/xml.php"); require_once('include/Probe.php'); diff --cc mod/oexchange.php index 28a9f4a241,47547e691c..4f2d7e0eb8 --- a/mod/oexchange.php +++ b/mod/oexchange.php @@@ -1,17 -1,20 +1,16 @@@ argc > 1) && ($a->argv[1] === 'xrd')) { + if (($a->argc > 1) && ($a->argv[1] === 'xrd')) { $tpl = get_markup_template('oexchange_xrd.tpl'); $o = replace_macros($tpl, array('$base' => App::get_baseurl())); echo $o; killme(); } - - } - function oexchange_content(App &$a) { + function oexchange_content(App $a) { if (! local_user()) { $o = login(false); diff --cc mod/uexport.php index 8b487380ec,d886e13b27..cada539bcd --- a/mod/uexport.php +++ b/mod/uexport.php @@@ -10,41 -10,37 +10,41 @@@ 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"); - header('Content-Disposition: attachment; filename="'.$a->user['nickname'].'.'.$a->argv[1].'"'); - switch($a->argv[1]) { - case "backup": uexport_all($a); killme(); break; - case "account": uexport_account($a); killme(); break; - default: - killme(); - } - } - - /** - * options shown on "Export personal data" page - * list of array( 'link url', 'link text', 'help text' ) - */ - $options = array( - array('uexport/account',t('Export account'),t('Export your account info and contacts. Use this to make a backup of your account and/or to move it to another server.')), - array('uexport/backup',t('Export all'),t('Export your accout info, contacts and all your items as json. Could be a very big file, and could take a lot of time. Use this to make a full backup of your account (photos are not exported)')), - ); - call_hooks('uexport_options', $options); - - $tpl = get_markup_template("uexport.tpl"); - return replace_macros($tpl, array( - '$baseurl' => App::get_baseurl(), - '$title' => t('Export personal data'), - '$options' => $options - )); - + if ($a->argc > 1) { + header("Content-type: application/json"); + header('Content-Disposition: attachment; filename="'.$a->user['nickname'].'.'.$a->argv[1].'"'); + switch($a->argv[1]) { + case "backup": + uexport_all($a); + killme(); + break; + case "account": + uexport_account($a); + killme(); + break; + default: + killme(); + } + } + /** + * options shown on "Export personal data" page + * list of array( 'link url', 'link text', 'help text' ) + */ + $options = array( + array('uexport/account',t('Export account'),t('Export your account info and contacts. Use this to make a backup of your account and/or to move it to another server.')), + array('uexport/backup',t('Export all'),t('Export your accout info, contacts and all your items as json. Could be a very big file, and could take a lot of time. Use this to make a full backup of your account (photos are not exported)')), + ); + call_hooks('uexport_options', $options); + + $tpl = get_markup_template("uexport.tpl"); + return replace_macros($tpl, array( + '$baseurl' => App::get_baseurl(), + '$title' => t('Export personal data'), + '$options' => $options + )); } function _uexport_multirow($query) { diff --cc mod/uimport.php index 55e04c5338,e9934393e8..336ec1c2dd --- a/mod/uimport.php +++ b/mod/uimport.php @@@ -6,39 -6,39 +6,39 @@@ 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; - $verified = 1; - break; + 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')){ - /// @TODO Pass $blocked / $verified, send email to admin on REGISTER_APPROVE - import_account($a, $_FILES['accountfile']); - return; - } + if (x($_FILES,'accountfile')){ + /// @TODO Pass $blocked / $verified, send email to admin on REGISTER_APPROVE + import_account($a, $_FILES['accountfile']); + return; + } } - function uimport_content(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; }