2 /****************************************************************************/
\r
4 /****************************************************************************/
\r
5 /* Copyright (c) 2002-2010 */
\r
6 /* Inclusive Design Institute */
\r
7 /* http://atutor.ca */
\r
9 /* This program is free software. You can redistribute it and/or */
\r
10 /* modify it under the terms of the GNU General Public License */
\r
11 /* as published by the Free Software Foundation. */
\r
12 /****************************************************************************/
\r
15 define('AT_INCLUDE_PATH', '../../../../include/');
\r
16 require(AT_INCLUDE_PATH.'vitals.inc.php');
\r
17 admin_authenticate(AT_ADMIN_PRIV_ADMIN);
\r
19 $_GET['login'] = $addslashes($_GET['login']);
\r
21 if (isset($_POST['submit_no'])) {
\r
22 $msg->addFeedback('CANCELLED');
\r
23 header('Location: index.php');
\r
25 } else if (isset($_POST['submit_yes'])) {
\r
26 $_POST['login'] = $addslashes($_POST['login']);
\r
28 $sql = "DELETE FROM ".TABLE_PREFIX."admins WHERE login='$_POST[login]'";
\r
29 $result = mysql_query($sql, $db);
\r
31 write_to_log(AT_ADMIN_LOG_DELETE, 'admins', mysql_affected_rows($db), $sql);
\r
33 $msg->addFeedback('ADMIN_DELETED');
\r
34 header('Location: index.php');
\r
38 <?php require(AT_INCLUDE_PATH.'header.inc.php'); ?>
\r
41 if (!strcasecmp($_GET['login'], $_SESSION['login'])) {
\r
42 $msg->addError('CANNOT_DELETE_OWN_ACCOUNT');
\r
43 $msg->printErrors();
\r
44 require(AT_INCLUDE_PATH.'footer.inc.php');
\r
48 $sql = "SELECT * FROM ".TABLE_PREFIX."admins WHERE login='$_GET[login]'";
\r
49 $result = mysql_query($sql, $db);
\r
50 if (!($row = mysql_fetch_assoc($result))) {
\r
51 echo _AT('no_user_found');
\r
53 $hidden_vars['login'] = $_GET['login'];
\r
54 $confirm = array('DELETE_ADMIN', $row['login']);
\r
55 $msg->addConfirm($confirm, $hidden_vars);
\r
56 $msg->printConfirm();
\r
59 <?php require(AT_INCLUDE_PATH.'footer.inc.php'); ?>