Package: gosa
Version: 2.7.4+reloaded3-11
Severity: normal
Tags: upstream

Moin Mike,

while working on Debian Edu Bullseye, I noticed that a warning message 
pops when clicking several GUI items (PHP 7.4 in use).

Deprecated: implode(): Passing glue string after array is deprecated. 
Swap the parameters...

These warnings disappear with the attached changes applied.
There might be more files affected upstream.

Please check and test.

Wolfgang
diff -ur /usr/share/gosa/include/class_acl.inc modified/gosa/include/class_acl.inc
--- /usr/share/gosa/include/class_acl.inc	2020-04-20 07:32:48.000000000 +0200
+++ modified/gosa/include/class_acl.inc	2020-07-09 12:17:52.002910541 +0200
@@ -306,9 +306,9 @@
 
     function convertForListing($entry)
     {
-        $member = implode($entry['members'],", ");
+        $member = implode(", ",$entry['members']);
         if(isset($entry['acl']) && is_array($entry['acl'])){
-            $acl = implode(array_keys($entry['acl']),", ");
+            $acl = implode(", ",array_keys($entry['acl']));
         }else{
             $acl="";
         }
@@ -638,7 +638,7 @@
                 // Create a map of all used sections, this allows us to simply hide the remove button 
                 //  if no acl is configured for the given section 
                 // e.g. ';all;department/country;users/user;
-                $usedList = ";".implode(array_keys($this->aclContents),';').";";
+                $usedList = ";".implode(';',array_keys($this->aclContents)).";";
 
                 /* Add settings for all categories to the (permanent) list */
                 $data = $lData = array();
diff -ur /usr/share/gosa/plugins/admin/acl/class_aclRole.inc modified/gosa/plugins/admin/acl/class_aclRole.inc
--- /usr/share/gosa/plugins/admin/acl/class_aclRole.inc	2020-04-20 07:32:48.000000000 +0200
+++ modified/gosa/plugins/admin/acl/class_aclRole.inc	2020-07-09 12:15:59.202864908 +0200
@@ -194,9 +194,9 @@
 
   function convertForListing($entry)
   {
-    $member = implode($entry['members'],", ");
-    $acl = implode(array_keys($entry['acl']),", ");
-    $type = implode(array_keys($entry['acl']),", ");
+    $member = implode(", ",$entry['members']);
+    $acl = implode(", ",array_keys($entry['acl']));
+    $type = implode(", ",array_keys($entry['acl']));
     return(array('data' => array($acl, $this->aclTypes[$entry['type']])));
   }
 
@@ -385,7 +385,7 @@
       // Create a map of all used sections, this allows us to simply hide the remove button
       //  if no acl is configured for the given section
       // e.g. ';all;department/country;users/user;
-      $usedList = ";".implode(array_keys($this->aclContents),';').";";
+      $usedList = ";".implode(';',array_keys($this->aclContents)).";";
 
       /* Add settings for all categories to the (permanent) list */
       foreach ($this->aclObjects as $section => $dsc){
diff -ur /usr/share/gosa/plugins/admin/departments/class_department.inc modified/gosa/plugins/admin/departments/class_department.inc
--- /usr/share/gosa/plugins/admin/departments/class_department.inc	2020-04-20 07:32:48.000000000 +0200
+++ modified/gosa/plugins/admin/departments/class_department.inc	2020-07-09 12:01:38.365073986 +0200
@@ -172,7 +172,7 @@
         $smarty= get_smarty();
 
         // Clear manager attribute if requested
-        if(preg_match("/ removeManager/i", " ".implode(array_keys($_POST),' ')." ")){
+        if(preg_match("/ removeManager/i", " ".implode(' ',array_keys($_POST))." ")){
             $this->manager = "";
             $this->manager_name = "";
         }
@@ -181,7 +181,7 @@
         if($this->manager_enabled){
 
             // Allow to select a new inetOrgPersion:manager
-            if(preg_match("/ editManager/i", " ".implode(array_keys($_POST),' ')." ")){
+            if(preg_match("/ editManager/i", " ".implode(' ',array_keys($_POST))." ")){
                 $this->dialog = new singleUserSelect($this->config, get_userinfo());
             }
             if($this->dialog && count($this->dialog->detectPostActions())){
diff -ur /usr/share/gosa/plugins/generic/references/class_aclResolver.inc modified/gosa/plugins/generic/references/class_aclResolver.inc
--- /usr/share/gosa/plugins/generic/references/class_aclResolver.inc	2011-07-27 08:38:29.000000000 +0200
+++ modified/gosa/plugins/generic/references/class_aclResolver.inc	2020-07-09 12:23:40.271141058 +0200
@@ -284,8 +284,8 @@
                     }                    
                     if(!empty($filter)) $filter =sprintf($filter_tpl,$class,$filter);
                     if(!empty($defs)) $defs = sprintf($acl_tpl,$class,$defs);
-                    if(count($users))  $umem = sprintf($umem_tpl,$class,"<li>".implode($users,'</li><li>')."</li>");
-                    if(count($groups)) $gmem = sprintf($gmem_tpl,$class,"<li>".implode($groups,'</li><li>')."</li>");
+                    if(count($users))  $umem = sprintf($umem_tpl,$class,"<li>".implode('</li><li>',$users)."</li>");
+                    if(count($groups)) $gmem = sprintf($gmem_tpl,$class,"<li>".implode('</li><li>',$groups)."</li>");
                     $str.= sprintf($tpl,$class, image($image), $dn, $aclType, $filter.$gmem.$umem.$defs);
                 }
             }
diff -ur /usr/share/gosa/plugins/personal/generic/class_user.inc modified/gosa/plugins/personal/generic/class_user.inc
--- /usr/share/gosa/plugins/personal/generic/class_user.inc	2020-04-20 07:32:48.000000000 +0200
+++ modified/gosa/plugins/personal/generic/class_user.inc	2020-07-09 11:41:18.553441180 +0200
@@ -306,13 +306,13 @@
     }
 
     // Clear manager attribute if requested
-    if(preg_match("/ removeManager/i", " ".implode(array_keys($_POST),' ')." ")){
+    if(preg_match("/ removeManager/i", " ".implode(' ',array_keys($_POST))." ")){
       $this->manager = "";
       $this->manager_name = "";
     }
 
     // Allow to select a new inetOrgPersion:manager 
-    if(preg_match("/ editManager/i", " ".implode(array_keys($_POST),' ')." ")){
+    if(preg_match("/ editManager/i", " ".implode(' ',array_keys($_POST))." ")){
       $this->dialog = new singleUserSelect($this->config, get_userinfo());
     }
     if($this->dialog && $this->dialog instanceOf singleUserSelect && count($this->dialog->detectPostActions())){

Attachment: signature.asc
Description: PGP signature

Reply via email to