Make sure hooks are declared just one time

tags/0.1.6_el5 0.1.6_el5
Daniel Berteaud 9 years ago
parent f5e615f5f4
commit 7812574a48
  1. 8
      root/etc/e-smith/templates/usr/share/limesurvey/application/config/config.php/25ProfileHook

@ -5,7 +5,8 @@ $lang = substr $lang, 0, 2;
$OUT .=<<"EOF";
function hook_get_auth_webserver_profile(\$user_name) {
if (!function_exists('hook_get_auth_webserver_profile')){
function hook_get_auth_webserver_profile(\$user_name) {
if (!isset(\$_SERVER['REMOTE_USER'])){
return false;
}
@ -29,9 +30,11 @@ function hook_get_auth_webserver_profile(\$user_name) {
'htmleditormode' => 'inline',
'templatelist' => 'default,basic,MyOrgTemplate',
);
}
}
function hook_get_auth_webserver_permissions(\$user_name) {
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'])) ||
in_array('surveyadmins', preg_split("/;\\s?/", \$_SERVER['HTTP_USER_GROUPS']))
@ -46,6 +49,7 @@ function hook_get_auth_webserver_permissions(\$user_name) {
'delete'=>true
));
}
}
}
EOF

Loading…
Cancel
Save