summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGunnar Wrobel <wrobel@pardus.de>2010-04-06 09:00:34 (GMT)
committerGunnar Wrobel <wrobel@pardus.de>2010-04-06 09:00:34 (GMT)
commit8eecbaccb2e4dabe9cc7d82aa759bdd7671efe2a (patch)
treef4d9c16fcb6b6530c1189d15a32ea47bcb509402
parentb60f4c9b81ed100729c26ec391be3db3b0fe8afe (diff)
downloadkolab-webadmin-8eecbaccb2e4dabe9cc7d82aa759bdd7671efe2a.tar.gz
The new handler reads the old delivery script just fine.
-rw-r--r--www/admin/user/deliver.php.in19
1 files changed, 8 insertions, 11 deletions
diff --git a/www/admin/user/deliver.php.in b/www/admin/user/deliver.php.in
index d9d966d..a3f5f1e 100644
--- a/www/admin/user/deliver.php.in
+++ b/www/admin/user/deliver.php.in
@@ -21,7 +21,12 @@
require_once '@kolab_php_module_prefix@admin/include/mysmarty.php';
require_once '@kolab_php_module_prefix@admin/include/headers.php';
require_once '@kolab_php_module_prefix@admin/include/authenticate.php';
+require_once 'KolabAdmin/Sieve.php';
require_once 'KolabAdmin/Sieve/Script.php';
+require_once 'KolabAdmin/Sieve/Segment.php';
+require_once 'KolabAdmin/Sieve/Segment/Delivery.php';
+require_once 'KolabAdmin/Sieve/Segment/Forward.php';
+require_once 'KolabAdmin/Sieve/Segment/Vacation.php';
// Funny multiline string escaping in Sieve
function dotstuff( $str ) {
@@ -79,15 +84,7 @@ if( !$errors ) {
}
}
- $scripts = $sieve->listScripts();
- $inbox = false;
- if( in_array( $scriptname, $scripts ) ) {
- // Fetch script data from server
- $script = $sieve->getScript($scriptname);
- $inbox = KolabAdmin_Sieve_Script::getDeliverFolder( $script );
- }
- if( $inbox === false ) $inbox = 'Inbox';
- $active = ( $sieve->getActive() === $scriptname );
+ $handler = new KolabAdmin_Sieve($sieve);
}
/**** Insert into template and output ***/
@@ -101,8 +98,8 @@ $smarty->assign( 'menuitems', $menuitems );
$smarty->assign( 'submenuitems',
array_key_exists('submenu',
$menuitems[$sidx])?$menuitems[$sidx]['submenu']:array() );
-$smarty->assign( 'active', $active );
-$smarty->assign( 'inbox', $inbox );
+$smarty->assign( 'active', $handler->fetchDeliverySegment()->isActive() );
+$smarty->assign( 'inbox', $handler->fetchDeliverySegment()->getDeliveryFolder() );
$smarty->assign( 'maincontent', 'deliver.tpl' );
$smarty->display('page.tpl');