home *** CD-ROM | disk | FTP | other *** search
/ PC Professionell 2007 April / PCpro_2007_04.ISO / files / dsl / NVinst.exe / Scripts / HTTP / 127.0.0.3 / ReloadCMS / admin.php < prev    next >
Encoding:
PHP Script  |  2007-02-10  |  3.3 KB  |  86 lines

  1. <?php 
  2. ////////////////////////////////////////////////////////////////////////////////
  3. //   Copyright (C) ReloadCMS Development Team                                 //
  4. //   http://reloadcms.sf.net                                                  //
  5. //                                                                            //
  6. //   This program is distributed in the hope that it will be useful,          //
  7. //   but WITHOUT ANY WARRANTY, without even the implied warranty of           //
  8. //   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.                     //
  9. //                                                                            //
  10. //   This product released under GNU General Public License v2                //
  11. ////////////////////////////////////////////////////////////////////////////////
  12. define('RCMS_ROOT_PATH', './');
  13.  
  14. include(RCMS_ROOT_PATH . 'common.php');
  15.  
  16. function rcms_loadAdminLib($lib){
  17.     require_once(ADMIN_PATH . 'libs/' . $lib . '.php');
  18. }
  19.  
  20. //------------------------------------------------------------------------------------------------------//
  21. // preparations...
  22.  
  23. $rights = &$system->rights;
  24. $root   = &$system->root;
  25. if(!LOGGED_IN){
  26.     $message = __('Access denied');
  27.     $message .= '<br />
  28. <form method="post" action="">
  29. <input type="hidden" name="login_form" value="1" />
  30. <table cellpadding="2" cellspacing="1" style="width: 100%;">
  31. <tr>
  32.     <td class="row1">' . __('Username') . ':</td>
  33.     <td class="row1" style="width: 100%;"><input type="text" name="username" style="text-align: left; width: 95%;" /></td>
  34. </tr>
  35. <tr>
  36.     <td class="row1">' . __('Password') . ':</td>
  37.     <td class="row1" style="width: 100%;"><input type="password" name="password" style="text-align: left; width: 95%;" /></td>
  38. </tr>
  39. <tr>
  40.     <td class="row1" colspan="2">
  41.         <input type="checkbox" name="remember" id="remember" value="1" />
  42.         <label for="remember">' . __('Remember me') . '</label>
  43.     </td>
  44. </tr>
  45. <tr>
  46.     <td class="row2" colspan="2"><input type="submit" value="' . __('Log in') . '" /></td>
  47. </tr>
  48. </table>
  49. </form>';
  50.     include(ADMIN_PATH . 'error.php');
  51. } elseif (empty($rights) && !$root) {
  52.     $message = __('You are not administrator of this site');
  53.     include(ADMIN_PATH . 'error.php');
  54. } else {
  55.     if(!empty($_GET['show'])) $show = $_GET['show']; else $show = '';
  56.     
  57.     $categories = rcms_scandir(ADMIN_PATH . 'modules', '', 'dir');
  58.     $MODULES = array();
  59.     foreach ($categories as $category){
  60.         if(file_exists(ADMIN_PATH . 'modules/' . $category . '/module.php')){
  61.             include_once(ADMIN_PATH . 'modules/' . $category . '/module.php');
  62.         }
  63.     }
  64.     switch($show){
  65.         case 'nav':
  66.             include(ADMIN_PATH . 'navigation.php');
  67.         break;
  68.         case 'module':
  69.             $module = (!empty($_GET['id'])) ? basename($_GET['id']) : '.index';
  70.             $module = explode('.', $module, 2);
  71.             if(!is_file(ADMIN_PATH . 'modules/' . $module[0] . '/' . $module[1] . '.php')) {
  72.                 $message = __('Module not found') . ': ' . $module[0] . '/' . $module[1];
  73.                 include(ADMIN_PATH . 'error.php');
  74.             } elseif($module[1] != 'index' && empty($MODULES[$module[0]][1][$module[1]])) {
  75.                 $message = __('Access denied') . ': ' . $module[0] . '/' . $module[1];
  76.                 include(ADMIN_PATH . 'error.php');
  77.             } else {
  78.                 include(ADMIN_PATH . 'module.php');
  79.             }
  80.         break;
  81.         default:
  82.             include(ADMIN_PATH . 'frameset.php');
  83.         break;
  84.     }
  85. }
  86. ?>