} } } /////////////////////////////////////////////////////////////////////////// //// INBOUND EMAIL SAVES if (isset($_REQUEST['server_url']) && !empty($_REQUEST['server_url'])) { $ie = new InboundEmail(); if (false === $ie->savePersonalEmailAccount($return_id, $focus->user_name)) { header("Location: index.php?action=Error&module=Users&error_string=&ie_error=true&id=" . $return_id); die; // die here, else the header redirect below takes over. } } elseif (isset($_REQUEST['ie_id']) && !empty($_REQUEST['ie_id']) && empty($_REQUEST['server_url'])) { // user is deleting their I-E $ie = new InboundEmail(); $ie->deletePersonalEmailAccount($_REQUEST['ie_id'], $focus->user_name); } //// END INBOUND EMAIL SAVES /////////////////////////////////////////////////////////////////////////// if ($newUser && !$focus->is_group && !$focus->portal_only && isset($sugar_config['passwordsetting']['SystemGeneratedPasswordON']) && $sugar_config['passwordsetting']['SystemGeneratedPasswordON']) { $new_pwd = '2'; require_once 'modules/Users/GeneratePassword.php'; } } //handle navigation from user wizard if (isset($_REQUEST['whatnext'])) { if ($_REQUEST['whatnext'] == 'import') { header("Location:index.php?module=Import&action=step1&import_module=Administration"); return; } elseif ($_REQUEST['whatnext'] == 'users') { header("Location:index.php?module=Users&action=index");
public function deletePersonalEmailAccount($id) { $inboundEmail = new InboundEmail(); //test with invalid username $result = $inboundEmail->deletePersonalEmailAccount($id, 'test'); $this->assertEquals(false, $result); //test with valid username $result = $inboundEmail->deletePersonalEmailAccount($id, 'admin'); $this->assertEquals(true, $result); }