$email_info = $MySQL->FetchOne(); $MySQL->Execute("SELECT * FROM departments ORDER BY deptid ASC"); $departments = $MySQL->FetchAll(); $MySQL->Execute("SELECT * FROM domains ORDER BY id ASC"); $Domains = $MySQL->FetchAll(); $departments = make_select_array($departments, 'deptid', 'department'); $Domains = make_select_array($Domains, 'id', 'domain'); $emailparts = split("@", $email_info['email']); $MySQL->Execute("SELECT id FROM domains WHERE domain = '{$emailparts[1]}'"); $Domain = $MySQL->FetchOne(); $smarty->assign('userid', $email_info['id']); $smarty->assign('departments', $departments); $smarty->assign('Domains', $Domains); $smarty->assign('Domain', $Domain['id']); $smarty->assign('email', $emailparts[0]); $smarty->assign('user_name', $email_info['user_name']); $smarty->assign('user_surname', $email_info['user_surname']); $smarty->assign('department', $email_info['deptid']); $smarty->assign('quota', $Converter->BytestoMB($email_info['quota'])); $smarty->assign('admin_password', $email_info['ui_password']); $smarty->assign('form', 'editmail'); $smarty->display('home.tpl'); } else { $MySQL = new iacMySQL(); $MySQL->Execute("SELECT id, CONCAT(user_name,' ', user_surname, ' ', '(', email,')') AS info FROM users ORDER BY id ASC"); $info = $MySQL->FetchAll(); $info = make_select_array($info, 'id', 'info'); $smarty->assign('users', $info); $smarty->assign('form', 'editmail_1'); $smarty->display('home.tpl'); }
$users = $MySQL->FetchAll(); $users = make_select_array($users, 'id', 'user'); $MySQL->Execute("SELECT id, source FROM forwardings"); $allaliases = $MySQL->FetchAll(); $allaliases = make_select_array($allaliases, 'id', 'source'); $smarty->assign('allaliases', $allaliases); $smarty->assign('users', $users); $smarty->assign('step', 'select_user'); $smarty->assign('form', 'deletealias'); $smarty->display('home.tpl'); } else { $smarty->assign('status', 'delete_alias_success'); $MySQL = new iacMySQL(); $Stats = new HomePageStats($MySQL); $smarty->assign('HomePageStats', $Stats->GiveAllStats()); $smarty->display('home.tpl'); } } else { $MySQL = new iacMySQL(); $MySQL->Execute("SELECT forwardings.id, CONCAT(forwardings.source, ' (', users.user_name, ' ', users.user_surname,')') AS user FROM users, forwardings WHERE users.email = forwardings.destination"); $users = $MySQL->FetchAll(); $users = make_select_array($users, 'id', 'user'); $MySQL->Execute("SELECT id, source FROM forwardings"); $allaliases = $MySQL->FetchAll(); $allaliases = make_select_array($allaliases, 'id', 'source'); $smarty->assign('allaliases', $allaliases); $smarty->assign('users', $users); $smarty->assign('step', 'select_user'); $smarty->assign('form', 'deletealias'); $smarty->display('home.tpl'); }
} 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()); $smarty->display('home.tpl'); } else { $amount_mails = count($_REQUEST['users']); $smarty->assign('successful', $amount_mails); $smarty->assign('status', 'delete_mail_success'); $MySQL = new iacMySQL(); $Stats = new HomePageStats($MySQL); $smarty->assign('HomePageStats', $Stats->GiveAllStats()); $smarty->display('home.tpl'); } } else { $MySQL = new iacMySQL(); $MySQL->Execute("SELECT id, CONCAT(email, ' (',user_name, ' ', user_surname,')') AS user FROM users ORDER BY id ASC"); $users = $MySQL->FetchAll(); $users = make_select_array($users, 'id', 'user'); $smarty->assign('step', 'select_users'); $smarty->assign('users', $users); $smarty->assign('form', 'deleteuser'); $smarty->display('home.tpl'); }
$smarty->assign('errors', $errors); $smarty->assign('domaininfo', $domaininfo); $smarty->assign('step', 'edit_domain'); $smarty->assign('form', 'editdomain'); $smarty->display('home.tpl'); } else { $smarty->assign('status', 'edit_domain_success'); $MySQL = new iacMySQL(); $Stats = new HomePageStats($MySQL); $smarty->assign('HomePageStats', $Stats->GiveAllStats()); $smarty->display('home.tpl'); } } } elseif ($_REQUEST['action'] == 'retr_domain_info') { $MySQL = new iacMySQL(); $MySQL->Execute("SELECT * FROM domains WHERE id = '{$_REQUEST['domain']}'"); $domaininfo = $MySQL->FetchOne(); $smarty->assign('domaininfo', $domaininfo); $smarty->assign('step', 'edit_domain'); $smarty->assign('form', 'editdomain'); $smarty->display('home.tpl'); } else { $MySQL = new iacMySQL(); $MySQL->Execute("SELECT id, domain FROM domains"); $domains = $MySQL->FetchAll(); $domains = make_select_array($domains, 'id', 'domain'); $smarty->assign('domains', $domains); $smarty->assign('step', 'select_domain'); $smarty->assign('form', 'editdomain'); $smarty->display('home.tpl'); }
$smarty->assign('errors', $errors); $smarty->assign('department', $_REQUEST['department']); $smarty->assign('step', 'edit_department'); $smarty->assign('form', 'editdepartment'); $smarty->display('home.tpl'); } else { $smarty->assign('status', 'edit_department_success'); $MySQL = new iacMySQL(); $Stats = new HomePageStats($MySQL); $smarty->assign('HomePageStats', $Stats->GiveAllStats()); $smarty->display('home.tpl'); } } } elseif ($_REQUEST['action'] == 'retr_department_info') { $MySQL = new iacMySQL(); $MySQL->Execute("SELECT deptid, department FROM departments WHERE deptid = '{$_REQUEST['department']}'"); $departmentinfo = $MySQL->FetchOne(); $smarty->assign('departmentinfo', $departmentinfo); $smarty->assign('step', 'edit_department'); $smarty->assign('form', 'editdepartment'); $smarty->display('home.tpl'); } else { $MySQL = new iacMySQL(); $MySQL->Execute("SELECT * FROM departments ORDER BY deptid ASC"); $departments = $MySQL->FetchAll(); $departments = make_select_array($departments, 'deptid', 'department'); $smarty->assign('departments', $departments); $smarty->assign('step', 'select_department'); $smarty->assign('form', 'editdepartment'); $smarty->display('home.tpl'); }
function fixAliases($new_email, $old_email) { if ($new_email != $old_email) { $MySQL = new iacMySQL(); $MySQL->Execute("SELECT id, source FROM forwardings WHERE destination = '{$old_email}'"); $aliases = $MySQL->FetchAll(); $aliases = make_select_array($aliases, 'id', 'source'); $upd_query = "UPDATE forwardings SET\r\n\t\t\t\t\t\t\t\t\t\t\t\tdestination = '{$new_email}'\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\tWHERE\r\n\r\n\t\t\t\t\t\t\t\t\t\t\t\tdestination = '{$old_email}'\r\n\t\t\t\t\t\t\t\t\t\t\t\t"; $MySQL->Execute($upd_query); return $aliases; } }
$smarty->assign('domain', $_REQUEST['domain']); $smarty->assign('email', $_REQUEST['email']); $MySQL->Execute("SELECT * FROM domains"); $domains = $MySQL->FetchAll(); $domains = make_select_array($domains, 'id', 'domain'); $smarty->assign('domains', $domains); $MySQL->Execute("SELECT email, id FROM users"); $emails = $MySQL->FetchAll(); $emails = make_select_array($emails, 'id', 'email'); $smarty->assign('emails', $emails); $smarty->assign('form', 'newalias'); $smarty->assign('errors', $errors); $smarty->display('home.tpl'); } } } } } } else { $MySQL = new iacMySQL(); $MySQL->Execute("SELECT * FROM domains"); $domains = $MySQL->FetchAll(); $domains = make_select_array($domains, 'id', 'domain'); $smarty->assign('domains', $domains); $MySQL->Execute("SELECT email, id FROM users"); $emails = $MySQL->FetchAll(); $emails = make_select_array($emails, 'id', 'email'); $smarty->assign('emails', $emails); $smarty->assign('form', 'newalias'); $smarty->display('home.tpl'); }