Updated modules to allow for partial overrides without errors

Only define functions if they have not been defined before, e.g. in themes. This makes it possible to override parts of a module and still use the other functions.
This commit is contained in:
Andrej Stieben 2016-02-05 21:52:39 +01:00
parent a81d929cdf
commit db949bb802
123 changed files with 768 additions and 471 deletions

View file

@ -5,6 +5,7 @@
require_once("include/uimport.php");
if(! function_exists('uimport_post')) {
function uimport_post(&$a) {
switch($a->config['register_policy']) {
case REGISTER_OPEN:
@ -27,16 +28,18 @@ function uimport_post(&$a) {
$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(! function_exists('uimport_content')) {
function uimport_content(&$a) {
if((! local_user()) && ($a->config['register_policy'] == REGISTER_CLOSED)) {
notice("Permission denied." . EOL);
return;
@ -51,8 +54,8 @@ function uimport_content(&$a) {
return;
}
}
if(x($_SESSION,'theme'))
unset($_SESSION['theme']);
if(x($_SESSION,'mobile-theme'))
@ -71,3 +74,4 @@ function uimport_content(&$a) {
),
));
}
}