Code

* Fixed current main base problem
[gosa.git] / plugins / personal / connectivity / class_kolabAccount.inc
index 94f57eefd02f162c0022ef4f3243de376090d637..16e23b9fa12cecc0176ba893c4eb4d04f112de33 100644 (file)
@@ -19,7 +19,7 @@ class kolabAccount extends plugin
 
   /* attribute list for save action */
   var $attributes= array( "kolabFreeBusyFuture", "unrestrictedMailSize", "calFBURL");
-  var $objectclasses= array();
+  var $objectclasses= array("kolab");
 
   /* Helper */
   var $imapping= array();
@@ -47,7 +47,7 @@ class kolabAccount extends plugin
   function execute()
   {
        /* Call parent execute */
-       plugin::execute();
+//     plugin::execute();
 
     /* Show tab dialog headers */
     $display= "";
@@ -108,7 +108,7 @@ class kolabAccount extends plugin
 
           $ldap= $this->config->get_ldap_link();
           $ldap->cd ($this->config->current['BASE']);
-          $ldap->search('(mail='.$address.')');
+          $ldap->search('(mail='.$address.')',array("mail"));
           if ($ldap->count() == 0){
             print_red (_("The mail address you're trying to add is no primary mail address of an existing user."));
           } else {
@@ -225,7 +225,8 @@ class kolabAccount extends plugin
 
   function check()
   {
-    $message= array();
+    /* Call common method to give check the hook */
+    $message= plugin::check();
 
     /* FBFuture is in days... */
     if ($this->kolabFreeBusyFuture != "" && !preg_match('/^[0-9]+$/', $this->kolabFreeBusyFuture)){
@@ -233,7 +234,7 @@ class kolabAccount extends plugin
     }
 
     /* Check for URL scheme... */
-    if ($this->calFBURL != "" && !preg_match('/^[^:/]+://[a-z0-9_/.+~-]+$/i', $this->calFBURL)){
+    if ($this->calFBURL != "" && !@preg_match('/^[^:/]+://[a-z0-9_/.+~-]+$/i', $this->calFBURL)){
       $message[]= _("The value specified as Free Busy Information URL is invalid.");
     }
 
@@ -254,7 +255,7 @@ class kolabAccount extends plugin
 
         $ldap= $this->config->get_ldap_link();
         $ldap->cd ($this->config->current['BASE']);
-        $ldap->search('(mail='.$address.')');
+        $ldap->search('(mail='.$address.')',array("mail"));
         if ($ldap->count() == 0){
           $message[]= sprintf(_("There's no mail user with address '%s' for your invitation policy!"), $address);
         } else {
@@ -318,8 +319,10 @@ class kolabAccount extends plugin
     /* Write back to ldap */
     $ldap= $this->config->get_ldap_link();
     $ldap->cd($this->dn);
-    $ldap->modify($this->attrs);
-    show_ldap_error($ldap->get_error());
+    $this->cleanup();
+    $ldap->modify ($this->attrs); 
+
+    show_ldap_error($ldap->get_error(), _("Saving Kolab account failed"));
 
     /* Optionally execute a command after we're done */
     if ($this->initially_was_account == $this->is_account){