} if ($auth_method == "pop3" && !empty($routing_domain) || $auth_method == "ldap" || $auth_method == "exchange" || $auth_method == "sql" || $auth_method == "internal" || $auth_method == "external") { $user_name = $login; $address = ""; } else { $address = $login; $user_name = ""; } list($authenticated, $email) = auth($user_name, $password, $address, $domain); if ($authenticated === true) { $address_id = get_email_address_id($email); $old_owner = get_email_address_owner($address_id); if (!$old_owner) { add_email_address_to_user($euid, $email); } else { transfer_email_address_to_user($old_owner, $euid, $email); } $message = sprintf($lang['text_address_added'], $email); } else { $message = sprintf($lang['text_login_failed'], $login); if (PEAR::isError($authenticated)) { $message .= "<br>" . $authenticated->getMessage(); } } $_SESSION['message'] = $message; header("Location: settings.php{$msid}tab=0"); exit; /* * Pressed the "Update Login Credentials" button * *
$button = "link"; if (isset($_POST["email"]) && isset($_POST["user"])) { $smarty->assign('email', 1); $smarty->assign('user', 1); // Note that $email is an array $email = $_POST["email"]; $new_owner_id = trim($_POST["user"]); $lang['text_address_linked_array'] = array(); if (is_a_domain_default_user($new_owner_id)) { //cannot link to domain deault accounts $lang['text_address_linked_array'][] = $lang['text_address_not_linked']; } else { foreach ($email as $address_id) { $old_owner_id = get_email_address_owner($address_id); $email_address = get_email_address_by_id($address_id); transfer_email_address_to_user($old_owner_id, $new_owner_id, $email_address); $lang['text_address_linked_array'][] = sprintf($lang['text_address_linked'], $email_address, get_user_name($new_owner_id)); } } } } elseif (isset($_POST["button_find"])) { $button = "find"; if (isset($_POST["lookup"])) { $smarty->assign('lookup', 1); $lookup = trim($_POST["lookup"]); $lookup = str_replace("*", ".*", $lookup); $lookup = "/^" . $lookup . "\$/"; $domain_name = array(); $user = array(); if (!$super) { // Make a list of the domains this administrator can access.