# HG changeset patch # User Dan # Date 1193702508 14400 # Node ID feaffad3e07b8d8092fc3c8a2466e06943bf3be2 # Parent 94db56b8124f8636bce1cd8cfdcf284d6da0c1d4 Localized the dreaded not-authenticated message in the admin panel diff -r 94db56b8124f -r feaffad3e07b plugins/SpecialAdmin.php --- a/plugins/SpecialAdmin.php Mon Oct 29 11:17:55 2007 -0400 +++ b/plugins/SpecialAdmin.php Mon Oct 29 20:01:48 2007 -0400 @@ -48,9 +48,12 @@ function page_Admin_Home() { global $db, $session, $paths, $template, $plugins; // Common objects + global $lang; if ( $session->auth_level < USER_LEVEL_ADMIN || $session->user_level < USER_LEVEL_ADMIN ) { - echo '

Error: Not authenticated

It looks like your administration session is invalid or you are not authorized to access this administration page. Please re-authenticate to continue.

'; + $login_link = makeUrlNS('Special', 'Login/' . $paths->nslist['Special'] . 'Administration', 'level=' . USER_LEVEL_ADMIN, true); + echo '

' . $lang->get('admin_err_not_auth_title') . '

'; + echo '

' . $lang->get('admin_err_not_auth_body', array( 'login_link' => $login_link )) . '

'; return; } @@ -115,9 +118,12 @@ function page_Admin_GeneralConfig() { global $db, $session, $paths, $template, $plugins; // Common objects + global $lang; if ( $session->auth_level < USER_LEVEL_ADMIN || $session->user_level < USER_LEVEL_ADMIN ) { - echo '

Error: Not authenticated

It looks like your administration session is invalid or you are not authorized to access this administration page. Please re-authenticate to continue.

'; + $login_link = makeUrlNS('Special', 'Login/' . $paths->nslist['Special'] . 'Administration', 'level=' . USER_LEVEL_ADMIN, true); + echo '

' . $lang->get('admin_err_not_auth_title') . '

'; + echo '

' . $lang->get('admin_err_not_auth_body', array( 'login_link' => $login_link )) . '

'; return; } @@ -511,9 +517,12 @@ function page_Admin_UploadConfig() { global $db, $session, $paths, $template, $plugins; // Common objects + global $lang; if ( $session->auth_level < USER_LEVEL_ADMIN || $session->user_level < USER_LEVEL_ADMIN ) { - echo '

Error: Not authenticated

It looks like your administration session is invalid or you are not authorized to access this administration page. Please re-authenticate to continue.

'; + $login_link = makeUrlNS('Special', 'Login/' . $paths->nslist['Special'] . 'Administration', 'level=' . USER_LEVEL_ADMIN, true); + echo '

' . $lang->get('admin_err_not_auth_title') . '

'; + echo '

' . $lang->get('admin_err_not_auth_body', array( 'login_link' => $login_link )) . '

'; return; } @@ -628,9 +637,12 @@ function page_Admin_PluginManager() { global $db, $session, $paths, $template, $plugins; // Common objects + global $lang; if ( $session->auth_level < USER_LEVEL_ADMIN || $session->user_level < USER_LEVEL_ADMIN ) { - echo '

Error: Not authenticated

It looks like your administration session is invalid or you are not authorized to access this administration page. Please re-authenticate to continue.

'; + $login_link = makeUrlNS('Special', 'Login/' . $paths->nslist['Special'] . 'Administration', 'level=' . USER_LEVEL_ADMIN, true); + echo '

' . $lang->get('admin_err_not_auth_title') . '

'; + echo '

' . $lang->get('admin_err_not_auth_body', array( 'login_link' => $login_link )) . '

'; return; } @@ -769,9 +781,12 @@ function page_Admin_UploadAllowedMimeTypes() { global $db, $session, $paths, $template, $plugins; // Common objects + global $lang; if ( $session->auth_level < USER_LEVEL_ADMIN || $session->user_level < USER_LEVEL_ADMIN ) { - echo '

Error: Not authenticated

It looks like your administration session is invalid or you are not authorized to access this administration page. Please re-authenticate to continue.

'; + $login_link = makeUrlNS('Special', 'Login/' . $paths->nslist['Special'] . 'Administration', 'level=' . USER_LEVEL_ADMIN, true); + echo '

' . $lang->get('admin_err_not_auth_title') . '

'; + echo '

' . $lang->get('admin_err_not_auth_body', array( 'login_link' => $login_link )) . '

'; return; } @@ -832,9 +847,12 @@ function page_Admin_Sidebar() { global $db, $session, $paths, $template, $plugins; // Common objects + global $lang; if ( $session->auth_level < USER_LEVEL_ADMIN || $session->user_level < USER_LEVEL_ADMIN ) { - echo '

Error: Not authenticated

It looks like your administration session is invalid or you are not authorized to access this administration page. Please re-authenticate to continue.

'; + $login_link = makeUrlNS('Special', 'Login/' . $paths->nslist['Special'] . 'Administration', 'level=' . USER_LEVEL_ADMIN, true); + echo '

' . $lang->get('admin_err_not_auth_title') . '

'; + echo '

' . $lang->get('admin_err_not_auth_body', array( 'login_link' => $login_link )) . '

'; return; } @@ -889,9 +907,12 @@ /* function page_Admin_UserManager() { global $db, $session, $paths, $template, $plugins; // Common objects + global $lang; if ( $session->auth_level < USER_LEVEL_ADMIN || $session->user_level < USER_LEVEL_ADMIN ) { - echo '

Error: Not authenticated

It looks like your administration session is invalid or you are not authorized to access this administration page. Please re-authenticate to continue.

'; + $login_link = makeUrlNS('Special', 'Login/' . $paths->nslist['Special'] . 'Administration', 'level=' . USER_LEVEL_ADMIN, true); + echo '

' . $lang->get('admin_err_not_auth_title') . '

'; + echo '

' . $lang->get('admin_err_not_auth_body', array( 'login_link' => $login_link )) . '

'; return; } @@ -1159,9 +1180,12 @@ function page_Admin_GroupManager() { global $db, $session, $paths, $template, $plugins; // Common objects + global $lang; if ( $session->auth_level < USER_LEVEL_ADMIN || $session->user_level < USER_LEVEL_ADMIN ) { - echo '

Error: Not authenticated

It looks like your administration session is invalid or you are not authorized to access this administration page. Please re-authenticate to continue.

'; + $login_link = makeUrlNS('Special', 'Login/' . $paths->nslist['Special'] . 'Administration', 'level=' . USER_LEVEL_ADMIN, true); + echo '

' . $lang->get('admin_err_not_auth_title') . '

'; + echo '

' . $lang->get('admin_err_not_auth_body', array( 'login_link' => $login_link )) . '

'; return; } @@ -1518,9 +1542,12 @@ function page_Admin_COPPA() { global $db, $session, $paths, $template, $plugins; // Common objects + global $lang; if ( $session->auth_level < USER_LEVEL_ADMIN || $session->user_level < USER_LEVEL_ADMIN ) { - echo '

Error: Not authenticated

It looks like your administration session is invalid or you are not authorized to access this administration page. Please re-authenticate to continue.

'; + $login_link = makeUrlNS('Special', 'Login/' . $paths->nslist['Special'] . 'Administration', 'level=' . USER_LEVEL_ADMIN, true); + echo '

' . $lang->get('admin_err_not_auth_title') . '

'; + echo '

' . $lang->get('admin_err_not_auth_body', array( 'login_link' => $login_link )) . '

'; return; } @@ -1591,9 +1618,12 @@ function page_Admin_PageManager() { global $db, $session, $paths, $template, $plugins; // Common objects + global $lang; if ( $session->auth_level < USER_LEVEL_ADMIN || $session->user_level < USER_LEVEL_ADMIN ) { - echo '

Error: Not authenticated

It looks like your administration session is invalid or you are not authorized to access this administration page. Please re-authenticate to continue.

'; + $login_link = makeUrlNS('Special', 'Login/' . $paths->nslist['Special'] . 'Administration', 'level=' . USER_LEVEL_ADMIN, true); + echo '

' . $lang->get('admin_err_not_auth_title') . '

'; + echo '

' . $lang->get('admin_err_not_auth_body', array( 'login_link' => $login_link )) . '

'; return; } @@ -1787,9 +1817,12 @@ function page_Admin_PageEditor() { global $db, $session, $paths, $template, $plugins; // Common objects + global $lang; if ( $session->auth_level < USER_LEVEL_ADMIN || $session->user_level < USER_LEVEL_ADMIN ) { - echo '

Error: Not authenticated

It looks like your administration session is invalid or you are not authorized to access this administration page. Please re-authenticate to continue.

'; + $login_link = makeUrlNS('Special', 'Login/' . $paths->nslist['Special'] . 'Administration', 'level=' . USER_LEVEL_ADMIN, true); + echo '

' . $lang->get('admin_err_not_auth_title') . '

'; + echo '

' . $lang->get('admin_err_not_auth_body', array( 'login_link' => $login_link )) . '

'; return; } @@ -1887,9 +1920,12 @@ { global $db, $session, $paths, $template, $plugins; // Common objects + global $lang; if ( $session->auth_level < USER_LEVEL_ADMIN || $session->user_level < USER_LEVEL_ADMIN ) { - echo '

Error: Not authenticated

It looks like your administration session is invalid or you are not authorized to access this administration page. Please re-authenticate to continue.

'; + $login_link = makeUrlNS('Special', 'Login/' . $paths->nslist['Special'] . 'Administration', 'level=' . USER_LEVEL_ADMIN, true); + echo '

' . $lang->get('admin_err_not_auth_title') . '

'; + echo '

' . $lang->get('admin_err_not_auth_body', array( 'login_link' => $login_link )) . '

'; return; } @@ -2150,9 +2186,12 @@ function page_Admin_BanControl() { global $db, $session, $paths, $template, $plugins; // Common objects + global $lang; if ( $session->auth_level < USER_LEVEL_ADMIN || $session->user_level < USER_LEVEL_ADMIN ) { - echo '

Error: Not authenticated

It looks like your administration session is invalid or you are not authorized to access this administration page. Please re-authenticate to continue.

'; + $login_link = makeUrlNS('Special', 'Login/' . $paths->nslist['Special'] . 'Administration', 'level=' . USER_LEVEL_ADMIN, true); + echo '

' . $lang->get('admin_err_not_auth_title') . '

'; + echo '

' . $lang->get('admin_err_not_auth_body', array( 'login_link' => $login_link )) . '

'; return; } @@ -2262,9 +2301,12 @@ function page_Admin_MassEmail() { global $db, $session, $paths, $template, $plugins; // Common objects + global $lang; if ( $session->auth_level < USER_LEVEL_ADMIN || $session->user_level < USER_LEVEL_ADMIN ) { - echo '

Error: Not authenticated

It looks like your administration session is invalid or you are not authorized to access this administration page. Please re-authenticate to continue.

'; + $login_link = makeUrlNS('Special', 'Login/' . $paths->nslist['Special'] . 'Administration', 'level=' . USER_LEVEL_ADMIN, true); + echo '

' . $lang->get('admin_err_not_auth_title') . '

'; + echo '

' . $lang->get('admin_err_not_auth_body', array( 'login_link' => $login_link )) . '

'; return; } @@ -2478,9 +2520,12 @@ function page_Admin_DBBackup() { global $db, $session, $paths, $template, $plugins; // Common objects + global $lang; if ( $session->auth_level < USER_LEVEL_ADMIN || $session->user_level < USER_LEVEL_ADMIN ) { - echo '

Error: Not authenticated

It looks like your administration session is invalid or you are not authorized to access this administration page. Please re-authenticate to continue.

'; + $login_link = makeUrlNS('Special', 'Login/' . $paths->nslist['Special'] . 'Administration', 'level=' . USER_LEVEL_ADMIN, true); + echo '

' . $lang->get('admin_err_not_auth_title') . '

'; + echo '

' . $lang->get('admin_err_not_auth_body', array( 'login_link' => $login_link )) . '

'; return; } @@ -2582,9 +2627,12 @@ function page_Admin_AdminLogout() { global $db, $session, $paths, $template, $plugins; // Common objects + global $lang; if ( $session->auth_level < USER_LEVEL_ADMIN || $session->user_level < USER_LEVEL_ADMIN ) { - echo '

Error: Not authenticated

It looks like your administration session is invalid or you are not authorized to access this administration page. Please re-authenticate to continue.

'; + $login_link = makeUrlNS('Special', 'Login/' . $paths->nslist['Special'] . 'Administration', 'level=' . USER_LEVEL_ADMIN, true); + echo '

' . $lang->get('admin_err_not_auth_title') . '

'; + echo '

' . $lang->get('admin_err_not_auth_body', array( 'login_link' => $login_link )) . '

'; return; } @@ -2595,6 +2643,7 @@ function page_Special_Administration() { global $db, $session, $paths, $template, $plugins; // Common objects + global $lang; if($session->auth_level < USER_LEVEL_ADMIN) { redirect(makeUrlNS('Special', 'Login/'.$paths->page, 'level='.USER_LEVEL_ADMIN), 'Not authorized', 'You need an authorization level of '.USER_LEVEL_ADMIN.' to use this page, your auth level is: ' . $session->auth_level, 0); @@ -2757,6 +2806,7 @@ function page_Special_EditSidebar() { global $db, $session, $paths, $template, $plugins; // Common objects + global $lang; if($session->auth_level < USER_LEVEL_ADMIN) {