summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGunnar Wrobel <wrobel@pardus.de>2010-04-06 17:56:33 (GMT)
committerGunnar Wrobel <wrobel@pardus.de>2010-04-06 17:56:33 (GMT)
commit419b3f70765890a507e36d9e11f3327cd5172ac8 (patch)
tree7f11207592ef8f12e156743498ba38d76cf409ed
parent0b2bffffa2b181f97d17552909916566ec1d8bd1 (diff)
downloadkolab-webadmin-419b3f70765890a507e36d9e11f3327cd5172ac8.tar.gz
Do not check for PEAR-Net_Sieve in the code. The package dependencies should ensure that it is installed. In addition remove some unused functions.
-rw-r--r--www/admin/user/deliver.php.in19
-rw-r--r--www/admin/user/forward.php.in19
-rw-r--r--www/admin/user/vacation.php.in10
3 files changed, 6 insertions, 42 deletions
diff --git a/www/admin/user/deliver.php.in b/www/admin/user/deliver.php.in
index 9140ac2..10e5afb 100644
--- a/www/admin/user/deliver.php.in
+++ b/www/admin/user/deliver.php.in
@@ -21,6 +21,7 @@
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 'Net/Sieve.php';
require_once 'KolabAdmin/Sieve.php';
require_once 'KolabAdmin/Sieve/Script.php';
require_once 'KolabAdmin/Sieve/Segment.php';
@@ -28,21 +29,6 @@ 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 ) {
- return str_replace( "\n.", "\n..", $str );
-}
-
-function undotstuff( $str ) {
- return str_replace( "\n..", "\n.", $str );
-}
-
-$errors = array();
-if( (@include_once 'Net/Sieve.php' ) === false ) {
- $errors[] = _('Net/Sieve.php is missing. Without that, filter settings are not available');
- $errors[] = _("Suggest your system administrator to run \"pear install http://pear.php.net/get/Net_Sieve\" on the server");
-}
-
/**** Authentication etc. ***/
$sidx = 'user';
@@ -54,7 +40,7 @@ $menuitems[$sidx]['selected'] = 'selected';
/**** Sieve handling ***/
// this is the name KDE client stores - so we can also change the setting from KDE client
$scriptname = "kolab-deliver.siv";
-if( !$errors ) {
+
$obj = $ldap->read( $auth->dn() );
$sieve =& new Net_Sieve( $auth->uid(), $auth->password(), $obj['kolabHomeServer'][0] );
@@ -82,7 +68,6 @@ if( !$errors ) {
$errors[] = '<pre>' . $handler->getScript() . '</pre>';
}
}
-}
/**** Insert into template and output ***/
$smarty = new MySmarty();
diff --git a/www/admin/user/forward.php.in b/www/admin/user/forward.php.in
index 6321139..6d336fa 100644
--- a/www/admin/user/forward.php.in
+++ b/www/admin/user/forward.php.in
@@ -22,6 +22,7 @@ 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/locale.php');
require_once '@kolab_php_module_prefix@admin/include/authenticate.php';
+require_once 'Net/Sieve.php';
require_once 'KolabAdmin/Sieve.php';
require_once 'KolabAdmin/Sieve/Script.php';
require_once 'KolabAdmin/Sieve/Segment.php';
@@ -29,21 +30,6 @@ 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 ) {
- return str_replace( "\n.", "\n..", $str );
-}
-
-function undotstuff( $str ) {
- return str_replace( "\n..", "\n.", $str );
-}
-
-$errors = array();
-if( (@include_once 'Net/Sieve.php' ) === false ) {
- $errors[] = _('Net/Sieve.php is missing. Without that, vacation settings are not available');
- $errors[] = _("Suggest your system administrator to run \"pear install http://pear.php.net/get/Net_Sieve\" on the server");
-}
-
/**** Authentication etc. ***/
$sidx = 'user';
@@ -55,7 +41,7 @@ $menuitems[$sidx]['selected'] = 'selected';
/**** Sieve handling ***/
// this is the name KDE client stores - so we can also change the setting from KDE client
$scriptname = "kolab-forward.siv";
-if( !$errors ) {
+
$obj = $ldap->read( $auth->dn() );
$sieve =& new Net_Sieve( $auth->uid(), $auth->password(), $obj['kolabHomeServer'][0] );
@@ -84,7 +70,6 @@ if( !$errors ) {
$errors[] = '<pre>' . $handler->getScript() . '</pre>';
}
}
-}
/**** Insert into template and output ***/
$smarty = new MySmarty();
diff --git a/www/admin/user/vacation.php.in b/www/admin/user/vacation.php.in
index fe09bbf..69ad79d 100644
--- a/www/admin/user/vacation.php.in
+++ b/www/admin/user/vacation.php.in
@@ -10,6 +10,7 @@ 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/locale.php');
require_once '@kolab_php_module_prefix@admin/include/authenticate.php';
+require_once 'Net/Sieve.php';
require_once 'KolabAdmin/Sieve.php';
require_once 'KolabAdmin/Sieve/Script.php';
require_once 'KolabAdmin/Sieve/Segment.php';
@@ -17,12 +18,6 @@ require_once 'KolabAdmin/Sieve/Segment/Delivery.php';
require_once 'KolabAdmin/Sieve/Segment/Forward.php';
require_once 'KolabAdmin/Sieve/Segment/Vacation.php';
-$errors = array();
-if( (@include_once 'Net/Sieve.php' ) === false ) {
- $errors[] = _('Net/Sieve.php is missing. Without that, vacation settings are not available');
- $errors[] = _("Suggest your system administrator to run \"pear install http://pear.php.net/get/Net_Sieve\" on the server");
-}
-
/**** Authentication etc. ***/
$sidx = 'user';
@@ -33,7 +28,7 @@ $menuitems[$sidx]['selected'] = 'selected';
/**** Sieve handling ***/
$scriptname = 'kolab-vacation.siv';
-if( !$errors ) {
+
$obj = $ldap->read( $auth->dn() );
$sieve =& new Net_Sieve( $auth->uid(), $auth->password(), $obj['kolabHomeServer'][0] );
//$sieve->setDebug(true);
@@ -75,7 +70,6 @@ if( !$errors ) {
$errors[] = '<pre>' . $handler->getScript() . '</pre>';
}
}
-}
/**** Insert into template and output ***/
$smarty = new MySmarty();