Made it possible for admins and superadmins to set a vacation message,

edit vacation messages, and remove them.

main.php added to admin directory so admin and / can share more
templates.

the new edit-vacation.php in admin and / are identical except
for template references

languages/en.lang and languages/default.lang are in sync now

I attempted to add some of the new .lang variables I created to
the spanish file (I don't know it that well, hope its OK)

fixed a bug in users/vacation.php

Added a "Main" menu item to the admin menu that gets you back to where
you started when you log in.



git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@2 a1433add-5e2c-0410-b055-b7f2511e0802
postfixadmin-2.3
Greg 17 years ago
parent 85dc57beee
commit a5ce5620cf

@ -6,6 +6,9 @@
#
Version 2.1.1 -- TBD
--------------------
- Added: main.php to admin dirctory (GregC)
- Added: Item "Main" on admin menu (GregC)
- Changed: Edit-vacation now edits for admins/superadmins (GregC)
- Added: Do not store local copy when forward mail. (Mihau) [24]
- Added: Virtual Vacation for PostgreSQL. (Tarvin)
- Added: Virtual Vacation 3.2 (Thanx David)

@ -0,0 +1,193 @@
<?php
//
// Postfix Admin
// by Mischa Peters <mischa at high5 dot net>
// Copyright (c) 2002 - 2007 High5!
// Licensed under GPL for more info check GPL-LICENSE.TXT
//
// File: edit-vacation.php
//
// Template File: edit-vacation.tpl
//
// Template Variables:
//
// tMessage
// tSubject
// tBody
//
// Form POST \ GET Variables:
//
// fUsername
// fDomain
// fCanceltarget
// fChange
// fBack
// fQuota
// fActive
//
//
// This is a copy of the domain admin edit-vacation.php with
// template references changed
//
require ("../variables.inc.php");
require ("../config.inc.php");
require ("../functions.inc.php");
include ("../languages/" . check_language () . ".lang");
$SESSID_USERNAME = check_session ();
(($CONF['vacation'] == 'NO') ? header("Location: " . $CONF['postfix_admin_url'] . "/main.php") && exit : '1');
$tmp = preg_split ('/@/', $SESSID_USERNAME);
$USERID_DOMAIN = $tmp[1];
if ($_SERVER['REQUEST_METHOD'] == "GET")
{
if (isset ($_GET['username'])) $fUsername = escape_string ($_GET['username']);
if (isset ($_GET['domain'])) $fDomain = escape_string ($_GET['domain']);
if (check_admin($SESSID_USERNAME))
{
$fCanceltarget= $CONF['postfix_admin_url'] . "/admin/list-virtual.php?domain=$fDomain";
}
else
{
if (check_owner ($SESSID_USERNAME, $fDomain))
{
$fCanceltarget= $CONF['postfix_admin_url'] . "/overview.php?domain=$fDomain";
}
//unauthorized, exit
else { exit; }
}
$result = db_query("SELECT * FROM $table_vacation WHERE email='$fUsername'");
if ($result['rows'] == 1)
{
$row = db_array($result['result']);
$tMessage = '';
$tSubject = $row['subject'];
$tBody = $row['body'];
}
$tUseremail = $fUsername;
if ($tSubject == '') { $tSubject = $PALANG['pUsersVacation_subject_text']; }
if ($tBody == '') { $tBody = $PALANG['pUsersVacation_body_text']; }
include ("../templates/header.tpl");
include ("../templates/admin_menu.tpl");
include ("../templates/edit-vacation.tpl");
include ("../templates/footer.tpl");
}
if ($_SERVER['REQUEST_METHOD'] == "POST")
{
$vacation_domain = $CONF['vacation_domain'];
if (isset ($_POST['fSubject'])) $fSubject = escape_string ($_POST['fSubject']);
if (isset ($_POST['fBody'])) $fBody = escape_string ($_POST['fBody']);
if (isset ($_POST['fChange'])) $fChange = escape_string ($_POST['fChange']);
if (isset ($_POST['fBack'])) $fBack = escape_string ($_POST['fBack']);
if (isset ($_GET['domain'])) $fDomain = escape_string ($_GET['domain']);
if (isset ($_GET['username'])) $fUsername = escape_string ($_GET['username']);
if (check_admin($SESSID_USERNAME))
{
$fCanceltarget= $CONF['postfix_admin_url'] . "/admin/list-virtual.php?domain=$fDomain";
}
else
{
if (check_owner ($SESSID_USERNAME, $fDomain))
{
$fCanceltarget= $CONF['postfix_admin_url'] . "/overview.php?domain=$fDomain";
}
//unauthorized, exit
else { exit; }
}
$tUseremail = $fUsername;
if ($tSubject == '') { $tSubject = $PALANG['pUsersVacation_subject_text']; }
if ($tBody == '') { $tBody = $PALANG['pUsersVacation_body_text']; }
//if change, remove old one, then set new one
if (!empty ($fBack) || !empty ($fChange))
{
//if we find an existing vacation entry, delete it
$result = db_query("SELECT * FROM $table_vacation WHERE email='$fUsername'");
if ($result['rows'] == 1)
{
$result = db_query ("DELETE FROM $table_vacation WHERE email='$fUsername'");
if ($result['rows'] != 1)
{
$error = 1;
$tMessage = $PALANG['pVacation_result_error'];
$tMessage = "cannot remove $fUsername from $table_vacation";
}
else
{
$tMessage = $PALANG['pVacation_result_success'];
}
$result = db_query ("SELECT * FROM $table_alias WHERE address='$fUsername'");
if ($result['rows'] == 1)
{
$row = db_array ($result['result']);
$goto = $row['goto'];
//only one of these will do something, first handles address at beginning and middle, second at end
$goto= preg_replace ( "/$fUsername@$vacation_domain,/", '', $goto);
$goto= preg_replace ( "/,$fUsername@$vacation_domain/", '', $goto);
$result = db_query ("UPDATE $table_alias SET goto='$goto',modified=NOW() WHERE address='$fUsername'");
if ($result['rows'] != 1)
{
$error = 1;
$tMessage = $PALANG['pVacation_result_error'];
}
else
{
$tMessage = $PALANG['pVacation_result_success'];
}
}
}
}
//Set the vacation data for $fUsername
if (!empty ($fChange))
{
$result = db_query ("SELECT * FROM $table_alias WHERE address='$fUsername'");
if ($result['rows'] == 1)
{
$row = db_array ($result['result']);
$goto = $row['goto'];
}
($CONF['database_type']=='pgsql') ? $Active='true' : $Active=1;
$result = db_query ("INSERT INTO $table_vacation (email,subject,body,domain,created,active) VALUES ('$fUsername','$fSubject','$fBody','$fDomain',NOW(),$Active)");
if ($result['rows'] != 1)
{
$error = 1;
$tMessage = $PALANG['pVacation_result_error'];
}
$goto = $goto . "," . "$fUsername@$vacation_domain";
$result = db_query ("UPDATE $table_alias SET goto='$goto',modified=NOW() WHERE address='$fUsername'");
if ($result['rows'] != 1)
{
$error = 1;
$tMessage = $PALANG['pVacation_result_error'];
}
else
{
header ("Location: $fCanceltarget");
exit;
}
}
include ("../templates/header.tpl");
include ("../templates/admin_menu.tpl");
include ("../templates/edit-vacation.tpl");
include ("../templates/footer.tpl");
}
?>

@ -29,6 +29,7 @@ $SESSID_USERNAME = check_session ();
$list_domains = list_domains ();
$tAlias = array();
$tMailbox = array();
@ -66,10 +67,24 @@ if ($_SERVER['REQUEST_METHOD'] == "GET")
}
}
$query = "SELECT * FROM $table_mailbox WHERE domain='$fDomain' ORDER BY username LIMIT $fDisplay, $page_size";
if ('pgsql'==$CONF['database_type'])
if ($CONF['vacation_control_admin'] == 'YES')
{
$query = "SELECT *,extract(epoch from created) as uts_created,extract(epoch from modified) as uts_modified FROM $table_mailbox WHERE domain='$fDomain' ORDER BY username LIMIT $page_size OFFSET $fDisplay";
$query = ("SELECT $table_mailbox.*, $table_vacation.active AS v_active FROM $table_mailbox LEFT JOIN $table_vacation ON $table_mailbox.username=$table_vacation.email WHERE $table_mailbox.domain='$fDomain' ORDER BY $table_mailbox.username LIMIT $fDisplay, $page_size");
if ('pgsql'==$CONF['database_type'])
{
//FIXME: postgres query needs to be rewrited
$query = "SELECT *,extract(epoch from created) as uts_created,extract(epoch from modified) as uts_modified FROM $table_mailbox WHERE domain='$fDomain' ORDER BY username LIMIT $page_size OFFSET $fDisplay";
}
}
else
{
$query = "SELECT * FROM $table_mailbox WHERE domain='$fDomain' ORDER BY username LIMIT $fDisplay, $page_size";
if ('pgsql'==$CONF['database_type'])
{
$query = "SELECT *,extract(epoch from created) as uts_created,extract(epoch from modified) as uts_modified FROM $table_mailbox WHERE domain='$fDomain' ORDER BY username LIMIT $page_size OFFSET $fDisplay";
}
}
$result = db_query ($query);
if ($result['rows'] > 0)
@ -81,6 +96,7 @@ if ($_SERVER['REQUEST_METHOD'] == "GET")
$row['created']=gmstrftime('%c %Z',$row['uts_created']);
$row['modified']=gmstrftime('%c %Z',$row['uts_modified']);
$row['active']=('t'==$row['active']) ? 1 : 0;
$row['v_active']=('t'==$row['v_active']) ? 1 : 0;
}
$tMailbox[] = $row;
}

@ -0,0 +1,22 @@
<?php
//
// Postfix Admin
// by Mischa Peters <mischa at high5 dot net>
// Copyright (c) 2002 - 2005 High5!
// Licensed under GPL for more info check GPL-LICENSE.TXT
//
// File: main.php
//
// Template File: -none-
//
// Template Variables:
//
// -none-
//
// Form POST \ GET Variables:
//
// -none-
//
header ("Location: list-admin.php");
exit;
?>

@ -133,13 +133,12 @@ $CONF['vacation'] = 'NO';
$CONF['vacation_domain'] = 'autoreply.change-this-to-your.domain.tld';
// Vacation Control
// If you want to take control of users vacation set this to 'YES'.
// TODO: AT THIS MOMENT WE WANT TO SEE VACATION STATUS ONLY
// If you want users to take control of vacation set this to 'YES'.
// TODO: not implemented
$CONF['vacation_control'] ='YES';
// Vacation Control for admins
// Set to 'YES' if your domain admins should be able to edit user vacation.
// TODO: AT THIS MOMENT WE WANT TO SEE VACATION STATUS ONLY
$CONF['vacation_control_admin'] = 'YES';
// Alias Control

@ -2,7 +2,7 @@
//
// Postfix Admin
// by Mischa Peters <mischa at high5 dot net>
// Copyright (c) 2002 - 2005 High5!
// Copyright (c) 2002 - 2007 High5!
// Licensed under GPL for more info check GPL-LICENSE.TXT
//
// File: edit-vacation.php
@ -12,19 +12,23 @@
// Template Variables:
//
// tMessage
// tName
// tQuota
// tSubject
// tBody
//
// Form POST \ GET Variables:
//
// fUsername
// fDomain
// fPassword
// fPassword2
// fName
// fCanceltarget
// fChange
// fBack
// fQuota
// fActive
//
// This is a copy of the superadmin edit-vacation.php with
// template references changed
//
require ("./variables.inc.php");
require ("./config.inc.php");
require ("./functions.inc.php");
@ -40,11 +44,145 @@ if ($_SERVER['REQUEST_METHOD'] == "GET")
if (isset ($_GET['username'])) $fUsername = escape_string ($_GET['username']);
if (isset ($_GET['domain'])) $fDomain = escape_string ($_GET['domain']);
if (check_admin($SESSID_USERNAME))
{
$fCanceltarget= $CONF['postfix_admin_url'] . "/admin/list-virtual.php?domain=$fDomain";
}
else
{
if (check_owner ($SESSID_USERNAME, $fDomain))
{
$fCanceltarget= $CONF['postfix_admin_url'] . "/overview.php?domain=$fDomain";
}
//unauthorized, exit
else { exit; }
}
$result = db_query("SELECT * FROM $table_vacation WHERE email='$fUsername'");
if ($result['rows'] == 1)
{
$row = db_array($result['result']);
$tMessage = '';
$tSubject = $row['subject'];
$tBody = $row['body'];
}
$tUseremail = $fUsername;
if ($tSubject == '') { $tSubject = $PALANG['pUsersVacation_subject_text']; }
if ($tBody == '') { $tBody = $PALANG['pUsersVacation_body_text']; }
include ("./templates/header.tpl");
include ("./templates/menu.tpl");
include ("./templates/edit-vacation.tpl");
include ("./templates/footer.tpl");
}
if ($_SERVER['REQUEST_METHOD'] == "POST")
{
$vacation_domain = $CONF['vacation_domain'];
if (isset ($_POST['fSubject'])) $fSubject = escape_string ($_POST['fSubject']);
if (isset ($_POST['fBody'])) $fBody = escape_string ($_POST['fBody']);
if (isset ($_POST['fChange'])) $fChange = escape_string ($_POST['fChange']);
if (isset ($_POST['fBack'])) $fBack = escape_string ($_POST['fBack']);
if (isset ($_GET['domain'])) $fDomain = escape_string ($_GET['domain']);
if (isset ($_GET['username'])) $fUsername = escape_string ($_GET['username']);
if (check_admin($SESSID_USERNAME))
{
$fCanceltarget= $CONF['postfix_admin_url'] . "/admin/list-virtual.php?domain=$fDomain";
}
else
{
if (check_owner ($SESSID_USERNAME, $fDomain))
{
$fCanceltarget= $CONF['postfix_admin_url'] . "/overview.php?domain=$fDomain";
}
//unauthorized, exit
else { exit; }
}
$tUseremail = $fUsername;
if ($tSubject == '') { $tSubject = $PALANG['pUsersVacation_subject_text']; }
if ($tBody == '') { $tBody = $PALANG['pUsersVacation_body_text']; }
//if change, remove old one, then set new one
if (!empty ($fBack) || !empty ($fChange))
{
//if we find an existing vacation entry, delete it
$result = db_query("SELECT * FROM $table_vacation WHERE email='$fUsername'");
if ($result['rows'] == 1)
{
$result = db_query ("DELETE FROM $table_vacation WHERE email='$fUsername'");
if ($result['rows'] != 1)
{
$error = 1;
$tMessage = $PALANG['pVacation_result_error'];
$tMessage = "cannot remove $fUsername from $table_vacation";
}
else
{
$tMessage = $PALANG['pVacation_result_success'];
}
$result = db_query ("SELECT * FROM $table_alias WHERE address='$fUsername'");
if ($result['rows'] == 1)
{
$row = db_array ($result['result']);
$goto = $row['goto'];
//only one of these will do something, first handles address at beginning and middle, second at end
$goto= preg_replace ( "/$fUsername@$vacation_domain,/", '', $goto);
$goto= preg_replace ( "/,$fUsername@$vacation_domain/", '', $goto);
$result = db_query ("UPDATE $table_alias SET goto='$goto',modified=NOW() WHERE address='$fUsername'");
if ($result['rows'] != 1)
{
$error = 1;
$tMessage = $PALANG['pVacation_result_error'];
}
else
{
$tMessage = $PALANG['pVacation_result_success'];
}
}
}
}
//Set the vacation data for $fUsername
if (!empty ($fChange))
{
$result = db_query ("SELECT * FROM $table_alias WHERE address='$fUsername'");
if ($result['rows'] == 1)
{
$row = db_array ($result['result']);
$goto = $row['goto'];
}
($CONF['database_type']=='pgsql') ? $Active='true' : $Active=1;
$result = db_query ("INSERT INTO $table_vacation (email,subject,body,domain,created,active) VALUES ('$fUsername','$fSubject','$fBody','$fDomain',NOW(),$Active)");
if ($result['rows'] != 1)
{
$error = 1;
$tMessage = $PALANG['pVacation_result_error'];
}
$goto = $goto . "," . "$fUsername@$vacation_domain";
$result = db_query ("UPDATE $table_alias SET goto='$goto',modified=NOW() WHERE address='$fUsername'");
if ($result['rows'] != 1)
{
$error = 1;
$tMessage = $PALANG['pVacation_result_error'];
}
else
{
header ("Location: $fCanceltarget");
exit;
}
}
include ("./templates/header.tpl");

@ -12,6 +12,7 @@ $PALANG['YES'] = 'YES';
$PALANG['NO'] = 'NO';
$PALANG['edit'] = 'edit';
$PALANG['del'] = 'del';
$PALANG['exit'] = 'Exit';
$PALANG['confirm'] = 'Are you sure you want to delete this?\n';
$PALANG['confirm_domain'] = 'Do you really want to delete all records for this domain? This can not be undone!\n';
$PALANG['check_update'] = 'Check for update';
@ -24,6 +25,7 @@ $PALANG['pLogin_username_incorrect'] = '<span class="error_msg">Your login is no
$PALANG['pLogin_password_incorrect'] = '<span class="error_msg">Your password is not correct!</span>';
$PALANG['pLogin_login_users'] = 'Users click here to login to the user section.';
$PALANG['pMenu_main'] = 'Main';
$PALANG['pMenu_overview'] = 'Overview';
$PALANG['pMenu_create_alias'] = 'Add Alias';
$PALANG['pMenu_create_mailbox'] = 'Add Mailbox';
@ -63,7 +65,9 @@ $PALANG['pOverview_mailbox_name'] = 'Name';
$PALANG['pOverview_mailbox_quota'] = 'Quota (MB)';
$PALANG['pOverview_mailbox_modified'] = 'Last Modified';
$PALANG['pOverview_mailbox_active'] = 'Active';
$PALANG['pOverview_vacation_edit'] = 'Vacation';
$PALANG['pOverview_vacation_edit'] = 'VACATION IS ON';
$PALANG['pOverview_vacation_option'] = 'Set Vacation';
$PALANG['pOverview_get_domain'] = 'Domain';
$PALANG['pOverview_get_aliases'] = 'Aliases';
@ -151,6 +155,12 @@ $PALANG['pPassword_button'] = 'Change Password';
$PALANG['pPassword_result_error'] = '<span class="error_msg">Unable to change your password!</span>';
$PALANG['pPassword_result_succes'] = 'Your password has been changed!';
$PALANG['pEdit_vacation_set'] = 'Change / Set away message';
$PALANG['pEdit_vacation_remove'] = 'Remove away message';
$PALANG['pVacation_result_error'] = '<span class="error_msg">Unable to update auto response settings!</span>';
$PALANG['pVacation_result_success'] = 'Auto response has been removed!';
$PALANG['pViewlog_welcome'] = 'View the last 10 actions for ';
$PALANG['pViewlog_timestamp'] = 'Timestamp';
$PALANG['pViewlog_username'] = 'Admin';

@ -10,6 +10,7 @@ $PALANG['YES'] = 'YES';
$PALANG['NO'] = 'NO';
$PALANG['edit'] = 'edit';
$PALANG['del'] = 'del';
$PALANG['exit'] = 'Exit';
$PALANG['confirm'] = 'Are you sure you want to delete this?\n';
$PALANG['confirm_domain'] = 'Do you really want to delete all records for this domain? This can not be undone!\n';
$PALANG['check_update'] = 'Check for update';
@ -22,6 +23,7 @@ $PALANG['pLogin_username_incorrect'] = '<span class="error_msg">Your login is no
$PALANG['pLogin_password_incorrect'] = '<span class="error_msg">Your password is not correct!</span>';
$PALANG['pLogin_login_users'] = 'Users click here to login to the user section.';
$PALANG['pMenu_main'] = 'Main';
$PALANG['pMenu_overview'] = 'Overview';
$PALANG['pMenu_create_alias'] = 'Add Alias';
$PALANG['pMenu_create_mailbox'] = 'Add Mailbox';
@ -54,12 +56,16 @@ $PALANG['pOverview_alias_mailbox_count'] = 'Mailboxes';
$PALANG['pOverview_alias_address'] = 'From';
$PALANG['pOverview_alias_goto'] = 'To';
$PALANG['pOverview_alias_modified'] = 'Last Modified';
$PALANG['pOverview_alias_active'] = 'Active';
$PALANG['pOverview_alias_edit'] = 'Alias';
$PALANG['pOverview_mailbox_username'] = 'Email';
$PALANG['pOverview_mailbox_name'] = 'Name';
$PALANG['pOverview_mailbox_quota'] = 'Quota (MB)';
$PALANG['pOverview_mailbox_modified'] = 'Last Modified';
$PALANG['pOverview_mailbox_active'] = 'Active';
$PALANG['pOverview_vacation_edit'] = 'Vacation';
$PALANG['pOverview_vacation_edit'] = 'VACATION IS ON';
$PALANG['pOverview_vacation_option'] = 'Set Vacation';
$PALANG['pOverview_get_domain'] = 'Domain';
$PALANG['pOverview_get_aliases'] = 'Aliases';
@ -70,6 +76,7 @@ $PALANG['pOverview_get_modified'] = 'Last Modified';
$PALANG['pDelete_delete_error'] = '<span class="error_msg">Unable to delete the entry ';
$PALANG['pDelete_postdelete_error'] = '<span class="error_msg">Unable to remove mailbox ';
$PALANG['pDelete_domain_error'] = '<span class="error_msg">This domain is not yours ';
$PALANG['pDelete_alias_error'] = '<span class="error_msg">Unable to delete alias ';
$PALANG['pCreate_alias_welcome'] = 'Create a new alias for your domain.';
$PALANG['pCreate_alias_address'] = 'Alias';
@ -77,6 +84,7 @@ $PALANG['pCreate_alias_address_text_error1'] = '<br /><span class="error_msg">Th
$PALANG['pCreate_alias_address_text_error2'] = '<br /><span class="error_msg">This email address already exists, please choose a different one!</span>';
$PALANG['pCreate_alias_address_text_error3'] = '<br /><span class="error_msg">You have reached your limit to create aliases!</span>';
$PALANG['pCreate_alias_goto'] = 'To';
$PALANG['pCreate_alias_active'] = 'Active';
$PALANG['pCreate_alias_button'] = 'Add Alias';
$PALANG['pCreate_alias_goto_text'] = 'Where the mail needs to be send to.';
$PALANG['pCreate_alias_goto_text_error'] = 'Where the email needs to go.<br /><span class="error_msg">The TO is not valid!</span>';
@ -88,6 +96,7 @@ $PALANG['pEdit_alias_welcome'] = 'Edit an alias for your domain.<br />One entry
$PALANG['pEdit_alias_address'] = 'Alias';
$PALANG['pEdit_alias_address_error'] = '<span class="error_msg">Unable to locate alias!</span>';
$PALANG['pEdit_alias_goto'] = 'To';
$PALANG['pEdit_alias_active'] = 'Active';
$PALANG['pEdit_alias_goto_text_error1'] = '<span class="error_msg">You didn\'t enter anything at To</span>';
$PALANG['pEdit_alias_goto_text_error2'] = '<span class="error_msg">The email address that you have entered is not valid: ';
$PALANG['pEdit_alias_domain_error'] = '<span class="error_msg">This domain is not yours: ';
@ -124,6 +133,7 @@ $PALANG['pEdit_mailbox_password'] = 'New Password';
$PALANG['pEdit_mailbox_password2'] = 'New Password (again)';
$PALANG['pEdit_mailbox_password_text_error'] = '<span class="error_msg">The passwords that you supplied don\'t match!</span>';
$PALANG['pEdit_mailbox_name'] = 'Name';
$PALANG['pEdit_mailbox_name_text'] = 'Full name';
$PALANG['pEdit_mailbox_quota'] = 'Quota';
$PALANG['pEdit_mailbox_quota_text'] = 'MB';
$PALANG['pEdit_mailbox_quota_text_error'] = 'MB<br /><span class="error_msg">The quota that you specified is to high!</span>';
@ -143,6 +153,12 @@ $PALANG['pPassword_button'] = 'Change Password';
$PALANG['pPassword_result_error'] = '<span class="error_msg">Unable to change your password!</span>';
$PALANG['pPassword_result_succes'] = 'Your password has been changed!';
$PALANG['pEdit_vacation_set'] = 'Change / Set away message';
$PALANG['pEdit_vacation_remove'] = 'Remove away message';
$PALANG['pVacation_result_error'] = '<span class="error_msg">Unable to update auto response settings!</span>';
$PALANG['pVacation_result_success'] = 'Auto response has been removed!';
$PALANG['pViewlog_welcome'] = 'View the last 10 actions for ';
$PALANG['pViewlog_timestamp'] = 'Timestamp';
$PALANG['pViewlog_username'] = 'Admin';
@ -198,6 +214,7 @@ $PALANG['pAdminList_virtual_alias_mailbox_count'] = 'Mailboxes';
$PALANG['pAdminList_virtual_alias_address'] = 'From';
$PALANG['pAdminList_virtual_alias_goto'] = 'To';
$PALANG['pAdminList_virtual_alias_modified'] = 'Last Modified';
$PALANG['pAdminList_virtual_alias_active'] = 'Active';
$PALANG['pAdminList_virtual_mailbox_username'] = 'Email';
$PALANG['pAdminList_virtual_mailbox_name'] = 'Name';
$PALANG['pAdminList_virtual_mailbox_quota'] = 'Quota (MB)';
@ -218,6 +235,7 @@ $PALANG['pAdminCreate_domain_maxquota_text'] = 'MB<br /> -1 = disable | 0 = unli
$PALANG['pAdminCreate_domain_transport'] = 'Transport';
$PALANG['pAdminCreate_domain_transport_text'] = 'Define transport';
$PALANG['pAdminCreate_domain_defaultaliases'] = 'Add default mail aliases';
$PALANG['pAdminCreate_domain_defaultaliases_text'] = '';
$PALANG['pAdminCreate_domain_backupmx'] = 'Mail server is backup MX';
$PALANG['pAdminCreate_domain_button'] = 'Add Domain';
$PALANG['pAdminCreate_domain_result_error'] = '<span class="error_msg">Unable to add domain!</span>';

@ -149,6 +149,9 @@ $PALANG['pViewlog_data'] = 'Datos';
$PALANG['pViewlog_button'] = 'Ir';
$PALANG['pViewlog_result_error'] = '<span class="error_msg">¡Imposible encontrar los logs!</span>';
$PALANG['pVacation_result_error'] = '<span class="error_msg">mposible actualizar la configuraci鏮e la respuesta autom嫢ica!</span>';
$PALANG['pVacation_result_success'] = 'La respuesta autom嫢ica ha sido borrada!';
$PALANG['pSendmail_welcome'] = 'Enviar un e-mail.';
$PALANG['pSendmail_admin'] = 'De';
$PALANG['pSendmail_to'] = 'Destino';

@ -21,7 +21,7 @@ for ($i = 0; $i < sizeof ($list_domains); $i++)
<h4><?php print $PALANG['pAdminList_virtual_welcome'] . $fDomain; ?></h4>
<p><?php print $PALANG['pAdminList_virtual_alias_alias_count'] . ": " . $limit['alias_count'] . " / " . $limit['aliases']; ?></p>
<p><?php print $PALANG['pAdminList_virtual_alias_mailbox_count'] . ": " . $limit['mailbox_count'] . " / " . $limit['mailboxes']; ?></p>
<form name="search" method="post" action="search.php">
<form name="search" method="post" action="search.php">search:
<input type="textbox" name="search" size="10" />
</form>
</div>
@ -123,6 +123,13 @@ if (sizeof ($tMailbox) > 0)
print " <td>" . $tMailbox[$i]['modified'] . "</td>\n";
$active = ($tMailbox[$i]['active'] == 1) ? $PALANG['YES'] : $PALANG['NO'];
print " <td><a href=\"edit-active.php?username=" . urlencode ($tMailbox[$i]['username']) . "&domain=$fDomain" . "\">" . $active . "</a></td>\n";
if ($CONF['vacation_control_admin'] == 'YES')
{
$v_active = ($tMailbox[$i]['v_active'] == 1) ? $PALANG['pOverview_vacation_edit'] : $PALANG['pOverview_vacation_option'];
print " <td><a href=\"edit-vacation.php?username=" . urlencode ($tMailbox[$i]['username']) . "&domain=$fDomain" . "\">" .$v_active . "</a></td>\n";
}
if ($CONF['alias_control'] == 'YES')
{
print " <td><a href=\"edit-alias.php?address=" . urlencode ($tMailbox[$i]['username']) . "&domain=$fDomain" . "\">" . $PALANG['pOverview_alias_edit'] . "</a></td>\n";

@ -1,25 +1,44 @@
<script type="text/javascript">
function newLocation()
{
window.location="<?php print $fCanceltarget; ?>"
}
</script>
<div id="edit_form">
<form name="edit-vacation" method="post">
<table>
<tr>
<td colspan="3"><h3><?php print $PALANG['pUsersVacation_welcome']; ?></h3></td>
</tr>
<tr>
<td><?php print $PALANG['pUsersLogin_username'] . ":"; ?></td>
<td><?php print $row['email']; ?></td>
<td><?php print $tUseremail; ?></td>
<td>&nbsp;</td>
</tr>
<tr>
<td><?php print $PALANG['pUsersVacation_subject'] . ":"; ?></td>
<td><textarea class="flat" cols="60" disabled="disabled"><?php print $row['subject']; ?></textarea></td>
<td><textarea class="flat" cols="60" name="fSubject" ><?php print $tSubject; ?></textarea></td>
<td>&nbsp;</td>
</tr>
<tr>
<td><?php print $PALANG['pUsersVacation_body'] . ":"; ?></td>
<td><textarea class="flat" rows="10" cols="60" disabled="disabled"><?php print htmlentities($row['body'],ENT_QUOTES); ?></textarea></td>
<td><textarea class="flat" rows="10" cols="60" name="fBody" ><?php print htmlentities($tBody,ENT_QUOTES); ?></textarea></td>
<td>&nbsp;</td>
</tr>
<tr>
<td colspan="3" class="hlp_center">
<input class="button" type="submit" name="fChange" value="<?php print $PALANG['pEdit_vacation_set']; ?>" />
<input class="button" type="submit" name="fBack" value="<?php print $PALANG['pEdit_vacation_remove']; ?>" />
<input class="button" type="button" name="fCancel" value="<?php print $PALANG['exit']; ?>" onclick="newLocation()" />
</td>
</tr>
<tr>
<td colspan="3" class="standout"><?php print $tMessage; ?></td>
</tr>
</table>
</form>
</div>

@ -1,3 +0,0 @@
</center>
</body>
</html>

@ -1,5 +1,6 @@
<div id="menu">
<ul>
<li><a target="_top" href="main.php"><?php print $PALANG['pMenu_main']; ?></a></li>
<li><a target="_top" href="overview.php"><?php print $PALANG['pMenu_overview']; ?></a></li>
<?php $url = "create-alias.php"; if (isset ($_GET['domain'])) $url .= "?domain=" . $_GET['domain']; ?>
<li><a target="_top" href="<?php print $url; ?>"><?php print $PALANG['pMenu_create_alias']; ?></a></li>

@ -28,7 +28,7 @@ for ($i = 0; $i < sizeof ($list_domains); $i++)
<h4><?php print $PALANG['pOverview_welcome'] . $fDomain; ?></h4>
<p><?php print $PALANG['pOverview_alias_alias_count'] . ": " . $limit['alias_count'] . " / " . $limit['aliases']; ?></p>
<p><?php print $PALANG['pOverview_alias_mailbox_count'] . ": " . $limit['mailbox_count'] . " / " . $limit['mailboxes']; ?></p>
<form name="search" method="post" action="search.php">
search:<form name="search" method="post" action="search.php">
<input type="textbox" name="search" size="10">
</form>
</div>
@ -72,7 +72,7 @@ if (sizeof ($tAlias) > 0)
}
else
{
if (!in_array ($tAlias[$i]['goto'], $CONF['default_aliases']) || !check_alias_owner ($SESSID_USERNAME, $tAlias[$i]['goto']))
if ( check_alias_owner ($SESSID_USERNAME, $tAlias[$i]['address']))
{
$active = ($tAlias[$i]['active'] == 1) ? $PALANG['YES'] : $PALANG['NO'];
print " <td><a href=\"edit-active.php?alias=" . urlencode ($tAlias[$i]['address']) . "&domain=$fDomain" . "\">" . $active . "</a></td>\n";
@ -81,6 +81,9 @@ if (sizeof ($tAlias) > 0)
}
else
{
//this is a special alias, show status only, don't allow changes
$active = ($tAlias[$i]['active'] == 1) ? $PALANG['YES'] : $PALANG['NO'];
print " <td>" . $active . "</td>\n";
print " <td>&nbsp;</td>\n";
print " <td>&nbsp;</td>\n";
}
@ -139,7 +142,7 @@ if (sizeof ($tMailbox) > 0)
print " <td><a href=\"edit-active.php?username=" . urlencode ($tMailbox[$i]['username']) . "&domain=$fDomain" . "\">" . $active . "</a></td>\n";
if ($CONF['vacation_control_admin'] == 'YES')
{
$v_active = ($tMailbox[$i]['v_active'] == 1) ? $PALANG['pOverview_vacation_edit'] : '';
$v_active = ($tMailbox[$i]['v_active'] == 1) ? $PALANG['pOverview_vacation_edit'] : $PALANG['pOverview_vacation_option'];
print " <td><a href=\"edit-vacation.php?username=" . urlencode ($tMailbox[$i]['username']) . "&domain=$fDomain" . "\">" . $v_active . "</a></td>\n";
}
if ($CONF['alias_control_admin'] == 'YES')

@ -108,7 +108,7 @@ if ($_SERVER['REQUEST_METHOD'] == "POST")
$tGoto = $row['goto'];
}
if ($CONF['database_type']=='pgsql') ? $Active='true' : $Active=1;
($CONF['database_type']=='pgsql') ? $Active='true' : $Active=1;
$result = db_query ("INSERT INTO $table_vacation (email,subject,body,domain,created,active) VALUES ('$USERID_USERNAME','$fSubject','$fBody','$USERID_DOMAIN',NOW(),$Active)");
if ($result['rows'] != 1)
{

Loading…
Cancel
Save