Alternc  3.2
Alternc logiel libre pour l'hébergement
 All Data Structures Namespaces Files Functions Variables Pages
adm_dodel.php
Go to the documentation of this file.
1 <?php
2 /*
3  $Id: adm_dodel.php,v 1.2 2004/05/19 14:23:06 benjamin Exp $
4  ----------------------------------------------------------------------
5  AlternC - Web Hosting System
6  Copyright (C) 2002 by the AlternC Development Team.
7  http://alternc.org/
8  ----------------------------------------------------------------------
9  Based on:
10  Valentin Lacambre's web hosting softwares: http://altern.org/
11  ----------------------------------------------------------------------
12  LICENSE
13 
14  This program is free software; you can redistribute it and/or
15  modify it under the terms of the GNU General Public License (GPL)
16  as published by the Free Software Foundation; either version 2
17  of the License, or (at your option) any later version.
18 
19  This program is distributed in the hope that it will be useful,
20  but WITHOUT ANY WARRANTY; without even the implied warranty of
21  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22  GNU General Public License for more details.
23 
24  To read the license please visit http://www.gnu.org/copyleft/gpl.html
25  ----------------------------------------------------------------------
26  Original Author of file: Benjamin Sonntag
27  Purpose of file: Delete a member
28  ----------------------------------------------------------------------
29 */
30 require_once("../class/config.php");
31 
32 if (!$admin->enabled) {
33  __("This page is restricted to authorized staff");
34  exit();
35 }
36 
37 $fields = array (
38  "d" => array ("request", "array", array()),
39  "del_confirm" => array("request", "string", ""),
40 );
42 
43 
44 if($del_confirm == "y"){
45  if (!is_array($d)) {
46  $d[]=$d;
47  }
48 
49  reset($d);
50  while (list($key,$val)=each($d)) {
51  if (!$admin->checkcreator($val)) {
52  __("This page is restricted to authorized staff");
53  exit();
54  }
55  if (!($u=$admin->get($val)) || !$admin->del_mem($val)) {
56  $error=sprintf(_("Member '%s' does not exist"),$val)."<br />";
57  } else {
58  $error=sprintf(_("Member %s successfully deleted"),$u["login"])."<br />";
59  }
60  }
61  include("adm_list.php");
62  exit();
63 } else {
64  if (!is_array($d) || count($d)==0) {
65  $error=_("Please check the accounts you want to delete");
66  require("adm_list.php");
67  exit();
68  }
69  include("head.php");
70  ?>
71  </head>
72  <body>
73  <h3><?php printf(_("Deleting users")); ?> : </h3>
74  <form action="adm_dodel.php" method="post">
75  <input type="hidden" name="action" value="delete" />
76  <input type="hidden" name="del_confirm" value="y" />
77  <p class="alert alert-warning"><?php __("WARNING : Confirm the deletion of the users"); ?></p>
78  <p>
79  <?php
80  foreach($d as $userid){
81  $membre=$admin->get($userid);
82  echo "<input type=\"hidden\" name=\"d[]\" value=\"$userid\" />".$membre['login']."<br/>";
83  }
84  ?>
85  </p>
86  <blockquote>
87  <input type="submit" class="inb ok" name="confirm" value="<?php __("Yes, delete those accounts"); ?>" />&nbsp;&nbsp;
88  <input type="button" class="inb cancel" name="cancel" value="<?php __("No, don't delete those accounts"); ?>" onclick="document.location='adm_list.php';" />
89  </blockquote>
90  </form>
91  <?php
92  include('foot.php');
93 }
94 
95 ?>