Alternc  latest
Alternc logiel libre pour l'hébergement
piwik_user_dodel.php
Go to the documentation of this file.
1 <?php
2 /*
3  ----------------------------------------------------------------------
4  LICENSE
5 
6  This program is free software; you can redistribute it and/or
7  modify it under the terms of the GNU General Public License (GPL)
8  as published by the Free Software Foundation; either version 2
9  of the License, or (at your option) any later version.
10 
11  This program is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  To read the license please visit http://www.gnu.org/copyleft/gpl.html
17  ----------------------------------------------------------------------
18 */
19 
20 /**
21  * delete piwik users
22  * @copyright AlternC-Team 2000-2017 https://alternc.com/
23  */
24 require_once("../class/config.php");
25 
26 $fields = array (
27  "confirm_del" => array ("post", "string", ""),
28  "login" => array ("post", "string", ""),
29 );
31 
32 if (empty($login)) {
33  $msg->raise("ERROR", "piwik", _("Missing login parameters"));
34  include('piwik_userlist.php');
35  exit;
36 }
37 
38 if(!empty($confirm_del)) {
39  // does this piwik acount still have websites ? can we delete it then ?
40  if ($piwik->user_has_sites()) {
41  $msg->raise("ALERT", "piwik", _("To be able to delete the last user account, you must first remove all the piwik sites"));
42  } else if ($piwik->user_delete($login) ) {
43  $msg->raise("INFO", "piwik", _("Account %s has been successfully deleted"), $login);
44  }
45 
46  include('piwik_userlist.php');
47  exit;
48 }
49 
50 include_once('head.php');
51 
52 ?>
53 <h3><?php __("Piwik accounts deletion confirm"); ?></h3>
54 <hr id="topbar"/>
55 <br />
56  <?php printf(_("Do you really want to delete the Piwik account %s ?"),$login);?>
57 <br />
58 <br />
59 
60  <form method="post" action="piwik_user_dodel.php" name="main" id="main">
61  <?php csrf_get(); ?>
62  <input type="hidden" name="login" value="<?php ehe($login);?>" />
63  <input type="submit" class="inb" name="confirm_del" value="<?php __("Delete")?>" />
64  <input type="button" class="inb" name="cancel" value="<?php __("Cancel"); ?>" onclick="document.location='piwik_userlist.php'" />
65  </form>
66 
67 <?php
68  include_once('foot.php');
69  exit();
70 ?>
exit
Definition: adm_doadd.php:70
$msg
Definition: bootstrap.php:75
__($str)
Definition: functions.php:404
getFields($fields, $requestOnly=false)
Get the Fields of the posted form from $_REQUEST or POST or GET and check their type.
Definition: functions.php:688
csrf_get($return=false)
Give a new CSRF uniq token for a form the session must be up since the CSRF is linked to the session ...
Definition: functions.php:1159
$fields
delete piwik users
$login