Adapt initial permissions

tags/0.1.4_el5 0.1.4_el5
Daniel Berteaud 10 years ago
parent b805a95afd
commit 0d662b16e5
  1. 34
      root/etc/e-smith/templates/usr/share/limesurvey/application/config/config.php/25ProfileHook

@ -22,31 +22,31 @@ function hook_get_auth_webserver_profile(\$user_name) {
else{ else{
\$email = \$login . '\@$DomainName'; \$email = \$login . '\@$DomainName';
} }
if ((isset(\$_SERVER['HTTP_USER_GROUPS']) && (
in_array('admins', preg_split("/; /", \$_SERVER['HTTP_USER_GROUPS'])) ||
in_array('surveyadmins', preg_split("/; /", \$_SERVER['HTTP_USER_GROUPS']))
)) ||
(\$login == "admin")){
\$admin = 1;
}
else{
\$admin = 0;
}
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',
'create_survey' => 1,
'create_user' => \$admin,
'delete_user' => \$admin,
'superadmin' => \$admin,
'configurator' => \$admin,
'manage_template' => \$admin,
'manage_label' => \$admin
); );
} }
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']))
)) || (\$login == "admin")){
return Array('superadmin' => Array('read'=>true));
}
else{
return Array('surveys' => Array(
'create'=>true,
'read'=>true,
'update'=>true,
'delete'=>true
));
}
}
EOF EOF
} }

Loading…
Cancel
Save