Revert "Mandatory function arguments must be listed before optional ones."

This reverts commit 3a75a32100.

Since calls to those functions had the arguements fully populated, just remove the default configured arg values.
This commit is contained in:
Deon George 2023-04-02 09:12:36 +10:00
parent d1dae60f05
commit 3bfd55de08
10 changed files with 21 additions and 21 deletions

View File

@ -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,'tree','null');
set_cached_item($app['server']->getIndex(),'tree','null',$tree);
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()));

View File

@ -50,7 +50,7 @@ if ($request['dn']) {
}
if ($treesave)
set_cached_item($app['server']->getIndex(),$tree,'tree','null');
set_cached_item($app['server']->getIndex(),'tree','null',$tree);
if ($request['dn'])
echo $tree->draw_children($dnentry,$request['code']);

View File

@ -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,'tree','null');
set_cached_item($app['server']->getIndex(),'tree','null',$tree);
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()));

View File

@ -34,7 +34,7 @@ if (get_request('purge','REQUEST')) {
$entry->open();
}
set_cached_item($app['server']->getIndex(),$tree,'tree','null');
set_cached_item($app['server']->getIndex(),'tree','null',$tree);
}
if (get_request('meth','REQUEST') == 'ajax')

View File

@ -827,7 +827,7 @@ class PageRender extends Visitor {
if (! $attribute->getOldValue($i))
return;
draw_jpeg_photo($this->getServer(),$this->template->getDN(),$i,$attribute->getName(),false,false);
draw_jpeg_photo($this->getServer(),$this->template->getDN(),$attribute->getName(),$i,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(),$i,$attribute->getName(),false,false);
draw_jpeg_photo(null,$this->template->getDN(),$attribute->getName(),$i,false,false);
} else
draw_jpeg_photo($this->getServer(),$this->template->getDN(),$i,$attribute->getName(),false,false);
draw_jpeg_photo($this->getServer(),$this->template->getDN(),$attribute->getName(),$i,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(),$i,$attribute->getName(),false,false);
draw_jpeg_photo(null,$this->template->getDN(),$attribute->getName(),$i,false,false);
}
protected function drawFormReadOnlyValueMultiLineAttribute($attribute,$i) {

View File

@ -68,7 +68,7 @@ abstract class Tree {
}
}
set_cached_item($server_id,$tree,'tree','null');
set_cached_item($server_id,'tree','null',$tree);
}
return $tree;

View File

@ -1770,7 +1770,7 @@ class ldap extends DS {
ksort($return);
# cache the schema to prevent multiple schema fetches from LDAP server
set_cached_item($this->index,$return,'schema','objectclasses');
set_cached_item($this->index,'schema','objectclasses',$return);
}
if (DEBUG_ENABLED)
@ -1955,7 +1955,7 @@ class ldap extends DS {
$return = $attrs;
# cache the schema to prevent multiple schema fetches from LDAP server
set_cached_item($this->index,$return,'schema','attributes');
set_cached_item($this->index,'schema','attributes',$return);
}
if (DEBUG_ENABLED)
@ -2031,7 +2031,7 @@ class ldap extends DS {
$return = $rules;
# cache the schema to prevent multiple schema fetches from LDAP server
set_cached_item($this->index,$return,'schema','matchingrules');
set_cached_item($this->index,'schema','matchingrules',$return);
}
if (DEBUG_ENABLED)
@ -2080,7 +2080,7 @@ class ldap extends DS {
ksort($return);
# cache the schema to prevent multiple schema fetches from LDAP server
set_cached_item($this->index,$return,'schema','syntaxes');
set_cached_item($this->index,'schema','syntaxes',$return);
}
if (DEBUG_ENABLED)

View File

@ -371,7 +371,7 @@ class ldap_pla extends ldap {
$tree->addEntry($dn);
set_cached_item($this->index,$tree,'tree','null');
set_cached_item($this->index,'tree','null',$tree);
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,'tree','null');
set_cached_item($this->index,'tree','null',$tree);
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,'tree','null');
set_cached_item($this->index,'tree','null',$tree);
run_hook('post_entry_rename',array('server_id'=>$this->index,'method'=>$method,'dn'=>$dn,'rdn'=>$new_rdn,'container'=>$container));
}

View File

@ -955,7 +955,7 @@ function get_cached_item($index,$item,$subitem='null') {
*
* Returns true on success of false on failure.
*/
function set_cached_item($index,$data,$item,$subitem='null') {
function set_cached_item($index,$item,$subitem='null',$data) {
if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS'))
debug_log('Entered (%%)',1,0,__FILE__,__LINE__,__METHOD__,$fargs);
@ -2065,8 +2065,8 @@ function ldap_error_msg($msg,$errnum) {
*
* Usage Examples:
* <code>
* 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);
* 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);
* </code>
*
* @param object The Server to get the image from.
@ -2079,7 +2079,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,$index,$attr_name='jpegphoto',$draw_delete_buttons=false,$options=array()) {
function draw_jpeg_photo($server,$dn,$attr_name='jpegphoto',$index,$draw_delete_buttons=false,$options=array()) {
if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS'))
debug_log('Entered (%%)',1,0,__FILE__,__LINE__,__METHOD__,$fargs);

View File

@ -140,7 +140,7 @@ abstract class xmlTemplates {
if ($changed) {
masort($this->templates,'title');
set_cached_item($server_id,$this->templates,$class['item'],'null');
set_cached_item($server_id,$class['item'],'null',$this->templates);
}
}