Skip to content

Commit 3bfd55d

Browse files
committed
Revert "Mandatory function arguments must be listed before optional ones."
This reverts commit 3a75a32. Since calls to those functions had the arguements fully populated, just remove the default configured arg values.
1 parent d1dae60 commit 3bfd55d

File tree

10 files changed

+21
-21
lines changed

10 files changed

+21
-21
lines changed

htdocs/collapse.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
$tree = get_cached_item($app['server']->getIndex(),'tree');
2020
$entry = $tree->getEntry($dn);
2121
$entry->close();
22-
set_cached_item($app['server']->getIndex(),$tree,'tree','null');
22+
set_cached_item($app['server']->getIndex(),'tree','null',$tree);
2323

2424
header(sprintf('Location:index.php?server_id=%s&junk=%s#%s%s',
2525
$app['server']->getIndex(),random_junk(),htmlid($app['server']->getIndex(),$dn),app_session_param()));

htdocs/draw_tree_node.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
}
5151

5252
if ($treesave)
53-
set_cached_item($app['server']->getIndex(),$tree,'tree','null');
53+
set_cached_item($app['server']->getIndex(),'tree','null',$tree);
5454

5555
if ($request['dn'])
5656
echo $tree->draw_children($dnentry,$request['code']);

htdocs/expand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
$tree = get_cached_item($app['server']->getIndex(),'tree');
2020
$entry = $tree->getEntry($dn);
2121
$entry->open();
22-
set_cached_item($app['server']->getIndex(),$tree,'tree','null');
22+
set_cached_item($app['server']->getIndex(),'tree','null',$tree);
2323

2424
header(sprintf('Location:index.php?server_id=%s&junk=%s#%s%s',
2525
$app['server']->getIndex(),random_junk(),htmlid($app['server']->getIndex(),$dn),app_session_param()));

htdocs/refresh.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
$entry->open();
3535
}
3636

37-
set_cached_item($app['server']->getIndex(),$tree,'tree','null');
37+
set_cached_item($app['server']->getIndex(),'tree','null',$tree);
3838
}
3939

4040
if (get_request('meth','REQUEST') == 'ajax')

lib/PageRender.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -827,7 +827,7 @@ final protected function drawOldValueJpegAttribute($attribute,$i) {
827827
if (! $attribute->getOldValue($i))
828828
return;
829829

830-
draw_jpeg_photo($this->getServer(),$this->template->getDN(),$i,$attribute->getName(),false,false);
830+
draw_jpeg_photo($this->getServer(),$this->template->getDN(),$attribute->getName(),$i,false,false);
831831
}
832832

833833
/**
@@ -844,16 +844,16 @@ final protected function drawCurrentValueJpegAttribute($attribute,$i) {
844844
# If the attribute is modified, the new value needs to be stored in a session variable for the draw_jpeg_photo callback.
845845
if ($attribute->hasBeenModified()) {
846846
$_SESSION['tmp'][$attribute->getName()][$i] = $attribute->getValue($i);
847-
draw_jpeg_photo(null,$this->template->getDN(),$i,$attribute->getName(),false,false);
847+
draw_jpeg_photo(null,$this->template->getDN(),$attribute->getName(),$i,false,false);
848848
} else
849-
draw_jpeg_photo($this->getServer(),$this->template->getDN(),$i,$attribute->getName(),false,false);
849+
draw_jpeg_photo($this->getServer(),$this->template->getDN(),$attribute->getName(),$i,false,false);
850850
}
851851

852852
protected function drawFormReadOnlyValueJpegAttribute($attribute,$i) {
853853
$this->draw('HiddenValue',$attribute,$i);
854854
$_SESSION['tmp'][$attribute->getName()][$i] = $attribute->getValue($i);
855855

856-
draw_jpeg_photo(null,$this->template->getDN(),$i,$attribute->getName(),false,false);
856+
draw_jpeg_photo(null,$this->template->getDN(),$attribute->getName(),$i,false,false);
857857
}
858858

859859
protected function drawFormReadOnlyValueMultiLineAttribute($attribute,$i) {

lib/Tree.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ static public function getInstance($server_id) {
6868
}
6969
}
7070

71-
set_cached_item($server_id,$tree,'tree','null');
71+
set_cached_item($server_id,'tree','null',$tree);
7272
}
7373

7474
return $tree;

lib/ds_ldap.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1770,7 +1770,7 @@ public function SchemaObjectClasses($method=null,$dn='') {
17701770
ksort($return);
17711771

17721772
# cache the schema to prevent multiple schema fetches from LDAP server
1773-
set_cached_item($this->index,$return,'schema','objectclasses');
1773+
set_cached_item($this->index,'schema','objectclasses',$return);
17741774
}
17751775

17761776
if (DEBUG_ENABLED)
@@ -1955,7 +1955,7 @@ public function SchemaAttributes($method=null,$dn='') {
19551955
$return = $attrs;
19561956

19571957
# cache the schema to prevent multiple schema fetches from LDAP server
1958-
set_cached_item($this->index,$return,'schema','attributes');
1958+
set_cached_item($this->index,'schema','attributes',$return);
19591959
}
19601960

19611961
if (DEBUG_ENABLED)
@@ -2031,7 +2031,7 @@ public function MatchingRules($method=null,$dn='') {
20312031
$return = $rules;
20322032

20332033
# cache the schema to prevent multiple schema fetches from LDAP server
2034-
set_cached_item($this->index,$return,'schema','matchingrules');
2034+
set_cached_item($this->index,'schema','matchingrules',$return);
20352035
}
20362036

20372037
if (DEBUG_ENABLED)
@@ -2080,7 +2080,7 @@ public function SchemaSyntaxes($method=null,$dn='') {
20802080
ksort($return);
20812081

20822082
# cache the schema to prevent multiple schema fetches from LDAP server
2083-
set_cached_item($this->index,$return,'schema','syntaxes');
2083+
set_cached_item($this->index,'schema','syntaxes',$return);
20842084
}
20852085

20862086
if (DEBUG_ENABLED)

lib/ds_ldap_pla.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ public function add($dn,$entry_array,$method=null) {
371371

372372
$tree->addEntry($dn);
373373

374-
set_cached_item($this->index,$tree,'tree','null');
374+
set_cached_item($this->index,'tree','null',$tree);
375375

376376
run_hook('post_entry_create',array('server_id'=>$this->index,'method'=>$method,'dn'=>$dn,'attrs'=>$entry_array));
377377

@@ -403,7 +403,7 @@ public function delete($dn,$method=null) {
403403
$tree = get_cached_item($this->index,'tree');
404404
$tree->delEntry($dn);
405405

406-
set_cached_item($this->index,$tree,'tree','null');
406+
set_cached_item($this->index,'tree','null',$tree);
407407

408408
run_hook('post_entry_delete',array('server_id'=>$this->index,'method'=>$method,'dn'=>$dn));
409409
}
@@ -430,7 +430,7 @@ public function rename($dn,$new_rdn,$container,$deleteoldrdn,$method=null) {
430430
$newdn = sprintf('%s,%s',$new_rdn,$container);
431431
$tree->renameEntry($dn,$newdn);
432432

433-
set_cached_item($this->index,$tree,'tree','null');
433+
set_cached_item($this->index,'tree','null',$tree);
434434

435435
run_hook('post_entry_rename',array('server_id'=>$this->index,'method'=>$method,'dn'=>$dn,'rdn'=>$new_rdn,'container'=>$container));
436436
}

lib/functions.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -955,7 +955,7 @@ function get_cached_item($index,$item,$subitem='null') {
955955
*
956956
* Returns true on success of false on failure.
957957
*/
958-
function set_cached_item($index,$data,$item,$subitem='null') {
958+
function set_cached_item($index,$item,$subitem='null',$data) {
959959
if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS'))
960960
debug_log('Entered (%%)',1,0,__FILE__,__LINE__,__METHOD__,$fargs);
961961

@@ -2065,8 +2065,8 @@ function ldap_error_msg($msg,$errnum) {
20652065
*
20662066
* Usage Examples:
20672067
* <code>
2068-
* draw_jpeg_photo(0,'cn=Bob,ou=People,dc=example,dc=com',0,"jpegPhoto",true,array('img_opts'=>"border: 1px; width: 150px"));
2069-
* draw_jpeg_photo(1,'cn=Fred,ou=People,dc=example,dc=com',1,null);
2068+
* draw_jpeg_photo(0,'cn=Bob,ou=People,dc=example,dc=com',"jpegPhoto",0,true,array('img_opts'=>"border: 1px; width: 150px"));
2069+
* draw_jpeg_photo(1,'cn=Fred,ou=People,dc=example,dc=com',null,1);
20702070
* </code>
20712071
*
20722072
* @param object The Server to get the image from.
@@ -2079,7 +2079,7 @@ function ldap_error_msg($msg,$errnum) {
20792079
* @param array Specifies optional image and CSS style attributes for the table tag. Supported keys are
20802080
* fixed_width, fixed_height, img_opts.
20812081
*/
2082-
function draw_jpeg_photo($server,$dn,$index,$attr_name='jpegphoto',$draw_delete_buttons=false,$options=array()) {
2082+
function draw_jpeg_photo($server,$dn,$attr_name='jpegphoto',$index,$draw_delete_buttons=false,$options=array()) {
20832083
if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS'))
20842084
debug_log('Entered (%%)',1,0,__FILE__,__LINE__,__METHOD__,$fargs);
20852085

lib/xmlTemplates.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ function __construct($server_id) {
140140

141141
if ($changed) {
142142
masort($this->templates,'title');
143-
set_cached_item($server_id,$this->templates,$class['item'],'null');
143+
set_cached_item($server_id,$class['item'],'null',$this->templates);
144144
}
145145
}
146146

0 commit comments

Comments
 (0)