if ($_REQUEST['admin']) { $Info['admin_password'] = $_REQUEST['admin_password']; } $Admin->updateEMail($Info); $fixedaliases = $Admin->fixAliases($_REQUEST['new_email'], $_REQUEST['prevemail']); $smarty->assign('fixedaliases', $fixedaliases); $smarty->assign('email', $Info['email']); $smarty->assign('status', 'editsuccess'); $MySQL = new iacMySQL(); $Stats = new HomePageStats($MySQL); $smarty->assign('HomePageStats', $Stats->GiveAllStats()); $smarty->display('home.tpl'); } } elseif ($_REQUEST['action'] == 'retr_info') { $MySQL = new iacMySQL(); $Converter = new MirConvert(); $MySQL->Execute("SELECT * FROM users WHERE id = '{$_REQUEST['user']}'"); $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']);
$departments = make_select_array($depts, 'deptid', 'department'); $Domains = make_select_array($Domains, 'id', 'domain'); $smarty->assign('departments', $departments); $smarty->assign('Domains', $Domains); $smarty->assign('departments', $departments); $smarty->assign('errors', $errors); $smarty->assign('form', 'newmail'); $smarty->display('home.tpl'); } else { $Info = array(); $Admin = new vMailAdmin(); $Info['email'] = $_REQUEST['new_email']; $Info['user_department'] = $_REQUEST['department']; $Info['password'] = $_REQUEST['password']; if ($_REQUEST['user_quota']) { $Converter = new MirConvert(); $Info['quota'] = $Converter->MBtoBytes($_REQUEST['user_quota']); } else { $Info['quota'] = 10240; } $Info['user_name'] = $_REQUEST['user_name']; $Info['user_surname'] = $_REQUEST['user_surname']; if ($_REQUEST['admin']) { $Info['admin_password'] = $_REQUEST['admin_password']; } $eMailWelcomeMSG['Welcome_MessageHTML'] = $Welcome_MessageHTML; $eMailWelcomeMSG['Welcome_MessageTEXT'] = $Welcome_MessageTEXT; if ($Admin->addEMail($Info, $eMailWelcomeMSG)) { $smarty->assign('status', 'new_email_success'); $MySQL = new iacMySQL(); $Stats = new HomePageStats($MySQL);