[ Index ]
 

Code source de e107 0.7.8

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/e107_admin/ -> admin.php (source)

   1  <?php
   2  /*
   3  + ----------------------------------------------------------------------------+
   4  |     e107 website system
   5  |
   6  |     ©Steve Dunstan 2001-2002
   7  |     http://e107.org
   8  |     jalist@e107.org
   9  |
  10  |     Released under the terms and conditions of the
  11  |     GNU General Public License (http://gnu.org).
  12  |
  13  |     $Source: /cvsroot/e107/e107_0.7/e107_admin/admin.php,v $
  14  |     $Revision: 1.39 $
  15  |     $Date: 2007/01/06 23:09:56 $
  16  |     $Author: e107steved $
  17  +----------------------------------------------------------------------------+
  18  */
  19  require_once ('../class2.php');
  20  $e_sub_cat = 'main';
  21  require_once ('auth.php');
  22  require_once(e_HANDLER.'admin_handler.php');
  23  
  24  // --- check for htmlarea.
  25  if (is_dir(e_ADMIN.'htmlarea') || is_dir(e_HANDLER.'htmlarea')) {
  26      $text = ADLAN_ERR_2."<br /><br />
  27      <div style='text-align:center'>".$HANDLERS_DIRECTORY."htmlarea/<br />".$ADMIN_DIRECTORY."htmlarea/</div>";
  28      $ns -> tablerender(ADLAN_ERR_1, $text);
  29  }
  30  
  31  // check for old modules.
  32  if(getperms('0') && isset($pref['modules']) && $pref['modules'] && $sql->db_Field("plugin",5) == "plugin_addons"){
  33  
  34      $mods=explode(",", $pref['modules']);
  35      $thef = "e_module.php";
  36      foreach ($mods as $mod)
  37      {
  38          if (is_readable(e_PLUGIN."{$mod}/module.php"))
  39          {
  40              $mod_found[] = e_PLUGIN."{$mod}/module.php";
  41          }
  42      }
  43  
  44      if($mod_found)
  45      {
  46          $text = ADLAN_ERR_5." <b>".$thef."</b>:<br /><br /><ul>";
  47          foreach($mod_found as $val){
  48              $text .= "<li>".str_replace("../","",$val)."</li>\n";
  49          }
  50          $text .="</ul><br />
  51          <form method='post' action='".e_ADMIN."db.php' id='upd'>
  52          <a href='#' onclick=\"document.getElementById('upd').submit()\">".ADLAN_ERR_6."</a>
  53          <input type='hidden' name='plugin_scan' value='1' />
  54          </form>";
  55          $ns -> tablerender(ADLAN_ERR_4,$text);
  56      }
  57  }
  58  
  59  // check for file-types;
  60  if (is_readable(e_ADMIN.'filetypes.php')) {
  61      $a_types = strtolower(trim(file_get_contents(e_ADMIN.'filetypes.php')));
  62  } else {
  63      $a_types = 'zip, gz, jpg, png, gif';
  64  }
  65  
  66  $a_types = explode(',', $a_types);
  67  foreach ($a_types as $f_type) {
  68      $allowed_types[] = '.'.trim(str_replace('.', '', $f_type));
  69  }
  70  
  71  // avatar check.
  72  $public = array(e_FILE.'public', e_FILE.'public/avatars');
  73  foreach ($public as $dir) {
  74      if (is_dir($dir)) {
  75          if ($dh = opendir($dir)) {
  76              while (($file = readdir($dh)) !== false) {
  77                  if (is_dir($dir."/".$file) == FALSE && $file != '.' && $file != '..' && $file != '/' && $file != 'CVS' && $file != 'avatars' && $file != 'Thumbs.db' && $file !=".htaccess" && $file !="php.ini") {
  78                      $fext = substr(strrchr($file, "."), 0);
  79                      if (!in_array(strtolower($fext), $allowed_types) ) {
  80                          if ($file == 'index.html' || $file == "null.txt") {
  81                              if (filesize($dir.'/'.$file)) {
  82                                  $potential[] = str_replace('../', '', $dir).'/'.$file;
  83                              }
  84                          } else {
  85                              $potential[] = str_replace('../', '', $dir).'/'.$file;
  86                          }
  87                      }
  88                  }
  89              }
  90          closedir($dh);
  91          }
  92      }
  93  }
  94  
  95  if (isset($potential)) {
  96      $text = ADLAN_ERR_3."<br /><br />";
  97  
  98      foreach ($potential as $p_file) {
  99          $text .= $p_file.'<br />';
 100      }
 101  
 102      $ns -> tablerender(ADLAN_ERR_1, $text);
 103  }
 104  
 105  // update users using old layout names to their new names
 106  $update_prefs = FALSE;
 107  if (!$pref['adminstyle'] || $pref['adminstyle'] == 'default') {
 108      $pref['adminstyle'] = 'compact';
 109      $update_prefs = true;
 110  }
 111  if ($pref['adminstyle'] == 'adminb') {
 112      $pref['adminstyle'] = 'cascade';
 113      $update_prefs = true;
 114  }
 115  if ($pref['adminstyle'] == 'admin_etalkers') {
 116      $pref['adminstyle'] = 'categories';
 117      $update_prefs = true;
 118  }
 119  if ($pref['adminstyle'] == 'admin_combo') {
 120      $pref['adminstyle'] = 'combo';
 121      $update_prefs = true;
 122  }
 123  if ($pref['adminstyle'] == 'admin_classis') {
 124      $pref['adminstyle'] = 'classis';
 125      $update_prefs = true;
 126  }
 127  
 128  // temporary code to switch users using admin_jayya to jayya
 129  
 130  if ($pref['admintheme'] == 'admin_jayya') {
 131      $pref['admintheme'] = 'jayya';
 132      $update_prefs = true;
 133  }
 134  
 135  if ($pref['sitetheme'] == 'admin_jayya') {
 136      $pref['sitetheme'] = 'jayya';
 137      $update_prefs = true;
 138  }
 139  
 140  // ---------------------------------------------------------
 141  
 142  
 143  if ($update_prefs == true) {
 144      save_prefs();
 145  }
 146  
 147  // auto db update
 148  if ('0' == ADMINPERMS) {
 149      require_once(e_ADMIN.'update_routines.php');
 150      update_check();
 151  }
 152  // end auto db update
 153  
 154  if (e_QUERY == 'purge' && getperms('0')) {
 155      $admin_log->purge_log_events(false);
 156  }
 157  
 158  $td = 1;
 159  if(!defined("ADLINK_COLS")){
 160      define("ADLINK_COLS",5);
 161  }
 162  function render_links($link, $title, $description, $perms, $icon = FALSE, $mode = FALSE) {
 163      global $td,$tp;
 164      $text = '';
 165      if (getperms($perms)) {
 166          if ($mode == 'adminb') {
 167              $text = "<tr><td class='forumheader3'>
 168                  <div class='td' style='text-align:left; vertical-align:top; width:100%'
 169                  onmouseover=\"eover(this, 'forumheader5')\" onmouseout=\"eover(this, 'td')\" onclick=\"document.location.href='".$link."'\">
 170                  ".$icon." <b>".$title."</b> ".($description ? "[ <span class='smalltext'>".$description."</span> ]" : "")."</div></td></tr>";
 171          } else {
 172              if ($td == (ADLINK_COLS+1)) {
 173                  $text .= '</tr>';
 174                  $td = 1;
 175              }
 176              if ($td == 1) {
 177                  $text .= '<tr>';
 178              }
 179              if ($mode == 'default') {
 180                  $text .= "<td class='td' style='text-align:left; vertical-align:top; width:20%; white-space:nowrap'
 181                      onmouseover=\"eover(this, 'forumheader5')\" onmouseout=\"eover(this, 'td')\" onclick=\"document.location.href='".$link."'\">".$icon." ".$tp->toHTML($title,FALSE,"defs,emotes_off")."</td>";
 182              }
 183              else if ($mode == 'classis') {
 184                  $text .= "<td style='text-align:center; vertical-align:top; width:20%'><a href='".$link."' title='$description'>".$icon."</a><br />
 185                      <a href='".$link."' title='$description'><b>".$tp->toHTML($title,FALSE,"defs,emotes_off")."</b></a><br /><br /></td>";
 186              }elseif ($mode == 'beginner'){
 187                  $text .= "<td style='text-align:center; vertical-align:top; width:20%' ><a href='".$link."' >".$icon."</a>
 188                      <div style='padding:5px'>
 189                      <a href='".$link."' title='".$description."' style='text-decoration:none'><b>".$tp->toHTML($title,FALSE,"defs,emotes_off")."</b></a></div><br /><br /><br /></td>";
 190              }
 191              $td++;
 192          }
 193      }
 194      return $text;
 195  }
 196  
 197  function render_clean() {
 198      global $td;
 199      while ($td <= ADLINK_COLS) {
 200          $text .= "<td class='td' style='width:20%;'></td>";
 201          $td++;
 202      }
 203      $text .= "</tr>";
 204      $td = 1;
 205      return $text;
 206  }
 207  
 208  $newarray = asortbyindex($array_functions, 1);
 209  
 210  require_once(e_ADMIN.'includes/'.$pref['adminstyle'].'.php');
 211  
 212  function admin_info() {
 213      global $tp;
 214  
 215      $width = (getperms('0')) ? "33%" : "50%";
 216  
 217      $ADMIN_INFO_TEMPLATE = "
 218      <div style='text-align:center'>
 219          <table style='width: 100%; border-collapse:collapse; border-spacing:0px;'>
 220          <tr>
 221              <td style='width: ".$width."; vertical-align: top'>
 222              {ADMIN_STATUS}
 223              </td>
 224              <td style='width:".$width."; vertical-align: top'>
 225              {ADMIN_LATEST}
 226              </td>";
 227  
 228          if(getperms('0'))
 229          {
 230              $ADMIN_INFO_TEMPLATE .= "
 231              <td style='width:".$width."; vertical-align: top'>{ADMIN_LOG}</td>";
 232          }
 233  
 234         $ADMIN_INFO_TEMPLATE .= "
 235          </tr></table></div>";
 236  
 237      return $tp->parseTemplate($ADMIN_INFO_TEMPLATE);
 238  }
 239  
 240  function status_request() {
 241      global $pref;
 242      if ($pref['adminstyle'] == 'classis' || $pref['adminstyle'] == 'cascade' || $pref['adminstyle'] == 'beginner') {
 243          return TRUE;
 244      } else {
 245          return FALSE;
 246      }
 247  }
 248  
 249  function latest_request() {
 250      global $pref;
 251      if ($pref['adminstyle'] == 'classis' || $pref['adminstyle'] == 'cascade' || $pref['adminstyle'] == 'beginner') {
 252          return TRUE;
 253      } else {
 254          return FALSE;
 255      }
 256  }
 257  
 258  function log_request() {
 259      global $pref;
 260      if ($pref['adminstyle'] == 'classis' || $pref['adminstyle'] == 'cascade'|| $pref['adminstyle'] == 'beginner') {
 261          return TRUE;
 262      } else {
 263          return FALSE;
 264      }
 265  }
 266  
 267  require_once ("footer.php");
 268  
 269  ?>


Généré le : Sun Apr 1 01:23:32 2007 par Balluche grâce à PHPXref 0.7