= $CONF['min_password_length']) { $fPassword = pacrypt($fPassword); } else { $error = 1; flash_error(sprintf($PALANG['pPasswordTooShort'], $CONF['min_password_length'])); } } else { $error = 1; $pAdminEdit_admin_password_text = $PALANG['pAdminEdit_admin_password_text_error']; } } } $fDomains = array(); if (array_key_exists('fDomains', $_POST)) $fDomains = escape_string ($_POST['fDomains']); if ($error != 1) { if ($fActive == "on") { $sqlActive = db_get_boolean(True); } else { $sqlActive = db_get_boolean(False); } $result = db_query ("UPDATE $table_admin SET modified=NOW(),active='$sqlActive',password='$fPassword' WHERE username='$username'"); if ($fSadmin == "on") $fSadmin = 'ALL'; // delete everything, and put it back later on.. db_query("DELETE FROM $table_domain_admins WHERE username = '$username'"); if($fSadmin == 'ALL') { $fDomains = array('ALL'); } foreach($fDomains as $domain) { $result = db_query ("INSERT INTO $table_domain_admins (username,domain,created) VALUES ('$username','$domain',NOW())"); } flash_info($PALANG['pAdminEdit_admin_result_success']); header("Location: list-admin.php"); exit(0); } else { flash_error($PALANG['pAdminEdit_admin_result_error']); } } if (isset($_GET['username'])) $username = escape_string ($_GET['username']); $tAllDomains = list_domains(); $tDomains = list_domains_for_admin ($username); $tActive = ''; $tPassword = $admin_details['password']; if($admin_details['active'] == 't' || $admin_details['active'] == 1) { $tActive = $admin_details['active']; } $tSadmin = '0'; $result = db_query ("SELECT * FROM $table_domain_admins WHERE username='$username'"); // could/should be multiple matches to query; if ($result['rows'] >= 1) { $result = $result['result']; while($row = db_array($result)) { if ($row['domain'] == 'ALL') { $tSadmin = '1'; $tDomains = array(); /* empty the list, they're an admin */ } } } include ("../templates/header.tpl"); include ("../templates/admin_menu.tpl"); include ("../templates/admin_edit-admin.tpl"); include ("../templates/footer.tpl");