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:
parent
a81d929cdf
commit
db949bb802
123 changed files with 768 additions and 471 deletions
|
|
@ -3,6 +3,7 @@
|
|||
require_once('include/enotify.php');
|
||||
require_once('include/user.php');
|
||||
|
||||
if(! function_exists('user_allow')) {
|
||||
function user_allow($hash) {
|
||||
|
||||
$a = get_app();
|
||||
|
|
@ -55,14 +56,14 @@ function user_allow($hash) {
|
|||
info( t('Account approved.') . EOL );
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// This does not have to go through user_remove() and save the nickname
|
||||
// permanently against re-registration, as the person was not yet
|
||||
// allowed to have friends on this system
|
||||
|
||||
if(! function_exists('user_deny')) {
|
||||
function user_deny($hash) {
|
||||
|
||||
$register = q("SELECT * FROM `register` WHERE `hash` = '%s' LIMIT 1",
|
||||
|
|
@ -91,9 +92,10 @@ function user_deny($hash) {
|
|||
);
|
||||
notice( sprintf(t('Registration revoked for %s'), $user[0]['username']) . EOL);
|
||||
return true;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if(! function_exists('regmod_content')) {
|
||||
function regmod_content(&$a) {
|
||||
|
||||
global $lang;
|
||||
|
|
@ -131,3 +133,4 @@ function regmod_content(&$a) {
|
|||
killme();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue