plugins/SpecialAdmin.php
changeset 216 feaffad3e07b
parent 215 94db56b8124f
child 217 2b13497fe820
equal deleted inserted replaced
215:94db56b8124f 216:feaffad3e07b
    46 
    46 
    47 // function names are IMPORTANT!!! The name pattern is: page_<namespace ID>_<page URLname, without namespace>
    47 // function names are IMPORTANT!!! The name pattern is: page_<namespace ID>_<page URLname, without namespace>
    48 
    48 
    49 function page_Admin_Home() {
    49 function page_Admin_Home() {
    50   global $db, $session, $paths, $template, $plugins; // Common objects
    50   global $db, $session, $paths, $template, $plugins; // Common objects
       
    51   global $lang;
    51   if ( $session->auth_level < USER_LEVEL_ADMIN || $session->user_level < USER_LEVEL_ADMIN )
    52   if ( $session->auth_level < USER_LEVEL_ADMIN || $session->user_level < USER_LEVEL_ADMIN )
    52   {
    53   {
    53     echo '<h3>Error: Not authenticated</h3><p>It looks like your administration session is invalid or you are not authorized to access this administration page. Please <a href="' . makeUrlNS('Special', 'Login/' . $paths->nslist['Special'] . 'Administration', 'level=' . USER_LEVEL_ADMIN, true) . '">re-authenticate</a> to continue.</p>';
    54     $login_link = makeUrlNS('Special', 'Login/' . $paths->nslist['Special'] . 'Administration', 'level=' . USER_LEVEL_ADMIN, true);
       
    55     echo '<h3>' . $lang->get('admin_err_not_auth_title') . '</h3>';
       
    56     echo '<p>' . $lang->get('admin_err_not_auth_body', array( 'login_link' => $login_link )) . '</p>';
    54     return;
    57     return;
    55   }
    58   }
    56   
    59   
    57   // Basic information
    60   // Basic information
    58   echo RenderMan::render(
    61   echo RenderMan::render(
   113   
   116   
   114 }
   117 }
   115 
   118 
   116 function page_Admin_GeneralConfig() {
   119 function page_Admin_GeneralConfig() {
   117   global $db, $session, $paths, $template, $plugins; // Common objects
   120   global $db, $session, $paths, $template, $plugins; // Common objects
       
   121   global $lang;
   118   if ( $session->auth_level < USER_LEVEL_ADMIN || $session->user_level < USER_LEVEL_ADMIN )
   122   if ( $session->auth_level < USER_LEVEL_ADMIN || $session->user_level < USER_LEVEL_ADMIN )
   119   {
   123   {
   120     echo '<h3>Error: Not authenticated</h3><p>It looks like your administration session is invalid or you are not authorized to access this administration page. Please <a href="' . makeUrlNS('Special', 'Login/' . $paths->nslist['Special'] . 'Administration', 'level=' . USER_LEVEL_ADMIN, true) . '">re-authenticate</a> to continue.</p>';
   124     $login_link = makeUrlNS('Special', 'Login/' . $paths->nslist['Special'] . 'Administration', 'level=' . USER_LEVEL_ADMIN, true);
       
   125     echo '<h3>' . $lang->get('admin_err_not_auth_title') . '</h3>';
       
   126     echo '<p>' . $lang->get('admin_err_not_auth_body', array( 'login_link' => $login_link )) . '</p>';
   121     return;
   127     return;
   122   }
   128   }
   123   
   129   
   124   if(isset($_POST['submit']) && !defined('ENANO_DEMO_MODE') )
   130   if(isset($_POST['submit']) && !defined('ENANO_DEMO_MODE') )
   125   {
   131   {
   509 }
   515 }
   510 
   516 
   511 function page_Admin_UploadConfig()
   517 function page_Admin_UploadConfig()
   512 {
   518 {
   513   global $db, $session, $paths, $template, $plugins; // Common objects
   519   global $db, $session, $paths, $template, $plugins; // Common objects
       
   520   global $lang;
   514   if ( $session->auth_level < USER_LEVEL_ADMIN || $session->user_level < USER_LEVEL_ADMIN )
   521   if ( $session->auth_level < USER_LEVEL_ADMIN || $session->user_level < USER_LEVEL_ADMIN )
   515   {
   522   {
   516     echo '<h3>Error: Not authenticated</h3><p>It looks like your administration session is invalid or you are not authorized to access this administration page. Please <a href="' . makeUrlNS('Special', 'Login/' . $paths->nslist['Special'] . 'Administration', 'level=' . USER_LEVEL_ADMIN, true) . '">re-authenticate</a> to continue.</p>';
   523     $login_link = makeUrlNS('Special', 'Login/' . $paths->nslist['Special'] . 'Administration', 'level=' . USER_LEVEL_ADMIN, true);
       
   524     echo '<h3>' . $lang->get('admin_err_not_auth_title') . '</h3>';
       
   525     echo '<p>' . $lang->get('admin_err_not_auth_body', array( 'login_link' => $login_link )) . '</p>';
   517     return;
   526     return;
   518   }
   527   }
   519   
   528   
   520   if(isset($_POST['save']))
   529   if(isset($_POST['save']))
   521   {
   530   {
   626   echo '</form>';
   635   echo '</form>';
   627 }
   636 }
   628 
   637 
   629 function page_Admin_PluginManager() {
   638 function page_Admin_PluginManager() {
   630   global $db, $session, $paths, $template, $plugins; // Common objects
   639   global $db, $session, $paths, $template, $plugins; // Common objects
       
   640   global $lang;
   631   if ( $session->auth_level < USER_LEVEL_ADMIN || $session->user_level < USER_LEVEL_ADMIN )
   641   if ( $session->auth_level < USER_LEVEL_ADMIN || $session->user_level < USER_LEVEL_ADMIN )
   632   {
   642   {
   633     echo '<h3>Error: Not authenticated</h3><p>It looks like your administration session is invalid or you are not authorized to access this administration page. Please <a href="' . makeUrlNS('Special', 'Login/' . $paths->nslist['Special'] . 'Administration', 'level=' . USER_LEVEL_ADMIN, true) . '">re-authenticate</a> to continue.</p>';
   643     $login_link = makeUrlNS('Special', 'Login/' . $paths->nslist['Special'] . 'Administration', 'level=' . USER_LEVEL_ADMIN, true);
       
   644     echo '<h3>' . $lang->get('admin_err_not_auth_title') . '</h3>';
       
   645     echo '<p>' . $lang->get('admin_err_not_auth_body', array( 'login_link' => $login_link )) . '</p>';
   634     return;
   646     return;
   635   }
   647   }
   636   
   648   
   637   if(isset($_GET['action']))
   649   if(isset($_GET['action']))
   638   {
   650   {
   767 }
   779 }
   768 
   780 
   769 function page_Admin_UploadAllowedMimeTypes()
   781 function page_Admin_UploadAllowedMimeTypes()
   770 {
   782 {
   771   global $db, $session, $paths, $template, $plugins; // Common objects
   783   global $db, $session, $paths, $template, $plugins; // Common objects
       
   784   global $lang;
   772   if ( $session->auth_level < USER_LEVEL_ADMIN || $session->user_level < USER_LEVEL_ADMIN )
   785   if ( $session->auth_level < USER_LEVEL_ADMIN || $session->user_level < USER_LEVEL_ADMIN )
   773   {
   786   {
   774     echo '<h3>Error: Not authenticated</h3><p>It looks like your administration session is invalid or you are not authorized to access this administration page. Please <a href="' . makeUrlNS('Special', 'Login/' . $paths->nslist['Special'] . 'Administration', 'level=' . USER_LEVEL_ADMIN, true) . '">re-authenticate</a> to continue.</p>';
   787     $login_link = makeUrlNS('Special', 'Login/' . $paths->nslist['Special'] . 'Administration', 'level=' . USER_LEVEL_ADMIN, true);
       
   788     echo '<h3>' . $lang->get('admin_err_not_auth_title') . '</h3>';
       
   789     echo '<p>' . $lang->get('admin_err_not_auth_body', array( 'login_link' => $login_link )) . '</p>';
   775     return;
   790     return;
   776   }
   791   }
   777   
   792   
   778   global $mime_types, $mimetype_exps, $mimetype_extlist;
   793   global $mime_types, $mimetype_exps, $mimetype_extlist;
   779   if(isset($_POST['save']) && !defined('ENANO_DEMO_MODE'))
   794   if(isset($_POST['save']) && !defined('ENANO_DEMO_MODE'))
   830 }
   845 }
   831 
   846 
   832 function page_Admin_Sidebar()
   847 function page_Admin_Sidebar()
   833 {
   848 {
   834   global $db, $session, $paths, $template, $plugins; // Common objects
   849   global $db, $session, $paths, $template, $plugins; // Common objects
       
   850   global $lang;
   835   if ( $session->auth_level < USER_LEVEL_ADMIN || $session->user_level < USER_LEVEL_ADMIN )
   851   if ( $session->auth_level < USER_LEVEL_ADMIN || $session->user_level < USER_LEVEL_ADMIN )
   836   {
   852   {
   837     echo '<h3>Error: Not authenticated</h3><p>It looks like your administration session is invalid or you are not authorized to access this administration page. Please <a href="' . makeUrlNS('Special', 'Login/' . $paths->nslist['Special'] . 'Administration', 'level=' . USER_LEVEL_ADMIN, true) . '">re-authenticate</a> to continue.</p>';
   853     $login_link = makeUrlNS('Special', 'Login/' . $paths->nslist['Special'] . 'Administration', 'level=' . USER_LEVEL_ADMIN, true);
       
   854     echo '<h3>' . $lang->get('admin_err_not_auth_title') . '</h3>';
       
   855     echo '<p>' . $lang->get('admin_err_not_auth_body', array( 'login_link' => $login_link )) . '</p>';
   838     return;
   856     return;
   839   }
   857   }
   840   
   858   
   841   ?>
   859   ?>
   842   <h2>Editing and managing the Enano sidebar</h2>
   860   <h2>Editing and managing the Enano sidebar</h2>
   887 }
   905 }
   888 
   906 
   889 /*
   907 /*
   890 function page_Admin_UserManager() {
   908 function page_Admin_UserManager() {
   891   global $db, $session, $paths, $template, $plugins; // Common objects
   909   global $db, $session, $paths, $template, $plugins; // Common objects
       
   910   global $lang;
   892   if ( $session->auth_level < USER_LEVEL_ADMIN || $session->user_level < USER_LEVEL_ADMIN )
   911   if ( $session->auth_level < USER_LEVEL_ADMIN || $session->user_level < USER_LEVEL_ADMIN )
   893   {
   912   {
   894     echo '<h3>Error: Not authenticated</h3><p>It looks like your administration session is invalid or you are not authorized to access this administration page. Please <a href="' . makeUrlNS('Special', 'Login/' . $paths->nslist['Special'] . 'Administration', 'level=' . USER_LEVEL_ADMIN, true) . '">re-authenticate</a> to continue.</p>';
   913     $login_link = makeUrlNS('Special', 'Login/' . $paths->nslist['Special'] . 'Administration', 'level=' . USER_LEVEL_ADMIN, true);
       
   914     echo '<h3>' . $lang->get('admin_err_not_auth_title') . '</h3>';
       
   915     echo '<p>' . $lang->get('admin_err_not_auth_body', array( 'login_link' => $login_link )) . '</p>';
   895     return;
   916     return;
   896   }
   917   }
   897   
   918   
   898   if ( isset($_GET['src']) && $_GET['src'] == 'get' && !empty($_GET['user']) )
   919   if ( isset($_GET['src']) && $_GET['src'] == 'get' && !empty($_GET['user']) )
   899   {
   920   {
  1157 */
  1178 */
  1158 
  1179 
  1159 function page_Admin_GroupManager()
  1180 function page_Admin_GroupManager()
  1160 {
  1181 {
  1161   global $db, $session, $paths, $template, $plugins; // Common objects
  1182   global $db, $session, $paths, $template, $plugins; // Common objects
       
  1183   global $lang;
  1162   if ( $session->auth_level < USER_LEVEL_ADMIN || $session->user_level < USER_LEVEL_ADMIN )
  1184   if ( $session->auth_level < USER_LEVEL_ADMIN || $session->user_level < USER_LEVEL_ADMIN )
  1163   {
  1185   {
  1164     echo '<h3>Error: Not authenticated</h3><p>It looks like your administration session is invalid or you are not authorized to access this administration page. Please <a href="' . makeUrlNS('Special', 'Login/' . $paths->nslist['Special'] . 'Administration', 'level=' . USER_LEVEL_ADMIN, true) . '">re-authenticate</a> to continue.</p>';
  1186     $login_link = makeUrlNS('Special', 'Login/' . $paths->nslist['Special'] . 'Administration', 'level=' . USER_LEVEL_ADMIN, true);
       
  1187     echo '<h3>' . $lang->get('admin_err_not_auth_title') . '</h3>';
       
  1188     echo '<p>' . $lang->get('admin_err_not_auth_body', array( 'login_link' => $login_link )) . '</p>';
  1165     return;
  1189     return;
  1166   }
  1190   }
  1167   
  1191   
  1168   if(isset($_POST['do_create_stage1']))
  1192   if(isset($_POST['do_create_stage1']))
  1169   {
  1193   {
  1516 }
  1540 }
  1517 
  1541 
  1518 function page_Admin_COPPA()
  1542 function page_Admin_COPPA()
  1519 {
  1543 {
  1520   global $db, $session, $paths, $template, $plugins; // Common objects
  1544   global $db, $session, $paths, $template, $plugins; // Common objects
       
  1545   global $lang;
  1521   if ( $session->auth_level < USER_LEVEL_ADMIN || $session->user_level < USER_LEVEL_ADMIN )
  1546   if ( $session->auth_level < USER_LEVEL_ADMIN || $session->user_level < USER_LEVEL_ADMIN )
  1522   {
  1547   {
  1523     echo '<h3>Error: Not authenticated</h3><p>It looks like your administration session is invalid or you are not authorized to access this administration page. Please <a href="' . makeUrlNS('Special', 'Login/' . $paths->nslist['Special'] . 'Administration', 'level=' . USER_LEVEL_ADMIN, true) . '">re-authenticate</a> to continue.</p>';
  1548     $login_link = makeUrlNS('Special', 'Login/' . $paths->nslist['Special'] . 'Administration', 'level=' . USER_LEVEL_ADMIN, true);
       
  1549     echo '<h3>' . $lang->get('admin_err_not_auth_title') . '</h3>';
       
  1550     echo '<p>' . $lang->get('admin_err_not_auth_body', array( 'login_link' => $login_link )) . '</p>';
  1524     return;
  1551     return;
  1525   }
  1552   }
  1526   
  1553   
  1527   echo '<h2>Background information</h2>';
  1554   echo '<h2>Background information</h2>';
  1528   echo '<p>
  1555   echo '<p>
  1589 }
  1616 }
  1590 
  1617 
  1591 function page_Admin_PageManager()
  1618 function page_Admin_PageManager()
  1592 {
  1619 {
  1593   global $db, $session, $paths, $template, $plugins; // Common objects
  1620   global $db, $session, $paths, $template, $plugins; // Common objects
       
  1621   global $lang;
  1594   if ( $session->auth_level < USER_LEVEL_ADMIN || $session->user_level < USER_LEVEL_ADMIN )
  1622   if ( $session->auth_level < USER_LEVEL_ADMIN || $session->user_level < USER_LEVEL_ADMIN )
  1595   {
  1623   {
  1596     echo '<h3>Error: Not authenticated</h3><p>It looks like your administration session is invalid or you are not authorized to access this administration page. Please <a href="' . makeUrlNS('Special', 'Login/' . $paths->nslist['Special'] . 'Administration', 'level=' . USER_LEVEL_ADMIN, true) . '">re-authenticate</a> to continue.</p>';
  1624     $login_link = makeUrlNS('Special', 'Login/' . $paths->nslist['Special'] . 'Administration', 'level=' . USER_LEVEL_ADMIN, true);
       
  1625     echo '<h3>' . $lang->get('admin_err_not_auth_title') . '</h3>';
       
  1626     echo '<p>' . $lang->get('admin_err_not_auth_body', array( 'login_link' => $login_link )) . '</p>';
  1597     return;
  1627     return;
  1598   }
  1628   }
  1599   
  1629   
  1600   
  1630   
  1601   echo '<h2>Page management</h2>';
  1631   echo '<h2>Page management</h2>';
  1785 }
  1815 }
  1786 
  1816 
  1787 function page_Admin_PageEditor()
  1817 function page_Admin_PageEditor()
  1788 {
  1818 {
  1789   global $db, $session, $paths, $template, $plugins; // Common objects
  1819   global $db, $session, $paths, $template, $plugins; // Common objects
       
  1820   global $lang;
  1790   if ( $session->auth_level < USER_LEVEL_ADMIN || $session->user_level < USER_LEVEL_ADMIN )
  1821   if ( $session->auth_level < USER_LEVEL_ADMIN || $session->user_level < USER_LEVEL_ADMIN )
  1791   {
  1822   {
  1792     echo '<h3>Error: Not authenticated</h3><p>It looks like your administration session is invalid or you are not authorized to access this administration page. Please <a href="' . makeUrlNS('Special', 'Login/' . $paths->nslist['Special'] . 'Administration', 'level=' . USER_LEVEL_ADMIN, true) . '">re-authenticate</a> to continue.</p>';
  1823     $login_link = makeUrlNS('Special', 'Login/' . $paths->nslist['Special'] . 'Administration', 'level=' . USER_LEVEL_ADMIN, true);
       
  1824     echo '<h3>' . $lang->get('admin_err_not_auth_title') . '</h3>';
       
  1825     echo '<p>' . $lang->get('admin_err_not_auth_body', array( 'login_link' => $login_link )) . '</p>';
  1793     return;
  1826     return;
  1794   }
  1827   }
  1795   
  1828   
  1796   
  1829   
  1797   echo '<h2>Edit page content</h2>';
  1830   echo '<h2>Edit page content</h2>';
  1885 
  1918 
  1886 function page_Admin_ThemeManager() 
  1919 function page_Admin_ThemeManager() 
  1887 {
  1920 {
  1888   
  1921   
  1889   global $db, $session, $paths, $template, $plugins; // Common objects
  1922   global $db, $session, $paths, $template, $plugins; // Common objects
       
  1923   global $lang;
  1890   if ( $session->auth_level < USER_LEVEL_ADMIN || $session->user_level < USER_LEVEL_ADMIN )
  1924   if ( $session->auth_level < USER_LEVEL_ADMIN || $session->user_level < USER_LEVEL_ADMIN )
  1891   {
  1925   {
  1892     echo '<h3>Error: Not authenticated</h3><p>It looks like your administration session is invalid or you are not authorized to access this administration page. Please <a href="' . makeUrlNS('Special', 'Login/' . $paths->nslist['Special'] . 'Administration', 'level=' . USER_LEVEL_ADMIN, true) . '">re-authenticate</a> to continue.</p>';
  1926     $login_link = makeUrlNS('Special', 'Login/' . $paths->nslist['Special'] . 'Administration', 'level=' . USER_LEVEL_ADMIN, true);
       
  1927     echo '<h3>' . $lang->get('admin_err_not_auth_title') . '</h3>';
       
  1928     echo '<p>' . $lang->get('admin_err_not_auth_body', array( 'login_link' => $login_link )) . '</p>';
  1893     return;
  1929     return;
  1894   }
  1930   }
  1895   
  1931   
  1896   
  1932   
  1897   // Get the list of styles in the themes/ dir
  1933   // Get the list of styles in the themes/ dir
  2148 }
  2184 }
  2149 
  2185 
  2150 function page_Admin_BanControl()
  2186 function page_Admin_BanControl()
  2151 {
  2187 {
  2152   global $db, $session, $paths, $template, $plugins; // Common objects
  2188   global $db, $session, $paths, $template, $plugins; // Common objects
       
  2189   global $lang;
  2153   if ( $session->auth_level < USER_LEVEL_ADMIN || $session->user_level < USER_LEVEL_ADMIN )
  2190   if ( $session->auth_level < USER_LEVEL_ADMIN || $session->user_level < USER_LEVEL_ADMIN )
  2154   {
  2191   {
  2155     echo '<h3>Error: Not authenticated</h3><p>It looks like your administration session is invalid or you are not authorized to access this administration page. Please <a href="' . makeUrlNS('Special', 'Login/' . $paths->nslist['Special'] . 'Administration', 'level=' . USER_LEVEL_ADMIN, true) . '">re-authenticate</a> to continue.</p>';
  2192     $login_link = makeUrlNS('Special', 'Login/' . $paths->nslist['Special'] . 'Administration', 'level=' . USER_LEVEL_ADMIN, true);
       
  2193     echo '<h3>' . $lang->get('admin_err_not_auth_title') . '</h3>';
       
  2194     echo '<p>' . $lang->get('admin_err_not_auth_body', array( 'login_link' => $login_link )) . '</p>';
  2156     return;
  2195     return;
  2157   }
  2196   }
  2158   
  2197   
  2159   if(isset($_GET['action']) && $_GET['action'] == 'delete' && isset($_GET['id']) && $_GET['id'] != '')
  2198   if(isset($_GET['action']) && $_GET['action'] == 'delete' && isset($_GET['id']) && $_GET['id'] != '')
  2160   {
  2199   {
  2260 }
  2299 }
  2261 
  2300 
  2262 function page_Admin_MassEmail()
  2301 function page_Admin_MassEmail()
  2263 {
  2302 {
  2264   global $db, $session, $paths, $template, $plugins; // Common objects
  2303   global $db, $session, $paths, $template, $plugins; // Common objects
       
  2304   global $lang;
  2265   if ( $session->auth_level < USER_LEVEL_ADMIN || $session->user_level < USER_LEVEL_ADMIN )
  2305   if ( $session->auth_level < USER_LEVEL_ADMIN || $session->user_level < USER_LEVEL_ADMIN )
  2266   {
  2306   {
  2267     echo '<h3>Error: Not authenticated</h3><p>It looks like your administration session is invalid or you are not authorized to access this administration page. Please <a href="' . makeUrlNS('Special', 'Login/' . $paths->nslist['Special'] . 'Administration', 'level=' . USER_LEVEL_ADMIN, true) . '">re-authenticate</a> to continue.</p>';
  2307     $login_link = makeUrlNS('Special', 'Login/' . $paths->nslist['Special'] . 'Administration', 'level=' . USER_LEVEL_ADMIN, true);
       
  2308     echo '<h3>' . $lang->get('admin_err_not_auth_title') . '</h3>';
       
  2309     echo '<p>' . $lang->get('admin_err_not_auth_body', array( 'login_link' => $login_link )) . '</p>';
  2268     return;
  2310     return;
  2269   }
  2311   }
  2270   
  2312   
  2271   global $enano_config;
  2313   global $enano_config;
  2272   if ( isset($_POST['do_send']) && !defined('ENANO_DEMO_MODE') )
  2314   if ( isset($_POST['do_send']) && !defined('ENANO_DEMO_MODE') )
  2476 }
  2518 }
  2477 
  2519 
  2478 function page_Admin_DBBackup()
  2520 function page_Admin_DBBackup()
  2479 {
  2521 {
  2480   global $db, $session, $paths, $template, $plugins; // Common objects
  2522   global $db, $session, $paths, $template, $plugins; // Common objects
       
  2523   global $lang;
  2481   if ( $session->auth_level < USER_LEVEL_ADMIN || $session->user_level < USER_LEVEL_ADMIN )
  2524   if ( $session->auth_level < USER_LEVEL_ADMIN || $session->user_level < USER_LEVEL_ADMIN )
  2482   {
  2525   {
  2483     echo '<h3>Error: Not authenticated</h3><p>It looks like your administration session is invalid or you are not authorized to access this administration page. Please <a href="' . makeUrlNS('Special', 'Login/' . $paths->nslist['Special'] . 'Administration', 'level=' . USER_LEVEL_ADMIN, true) . '">re-authenticate</a> to continue.</p>';
  2526     $login_link = makeUrlNS('Special', 'Login/' . $paths->nslist['Special'] . 'Administration', 'level=' . USER_LEVEL_ADMIN, true);
       
  2527     echo '<h3>' . $lang->get('admin_err_not_auth_title') . '</h3>';
       
  2528     echo '<p>' . $lang->get('admin_err_not_auth_body', array( 'login_link' => $login_link )) . '</p>';
  2484     return;
  2529     return;
  2485   }
  2530   }
  2486   
  2531   
  2487   if(isset($_GET['submitting']) && $_GET['submitting'] == 'yes' && defined('ENANO_DEMO_MODE') )
  2532   if(isset($_GET['submitting']) && $_GET['submitting'] == 'yes' && defined('ENANO_DEMO_MODE') )
  2488   {
  2533   {
  2580 }
  2625 }
  2581 
  2626 
  2582 function page_Admin_AdminLogout()
  2627 function page_Admin_AdminLogout()
  2583 {
  2628 {
  2584   global $db, $session, $paths, $template, $plugins; // Common objects
  2629   global $db, $session, $paths, $template, $plugins; // Common objects
       
  2630   global $lang;
  2585   if ( $session->auth_level < USER_LEVEL_ADMIN || $session->user_level < USER_LEVEL_ADMIN )
  2631   if ( $session->auth_level < USER_LEVEL_ADMIN || $session->user_level < USER_LEVEL_ADMIN )
  2586   {
  2632   {
  2587     echo '<h3>Error: Not authenticated</h3><p>It looks like your administration session is invalid or you are not authorized to access this administration page. Please <a href="' . makeUrlNS('Special', 'Login/' . $paths->nslist['Special'] . 'Administration', 'level=' . USER_LEVEL_ADMIN, true) . '">re-authenticate</a> to continue.</p>';
  2633     $login_link = makeUrlNS('Special', 'Login/' . $paths->nslist['Special'] . 'Administration', 'level=' . USER_LEVEL_ADMIN, true);
       
  2634     echo '<h3>' . $lang->get('admin_err_not_auth_title') . '</h3>';
       
  2635     echo '<p>' . $lang->get('admin_err_not_auth_body', array( 'login_link' => $login_link )) . '</p>';
  2588     return;
  2636     return;
  2589   }
  2637   }
  2590   
  2638   
  2591   $session->logout(USER_LEVEL_ADMIN);
  2639   $session->logout(USER_LEVEL_ADMIN);
  2592   echo '<h3>You have now been logged out of the administration panel.</h3><p>You will continue to be logged into the website, but you will need to re-authenticate before you can access the administration panel again.</p><p>Return to the <a href="'.makeUrl(getConfig('main_page')).'">Main Page</a>.</p>';
  2640   echo '<h3>You have now been logged out of the administration panel.</h3><p>You will continue to be logged into the website, but you will need to re-authenticate before you can access the administration panel again.</p><p>Return to the <a href="'.makeUrl(getConfig('main_page')).'">Main Page</a>.</p>';
  2593 }
  2641 }
  2594 
  2642 
  2595 function page_Special_Administration()
  2643 function page_Special_Administration()
  2596 {
  2644 {
  2597   global $db, $session, $paths, $template, $plugins; // Common objects
  2645   global $db, $session, $paths, $template, $plugins; // Common objects
       
  2646   global $lang;
  2598   
  2647   
  2599   if($session->auth_level < USER_LEVEL_ADMIN) {
  2648   if($session->auth_level < USER_LEVEL_ADMIN) {
  2600     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);
  2649     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);
  2601     exit;
  2650     exit;
  2602   }
  2651   }
  2755 }
  2804 }
  2756 
  2805 
  2757 function page_Special_EditSidebar()
  2806 function page_Special_EditSidebar()
  2758 {
  2807 {
  2759   global $db, $session, $paths, $template, $plugins; // Common objects
  2808   global $db, $session, $paths, $template, $plugins; // Common objects
       
  2809   global $lang;
  2760   
  2810   
  2761   if($session->auth_level < USER_LEVEL_ADMIN) 
  2811   if($session->auth_level < USER_LEVEL_ADMIN) 
  2762   {
  2812   {
  2763     redirect(makeUrlNS('Special', 'Login/'.$paths->page, 'level='.USER_LEVEL_ADMIN), '', '', false);
  2813     redirect(makeUrlNS('Special', 'Login/'.$paths->page, 'level='.USER_LEVEL_ADMIN), '', '', false);
  2764     exit;
  2814     exit;