Code

More cleanups
authorcajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 3 Nov 2008 16:28:52 +0000 (16:28 +0000)
committercajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Mon, 3 Nov 2008 16:28:52 +0000 (16:28 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@12881 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/include/class_pluglist.inc
gosa-core/include/class_userinfo.inc

index 48233fbc07c643c3504cf08d96b2219f4bff12f1..b7c497dafce8e5ceb011b01d40280cad04510aee 100644 (file)
@@ -42,15 +42,15 @@ class pluglist {
                /* Create dirlist for all plugins */
                $this->dirlist= $this->get_plugins ($this->dirlist, $this->config->data['MENU']);
 
-                /* Fill info part of pluglist */
-                $classes= get_declared_classes();
+               /* Fill info part of pluglist */
+               $classes= get_declared_classes();
 
-                               foreach ($classes as $cname){
-                                       $cmethods = get_class_methods($cname);
-                                       if (in_array_ics('plInfo',$cmethods)){
-                                               $this->info[$cname]= call_user_func(array($cname, 'plInfo'));
-                                       }
-                               }
+               foreach ($classes as $cname){
+                       $cmethods = get_class_methods($cname);
+                       if (in_array_ics('plInfo',$cmethods)){
+                               $this->info[$cname]= call_user_func(array($cname, 'plInfo'));
+                       }
+               }
 
                /* Provide field for 'all' */
                $this->info['all']= array();
@@ -61,9 +61,8 @@ class pluglist {
 
        function get_plugins($list, &$config)
        {
-                global $class_mapping;
+               global $class_mapping;
 
-               /* Error reporting, because I'm getting strange messages in PHP 4.2.x */
                if (!isset($config['CLASS'])){
                        if (is_array($config)){
                                foreach ($config as $val){
@@ -71,7 +70,7 @@ class pluglist {
                                }
                        }
                } else {
-                        if (is_array($config) && isset($class_mapping[$config['CLASS']])){
+                       if (is_array($config) && isset($class_mapping[$config['CLASS']])){
                                $list[$this->index++]= dirname($class_mapping[$config['CLASS']]);
                        } else {
                                $list[$this->index++]= "";
@@ -108,8 +107,7 @@ class pluglist {
       $acl_to_check = trim($acl_to_check);
                
                        /* Check if the given acl tag is only valid for self acl entries  
-                 <plugin acl="users/user:self" class="user"...
-             */        
+                 <plugin acl="users/user:self" class="user"...  */     
                        if(preg_match("/:self$/",$acl_to_check)){
                                $acl_to_check = preg_replace("/:self$/","",$acl_to_check);      
                                if($this->ui->get_permissions($this->ui->dn,$acl_to_check,"") != ""){
@@ -120,8 +118,7 @@ class pluglist {
                                return(FALSE);
                        }else{
                
-                               /* No self acls. Check if we have any acls for the given ACL type 
-                 */
+                               /* No self acls. Check if we have any acls for the given ACL type */
                                $deps = $this->ui->get_module_departments($acl_to_check,TRUE);
                                if(count($deps)){
                                        $this->silly_cache[$aclname]= TRUE;
index c10c6c35f89424de4a9d1ee5de7c6fa0650f43de..71f7ea9935cd8a135a9549a14ad54e4e4a2ab008 100644 (file)
@@ -299,7 +299,7 @@ class userinfo
     if (isset($ACL_CACHE["$dn+$object+$attribute"])){
       $ret = $ACL_CACHE["$dn+$object+$attribute"];
       if($skip_write){
-        $ret = preg_replace('/w/', '',$ret);
+        $ret = str_replace('w', '',$ret);
       }
       return($ret);
     }
@@ -329,7 +329,7 @@ class userinfo
           $ACL_CACHE["$orig_dn+$object+$attribute"] = $ACL_CACHE["$dn+$object+$attribute"];
         }
         if($skip_write){
-          $ret = preg_replace('/w/','',$ret);
+          $ret = str_replace('w','',$ret);
         }
         return($ret);
       }
@@ -456,7 +456,7 @@ class userinfo
 
     /* Remove write if needed */
     if ($skip_write){
-      $ret= preg_replace('/w/', '', $ret);
+      $ret= str_replace('w', '', $ret);
     }
     return ($ret);
   }