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 112babe..5fe9ecc 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: * - * 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); * * * @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'); } }