steffen: server/kolab-webadmin/kolab-webadmin/www/admin/user forward.php, 1.9, 1.10 vacation.php, 1.8, 1.9

cvs at intevation.de cvs at intevation.de
Fri Jan 7 13:53:38 CET 2005


Author: steffen

Update of /kolabrepository/server/kolab-webadmin/kolab-webadmin/www/admin/user
In directory doto:/tmp/cvs-serv31247/kolab-webadmin/www/admin/user

Modified Files:
	forward.php vacation.php 
Log Message:
Fix for Issue597 (vacation broken)

Index: forward.php
===================================================================
RCS file: /kolabrepository/server/kolab-webadmin/kolab-webadmin/www/admin/user/forward.php,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- forward.php	17 Dec 2004 02:04:16 -0000	1.9
+++ forward.php	7 Jan 2005 12:53:36 -0000	1.10
@@ -48,11 +48,10 @@
 
 /**** Sieve handling ***/
 // this is the name KDE client stores - so we can also change the setting from KDE client
-$scriptname = "kmail-forward.siv";
+$scriptname = "kolab-forward.siv";
 if( !$errors ) {
   $obj = $ldap->read( $auth->dn() );
   $sieve =& new Net_Sieve( $auth->uid(), $auth->password(), $obj['kolabHomeServer'][0] );
-  $scripts = $sieve->listScripts();
   
   // Update sieve script on server in case we have submit data
   if( $_REQUEST['submit'] ) {
@@ -81,9 +80,11 @@
 	}
   }
 
+  $scripts = $sieve->listScripts();
   if( in_array( $scriptname, $scripts ) ) {
-	$address = SieveUtils::getForwardAddress( $sieve );
-	$keep = SieveUtils::getKeepOnServer( $sieve );
+	$script = $sieve->getScript($scriptname);
+	$address = SieveUtils::getForwardAddress( $script );
+	$keep = SieveUtils::getKeepOnServer( $script );
   } else {
 	$address = '';
 	$keep = true;

Index: vacation.php
===================================================================
RCS file: /kolabrepository/server/kolab-webadmin/kolab-webadmin/www/admin/user/vacation.php,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- vacation.php	22 Nov 2004 00:06:41 -0000	1.8
+++ vacation.php	7 Jan 2005 12:53:36 -0000	1.9
@@ -26,11 +26,11 @@
 $menuitems[$sidx]['selected'] = 'selected';
 
 /**** Sieve handling ***/
-$scriptname = 'kmail-vacation.siv';
+$scriptname = 'kolab-vacation.siv';
 if( !$errors ) {
   $obj = $ldap->read( $auth->dn() );
   $sieve =& new Net_Sieve( $auth->uid(), $auth->password(), $obj['kolabHomeServer'][0] );
-  $scripts = $sieve->listScripts();
+  //$sieve->setDebug(true);
 
   // Update sieve script on server in case we have submit data
   if( $_REQUEST['submit'] ) {
@@ -58,17 +58,20 @@
 	}
   }
 
+  $addresses = $days = $text = false;
+  $scripts = $sieve->listScripts();
   if( in_array( $scriptname, $scripts ) ) {
-	$addresses = SieveUtils::getVacationAddresses( $sieve );
-	$days = SieveUtils::getVacationDays( $sieve );
-	$text = SieveUtils::getVacationText( $sieve );
+	$script = $sieve->getScript($scriptname);
+	$addresses = SieveUtils::getVacationAddresses( $script );
+	$days = SieveUtils::getVacationDays( $script );
+	$text = SieveUtils::getVacationText( $script );
   }
-  if( !$addresses ) {
+  if( $addresses === false ) {
 	$object = $ldap->read( $auth->dn() );
 	$addresses = array_merge( $object['mail'], $object['alias'] );
   }
-  if( !$days ) $days = 7;
-  if( !$text ) {
+  if( $days === false ) $days = 7;
+  if( $text === false ) {
 	$date = strftime(_('%x'));
 	$text = _("I am out of office till $date.\r\n".
 	  "In urgent cases, please contact Mrs. <vacation replacement>\r\n\r\n".





More information about the commits mailing list