Exemple #1
0
 * @copyright 2009
 */
require 'includes/include.inc.php';
if (!$_SESSION['login']) {
    $smarty->display('index.tpl');
    die;
}
if (!array_key_exists('action', $_REQUEST)) {
    $_REQUEST['action'] = '';
}
if ($_REQUEST['action'] == 'delete') {
    $errors = array();
    $Admin = new vMailAdmin();
    $MySQL = new iacMySQL();
    foreach ($_REQUEST['users'] as $id) {
        if (!$Admin->deleteUser($id)) {
            $MySQL->Execute("SELECT email FROM users WHERE id = '{$id}'");
            $email = $MySQL->FetchOne();
            $errors[] = "The EMail Address {$email['email']} could not be Deleted. Please Ensure that everything is in order.";
        }
    }
    if (count($errors) != 0) {
        $amount_mails = count($_REQUEST['users']);
        $amount_errors = count($errors);
        $successful_amount = $amount_mails - $amount_errors;
        $smarty->assign('amount_errors', $amount_errors);
        $smarty->assign('successful', $successful_amount);
        $smarty->assign('errors', $errors);
        $smarty->assign('status', 'delete_mail_success');
        $Stats = new HomePageStats($MySQL);
        $smarty->assign('HomePageStats', $Stats->GiveAllStats());