-
Notifications
You must be signed in to change notification settings - Fork 2
/
admin_purge_accounts.php
149 lines (126 loc) · 5 KB
/
admin_purge_accounts.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
<?php
/**
* admin_purge_accounts.php
* interface de purge des comptes et réservations
* Dernière modification : $Date: 2009-12-16 14:52:31 $
* @author Christian Daviau (GIP RECIA - Esco-Portail)
* @author Laurent Delineau <laurent.delineau@ac-poitiers.fr>
* @copyright Copyright 2003-2008 Laurent Delineau
* @link http://www.gnu.org/licenses/licenses.html
* @package admin
* @version $Id: admin_purge_accounts.php,v 1.2 2009-12-16 14:52:31 grr Exp $
* @filesource
*
* This file is part of GRR.
*
* GRR is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* GRR is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with GRR; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
include "include/admin.inc.php";
$grr_script_name = "admin_user.php";
$back = '';
if (isset($_SERVER['HTTP_REFERER'])) $back = my_htmlspecialcharacters($_SERVER['HTTP_REFERER']);
$display = isset($_GET["display"]) ? $_GET["display"] : NULL;
$order_by = isset($_GET["order_by"]) ? $_GET["order_by"] : NULL;
$msg = '';
if ((getSettingValue("ldap_statut")=="") and (getSettingValue("sso_statut")=="") and (getSettingValue("imap_statut")=="")) {
$day = date("d");
$month = date("m");
$year = date("Y");
showAccessDenied($day, $month, $year, $area,$back);
exit();
}
if ((authGetUserLevel(getUserName(),-1) < 6) and (authGetUserLevel(getUserName(),-1,'user') != 1))
{
$day = date("d");
$month = date("m");
$year = date("Y");
showAccessDenied($day, $month, $year, $area,$back);
exit();
}
# print the page header
print_header("","","","",$type="with_session", $page="admin");
// Affichage de la colonne de gauche
include "admin_col_gauche.php";
$themessage = str_replace ( "'" , "\\'" , get_vocab("admin_purge_accounts_confirm"));
$themessage2 = str_replace ( "'" , "\\'" , get_vocab("admin_purge_accounts_confirm2"));
$themessage3 = str_replace ( "'" , "\\'" , get_vocab("admin_purge_tables_confirm"));
$themessage4 = str_replace ( "'" , "\\'" , get_vocab("admin_purge_accounts_confirm4"));
echo "<h2>".get_vocab('admin_purge_accounts.php').grr_help("aide_grr_purge_accounts")."</h2>";
echo get_vocab('admin_clean_accounts_desc');
echo "<div style=\"text-align:center;\">\n
<form id=\"purge_liaison\" action=\"admin_purge_accounts.php\" method=\"post\">\n
<div>
<input type=\"hidden\" name=\"do_purge_table_liaison\" value=\"1\" />\n
<input
type=\"button\"
value=\"".get_vocab('admin_purge_tables_liaison')."\"
onclick=\"return confirmButton('purge_liaison', '$themessage3')\" />\n
</div></form></div>";
echo "<hr />";
echo get_vocab('admin_purge_accounts_desc');
echo "<div style=\"text-align:center;\">\n
<form id=\"purge_sauf_privileges\" action=\"admin_purge_accounts.php\" method=\"post\">\n
<div>
<input type=\"hidden\" name=\"do_purge_sauf_privileges\" value=\"1\" />\n
<input
type=\"button\"
value=\"".get_vocab('admin_purge_accounts_sauf_privileges')."\"
onclick=\"return confirmButton('purge_sauf_privileges', '$themessage4')\" />\n
</div></form></div>";
echo "<div style=\"text-align:center;\">\n
<form id=\"purge\" action=\"admin_purge_accounts.php\" method=\"post\">\n
<div>
<input type=\"hidden\" name=\"do_purge\" value=\"1\" />\n
<input
type=\"button\"
value=\"".get_vocab('admin_purge_accounts')."\"
onclick=\"return confirmButton('purge', '$themessage')\" />\n
</div></form></div>";
echo "<div style=\"text-align:center;\">\n
<form id=\"purge_avec_resa\" action=\"admin_purge_accounts.php\" method=\"post\">\n
<div>
<input type=\"hidden\" name=\"do_purge_avec_resa\" value=\"1\" />\n
<input
type=\"button\"
value=\"".get_vocab('admin_purge_accounts_with_bookings')."\"
onclick=\"return confirmButton('purge_avec_resa', '$themessage2')\" />\n
</div></form></div>";
if (isset($_POST['do_purge_table_liaison'])) {
if ($_POST['do_purge_table_liaison'] == 1) {
NettoyerTablesJointure();
}
}
if (isset($_POST['do_purge_sauf_privileges'])) {
if ($_POST['do_purge_sauf_privileges'] == 1) {
supprimerReservationsUtilisateursEXT("n","n");
}
}
if (isset($_POST['do_purge'])) {
if ($_POST['do_purge'] == 1) {
supprimerReservationsUtilisateursEXT("n","y");
}
}
if (isset($_POST['do_purge_avec_resa'])) {
if ($_POST['do_purge_avec_resa'] == 1) {
supprimerReservationsUtilisateursEXT("y","y");
}
}
// fin de l'affichage de la colonne de droite
echo "</td></tr></table>\n";
// Affichage d'un pop-up
affiche_pop_up($msg,"admin");
?>
</body>
</html>