<?php
--
- function oexchange_init(App &$a) {
-
+ function oexchange_init(App $a) {
- if(($a->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);
}
/// @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) {
\r
require_once("include/uimport.php");\r
\r
- function uimport_post(App &$a) {\r
+ function uimport_post(App $a) {\r
switch($a->config['register_policy']) {\r
- case REGISTER_OPEN:\r
- $blocked = 0;\r
- $verified = 1;\r
- break;\r
+ case REGISTER_OPEN:\r
+ $blocked = 0;\r
+ $verified = 1;\r
+ break;\r
\r
- case REGISTER_APPROVE:\r
- $blocked = 1;\r
- $verified = 0;\r
- break;\r
+ case REGISTER_APPROVE:\r
+ $blocked = 1;\r
+ $verified = 0;\r
+ break;\r
\r
- default:\r
- case REGISTER_CLOSED:\r
- if((! x($_SESSION,'authenticated') && (! x($_SESSION,'administrator')))) {\r
- notice( t('Permission denied.') . EOL );\r
- return;\r
- }\r
- $blocked = 1;\r
- $verified = 0;\r
- break;\r
+ default:\r
+ case REGISTER_CLOSED:\r
+ if ((! x($_SESSION,'authenticated') && (! x($_SESSION,'administrator')))) {\r
+ notice( t('Permission denied.') . EOL );\r
+ return;\r
+ }\r
+ $blocked = 1;\r
+ $verified = 0;\r
+ break;\r
}\r
\r
- if (x($_FILES,'accountfile')){\r
- /// @TODO Pass $blocked / $verified, send email to admin on REGISTER_APPROVE\r
- import_account($a, $_FILES['accountfile']);\r
- return;\r
- }\r
+ if (x($_FILES,'accountfile')){\r
+ /// @TODO Pass $blocked / $verified, send email to admin on REGISTER_APPROVE\r
+ import_account($a, $_FILES['accountfile']);\r
+ return;\r
+ }\r
}\r
\r
- function uimport_content(App &$a) {\r
+ function uimport_content(App $a) {\r
\r
- if((! local_user()) && ($a->config['register_policy'] == REGISTER_CLOSED)) {\r
+ if ((! local_user()) && ($a->config['register_policy'] == REGISTER_CLOSED)) {\r
notice("Permission denied." . EOL);\r
return;\r
}\r