Projet

Général

Profil

Paste
Statistiques
| Branche: | Révision:

ryxeo-glpi-git / front / ocsng.form.php @ b67d8923

Historique | Voir | Annoter | Télécharger (3,36 ko)

1
<?php
2

    
3

    
4
/*
5
 * @version $Id: ocsng.form.php 7763 2009-01-06 18:44:50Z moyo $
6
 -------------------------------------------------------------------------
7
 GLPI - Gestionnaire Libre de Parc Informatique
8
 Copyright (C) 2003-2009 by the INDEPNET Development Team.
9

10
 http://indepnet.net/   http://glpi-project.org
11
 -------------------------------------------------------------------------
12

13
 LICENSE
14

15
 This file is part of GLPI.
16

17
 GLPI is free software; you can redistribute it and/or modify
18
 it under the terms of the GNU General Public License as published by
19
 the Free Software Foundation; either version 2 of the License, or
20
 (at your option) any later version.
21

22
 GLPI is distributed in the hope that it will be useful,
23
 but WITHOUT ANY WARRANTY; without even the implied warranty of
24
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
25
 GNU General Public License for more details.
26

27
 You should have received a copy of the GNU General Public License
28
 along with GLPI; if not, write to the Free Software
29
 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
30
 --------------------------------------------------------------------------
31
 */
32

    
33
// ----------------------------------------------------------------------
34
// Original Author of file:
35
// Purpose of file:
36
// ----------------------------------------------------------------------
37

    
38
$NEEDED_ITEMS = array ("setup","ocsng","user","search","admininfo");
39

    
40
define('GLPI_ROOT', '..');
41
include (GLPI_ROOT . "/inc/includes.php");
42

    
43
checkRight("ocsng", "w");
44
$ocs = new Ocsng();
45

    
46
if(isset($_GET)) $tab = $_GET;
47
if(empty($tab) && isset($_POST)) $tab = $_POST;
48
if(!isset($tab["ID"])) $tab["ID"] = "";
49
if(!isset($tab["withtemplate"])) $tab["withtemplate"] = "";
50
if ($tab["ID"] == -1) $tab["ID"] = "";
51

    
52
commonHeader($LANG["ocsng"][0], $_SERVER['PHP_SELF'], "config","ocsng");
53

    
54
//Delete template or server
55
if (isset ($tab["purge"]) || isset ($tab["delete"])) {
56
        $ocs->delete($tab);
57
        glpi_header($CFG_GLPI["root_doc"] . "/front/setup.ocsng.php");
58
}
59
//Update server
60
elseif (isset ($tab["update_server"])) {
61
        $ocs->update($tab);
62
        $ocs->updateAdminInfo($tab);
63
        $ocs->showForm($_SERVER['PHP_SELF'], $tab["ID"]);
64
}
65
//Add new server
66
elseif (isset ($tab["add_server"])) {
67
        $newid = $ocs->add($tab);
68

    
69
        //If template, display the template form
70
        $ocs->showForm($_SERVER['PHP_SELF'], $newid,$tab["withtemplate"],$tab["templateid"]);
71
}
72

    
73
//Templates
74

    
75
//Add new template
76
elseif (isset ($tab["add_template"])) {
77
        $newid = $ocs->add($tab);
78

    
79
        //If template, display the template form
80
        $ocs->ocsFormConfig($_SERVER['PHP_SELF'],-1,$tab["withtemplate"],$newid);
81
}
82
//Update a template
83
elseif (isset ($tab["update_template"])) {
84
        //If template, display the template form
85
        $ocs->update($_POST);
86
        $ocs->ocsFormConfig($_SERVER['PHP_SELF'],-1,$tab["withtemplate"],$tab["ID"]);
87
}
88
//Update a server with template
89
elseif (isset ($tab["update_server_with_template"])) {
90
        $ocs->update($tab);
91
        $ocs->showForm($_SERVER['PHP_SELF'],$tab["ID"]);
92
}
93

    
94
elseif (isset ($tab["withtemplate"]) && $tab["withtemplate"] != '') {
95
        //If creation or modification of a template
96
        if ($tab["withtemplate"] ==1)
97
        $ocs->ocsFormConfig($_SERVER['PHP_SELF'],-1,$tab["withtemplate"],$tab["ID"]);
98
        
99
        //If creation of a new OCS server
100
        elseif ($tab["withtemplate"] ==2)
101
        $ocs->showForm($_SERVER['PHP_SELF'],-1,$tab["withtemplate"],$tab["ID"]);
102
}
103

    
104
//Other
105
else
106
{
107
        $ocs->showForm($_SERVER['PHP_SELF'], $tab["ID"]);
108
}
109

    
110
commonFooter();
111
?>
Redmine Appliance - Powered by TurnKey Linux