diff --git a/functions.inc.php b/functions.inc.php index cb2f27cd..2a2c819a 100644 --- a/functions.inc.php +++ b/functions.inc.php @@ -1661,8 +1661,6 @@ function gen_show_status ($show_alias) $stat_ok = 1; while ( ($g=array_pop($gotos)) && $stat_ok ) { - - //$stat_result = db_query ("SELECT address FROM $table_alias WHERE goto='$g' AND address != '$g'"); $stat_result = db_query ("SELECT address FROM $table_alias WHERE address = '$g'"); if ($stat_result['rows'] == 0) { @@ -1671,6 +1669,12 @@ function gen_show_status ($show_alias) if ( $stat_ok == 0 ) { $stat_domain = substr($g,strpos($g,"@")+1); + $stat_vacdomain = substr($stat_domain,strpos($stat_domain,"@")+1); + if ( $stat_vacdomain == $CONF['vacation_domain'] ) + { + $stat_ok = 1; + break; + } for ($i=0; $i < sizeof($CONF['show_undeliverable_exceptions']);$i++) { if ( $stat_domain == $CONF['show_undeliverable_exceptions'][$i] ) @@ -1700,9 +1704,10 @@ function gen_show_status ($show_alias) // POP/IMAP CHECK if ( $CONF['show_popimap'] == 'YES' ) { - //if the address passed in appears in its own goto filed, its POP/IMAP - if (preg_match ('/^' . $show_alias . '.*$/', $stat_goto) || - preg_match ('/,' . $show_alias . '.*$/', $stat_goto) ) + //if the address passed in appears in its own goto field, its POP/IMAP + if (preg_match ('/^' . $show_alias . '$/', $stat_goto) || + preg_match ('/.*,' . $show_alias . ',.*$/', $stat_goto) || + preg_match ('/,' . $show_alias . '$/', $stat_goto) ) { $stat_string .= "" . $CONF['show_status_text'] . " "; diff --git a/languages/en.lang b/languages/en.lang index 0527d751..f37e1250 100644 --- a/languages/en.lang +++ b/languages/en.lang @@ -324,6 +324,8 @@ $PALANG['pEdit_dbLog_editmailbox'] = 'edit mailbox'; $PALANG['pSearch'] = 'search'; $PALANG['pSearch_welcome'] = 'Searching for: '; +$PALANG['pReturn_to'] = 'Return to'; + $PALANG['pBroadcast_title'] = 'Send broadcast message'; $PALANG['pBroadcast_from'] = 'From'; $PALANG['pBroadcast_from_help'] = 'From address should be like e.g. "Systems Team" <support@my.domain.tld>'; diff --git a/search.php b/search.php index 614cfad8..db846987 100644 --- a/search.php +++ b/search.php @@ -17,6 +17,8 @@ // Form POST \ GET Variables: // // fSearch +// fGo +// fDomain // require ("./variables.inc.php"); require ("./config.inc.php"); @@ -102,12 +104,19 @@ if ($_SERVER['REQUEST_METHOD'] == "GET") if ($_SERVER['REQUEST_METHOD'] == "POST") { if (isset ($_POST['search'])) $fSearch = escape_string ($_POST['search']); - if (isset ($_POST['fgo'])) $fgo = escape_string ($_POST['fgo']); - if (isset ($_POST['domain'])) $fdomain = escape_string ($_POST['domain']); + if (isset ($_POST['fGo'])) $fGo = escape_string ($_POST['fGo']); + if (isset ($_POST['fDomain'])) $fDomain = escape_string ($_POST['fDomain']); - if (empty ($fSearch) && !empty ($fgo)) + if (empty ($fSearch) && !empty ($fGo)) { - header("Location: overview.php?domain=" . $_POST['domain'] ) && exit; + if (check_admin($SESSID_USERNAME)) + { + header("Location: list-virtual.php?domain=" . $fDomain ) && exit; + } + else + { + header("Location: overview.php?domain=" . $fDomain ) && exit; + } } diff --git a/templates/search.tpl b/templates/search.tpl index 83b55100..8b0ee0a5 100644 --- a/templates/search.tpl +++ b/templates/search.tpl @@ -11,7 +11,8 @@ '; - print ''; + } else { print ' + - + @@ -60,7 +61,20 @@ if (sizeof ($tAlias) > 0) if ((is_array ($tAlias) and sizeof ($tAlias) > 0)) { print " \n"; + //highlight search string + if (stristr($tAlias[$i]['address'],$fSearch)) + { + $new_address = str_ireplace($fSearch, "" . + $fSearch . "", $tAlias[$i]['address']); + $tAlias[$i]['address'] = $new_address; + } print " " . $tAlias[$i]['address'] . "\n"; + if (stristr($tAlias[$i]['goto'],$fSearch)) + { + $new_goto = str_ireplace($fSearch, "" . + $fSearch . "", $tAlias[$i]['goto']); + $tAlias[$i]['goto'] = $new_goto; + } print " " . ereg_replace (",", "
", $tAlias[$i]['goto']) . "\n"; print " " . $tAlias[$i]['modified'] . "\n"; if ($CONF['special_alias_control'] == 'YES' || check_admin($SESSID_USERNAME)) @@ -124,7 +138,19 @@ if (sizeof ($tMailbox) > 0) if ((is_array ($tMailbox) and sizeof ($tMailbox) > 0)) { print " \n"; + if (stristr($tMailbox[$i]['username'],$fSearch)) + { + $new_name = str_ireplace($fSearch, "" . + $fSearch . "", $tMailbox[$i]['username']); + $tMailbox[$i]['username'] = $new_name; + } print " " . $tMailbox[$i]['username'] . "\n"; + if (stristr($tMailbox[$i]['name'],$fSearch)) + { + $new_name = str_ireplace($fSearch, "" . + $fSearch . "", $tMailbox[$i]['name']); + $tMailbox[$i]['name'] = $new_name; + } print " " . $tMailbox[$i]['name'] . "\n"; if ($CONF['quota'] == 'YES') print " " . divide_quota ($tMailbox[$i]['quota']) . "\n"; print " " . $tMailbox[$i]['modified'] . "\n"; diff --git a/templates/viewlog.tpl b/templates/viewlog.tpl index fad17b01..06cc235c 100644 --- a/templates/viewlog.tpl +++ b/templates/viewlog.tpl @@ -42,7 +42,7 @@ for ($i = 0; $i < sizeof ($list_domains); $i++) $data_length = strlen ($log_data); if ($data_length > 35) $log_data = substr ($log_data, 0, 35) . " ..."; - print " \n"; + print " \n"; print " " . $tLog[$i]['timestamp'] . "\n"; print " " . $tLog[$i]['username'] . "\n"; print " " . $tLog[$i]['domain'] . "\n"; diff --git a/viewlog.php b/viewlog.php index 015521d2..163e511a 100644 --- a/viewlog.php +++ b/viewlog.php @@ -53,10 +53,10 @@ if (! (check_owner ($SESSID_USERNAME, $fDomain) || check_admin($SESSID_USERNAME) if ($error != 1) { - $query = "SELECT timestamp,username,domain,action,substring(data from 1 for 36) as data FROM $table_log WHERE domain='$fDomain' ORDER BY timestamp DESC LIMIT 10"; + $query = "SELECT timestamp,username,domain,action,data FROM $table_log WHERE domain='$fDomain' ORDER BY timestamp DESC LIMIT 10"; if ('pgsql'==$CONF['database_type']) { - $query = "SELECT extract(epoch from timestamp) as timestamp,username,domain,action,substring(data from 1 for 36) as data FROM $table_log WHERE domain='$fDomain' ORDER BY timestamp DESC LIMIT 10"; + $query = "SELECT extract(epoch from timestamp) as timestamp,username,domain,action,data FROM $table_log WHERE domain='$fDomain' ORDER BY timestamp DESC LIMIT 10"; } $result=db_query($query); if ($result['rows'] > 0)