[ Index ]

PHP Cross Reference of Unnamed Project

title

Body

[close]

/se3-ocs/sources/www/ -> header.php.org (source)

   1  <?
   2  //====================================================================================
   3  // OCS INVENTORY REPORTS
   4  // Copyleft Pierre LEMMET 2005
   5  // Web: http://ocsinventory.sourceforge.net
   6  //
   7  // This code is open source and may be copied and modified as long as the source
   8  // code is always made freely available.
   9  // Please refer to the General Public Licence http://www.gnu.org/ or Licence.txt
  10  //====================================================================================
  11  //Modified on 12/13/2005
  12  
  13  error_reporting(E_ALL & ~E_NOTICE);
  14  set_time_limit(0);
  15  @session_start();
  16  
  17  include ("preferences.php");
  18  
  19  // update checking
  20  $resUpd = @mysql_query("SELECT tvalue FROM config WHERE name='GUI_VERSION'", $_SESSION["readServer"]) or die(mysql_error($_SESSION["readServer"]));
  21  $valUpd = @mysql_fetch_array($resUpd);
  22  if( !$valUpd || $valUpd["tvalue"]<GUI_VER ) {
  23      $fromAuto = true;
  24      include ('install.php');
  25      die();
  26  }//
  27  
  28  if(isset($_GET["logout"])) {
  29      foreach( $_SESSION as $key=>$val) {        
  30          unset($_SESSION[$key]);
  31      }
  32  }
  33  
  34  if( isset($_GET["first"] )) {
  35      unset( $_SESSION["lareq"] );
  36      unset( $_SESSION["lareqpages"] );
  37  }
  38  
  39  ?>
  40  <html>
  41  <head>
  42  <TITLE>OCS Inventory</TITLE>
  43  <META HTTP-EQUIV="Pragma" CONTENT="no-cache">
  44  <META HTTP-EQUIV="Expires" CONTENT="-1">
  45  <LINK REL='StyleSheet' TYPE='text/css' HREF='css/ocsreports.css'>
  46  <? incPicker(); ?>
  47  <script language='javascript'>
  48  <?if($_GET["multi"] == 3 && $_GET["mode"] == 1) {?>
  49  	function scrollHeaders() {
  50          var monSpan = document.getElementById("headers");
  51          if( document.body.scrollTop > 200) {
  52              monSpan.style.top = (( Math.ceil(document.body.scrollTop / 27)) * 27) + 3<?
  53      if( getBrowser() == "MOZ" )
  54          echo " - 17 + 27;\n";
  55  ?>            
  56              monSpan.style.visibility = 'visible';
  57              // 15 Netsc 8ie
  58          }
  59          else
  60              monSpan.style.visibility = 'hidden';
  61      }
  62  <?}?>
  63      
  64  	function wait( sens ) {    
  65          var mstyle = document.getElementById('wait').style.display    = (sens!=0?"block" :"none");    
  66      }
  67  
  68  </script>
  69  </head> 
  70  <?
  71  echo "<body bottommargin='0' leftmargin='0' topmargin='0' rightmargin='0' marginheight='0' marginwidth='0'";
  72  if( $_GET["multi"] ==3 && $_GET["mode"] == 1) {
  73      echo " OnScroll='javascript:scrollHeaders()'";
  74      if( getBrowser()=="MOZ")
  75          echo " OnMouseMove='javascript:scrollHeaders()'";
  76  }
  77  echo ">";
  78  
  79  if( !isset($_GET["popup"] )) {
  80  ?>
  81  <table class='headfoot' border='0'>
  82  <tr height=25px>
  83      <td><a href='index.php?first'><img src='image/logo OCS-ng-48.png'></a></td>
  84      <td align='center' width='33%'><a href='index.php?first'><img src=image/banner-ocs.png></a></td><td width='33%' align='right'>
  85      <b>Ver. <?=GUI_VER?>&nbsp&nbsp&nbsp;</b>    
  86  <?
  87      }
  88  
  89      if(isset($_POST["subLogin"])) {                
  90          $req="SELECT id, accesslvl, passwd FROM operators WHERE id='".$_POST["login"]."'";
  91          
  92          $res=mysql_query($req,$_SESSION["readServer"]) or die(mysql_error());
  93          
  94          if($row=@mysql_fetch_object($res))
  95          {
  96                       // DL 25/08/2005
  97              // Support new MD5 encrypted password or old clear password for login only                        
  98              if (($row->passwd != md5( $_POST["pass"])) and
  99                  ($row->passwd != $_POST["pass"])) {
 100                  $err = "</tr></table><br><center><font color=red><b>".$l->g(216)."</b></font></center>";
 101                  unset($_SESSION["loggeduser"],$_SESSION["lvluser"]);                
 102              }
 103              else {
 104                  $_SESSION["loggeduser"]=$row->id;
 105                  $_SESSION["lvluser"]=$row->accesslvl;    
 106              }
 107          }
 108          else
 109          {
 110              $err = "</tr></table><br><center><font color=red><b>".$l->g(180)."</b></font></center>";
 111              unset($_SESSION["loggeduser"],$_SESSION["lvluser"]);            
 112          }                
 113      }    
 114      
 115      if ( !isset($_SESSION["loggeduser"]) && $dir = @opendir("languages")) {
 116          while($filename = readdir($dir)) {
 117              if( strstr ( $filename, ".txt") === false)
 118                  continue;
 119              $langue = basename ( $filename,".txt");
 120              echo "<a title='$langue' href=\"index.php?av=1&multi=".$_GET["multi"]."&c=".$_GET["c"]."&a=".$_GET["a"]."&lang=$langue\"><img src =\"languages/$langue.png\" width=\"20\" height=\"15\"></a>&nbsp;";
 121          }
 122          closedir($dir);
 123      }
 124      
 125      if( isset($err) )
 126          echo $err;
 127      
 128      if(isset($_SESSION["loggeduser"]) && !isset($_GET["popup"]))
 129          echo "</td></tr><tr align=center><td align='center' colspan='3'>&nbsp;&nbsp;&nbsp;<a href=?logout><font color=black><u>".$l->g(251)."</u></font></a>&nbsp;&nbsp;&nbsp;<a href=index.php?multi=11><font color=black><u>".$l->g(236)."</u></font></a></td>";
 130  
 131      echo "</tr></table>";
 132  
 133      if(!isset($_SESSION["loggeduser"]))
 134      {            
 135          echo "<br><form name=log action=index.php method=post>
 136          <table BORDER='0' WIDTH = '35%' ALIGN = 'Center' CELLPADDING='0' BORDERCOLOR='#9894B5'>
 137              <tr>
 138                  <td><b>".$l->g(24).":</b></td>
 139                  <td><input name=login type=input size=15></td>
 140              </tr>
 141              <tr>
 142                  <td><b>".$l->g(217).":</b></td>
 143                  <td><input name=pass type=password size=15></td>
 144              </tr>
 145              <tr>
 146                  <td>&nbsp;</td>
 147                  <td><input name=subLogin type=submit value=".$l->g(13)."></td>
 148              </tr>
 149          </table>
 150          </form>        
 151          ";
 152          include  ("footer.php");
 153          die();
 154      }
 155      
 156      $limitedAccess = array(2,3,4,5,6,7,8,9,14,13,22,23,24,27,20,21,26);
 157      if( in_array($_GET["multi"],$limitedAccess) && $_SESSION["lvluser"]!=1) {
 158          echo "<br><br><center><b><font color=red>ACCESS DENIED</font></b></center><br>";
 159          unset($_GET["multi"]);
 160          die();
 161      }
 162  
 163      
 164  ?>


Generated: Tue Mar 17 22:47:18 2015 Cross-referenced by PHPXref 0.7.1