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. 70
      root/etc/e-smith/templates/usr/share/limesurvey/application/config/config.php/25ProfileHook

@ -5,46 +5,50 @@ $lang = substr $lang, 0, 2;
$OUT .=<<"EOF"; $OUT .=<<"EOF";
function hook_get_auth_webserver_profile(\$user_name) { if (!function_exists('hook_get_auth_webserver_profile')){
if (!isset(\$_SERVER['REMOTE_USER'])){ function hook_get_auth_webserver_profile(\$user_name) {
return false; if (!isset(\$_SERVER['REMOTE_USER'])){
} return false;
\$login = \$_SERVER['REMOTE_USER']; }
if (isset(\$_SERVER['HTTP_USER_NAME'])){ \$login = \$_SERVER['REMOTE_USER'];
\$name = \$_SERVER['HTTP_USER_NAME']; if (isset(\$_SERVER['HTTP_USER_NAME'])){
} \$name = \$_SERVER['HTTP_USER_NAME'];
else{ }
\$name = \$login; else{
} \$name = \$login;
if (isset(\$_SERVER['HTTP_USER_EMAIL'])){ }
\$email = \$_SERVER['HTTP_USER_EMAIL']; if (isset(\$_SERVER['HTTP_USER_EMAIL'])){
} \$email = \$_SERVER['HTTP_USER_EMAIL'];
else{ }
\$email = \$login . '\@$DomainName'; else{
} \$email = \$login . '\@$DomainName';
return Array( }
return Array(
'full_name' => \$name, 'full_name' => \$name,
'email' => \$email, 'email' => \$email,
'lang' => '$lang', 'lang' => '$lang',
'htmleditormode' => 'inline', 'htmleditormode' => 'inline',
'templatelist' => 'default,basic,MyOrgTemplate', 'templatelist' => 'default,basic,MyOrgTemplate',
); );
}
} }
function hook_get_auth_webserver_permissions(\$user_name) { if (!function_exists('hook_get_auth_webserver_permissions')){
if ((isset(\$_SERVER['HTTP_USER_GROUPS']) && ( function hook_get_auth_webserver_permissions(\$user_name) {
in_array('admins', preg_split("/;\\s?/", \$_SERVER['HTTP_USER_GROUPS'])) || if ((isset(\$_SERVER['HTTP_USER_GROUPS']) && (
in_array('surveyadmins', preg_split("/;\\s?/", \$_SERVER['HTTP_USER_GROUPS'])) in_array('admins', preg_split("/;\\s?/", \$_SERVER['HTTP_USER_GROUPS'])) ||
)) || (\$user_name == "admin")){ in_array('surveyadmins', preg_split("/;\\s?/", \$_SERVER['HTTP_USER_GROUPS']))
return Array('superadmin' => Array('read'=>true)); )) || (\$user_name == "admin")){
} return Array('superadmin' => Array('read'=>true));
else{ }
return Array('surveys' => Array( else{
'create'=>true, return Array('surveys' => Array(
'read'=>true, 'create'=>true,
'update'=>true, 'read'=>true,
'delete'=>true 'update'=>true,
)); 'delete'=>true
));
}
} }
} }

Loading…
Cancel
Save