diff --git a/CHANGELOG.TXT b/CHANGELOG.TXT index f41828d4..1f9492b0 100644 --- a/CHANGELOG.TXT +++ b/CHANGELOG.TXT @@ -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) diff --git a/admin/edit-vacation.php b/admin/edit-vacation.php new file mode 100644 index 00000000..9b093f52 --- /dev/null +++ b/admin/edit-vacation.php @@ -0,0 +1,193 @@ + +// 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"); +} +?> diff --git a/admin/list-virtual.php b/admin/list-virtual.php index d2490c2a..49d465ea 100644 --- a/admin/list-virtual.php +++ b/admin/list-virtual.php @@ -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; } diff --git a/admin/main.php b/admin/main.php new file mode 100644 index 00000000..f5991be5 --- /dev/null +++ b/admin/main.php @@ -0,0 +1,22 @@ + +// 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; +?> diff --git a/config.inc.php.sample b/config.inc.php.sample index 427e7c26..1d445faf 100644 --- a/config.inc.php.sample +++ b/config.inc.php.sample @@ -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 diff --git a/edit-vacation.php b/edit-vacation.php index da7aac32..84711b44 100644 --- a/edit-vacation.php +++ b/edit-vacation.php @@ -2,7 +2,7 @@ // // Postfix Admin // by Mischa Peters -// 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"); diff --git a/languages/default.lang b/languages/default.lang index 1f0d0449..30e87dae 100644 --- a/languages/default.lang +++ b/languages/default.lang @@ -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'] = 'Your login is no $PALANG['pLogin_password_incorrect'] = 'Your password is not correct!'; $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'] = 'Unable to change your password!'; $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'] = 'Unable to update auto response settings!'; +$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'; diff --git a/languages/en.lang b/languages/en.lang index 989427e6..8339ce72 100644 --- a/languages/en.lang +++ b/languages/en.lang @@ -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'] = 'Your login is no $PALANG['pLogin_password_incorrect'] = 'Your password is not correct!'; $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'] = 'Unable to delete the entry '; $PALANG['pDelete_postdelete_error'] = 'Unable to remove mailbox '; $PALANG['pDelete_domain_error'] = 'This domain is not yours '; +$PALANG['pDelete_alias_error'] = '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'] = '
Th $PALANG['pCreate_alias_address_text_error2'] = '
This email address already exists, please choose a different one!'; $PALANG['pCreate_alias_address_text_error3'] = '
You have reached your limit to create aliases!'; $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.
The TO is not valid!'; @@ -88,6 +96,7 @@ $PALANG['pEdit_alias_welcome'] = 'Edit an alias for your domain.
One entry $PALANG['pEdit_alias_address'] = 'Alias'; $PALANG['pEdit_alias_address_error'] = 'Unable to locate alias!'; $PALANG['pEdit_alias_goto'] = 'To'; +$PALANG['pEdit_alias_active'] = 'Active'; $PALANG['pEdit_alias_goto_text_error1'] = 'You didn\'t enter anything at To'; $PALANG['pEdit_alias_goto_text_error2'] = 'The email address that you have entered is not valid: '; $PALANG['pEdit_alias_domain_error'] = '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'] = 'The passwords that you supplied don\'t match!'; $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
The quota that you specified is to high!'; @@ -143,6 +153,12 @@ $PALANG['pPassword_button'] = 'Change Password'; $PALANG['pPassword_result_error'] = 'Unable to change your password!'; $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'] = 'Unable to update auto response settings!'; +$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
-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'] = 'Unable to add domain!'; diff --git a/languages/es.lang b/languages/es.lang index d0c2cdd1..c2e591e6 100644 --- a/languages/es.lang +++ b/languages/es.lang @@ -149,6 +149,9 @@ $PALANG['pViewlog_data'] = 'Datos'; $PALANG['pViewlog_button'] = 'Ir'; $PALANG['pViewlog_result_error'] = 'ˇImposible encontrar los logs!'; +$PALANG['pVacation_result_error'] = 'ˇImposible actualizar la configuracióne la respuesta automática!'; +$PALANG['pVacation_result_success'] = 'La respuesta automática ha sido borrada!'; + $PALANG['pSendmail_welcome'] = 'Enviar un e-mail.'; $PALANG['pSendmail_admin'] = 'De'; $PALANG['pSendmail_to'] = 'Destino'; diff --git a/templates/admin_list-virtual.tpl b/templates/admin_list-virtual.tpl index 0d0c640b..7b0d3468 100644 --- a/templates/admin_list-virtual.tpl +++ b/templates/admin_list-virtual.tpl @@ -21,7 +21,7 @@ for ($i = 0; $i < sizeof ($list_domains); $i++)

-
+search:
@@ -123,6 +123,13 @@ if (sizeof ($tMailbox) > 0) print " " . $tMailbox[$i]['modified'] . "\n"; $active = ($tMailbox[$i]['active'] == 1) ? $PALANG['YES'] : $PALANG['NO']; print " " . $active . "\n"; + + if ($CONF['vacation_control_admin'] == 'YES') + { + $v_active = ($tMailbox[$i]['v_active'] == 1) ? $PALANG['pOverview_vacation_edit'] : $PALANG['pOverview_vacation_option']; + print " " .$v_active . "\n"; + } + if ($CONF['alias_control'] == 'YES') { print " " . $PALANG['pOverview_alias_edit'] . "\n"; diff --git a/templates/edit-vacation.tpl b/templates/edit-vacation.tpl index 4c9ed728..ceea0f38 100644 --- a/templates/edit-vacation.tpl +++ b/templates/edit-vacation.tpl @@ -1,25 +1,44 @@ +
+ +
- + - + - + + + + +

 
 
 
+ + + + +
+
diff --git a/templates/footer.tpl.orig b/templates/footer.tpl.orig deleted file mode 100644 index 4c552e62..00000000 --- a/templates/footer.tpl.orig +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/templates/menu.tpl b/templates/menu.tpl index 10c57277..0fabc9bc 100644 --- a/templates/menu.tpl +++ b/templates/menu.tpl @@ -1,5 +1,6 @@ @@ -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 " " . $active . "\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 " " . $active . "\n"; print "  \n"; print "  \n"; } @@ -139,7 +142,7 @@ if (sizeof ($tMailbox) > 0) print " " . $active . "\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 " " . $v_active . "\n"; } if ($CONF['alias_control_admin'] == 'YES') diff --git a/users/vacation.php b/users/vacation.php index d381f412..d384d85e 100644 --- a/users/vacation.php +++ b/users/vacation.php @@ -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) {