ryxeo-glpi-git / htdocs / front / profile.form.php @ 1c14bcc4
Historique | Voir | Annoter | Télécharger (3,33 ko)
1 | 1c14bcc4 | Eric Seigne | <?php
|
---|---|---|---|
2 | /*
|
||
3 | * @version $Id: profile.form.php 7763 2009-01-06 18:44:50Z moyo $
|
||
4 | -------------------------------------------------------------------------
|
||
5 | GLPI - Gestionnaire Libre de Parc Informatique
|
||
6 | Copyright (C) 2003-2009 by the INDEPNET Development Team.
|
||
7 | |||
8 | http://indepnet.net/ http://glpi-project.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: Julien Dombre
|
||
33 | // Purpose of file:
|
||
34 | // ----------------------------------------------------------------------
|
||
35 | |||
36 | |||
37 | |||
38 | $NEEDED_ITEMS=array("profile","search","entity","user"); |
||
39 | |||
40 | define('GLPI_ROOT', '..'); |
||
41 | include (GLPI_ROOT . "/inc/includes.php"); |
||
42 | |||
43 | checkRight("profile","r"); |
||
44 | |||
45 | if (!isset($_GET['ID'])) { |
||
46 | $_GET['ID']=""; |
||
47 | } |
||
48 | |||
49 | |||
50 | $prof=new Profile(); |
||
51 | |||
52 | if (isset($_POST["add"])){ |
||
53 | |||
54 | checkRight("profile","w"); |
||
55 | $ID=$prof->add($_POST); |
||
56 | glpi_header($_SERVER['HTTP_REFERER']); |
||
57 | }else if (isset($_POST["delete"])){ |
||
58 | checkRight("profile","w"); |
||
59 | |||
60 | $prof->delete($_POST); |
||
61 | glpi_header($CFG_GLPI["root_doc"]."/front/profile.php"); |
||
62 | } |
||
63 | else if (isset($_POST["update"])){ |
||
64 | checkRight("profile","w"); |
||
65 | |||
66 | $prof->update($_POST); |
||
67 | glpi_header($_SERVER['HTTP_REFERER']); |
||
68 | } else if (isset($_POST["moveentity"])){ |
||
69 | checkRight("user","w"); |
||
70 | if (isset($_POST['FK_entities'])&&$_POST['FK_entities']>=0){ |
||
71 | foreach ($_POST["item"] as $key => $val){ |
||
72 | if ($val==1) { |
||
73 | moveUserProfileEntity($key,$_POST['FK_entities']); |
||
74 | } |
||
75 | } |
||
76 | } |
||
77 | glpi_header($_SERVER['HTTP_REFERER']); |
||
78 | } else if (isset($_POST["deleteuser"])){ |
||
79 | checkRight("user","w"); |
||
80 | foreach ($_POST["item"] as $key => $val){ |
||
81 | if ($val==1) { |
||
82 | deleteUserProfileEntity($key);
|
||
83 | } |
||
84 | } |
||
85 | glpi_header($_SERVER['HTTP_REFERER']); |
||
86 | } |
||
87 | |||
88 | |||
89 | commonHeader($LANG["Menu"][35],$_SERVER['PHP_SELF'],"admin","profile"); |
||
90 | |||
91 | if (!isset($_SESSION['glpi_onglet'])) $_SESSION['glpi_onglet']=1; |
||
92 | if (isset($_GET['onglet'])) { |
||
93 | $_SESSION['glpi_onglet']=$_GET['onglet']; |
||
94 | } |
||
95 | |||
96 | if ($prof->showForm($_SERVER['PHP_SELF'],$_GET["ID"])){ |
||
97 | switch($_SESSION['glpi_onglet']){ |
||
98 | case -1 : |
||
99 | showProfileConfig($_SERVER['PHP_SELF'],$_GET["ID"],$prof); |
||
100 | showProfileEntityUser($_SERVER['PHP_SELF'],$_GET["ID"],$prof); |
||
101 | displayPluginAction(PROFILE_TYPE,$_GET["ID"],$_SESSION['glpi_onglet']); |
||
102 | break;
|
||
103 | case 1: |
||
104 | showProfileConfig($_SERVER['PHP_SELF'],$_GET["ID"],$prof); |
||
105 | break;
|
||
106 | case 2 : |
||
107 | showProfileEntityUser($_SERVER['PHP_SELF'],$_GET["ID"],$prof); |
||
108 | break;
|
||
109 | default :
|
||
110 | if (!displayPluginAction(PROFILE_TYPE,$_GET["ID"],$_SESSION['glpi_onglet'])){ |
||
111 | showProfileConfig($_SERVER['PHP_SELF'],$_GET["ID"],$prof); |
||
112 | } |
||
113 | break;
|
||
114 | } |
||
115 | } |
||
116 | |||
117 | commonFooter(); |
||
118 | |||
119 | |||
120 | ?> |