Make sure hooks are declared just one time

This commit is contained in:
Daniel Berteaud 2015-12-23 11:22:44 +01:00
parent f5e615f5f4
commit 7812574a48
1 changed files with 37 additions and 33 deletions

View File

@ -5,6 +5,7 @@ $lang = substr $lang, 0, 2;
$OUT .=<<"EOF";
if (!function_exists('hook_get_auth_webserver_profile')){
function hook_get_auth_webserver_profile(\$user_name) {
if (!isset(\$_SERVER['REMOTE_USER'])){
return false;
@ -30,7 +31,9 @@ function hook_get_auth_webserver_profile(\$user_name) {
'templatelist' => 'default,basic,MyOrgTemplate',
);
}
}
if (!function_exists('hook_get_auth_webserver_permissions')){
function hook_get_auth_webserver_permissions(\$user_name) {
if ((isset(\$_SERVER['HTTP_USER_GROUPS']) && (
in_array('admins', preg_split("/;\\s?/", \$_SERVER['HTTP_USER_GROUPS'])) ||
@ -47,6 +50,7 @@ function hook_get_auth_webserver_permissions(\$user_name) {
));
}
}
}
EOF
}