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