1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234
|
From: William Desportes <williamdes@wdes.fr>
Date: Sat, 18 Mar 2023 16:06:13 +0100
Subject: Fix Mandatory function arguments must be listed before optional ones
Origin: upstream
Forwarded: https://github.com/leenooks/phpLDAPadmin/commit/3a75a321000150e9af89bf45fc5f60d8198e9157
---
htdocs/collapse.php | 2 +-
htdocs/draw_tree_node.php | 2 +-
htdocs/expand.php | 2 +-
htdocs/refresh.php | 2 +-
lib/PageRender.php | 8 ++++----
lib/Tree.php | 2 +-
lib/ds_ldap.php | 8 ++++----
lib/ds_ldap_pla.php | 6 +++---
lib/functions.php | 8 ++++----
lib/xmlTemplates.php | 2 +-
10 files changed, 21 insertions(+), 21 deletions(-)
diff --git a/htdocs/collapse.php b/htdocs/collapse.php
index 8fb2731..c1ec07f 100644
--- a/htdocs/collapse.php
+++ b/htdocs/collapse.php
@@ -19,7 +19,7 @@ $dn = get_request('dn','GET',true);
$tree = get_cached_item($app['server']->getIndex(),'tree');
$entry = $tree->getEntry($dn);
$entry->close();
-set_cached_item($app['server']->getIndex(),'tree','null',$tree);
+set_cached_item($app['server']->getIndex(),$tree,'tree','null');
header(sprintf('Location:index.php?server_id=%s&junk=%s#%s%s',
$app['server']->getIndex(),random_junk(),htmlid($app['server']->getIndex(),$dn),app_session_param()));
diff --git a/htdocs/draw_tree_node.php b/htdocs/draw_tree_node.php
index 7311e2d..12ed6ee 100644
--- a/htdocs/draw_tree_node.php
+++ b/htdocs/draw_tree_node.php
@@ -50,7 +50,7 @@ if ($request['dn']) {
}
if ($treesave)
- set_cached_item($app['server']->getIndex(),'tree','null',$tree);
+ set_cached_item($app['server']->getIndex(),$tree,'tree','null');
if ($request['dn'])
echo $tree->draw_children($dnentry,$request['code']);
diff --git a/htdocs/expand.php b/htdocs/expand.php
index d0647d0..3600f00 100644
--- a/htdocs/expand.php
+++ b/htdocs/expand.php
@@ -19,7 +19,7 @@ $dn = get_request('dn','GET',true);
$tree = get_cached_item($app['server']->getIndex(),'tree');
$entry = $tree->getEntry($dn);
$entry->open();
-set_cached_item($app['server']->getIndex(),'tree','null',$tree);
+set_cached_item($app['server']->getIndex(),$tree,'tree','null');
header(sprintf('Location:index.php?server_id=%s&junk=%s#%s%s',
$app['server']->getIndex(),random_junk(),htmlid($app['server']->getIndex(),$dn),app_session_param()));
diff --git a/htdocs/refresh.php b/htdocs/refresh.php
index 385c4c6..120ce7a 100644
--- a/htdocs/refresh.php
+++ b/htdocs/refresh.php
@@ -34,7 +34,7 @@ if (get_request('purge','REQUEST')) {
$entry->open();
}
- set_cached_item($app['server']->getIndex(),'tree','null',$tree);
+ set_cached_item($app['server']->getIndex(),$tree,'tree','null');
}
if (get_request('meth','REQUEST') == 'ajax')
diff --git a/lib/PageRender.php b/lib/PageRender.php
index d905c96..f3c4169 100644
--- a/lib/PageRender.php
+++ b/lib/PageRender.php
@@ -827,7 +827,7 @@ class PageRender extends Visitor {
if (! $attribute->getOldValue($i))
return;
- draw_jpeg_photo($this->getServer(),$this->template->getDN(),$attribute->getName(),$i,false,false);
+ draw_jpeg_photo($this->getServer(),$this->template->getDN(),$i,$attribute->getName(),false,false);
}
/**
@@ -844,16 +844,16 @@ class PageRender extends Visitor {
# If the attribute is modified, the new value needs to be stored in a session variable for the draw_jpeg_photo callback.
if ($attribute->hasBeenModified()) {
$_SESSION['tmp'][$attribute->getName()][$i] = $attribute->getValue($i);
- draw_jpeg_photo(null,$this->template->getDN(),$attribute->getName(),$i,false,false);
+ draw_jpeg_photo(null,$this->template->getDN(),$i,$attribute->getName(),false,false);
} else
- draw_jpeg_photo($this->getServer(),$this->template->getDN(),$attribute->getName(),$i,false,false);
+ draw_jpeg_photo($this->getServer(),$this->template->getDN(),$i,$attribute->getName(),false,false);
}
protected function drawFormReadOnlyValueJpegAttribute($attribute,$i) {
$this->draw('HiddenValue',$attribute,$i);
$_SESSION['tmp'][$attribute->getName()][$i] = $attribute->getValue($i);
- draw_jpeg_photo(null,$this->template->getDN(),$attribute->getName(),$i,false,false);
+ draw_jpeg_photo(null,$this->template->getDN(),$i,$attribute->getName(),false,false);
}
protected function drawFormReadOnlyValueMultiLineAttribute($attribute,$i) {
diff --git a/lib/Tree.php b/lib/Tree.php
index e7542fc..f18ba36 100644
--- a/lib/Tree.php
+++ b/lib/Tree.php
@@ -68,7 +68,7 @@ abstract class Tree {
}
}
- set_cached_item($server_id,'tree','null',$tree);
+ set_cached_item($server_id,$tree,'tree','null');
}
return $tree;
diff --git a/lib/ds_ldap.php b/lib/ds_ldap.php
index a477efc..faa8478 100644
--- a/lib/ds_ldap.php
+++ b/lib/ds_ldap.php
@@ -1768,7 +1768,7 @@ class ldap extends DS {
ksort($return);
# cache the schema to prevent multiple schema fetches from LDAP server
- set_cached_item($this->index,'schema','objectclasses',$return);
+ set_cached_item($this->index,$return,'schema','objectclasses');
}
if (DEBUG_ENABLED)
@@ -1953,7 +1953,7 @@ class ldap extends DS {
$return = $attrs;
# cache the schema to prevent multiple schema fetches from LDAP server
- set_cached_item($this->index,'schema','attributes',$return);
+ set_cached_item($this->index,$return,'schema','attributes');
}
if (DEBUG_ENABLED)
@@ -2029,7 +2029,7 @@ class ldap extends DS {
$return = $rules;
# cache the schema to prevent multiple schema fetches from LDAP server
- set_cached_item($this->index,'schema','matchingrules',$return);
+ set_cached_item($this->index,$return,'schema','matchingrules');
}
if (DEBUG_ENABLED)
@@ -2078,7 +2078,7 @@ class ldap extends DS {
ksort($return);
# cache the schema to prevent multiple schema fetches from LDAP server
- set_cached_item($this->index,'schema','syntaxes',$return);
+ set_cached_item($this->index,$return,'schema','syntaxes');
}
if (DEBUG_ENABLED)
diff --git a/lib/ds_ldap_pla.php b/lib/ds_ldap_pla.php
index fdc8048..8a10905 100644
--- a/lib/ds_ldap_pla.php
+++ b/lib/ds_ldap_pla.php
@@ -371,7 +371,7 @@ class ldap_pla extends ldap {
$tree->addEntry($dn);
- set_cached_item($this->index,'tree','null',$tree);
+ set_cached_item($this->index,$tree,'tree','null');
run_hook('post_entry_create',array('server_id'=>$this->index,'method'=>$method,'dn'=>$dn,'attrs'=>$entry_array));
@@ -403,7 +403,7 @@ class ldap_pla extends ldap {
$tree = get_cached_item($this->index,'tree');
$tree->delEntry($dn);
- set_cached_item($this->index,'tree','null',$tree);
+ set_cached_item($this->index,$tree,'tree','null');
run_hook('post_entry_delete',array('server_id'=>$this->index,'method'=>$method,'dn'=>$dn));
}
@@ -430,7 +430,7 @@ class ldap_pla extends ldap {
$newdn = sprintf('%s,%s',$new_rdn,$container);
$tree->renameEntry($dn,$newdn);
- set_cached_item($this->index,'tree','null',$tree);
+ set_cached_item($this->index,$tree,'tree','null');
run_hook('post_entry_rename',array('server_id'=>$this->index,'method'=>$method,'dn'=>$dn,'rdn'=>$new_rdn,'container'=>$container));
}
diff --git a/lib/functions.php b/lib/functions.php
index b44dd2c..5746aa5 100644
--- a/lib/functions.php
+++ b/lib/functions.php
@@ -928,7 +928,7 @@ function get_cached_item($index,$item,$subitem='null') {
*
* Returns true on success of false on failure.
*/
-function set_cached_item($index,$item,$subitem='null',$data) {
+function set_cached_item($index,$data,$item,$subitem='null') {
if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS'))
debug_log('Entered (%%)',1,0,__FILE__,__LINE__,__METHOD__,$fargs);
@@ -2032,8 +2032,8 @@ function ldap_error_msg($msg,$errnum) {
*
* Usage Examples:
* <code>
- * draw_jpeg_photo(0,'cn=Bob,ou=People,dc=example,dc=com',"jpegPhoto",0,true,array('img_opts'=>"border: 1px; width: 150px"));
- * draw_jpeg_photo(1,'cn=Fred,ou=People,dc=example,dc=com',null,1);
+ * draw_jpeg_photo(0,'cn=Bob,ou=People,dc=example,dc=com',0,"jpegPhoto",true,array('img_opts'=>"border: 1px; width: 150px"));
+ * draw_jpeg_photo(1,'cn=Fred,ou=People,dc=example,dc=com',1,null);
* </code>
*
* @param object The Server to get the image from.
@@ -2046,7 +2046,7 @@ function ldap_error_msg($msg,$errnum) {
* @param array Specifies optional image and CSS style attributes for the table tag. Supported keys are
* fixed_width, fixed_height, img_opts.
*/
-function draw_jpeg_photo($server,$dn,$attr_name='jpegphoto',$index,$draw_delete_buttons=false,$options=array()) {
+function draw_jpeg_photo($server,$dn,$index,$attr_name='jpegphoto',$draw_delete_buttons=false,$options=array()) {
if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS'))
debug_log('Entered (%%)',1,0,__FILE__,__LINE__,__METHOD__,$fargs);
diff --git a/lib/xmlTemplates.php b/lib/xmlTemplates.php
index 1749bac..f55e876 100644
--- a/lib/xmlTemplates.php
+++ b/lib/xmlTemplates.php
@@ -140,7 +140,7 @@ abstract class xmlTemplates {
if ($changed) {
masort($this->templates,'title');
- set_cached_item($server_id,$class['item'],'null',$this->templates);
+ set_cached_item($server_id,$this->templates,$class['item'],'null');
}
}
|