';
echo 'An error happened.. could not load the "member" object';
echo '
';
}
echo '';
echo '
Mail Admin Tool
';
echo '';
echo '
';
if ($member->is_loggedin()) {
if (!empty($_GET['page'])) {
if ($_GET['page'] == "domains") {
require_once('includes/class_domains.php');
if ($domains = new domains) {
echo '
Domains
';
echo '
If you delete a domain all Email accounts and aliases on it will be deleted too (exept if you converted the databse to MyISAM, then you have to delete Email accounts and Aliases manually, if you dont know what MyISAM is then you propaply didnt.)
';
echo '
You can see a list of domains, create a new one or delete the old ones below
';
echo 'An error happened.. could not get domains from database';
echo '
';
}
}
else {
echo '
';
echo 'An error happened.. could not load the "Domains" object';
echo '
';
}
}
elseif ($_GET['page'] == "emails") {
require_once('includes/class_domains.php');
require_once('includes/class_emails.php');
if ($emails = new emails) {
echo '
Email accounts
';
echo '
Here you can delete or add email accounts. You can even reset the password if your users forget them.
';
echo '
Please thoose a domain in the dropdown list you want to modify/view To reset a password, click the key icon on the left site of the email you want to change it for and input a new password in the field on the right
';
echo '
You can click on a email address to see what aliases has the emails as "Destination"
';
echo 'The email has been created, and should be in the list below.';
echo '
';
}
else {
echo '
';
echo 'Could not create email, make sure you typed it correctly.. you have to include the "@" and ".", example: "user@example.com" (without " ")';
echo '
';
}
}
if (!empty($_GET['reset_password']) && !empty($_POST['new_password'])) {
$email_id = $emails->db->clean($_GET['reset_password']);
$new_password = $emails->db->clean($_POST['new_password']);
if (is_numeric($email_id)) {
if ($emails->reset_password($email_id, $new_password)) {
echo '
';
echo 'The password has been reset!';
echo '
';
}
else {
echo '
';
echo 'Something went wrong. the password has not been reset!';
echo '
';
}
}
}
if (!empty($_GET['delete'])) {
if (is_numeric($_GET['delete'])) {
$delete = $emails->db->clean($_GET['delete']);
if ($emails->delete_email($delete)) {
echo '
';
echo 'The email and all its aliases has been deleted.';
echo '
';
}
else {
echo '
';
echo 'Could not delete the email, something went wrong!';
echo '
';
}
}
}
$domainid = 0;
if ((!empty($_GET['domainid'])) || (!empty($_POST['domainid']))) {
if (!empty($_POST['domainid'])) { $_GET['domainid'] = $_POST['domainid']; }
$domainid = $emails->db->clean($_GET['domainid']);
if (!is_numeric($domainid)) {
$domainid = 0;
}
}
if ($domains = new domains) {
if ($domains->get_all_domains()) {
if ($domains->num_domains() > 0) {
echo '';
if (!empty($domainid)) {
echo '
';
echo '
Create new
';
echo '';
echo '
';
echo '
In database
';
if ($emails->num_emails_for_domain($domainid) > 0) {
if ($emails->get_emails_for_domain($domainid)){
if (!$emails->echo_email_list($domainid)) {
echo '
';
echo 'An error happened.. Could not show the emails!';
echo '
';
}
}
else {
echo '
';
echo 'An error happened.. could not get emails from database';
echo '
';
}
}
else {
echo 'No emails found for that domain';
}
}
}
else {
echo 'You have not created any domains yet. Please create one from the Domains page';
}
}
else {
echo '
';
echo 'Could not get domains from database';
echo '
';
}
}
else {
echo '
';
echo 'An error happened.. could not load the "domains" object';
echo '
';
}
}
else {
echo '
';
echo 'An error happened.. could not load the "emails" object';
echo '
';
}
}
elseif ($_GET['page'] == "aliases") {
require_once('includes/class_domains.php');
require_once('includes/class_aliases.php');
if ($aliases = new aliases) {
echo '
Aliases
';
echo '
On this page you can view the aliases for a domain, create new ones and delete old ones.
';
echo '
To make a "catch all" alias that redirects everything send to an entire domain to one users, type it like this: Source: @domain-to-catch.com Destination: user@to-get-it-all.com
';
echo '
Deleting an alias will not delete any users or domains. Please choose the domain you want to show the aliases for below
';
echo 'The alias has been created, and should be in the list below.';
echo '
';
}
else {
echo '
';
echo 'Could not create alias, make sure you typed it correctly.. you have to include the "@" and ".", example: "user@example.com" or "@domain.com" for a catch-all alias (without " ")';
echo '
';
}
}
if (!empty($_GET['delete'])) {
if (is_numeric($_GET['delete'])) {
$delete = $aliases->db->clean($_GET['delete']);
if ($aliases->delete_alias($delete)) {
echo '
';
echo 'The alias and all its aliases has been deleted.';
echo '
';
}
else {
echo '
';
echo 'Could not delete the alias, something went wrong!';
echo '
';
}
}
}
$domainid = 0;
if ((!empty($_GET['domainid'])) || (!empty($_POST['domainid']))) {
if (!empty($_POST['domainid'])) { $_GET['domainid'] = $_POST['domainid']; }
$domainid = $aliases->db->clean($_GET['domainid']);
if (!is_numeric($domainid)) {
$domainid = 0;
}
}
$emailid = 0;
if (!empty($_GET['emailid'])) {
$emailid = $aliases->db->clean($_GET['emailid']);
if (!is_numeric($emailid)) {
$emailid = 0;
}
}
if ($domains = new domains) {
if ($domains->get_all_domains()) {
if ($domains->num_domains() > 0) {
echo '';
if (!empty($emailid)) {
if ($domainid = $aliases->get_domainid_for_emailid($emailid)) {
echo '
';
echo '
Create new
';
echo '';
echo '
';
echo '
In database
';
if ($email_address = $aliases->get_emailaddress_for_emailid($emailid)) {
if ($aliases->num_aliases_for_destinationemail($email_address) > 0) {
if ($aliases->get_aliases_for_emaildestination($email_address)) {
if (!$aliases->echo_alias_list_for_emaildestination($email_address, $emailid)) {
echo '
';
echo 'An error happened.. Could not show the aliases!';
echo '
';
}
}
else {
echo '
';
echo 'An error happened.. could not get aliases from database';
echo '
';
}
}
else {
echo 'No aliases for that email address.';
}
}
else {
echo '
';
echo 'An error happened.. could not get the email address based on the email ID';
echo '
';
}
}
else {
echo '
';
echo 'An error happened.. could not get the domain ID for the emails';
echo '
';
}
}
elseif (!empty($domainid)) {
echo '
';
echo '
Create new
';
echo '';
echo '
';
echo '
In database
';
if ($aliases->num_aliases_for_domain($domainid) > 0) {
if ($aliases->get_aliases_for_domain($domainid)){
if (!$aliases->echo_alias_list($domainid)) {
echo '
';
echo 'An error happened.. Could not show the aliases!';
echo '
';
}
}
else {
echo '
';
echo 'An error happened.. could not get aliases from database';
echo '
';
}
}
else {
echo 'No aliases found for that domain';
}
}
}
else {
echo 'You have not created any domains yet. Please create one from the Domains page';
}
}
else {
echo '
';
echo 'Could not get domains from database';
echo '
';
}
}
else {
echo '
';
echo 'An error happened.. could not load the "domains" object';
echo '
';
}
}
else {
echo '
';
echo 'An error happened.. could not load the "aliases" object';
echo '
';
if (!$member->echo_login_form()) {
echo " Der er sket en fejl, login billedet kunne ikke vises.";
}
}
else {
?>
here';
}
}
else {
if (!$member->echo_login_form()) {
echo " Der er sket en fejl, login billedet kunne ikke vises.";
}
}
}
echo '