// Check edit-permission
function check_editable($page, $auth_enabled = TRUE, $exit_on_fail = TRUE)
{
- global $script, $_title_cannotedit, $_msg_unfreeze;
+ global $_title_cannotedit, $_msg_unfreeze;
if (edit_auth($page, $auth_enabled, $exit_on_fail) && is_editable($page)) {
// Editable
$body = $title = str_replace('$1',
htmlsc(strip_bracket($page)), $_title_cannotedit);
if (is_freeze($page))
- $body .= '(<a href="' . $script . '?cmd=unfreeze&page=' .
+ $body .= '(<a href="' . get_base_uri() . '?cmd=unfreeze&page=' .
rawurlencode($page) . '">' . $_msg_unfreeze . '</a>)';
$page = str_replace('$1', make_search($page), $_title_cannotedit);
catbody($title, $page, $body);
header('WWW-Authenticate: Basic realm="' . $_msg_auth . '"');
header('HTTP/1.0 401 Unauthorized');
} elseif (AUTH_TYPE_FORM === $auth_type) {
- $url_after_login = get_script_uri() . '?' . $g_query_string;
- $loginurl = get_script_uri() . '?plugin=loginform'
+ $url_after_login = get_base_uri() . '?' . $g_query_string;
+ $loginurl = get_base_uri() . '?plugin=loginform'
. '&page=' . rawurlencode($page)
. '&url_after_login=' . rawurlencode($url_after_login);
header('HTTP/1.0 302 Found');