[ PHPXref.com ] [ Generated: Sun Jul 20 17:59:13 2008 ] [ GLPI 0.65 ]
[ Index ]     [ Variables ]     [ Functions ]     [ Classes ]     [ Constants ]     [ Statistics ]

title

Body

[close]

/ocsng/ -> ocsng-sync.php (source)

   1  <?php
   2  /*
   3   * @version $Id: ocsng-sync.php,v 1.11 2006/02/26 22:40:06 moyo Exp $
   4   ----------------------------------------------------------------------
   5   GLPI - Gestionnaire Libre de Parc Informatique
   6   Copyright (C) 2003-2006 by the INDEPNET Development Team.
   7   
   8   http://indepnet.net/   http://glpi.indepnet.org
   9   ----------------------------------------------------------------------
  10  
  11   LICENSE
  12  
  13      This file is part of GLPI.
  14  
  15      GLPI is free software; you can redistribute it and/or modify
  16      it under the terms of the GNU General Public License as published by
  17      the Free Software Foundation; either version 2 of the License, or
  18      (at your option) any later version.
  19  
  20      GLPI is distributed in the hope that it will be useful,
  21      but WITHOUT ANY WARRANTY; without even the implied warranty of
  22      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  23      GNU General Public License for more details.
  24  
  25      You should have received a copy of the GNU General Public License
  26      along with GLPI; if not, write to the Free Software
  27      Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  28   ------------------------------------------------------------------------
  29  */
  30  
  31  // ----------------------------------------------------------------------
  32  // Original Author of file:
  33  // Purpose of file:
  34  // ----------------------------------------------------------------------
  35  
  36  include  ("_relpos.php");
  37  include  ($phproot."/glpi/includes.php");
  38  include  ($phproot."/glpi/includes_ocsng.php");
  39  include  ($phproot."/glpi/includes_computers.php");
  40  include  ($phproot."/glpi/includes_financial.php");
  41  include  ($phproot."/glpi/includes_devices.php");
  42  include  ($phproot."/glpi/includes_networking.php");
  43  include  ($phproot."/glpi/includes_monitors.php");
  44  include  ($phproot."/glpi/includes_peripherals.php");
  45  include  ($phproot."/glpi/includes_printers.php");
  46  include  ($phproot."/glpi/includes_software.php");
  47  include  ($phproot."/glpi/includes_tracking.php");
  48  include  ($phproot."/glpi/includes_phones.php");
  49  include  ($phproot."/glpi/includes_state.php");
  50  
  51  checkAuthentication("admin");
  52  
  53  commonHeader($lang["title"][39],$_SERVER["PHP_SELF"]);
  54  
  55  if (isset($_SESSION["ocs_update"])){
  56      if ($count=count($_SESSION["ocs_update"])){
  57          $percent=min(100,round(100*($_SESSION["ocs_update_count"]-$count)/$_SESSION["ocs_update_count"],0));
  58          
  59          displayProgressBar(400,$percent);
  60  
  61          $key=array_pop($_SESSION["ocs_update"]);
  62          ocsUpdateComputer($key,2);
  63          glpi_header($_SERVER['PHP_SELF']);
  64      } else {
  65          unset($_SESSION["ocs_update"]);
  66  
  67          displayProgressBar(400,100);
  68  
  69          echo "<div align='center'><strong>".$lang["ocsng"][8]."<br>";
  70          echo "<a href='".$_SERVER['PHP_SELF']."'>".$lang["buttons"][13]."</a>";
  71          echo "</strong></div>";
  72      }
  73  }
  74  
  75  
  76  if (!isset($_POST["update_ok"])){
  77  if (!isset($_GET['check'])) $_GET['check']='all';
  78  if (!isset($_GET['start'])) $_GET['start']=0;
  79  
  80  ocsCleanLinks();
  81  ocsManageDeleted();
  82  ocsShowUpdateComputer($_GET['check'],$_GET['start']);
  83  
  84  } else {
  85      if (count($_POST['toupdate'])>0){
  86          $_SESSION["ocs_update_count"]=0;
  87          foreach ($_POST['toupdate'] as $key => $val){
  88              if ($val=="on")    {
  89                  $_SESSION["ocs_update"][]=$key;
  90                  $_SESSION["ocs_update_count"]++;
  91              }
  92              
  93          }
  94      }
  95  
  96  glpi_header($_SERVER['PHP_SELF']);
  97  }
  98  
  99  
 100  commonFooter();
 101  
 102  ?>


[ Powered by PHPXref - Served by Debian GNU/Linux ]