Index: users/vacation.php =================================================================== --- users/vacation.original (Revision 1) +++ users/vacation.php (Arbeitskopie) @@ -28,6 +28,7 @@ $USERID_USERNAME = check_user_session (); (($CONF['vacation'] == 'NO') ? header("Location: " . $CONF['postfix_admin_url'] . "/users/main.php") && exit : '1'); $tmp = preg_split ('/@/', $USERID_USERNAME); +$USERID_LOCALPART = $tmp[0]; $USERID_DOMAIN = $tmp[1]; if ($_SERVER['REQUEST_METHOD'] == "GET") @@ -108,7 +109,8 @@ $tGoto = $row['goto']; } - if ($CONF['database_type']=='pgsql') ? $Active='true' : $Active=1; + # [cb] fix syntax error + ($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) { @@ -116,8 +118,8 @@ $tMessage = $PALANG['pUsersVacation_result_error']; } - $goto = $tGoto . "," . "$USERID_USERNAME@$vacation_domain"; - + $goto = $tGoto . "," . "$USERID_LOCALPART" . "#" . "$USERID_DOMAIN@$vacation_domain"; + $result = db_query ("UPDATE $table_alias SET goto='$goto',modified=NOW() WHERE address='$USERID_USERNAME'"); if ($result['rows'] != 1) { Index: stylesheet.css =================================================================== --- stylesheet.css.original (Revision 1) +++ stylesheet.css (Arbeitskopie) @@ -205,11 +205,7 @@ color: black; } -#alias_table .hilightoff, #mailbox_table .hilightoff, #overview_table .hilightoff, #log_table .hilightoff, #admin_table .hilighoff { - background: white; -} - -#alias_table .hilighton, #mailbox_table .hilighton, #overview_table .hilighton, #log_table .hilighton, #admin_table .hilighton { +#alias_table tr:hover, #mailbox_table tr:hover, #overview_table tr:hover, #log_table tr:hover, #admin_table tr:hover { background: #D9FF43; /*#D6FF85;*/ /*#ffdddd;*/ } Index: admin/list-virtual.php =================================================================== --- admin/list-virtual.original (Revision 1) +++ admin/list-virtual.php (Arbeitskopie) @@ -122,10 +122,10 @@ if ($CONF['alias_control'] == "YES") { - $query = "SELECT address,goto,modified,active FROM alias WHERE domain='$fDomain' ORDER BY address LIMIT $fDisplay, $page_size"; + $query = "SELECT address,goto,modified,active FROM $table_alias WHERE domain='$fDomain' ORDER BY address LIMIT $fDisplay, $page_size"; if ('pgsql'==$CONF['database_type']) { - $query = "SELECT address,goto,extract(epoch from modified) as modified,active FROM alias WHERE domain='$fDomain' ORDER BY alias.address LIMIT $page_size OFFSET $fDisplay"; + $query = "SELECT address,goto,extract(epoch from modified) as modified,active FROM $table_alias WHERE domain='$fDomain' ORDER BY $table_alias.address LIMIT $page_size OFFSET $fDisplay"; } } else Index: templates/overview.tpl =================================================================== --- templates/overview.tpl.original (Revision 1) +++ templates/overview.tpl (Arbeitskopie) @@ -60,7 +60,11 @@ { print "
" . $PALANG['pMenu_create_alias'] . "\n"; if (sizeof ($tMailbox) > 0) { @@ -153,5 +158,6 @@ } print "\n"; } + print "
" . $PALANG['pMenu_create_mailbox'] . "\n"; /* vim: set expandtab softtabstop=3 tabstop=3 shiftwidth=3: */ ?> Index: templates/admin_list-virtual.tpl =================================================================== --- templates/admin_list-virtual.tpl.original (Revision 1) +++ templates/admin_list-virtual.tpl (Arbeitskopie) @@ -62,7 +62,11 @@ { print "
" . $PALANG['pMenu_create_alias'] . "\n"; if (sizeof ($tMailbox) > 0) { @@ -134,5 +139,6 @@ } print "\n"; } + print "
" . $PALANG['pMenu_create_mailbox'] . "\n"; /* vim: set expandtab softtabstop=3 tabstop=3 shiftwidth=3: */ ?> Index: templates/login.tpl =================================================================== --- templates/login.tpl.original (Revision 1) +++ templates/login.tpl (Arbeitskopie) @@ -23,4 +23,10 @@
{$PALANG['pAdminMenu_create_domain']}"; ?> Index: languages/de.lang =================================================================== --- languages/de.lang.original (Revision 1) +++ languages/de.lang (Arbeitskopie) @@ -289,14 +289,14 @@ $PALANG['pUsersVacation_result_error'] = 'Konnte Ihre Automatische Antwort nicht einstellen!'; $PALANG['pUsersVacation_result_succes'] = 'Ihre Automatische Antwort wurde gelöscht!'; -$PALANG['pCreate_dbLog_createmailbox'] = 'create mailbox'; -$PALANG['pCreate_dbLog_createalias'] = 'create alias'; -$PALANG['pDelete_dbLog_deletealias'] = 'delete alias'; -$PALANG['pDelete_dbLog_deletemailbox'] = 'delete mailbox'; +$PALANG['pCreate_dbLog_createmailbox'] = 'Mailbox hinzufügen'; +$PALANG['pCreate_dbLog_createalias'] = 'Alias hinzufügen'; +$PALANG['pDelete_dbLog_deletealias'] = 'Alias löschen'; +$PALANG['pDelete_dbLog_deletemailbox'] = 'Mailbox löschen'; -$PALANG['pEdit_dbLog_editactive'] = 'change active state'; -$PALANG['pEdit_dbLog_editalias'] = 'edit alias'; -$PALANG['pEdit_dbLog_editmailbox'] = 'edit mailbox'; +$PALANG['pEdit_dbLog_editactive'] = 'Aktiv-Status ändern'; +$PALANG['pEdit_dbLog_editalias'] = 'Alias bearbeiten'; +$PALANG['pEdit_dbLog_editmailbox'] = 'Mailbox bearbeiten'; -$PALANG['pSearch_welcome'] = 'Searching for: '; +$PALANG['pSearch_welcome'] = 'Suche nach: '; ?> Index: search.php =================================================================== --- search.original (revision 1) +++ search.php (working copy) @@ -48,7 +48,11 @@ { if (check_owner ($SESSID_USERNAME, $row['domain'])) { - $tAlias[] = $row; + if ('pgsql'==$CONF['database_type']) + { + $row['modified']=gmstrftime('%c %Z',$row['modified']); + } + $tAlias[] = $row; } } } @@ -56,28 +60,25 @@ if ($CONF['vacation_control_admin'] == 'YES') { $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.username LIKE '%$fSearch%' ORDER BY $table_mailbox.username"); - 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 $limitSql"; - } } else { $query = "SELECT * FROM $table_mailbox WHERE username LIKE '%$fSearch%' ORDER BY username"; - 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 $limitSql"; - } } + $result = db_query ($query); if ($result['rows'] > 0) { while ($row = db_array ($result['result'])) { if (check_owner ($SESSID_USERNAME, $row['domain'])) { - $tMailbox[] = $row; + if ('pgsql'==$CONF['database_type']) + { + $row['modified']=gmstrftime('%c %Z',$row['modified']); + $row['active']=('t'==$row['active']) ? 1 : 0; + } + $tMailbox[] = $row; } } } @@ -108,6 +109,10 @@ { if (check_owner ($SESSID_USERNAME, $row['domain'])) { + if ('pgsql'==$CONF['database_type']) + { + $row['modified']=gmstrftime('%c %Z',$row['modified']); + } $tAlias[] = $row; } } @@ -116,19 +121,10 @@ if ($CONF['vacation_control_admin'] == 'YES') { $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.username LIKE '%$fSearch%' ORDER BY $table_mailbox.username"); - 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 $limitSql"; - } } else { $query = "SELECT * FROM $table_mailbox WHERE username LIKE '%$fSearch%' ORDER BY username"; - 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 $limitSql"; - } } $result = db_query ("$query"); @@ -138,6 +134,11 @@ { if (check_owner ($SESSID_USERNAME, $row['domain'])) { + if ('pgsql'==$CONF['database_type']) + { + $row['modified']=gmstrftime('%c %Z',$row['modified']); + $row['active']=('t'==$row['active']) ? 1 : 0; + } $tMailbox[] = $row; } }