From f8f0d175b82efd08a9bcc9db7620b04f675fd230 Mon Sep 17 00:00:00 2001 From: Timothy J Warren Date: Tue, 12 Feb 2019 14:52:01 -0500 Subject: [PATCH] Automated code cleanup, part 1 --- htdocs/add_attr_form.php | 2 +- htdocs/add_oclass_form.php | 2 +- htdocs/add_value_form.php | 2 +- htdocs/cmd.php | 4 +- htdocs/collapse.php | 2 +- htdocs/common.php | 2 +- htdocs/compare.php | 2 +- htdocs/compare_form.php | 2 +- htdocs/copy.php | 2 +- htdocs/copy_form.php | 2 +- htdocs/create.php | 2 +- htdocs/create_confirm.php | 2 +- htdocs/delete.php | 2 +- htdocs/delete_attr.php | 2 +- htdocs/delete_form.php | 2 +- htdocs/download_binary_attr.php | 2 +- htdocs/draw_tree_node.php | 2 +- htdocs/entry_chooser.php | 4 +- htdocs/expand.php | 2 +- htdocs/export.php | 2 +- htdocs/export_form.php | 4 +- htdocs/import.php | 2 +- htdocs/import_form.php | 2 +- htdocs/index.php | 2 +- htdocs/login.php | 2 +- htdocs/login_form.php | 2 +- htdocs/logout.php | 2 +- htdocs/mass_delete.php | 2 +- htdocs/mass_edit.php | 2 +- htdocs/mass_update.php | 2 +- htdocs/modify_member_form.php | 2 +- htdocs/monitor.php | 2 +- htdocs/password_checker.php | 4 +- htdocs/purge_cache.php | 2 +- htdocs/query_engine.php | 2 +- htdocs/rdelete.php | 2 +- htdocs/refresh.php | 2 +- htdocs/rename.php | 2 +- htdocs/rename_form.php | 2 +- htdocs/schema.php | 2 +- htdocs/server_info.php | 2 +- htdocs/template_engine.php | 2 +- htdocs/update.php | 2 +- htdocs/update_confirm.php | 2 +- htdocs/view_jpeg_photo.php | 2 +- htdocs/welcome.php | 2 +- lib/AJAXTree.php | 14 ++- lib/Attribute.php | 6 +- lib/AttributeFactory.php | 2 +- lib/BinaryAttribute.php | 2 +- lib/DateAttribute.php | 2 +- lib/DnAttribute.php | 2 +- lib/GidAttribute.php | 2 +- lib/HTMLTree.php | 6 +- lib/JpegAttribute.php | 2 +- lib/MassRender.php | 2 +- lib/MultiLineAttribute.php | 2 +- lib/ObjectClassAttribute.php | 2 +- lib/PageRender.php | 32 +++++- lib/PasswordAttribute.php | 2 +- lib/Query.php | 3 +- lib/QueryRender.php | 4 +- lib/RandomPasswordAttribute.php | 2 +- lib/SambaPasswordAttribute.php | 2 +- lib/SelectionAttribute.php | 2 +- lib/ShadowAttribute.php | 2 +- lib/Template.php | 42 +++++--- lib/TemplateRender.php | 71 +++++++++--- lib/Tree.php | 4 +- lib/TreeItem.php | 4 +- lib/Visitor.php | 2 +- lib/blowfish.php | 43 ++++---- lib/config_default.php | 26 +++-- lib/createlm.php | 78 +++++++------- lib/ds.php | 42 +++++++- lib/ds_ldap.php | 184 ++++++++++++++++++-------------- lib/ds_ldap_pla.php | 27 ++++- lib/export_functions.php | 14 +-- lib/functions.php | 135 ++++++++++++++++------- lib/import_functions.php | 19 +++- lib/page.php | 9 +- lib/query_functions.php | 2 +- lib/schema_functions.php | 27 +++-- lib/session_functions.php | 4 +- lib/template_functions.php | 2 +- lib/xml2array.php | 11 +- lib/xmlTemplates.php | 19 ++-- 87 files changed, 618 insertions(+), 340 deletions(-) diff --git a/htdocs/add_attr_form.php b/htdocs/add_attr_form.php index 7f72841..ba5ece0 100644 --- a/htdocs/add_attr_form.php +++ b/htdocs/add_attr_form.php @@ -182,4 +182,4 @@ if (get_request('meth','REQUEST') != 'ajax') { echo ''; echo ''; } -?> + diff --git a/htdocs/add_oclass_form.php b/htdocs/add_oclass_form.php index d2353c9..d94a188 100644 --- a/htdocs/add_oclass_form.php +++ b/htdocs/add_oclass_form.php @@ -114,4 +114,4 @@ if (count($ldap['attrs']['need']) > 0) { die(); } } -?> + diff --git a/htdocs/add_value_form.php b/htdocs/add_value_form.php index c30f348..e01b3dc 100644 --- a/htdocs/add_value_form.php +++ b/htdocs/add_value_form.php @@ -170,4 +170,4 @@ if (! strcasecmp($request['attr'],'objectclass') || get_request('meth','REQUEST' $request['page']->draw('FormReadWriteValue',$attribute,$request['count']); } } -?> + diff --git a/htdocs/cmd.php b/htdocs/cmd.php index 0ddf004..5f39368 100644 --- a/htdocs/cmd.php +++ b/htdocs/cmd.php @@ -68,7 +68,7 @@ if (isAjaxEnabled() && get_request('refresh','REQUEST') && get_request('refresh' # Capture the output and put into the body of the page. $www['body'] = new block(); -$www['body']->SetBody(ob_get_contents()); +$www['body']->setBody(ob_get_contents()); $www['page']->block_add('body',$www['body']); ob_end_clean(); @@ -76,4 +76,4 @@ if ($www['meth'] == 'ajax') $www['page']->show(get_request('frame','REQUEST',false,'BODY'),true,get_request('raw','REQUEST',false,false)); else $www['page']->display(); -?> + diff --git a/htdocs/collapse.php b/htdocs/collapse.php index 8fb2731..456edea 100644 --- a/htdocs/collapse.php +++ b/htdocs/collapse.php @@ -24,4 +24,4 @@ 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())); die(); -?> + diff --git a/htdocs/common.php b/htdocs/common.php index de4122c..22e9af4 100644 --- a/htdocs/common.php +++ b/htdocs/common.php @@ -11,4 +11,4 @@ if (! defined('LIBDIR')) define('LIBDIR',sprintf('%s/',realpath('../lib/'))); require_once LIBDIR.'common.php'; -?> + diff --git a/htdocs/compare.php b/htdocs/compare.php index 47a80db..84b8ea1 100644 --- a/htdocs/compare.php +++ b/htdocs/compare.php @@ -185,4 +185,4 @@ foreach ($attrs_all as $attr) { echo ''; } echo ''; -?> + diff --git a/htdocs/compare_form.php b/htdocs/compare_form.php index 56962bd..8e9070b 100644 --- a/htdocs/compare_form.php +++ b/htdocs/compare_form.php @@ -62,4 +62,4 @@ echo "\n"; echo ''; echo ''; -?> + diff --git a/htdocs/copy.php b/htdocs/copy.php index 34d1512..04071c5 100644 --- a/htdocs/copy.php +++ b/htdocs/copy.php @@ -206,4 +206,4 @@ function build_tree($server,$dn,$buildtree) { return $buildtree; } -?> + diff --git a/htdocs/copy_form.php b/htdocs/copy_form.php index 749b78e..ebe6086 100644 --- a/htdocs/copy_form.php +++ b/htdocs/copy_form.php @@ -100,4 +100,4 @@ if ($_SESSION[APPCONFIG]->getValue('appearance','show_hints')) # Draw the javascrpt to enable/disable the filter field if this may be a recursive copy if (count($request['children']) > 0) printf('',JSDIR); -?> + diff --git a/htdocs/create.php b/htdocs/create.php index 0ed5a3c..075f933 100644 --- a/htdocs/create.php +++ b/htdocs/create.php @@ -101,4 +101,4 @@ if ($add_result) { echo ''; } } -?> + diff --git a/htdocs/create_confirm.php b/htdocs/create_confirm.php index 6727fb1..02e87ff 100644 --- a/htdocs/create_confirm.php +++ b/htdocs/create_confirm.php @@ -140,4 +140,4 @@ if (count($request['template']->getLDAPadd(true))) { echo ''; } -?> + diff --git a/htdocs/delete.php b/htdocs/delete.php index 137055c..9a2d01e 100644 --- a/htdocs/delete.php +++ b/htdocs/delete.php @@ -37,4 +37,4 @@ if ($result) { 'title'=>_('Could not delete the entry.').sprintf(' (%s)',pretty_print_dn($request['dn'])), 'body'=>ldap_error_msg($app['server']->getErrorMessage(null),$app['server']->getErrorNum(null)), 'type'=>'error')); -?> + diff --git a/htdocs/delete_attr.php b/htdocs/delete_attr.php index ad323fa..ce12be8 100644 --- a/htdocs/delete_attr.php +++ b/htdocs/delete_attr.php @@ -46,4 +46,4 @@ else { die(); } } -?> + diff --git a/htdocs/delete_form.php b/htdocs/delete_form.php index 3f0d44c..2294ccc 100644 --- a/htdocs/delete_form.php +++ b/htdocs/delete_form.php @@ -154,4 +154,4 @@ if (count($request['children'])) { echo ''; echo '
'; -?> + diff --git a/htdocs/download_binary_attr.php b/htdocs/download_binary_attr.php index 251f2de..d648077 100644 --- a/htdocs/download_binary_attr.php +++ b/htdocs/download_binary_attr.php @@ -46,4 +46,4 @@ header(sprintf('Expires: Mon, 26 Jul 1997 05:00:00 GMT',gmdate('r'))); header(sprintf('Last-Modified: %s',gmdate('r'))); echo $search[$request['attr']][$request['index']]; die(); -?> + diff --git a/htdocs/draw_tree_node.php b/htdocs/draw_tree_node.php index 7311e2d..cc1e47b 100644 --- a/htdocs/draw_tree_node.php +++ b/htdocs/draw_tree_node.php @@ -58,4 +58,4 @@ else $tree->draw($request['noheader']); die(); -?> + diff --git a/htdocs/entry_chooser.php b/htdocs/entry_chooser.php index 16a4eb6..6a24934 100644 --- a/htdocs/entry_chooser.php +++ b/htdocs/entry_chooser.php @@ -126,10 +126,10 @@ echo ''; # Capture the output and put into the body of the page. $www['body'] = new block(); -$www['body']->SetBody(ob_get_contents()); +$www['body']->setBody(ob_get_contents()); $www['page']->block_add('body',$www['body']); ob_end_clean(); # Render the popup. $www['page']->display(array('CONTROL'=>false,'FOOT'=>false,'HEAD'=>false,'TREE'=>false)); -?> + diff --git a/htdocs/expand.php b/htdocs/expand.php index d0647d0..0f3088d 100644 --- a/htdocs/expand.php +++ b/htdocs/expand.php @@ -24,4 +24,4 @@ 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())); die(); -?> + diff --git a/htdocs/export.php b/htdocs/export.php index cc1096b..5e4ab24 100644 --- a/htdocs/export.php +++ b/htdocs/export.php @@ -37,4 +37,4 @@ if ($request['file']) { echo htmlspecialchars($request['export']->export()); print ''; } -?> + diff --git a/htdocs/export_form.php b/htdocs/export_form.php index 326184e..8099109 100644 --- a/htdocs/export_form.php +++ b/htdocs/export_form.php @@ -173,6 +173,8 @@ function get_user_agent_string() { /** * Determine the OS for the browser + * @param $type + * @return bool */ function is_browser($type) { $agents = array(); @@ -210,4 +212,4 @@ function is_browser($type) { else return false; } -?> + diff --git a/htdocs/import.php b/htdocs/import.php index 22d7ee2..2eaade7 100644 --- a/htdocs/import.php +++ b/htdocs/import.php @@ -108,4 +108,4 @@ function display_pla_parse_error($request) { echo ''; echo ''; } -?> + diff --git a/htdocs/import_form.php b/htdocs/import_form.php index 9c6bbbb..9c7ed35 100644 --- a/htdocs/import_form.php +++ b/htdocs/import_form.php @@ -45,4 +45,4 @@ printf(' ',_('Proceed >>')); echo ''; echo ''; -?> + diff --git a/htdocs/index.php b/htdocs/index.php index f72840c..c847e1a 100644 --- a/htdocs/index.php +++ b/htdocs/index.php @@ -145,4 +145,4 @@ if (! preg_match('/^([0-9]+\.?)+/',app_version())) { } include './cmd.php'; -?> + diff --git a/htdocs/login.php b/htdocs/login.php index 48f9e2e..600feca 100644 --- a/htdocs/login.php +++ b/htdocs/login.php @@ -34,4 +34,4 @@ else 'body'=>_('Invalid Username or Password.'), 'type'=>'error'), sprintf('cmd.php?cmd=login_form&server_id=%s',get_request('server_id','REQUEST'))); -?> + diff --git a/htdocs/login_form.php b/htdocs/login_form.php index f16bdbf..6cecf6a 100644 --- a/htdocs/login_form.php +++ b/htdocs/login_form.php @@ -95,4 +95,4 @@ if ($app['server']->getAuthType() == 'http') { if ($app['server']->isAnonBindAllowed()) printf('',JSDIR); } -?> + diff --git a/htdocs/logout.php b/htdocs/logout.php index 3c0e5eb..d6451fa 100644 --- a/htdocs/logout.php +++ b/htdocs/logout.php @@ -26,4 +26,4 @@ if ($app['server']->logout()) { 'body'=>_('Please report this error to the admins.'), 'type'=>'error'), sprintf('index.php?server_id=%s',$app['server']->getIndex())); -?> + diff --git a/htdocs/mass_delete.php b/htdocs/mass_delete.php index 4f91ae4..ff19076 100644 --- a/htdocs/mass_delete.php +++ b/htdocs/mass_delete.php @@ -144,4 +144,4 @@ echo ''; echo ''; echo '
'; -?> + diff --git a/htdocs/mass_edit.php b/htdocs/mass_edit.php index 1ea7001..a66c7f2 100644 --- a/htdocs/mass_edit.php +++ b/htdocs/mass_edit.php @@ -130,4 +130,4 @@ echo '
'; printf('',_('Update Values')); echo ''; echo ''; -?> + diff --git a/htdocs/mass_update.php b/htdocs/mass_update.php index 8a9dd01..b75c398 100644 --- a/htdocs/mass_update.php +++ b/htdocs/mass_update.php @@ -172,4 +172,4 @@ if (count($request['update'])) { echo _('You made no changes'); echo ''; } -?> + diff --git a/htdocs/modify_member_form.php b/htdocs/modify_member_form.php index 208b9ef..6a22f97 100644 --- a/htdocs/modify_member_form.php +++ b/htdocs/modify_member_form.php @@ -175,4 +175,4 @@ echo ''; echo ''; echo ''; printf('',JSDIR); -?> + diff --git a/htdocs/monitor.php b/htdocs/monitor.php index 51ac392..aeb71e7 100644 --- a/htdocs/monitor.php +++ b/htdocs/monitor.php @@ -256,4 +256,4 @@ foreach (array( } echo ''; -?> + diff --git a/htdocs/password_checker.php b/htdocs/password_checker.php index c616e2e..e5f97fa 100644 --- a/htdocs/password_checker.php +++ b/htdocs/password_checker.php @@ -79,10 +79,10 @@ if ($request['componentid']) { # Capture the output and put into the body of the page. $www['body'] = new block(); -$www['body']->SetBody(ob_get_contents()); +$www['body']->setBody(ob_get_contents()); $www['page']->block_add('body',$www['body']); ob_end_clean(); # Render the popup. $www['page']->display(array('CONTROL'=>false,'FOOT'=>false,'HEAD'=>false,'TREE'=>false)); -?> + diff --git a/htdocs/purge_cache.php b/htdocs/purge_cache.php index 339fe73..92bba75 100644 --- a/htdocs/purge_cache.php +++ b/htdocs/purge_cache.php @@ -30,4 +30,4 @@ system_message(array( 'body'=>$body, 'type'=>'info'), get_request('meth','REQUEST') == 'ajax' ? null : 'index.php'); -?> + diff --git a/htdocs/query_engine.php b/htdocs/query_engine.php index a94fedd..a834f50 100644 --- a/htdocs/query_engine.php +++ b/htdocs/query_engine.php @@ -16,4 +16,4 @@ require LIBDIR.'query_functions.php'; $request = array(); $request['page'] = new QueryRender($app['server']->getIndex(),get_request('query','REQUEST',false,null)); $request['page']->accept(); -?> + diff --git a/htdocs/rdelete.php b/htdocs/rdelete.php index bb864a9..ae6624c 100644 --- a/htdocs/rdelete.php +++ b/htdocs/rdelete.php @@ -86,4 +86,4 @@ function pla_rdelete($server,$dn) { } } } -?> + diff --git a/htdocs/refresh.php b/htdocs/refresh.php index 385c4c6..072a62c 100644 --- a/htdocs/refresh.php +++ b/htdocs/refresh.php @@ -43,4 +43,4 @@ else header(sprintf('Location: cmd.php?server_id=%s',$app['server']->getIndex())); die(); -?> + diff --git a/htdocs/rename.php b/htdocs/rename.php index 96c2e33..6af59fb 100644 --- a/htdocs/rename.php +++ b/htdocs/rename.php @@ -61,4 +61,4 @@ if ($success) { 'body'=>ldap_error_msg($app['server']->getErrorMessage(null),$app['server']->getErrorNum(null)), 'type'=>'error')); } -?> + diff --git a/htdocs/rename_form.php b/htdocs/rename_form.php index aebc5fb..1461c0c 100644 --- a/htdocs/rename_form.php +++ b/htdocs/rename_form.php @@ -37,4 +37,4 @@ echo ''; echo ''; echo "\n"; -?> + diff --git a/htdocs/schema.php b/htdocs/schema.php index aa4a749..a54f95c 100644 --- a/htdocs/schema.php +++ b/htdocs/schema.php @@ -637,4 +637,4 @@ function items() { echo ''; } -?> + diff --git a/htdocs/server_info.php b/htdocs/server_info.php index 222b912..0866b2b 100644 --- a/htdocs/server_info.php +++ b/htdocs/server_info.php @@ -86,4 +86,4 @@ foreach ($attrs as $key => $values) { echo ''; } echo ''; -?> + diff --git a/htdocs/template_engine.php b/htdocs/template_engine.php index 1cfaba9..64056f9 100644 --- a/htdocs/template_engine.php +++ b/htdocs/template_engine.php @@ -54,4 +54,4 @@ if ($request['dn']) { $request['page']->setContainer(get_request('container','REQUEST')); $request['page']->accept(); } -?> + diff --git a/htdocs/update.php b/htdocs/update.php index 45762cf..a59b416 100644 --- a/htdocs/update.php +++ b/htdocs/update.php @@ -75,4 +75,4 @@ if ($result) { header("Location: $redirect_url"); die(); } -?> + diff --git a/htdocs/update_confirm.php b/htdocs/update_confirm.php index 037b91d..550d664 100644 --- a/htdocs/update_confirm.php +++ b/htdocs/update_confirm.php @@ -250,4 +250,4 @@ function getMustAttrs($oclasses) { return $mustattrs; } -?> + diff --git a/htdocs/view_jpeg_photo.php b/htdocs/view_jpeg_photo.php index d52501c..2b40b10 100644 --- a/htdocs/view_jpeg_photo.php +++ b/htdocs/view_jpeg_photo.php @@ -74,4 +74,4 @@ header(sprintf('Content-type: %s',$request['type'])); header(sprintf('Content-disposition: inline; filename="%s"',$request['filename'])); echo $jpeg_data[$request['attr']][$request['index']]; die(); -?> + diff --git a/htdocs/welcome.php b/htdocs/welcome.php index e427281..61181ab 100644 --- a/htdocs/welcome.php +++ b/htdocs/welcome.php @@ -26,4 +26,4 @@ if ($_SESSION[APPCONFIG]->isCommandAvailable('cmd','oslinks')) { } echo ''; -?> + diff --git a/lib/AJAXTree.php b/lib/AJAXTree.php index 300a976..523a6c7 100644 --- a/lib/AJAXTree.php +++ b/lib/AJAXTree.php @@ -134,6 +134,8 @@ class AJAXTree extends HTMLTree { /** * Expand and draw a child entry, when it is clicked on. This is using AJAX just to render this section of the tree. + * @param $parent_entry + * @param $code */ public function draw_children($parent_entry,$code) { if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS')) @@ -218,6 +220,9 @@ class AJAXTree extends HTMLTree { /** * Draw the "Create New Entry" item before the children. + * @param $entry + * @param $level + * @return string */ private function create_before_child($entry,$level) { if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS')) @@ -238,6 +243,9 @@ class AJAXTree extends HTMLTree { /** * Draw the "Create New Entry" item after the children. + * @param $entry + * @param $level + * @return string */ private function create_after_child($entry,$level) { if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS')) @@ -257,6 +265,10 @@ class AJAXTree extends HTMLTree { /** * Draw the "Create New Entry" item. + * @param $entry + * @param $level + * @param $img + * @return string */ private function draw_create_new_entry($entry,$level,$img) { if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS')) @@ -304,4 +316,4 @@ class AJAXTree extends HTMLTree { return $result; } } -?> + diff --git a/lib/Attribute.php b/lib/Attribute.php index 9c4ef98..e419727 100644 --- a/lib/Attribute.php +++ b/lib/Attribute.php @@ -168,6 +168,7 @@ class Attribute { /** * Autovalue is called after the attribute is initialised, and thus the values from the ldap server will be set. + * @param $new_val */ public function autoValue($new_val) { if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS')) @@ -870,7 +871,6 @@ class Attribute { * real_attr_name(), you can more easily fetch these attributes' schema * with their "real" attribute name. * - * @param string $attr_name The name of the attribute to examine. * @return string */ private function real_attr_name() { @@ -882,6 +882,8 @@ class Attribute { /** * Does this attribute need supporting JS + * @param null $type + * @return bool */ public function needJS($type=null) { if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS')) @@ -914,4 +916,4 @@ class Attribute { debug_dump_backtrace(sprintf('Unknown JS request %s',$type),1); } } -?> + diff --git a/lib/AttributeFactory.php b/lib/AttributeFactory.php index 82cf562..ff2ecd8 100644 --- a/lib/AttributeFactory.php +++ b/lib/AttributeFactory.php @@ -185,4 +185,4 @@ class AttributeFactory { return new GidAttribute($name,$values,$server_id,$source); } } -?> + diff --git a/lib/BinaryAttribute.php b/lib/BinaryAttribute.php index 6b5053b..81e3df2 100644 --- a/lib/BinaryAttribute.php +++ b/lib/BinaryAttribute.php @@ -57,4 +57,4 @@ class BinaryAttribute extends Attribute { } } } -?> + diff --git a/lib/DateAttribute.php b/lib/DateAttribute.php index e1a687f..633f675 100644 --- a/lib/DateAttribute.php +++ b/lib/DateAttribute.php @@ -14,4 +14,4 @@ */ class DateAttribute extends Attribute { } -?> + diff --git a/lib/DnAttribute.php b/lib/DnAttribute.php index 1f5c02f..eb19579 100644 --- a/lib/DnAttribute.php +++ b/lib/DnAttribute.php @@ -14,4 +14,4 @@ */ class DnAttribute extends Attribute { } -?> + diff --git a/lib/GidAttribute.php b/lib/GidAttribute.php index 7442a07..bb807bc 100644 --- a/lib/GidAttribute.php +++ b/lib/GidAttribute.php @@ -14,4 +14,4 @@ */ class GidAttribute extends Attribute { } -?> + diff --git a/lib/HTMLTree.php b/lib/HTMLTree.php index 90861cb..35ede20 100644 --- a/lib/HTMLTree.php +++ b/lib/HTMLTree.php @@ -202,6 +202,8 @@ class HTMLTree extends Tree { /** * Get the HTML for each tree menu option + * @param $item + * @return bool|string */ protected function get_menu_item($item) { if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS')) @@ -394,7 +396,7 @@ class HTMLTree extends Tree { /** * Recursively descend on the given dn and draw the tree in html * - * @param dn $dn Current dn. + * @param $item * @param int $level Level to start drawing (start to -1) */ protected function draw_item($item,$level) { @@ -584,4 +586,4 @@ class HTMLTree extends Tree { return $depths[$server->getIndex()]; } } -?> + diff --git a/lib/JpegAttribute.php b/lib/JpegAttribute.php index d440048..551804c 100644 --- a/lib/JpegAttribute.php +++ b/lib/JpegAttribute.php @@ -14,4 +14,4 @@ */ class JpegAttribute extends BinaryAttribute { } -?> + diff --git a/lib/MassRender.php b/lib/MassRender.php index f0bf67e..dbc3f9a 100644 --- a/lib/MassRender.php +++ b/lib/MassRender.php @@ -45,4 +45,4 @@ class MassRender extends TemplateRender { $this->drawFormReadOnlyValueJpegAttribute($attribute,$i); } } -?> + diff --git a/lib/MultiLineAttribute.php b/lib/MultiLineAttribute.php index b6d0eb5..a1eb74c 100644 --- a/lib/MultiLineAttribute.php +++ b/lib/MultiLineAttribute.php @@ -32,4 +32,4 @@ class MultiLineAttribute extends Attribute { $this->cols = $cols; } } -?> + diff --git a/lib/ObjectClassAttribute.php b/lib/ObjectClassAttribute.php index 939094d..98d67d6 100644 --- a/lib/ObjectClassAttribute.php +++ b/lib/ObjectClassAttribute.php @@ -14,4 +14,4 @@ */ class ObjectClassAttribute extends Attribute { } -?> + diff --git a/lib/PageRender.php b/lib/PageRender.php index 5f9097b..ac7381c 100644 --- a/lib/PageRender.php +++ b/lib/PageRender.php @@ -150,6 +150,8 @@ class PageRender extends Visitor { /** * Process our arguments from the templates + * @param $attribute + * @param $i */ protected function getPostAttribute($attribute,$i) { if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS')) @@ -371,7 +373,9 @@ class PageRender extends Visitor { return null; } - /** DRAW ATTRIBUTE NAME **/ + /** DRAW ATTRIBUTE NAME * + * @param $attribute + */ final protected function drawNameAttribute($attribute) { if (DEBUGTMP) printf('%s
',__METHOD__); @@ -392,7 +396,9 @@ class PageRender extends Visitor { if (DEBUGTMPSUB) printf(' [%s]',get_class($attribute)); } - /** ATTRIBUTE NOTES */ + /** ATTRIBUTE NOTES + * @param $attribute + */ protected function drawNotesAttribute($attribute) { if (DEBUGTMP) printf('%s
',__METHOD__); @@ -534,6 +540,8 @@ class PageRender extends Visitor { /** * Draw specific hidden attribute + * @param $attribute + * @param $i */ final protected function drawHiddenValueAttribute($attribute,$i) { if (DEBUGTMP) printf('%s
',__METHOD__); @@ -545,7 +553,9 @@ class PageRender extends Visitor { htmlspecialchars($val)); } - /** DRAW DISPLAYED OLD VALUES **/ + /** DRAW DISPLAYED OLD VALUES * + * @param $attribute + */ protected function drawOldValuesAttribute($attribute) { if (DEBUGTMP) printf('%s
',__METHOD__); @@ -559,7 +569,9 @@ class PageRender extends Visitor { echo $attribute->getOldValue($i); } - /** DRAW DISPLAYED CURRENT VALUES **/ + /** DRAW DISPLAYED CURRENT VALUES * + * @param $attribute + */ protected function drawCurrentValuesAttribute($attribute) { if (DEBUGTMP) printf('%s
',__METHOD__); @@ -574,6 +586,8 @@ class PageRender extends Visitor { /** * Draw the current specific value of an attribute + * @param $attribute + * @param $i */ final protected function drawCurrentValueAttribute($attribute,$i) { if (DEBUGTMP) printf('%s
',__METHOD__); @@ -584,6 +598,8 @@ class PageRender extends Visitor { /** * Draw a input value for an attribute - used in a form. + * @param $attribute + * @param $i */ protected function drawFormValueAttribute($attribute,$i) { if (DEBUGTMP) printf('%s
',__METHOD__); @@ -656,6 +672,8 @@ class PageRender extends Visitor { /** * Draw specific hidden binary attribute + * @param $attribute + * @param $i */ final protected function drawHiddenValueBinaryAttribute($attribute,$i) { if (DEBUGTMP) printf('%s
',__METHOD__); @@ -818,6 +836,8 @@ class PageRender extends Visitor { /** * Draw a Jpeg Attribute + * @param $attribute + * @param $i */ final protected function drawOldValueJpegAttribute($attribute,$i) { if (DEBUGTMP) printf('%s
',__METHOD__); @@ -832,6 +852,8 @@ class PageRender extends Visitor { /** * Draw a Jpeg Attribute + * @param $attribute + * @param $i */ final protected function drawCurrentValueJpegAttribute($attribute,$i) { if (DEBUGTMP) printf('%s
',__METHOD__); @@ -1241,4 +1263,4 @@ class PageRender extends Visitor { $this->draw('ShadowDate',$attribute); } } -?> + diff --git a/lib/PasswordAttribute.php b/lib/PasswordAttribute.php index 2667197..122ac2d 100644 --- a/lib/PasswordAttribute.php +++ b/lib/PasswordAttribute.php @@ -14,4 +14,4 @@ */ class PasswordAttribute extends Attribute { } -?> + diff --git a/lib/Query.php b/lib/Query.php index 62a3d2b..a609f0a 100644 --- a/lib/Query.php +++ b/lib/Query.php @@ -177,6 +177,7 @@ class Query extends xmlTemplate { /** * This is temporary to get around objects that use a DN for rendering, for example jpegPhoto + * @param $dn */ public function setDN($dn) { if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS')) @@ -280,4 +281,4 @@ class Query extends xmlTemplate { return $this->description; } } -?> + diff --git a/lib/QueryRender.php b/lib/QueryRender.php index 16660bc..9ebaf27 100644 --- a/lib/QueryRender.php +++ b/lib/QueryRender.php @@ -224,7 +224,7 @@ class QueryRender extends PageRender { debug_log('Entered (%%)',129,0,__FILE__,__LINE__,__METHOD__,$fargs); $server = $this->getServer(); - $afattrs = $this->getAFAttrs(); + $afattrs = $this->getAFattrs(); # If Mass Actions Enabled if ($_SESSION[APPCONFIG]->getValue('mass','enabled')) { @@ -554,4 +554,4 @@ class QueryRender extends PageRender { echo ''; } } -?> + diff --git a/lib/RandomPasswordAttribute.php b/lib/RandomPasswordAttribute.php index ca11f8d..c9d92b3 100644 --- a/lib/RandomPasswordAttribute.php +++ b/lib/RandomPasswordAttribute.php @@ -14,4 +14,4 @@ */ class RandomPasswordAttribute extends PasswordAttribute { } -?> + diff --git a/lib/SambaPasswordAttribute.php b/lib/SambaPasswordAttribute.php index 35c1a08..fe4d6b2 100644 --- a/lib/SambaPasswordAttribute.php +++ b/lib/SambaPasswordAttribute.php @@ -14,4 +14,4 @@ */ class SambaPasswordAttribute extends PasswordAttribute { } -?> + diff --git a/lib/SelectionAttribute.php b/lib/SelectionAttribute.php index 5f1c8bb..d3df9b8 100644 --- a/lib/SelectionAttribute.php +++ b/lib/SelectionAttribute.php @@ -68,4 +68,4 @@ class SelectionAttribute extends Attribute { $this->multiple = true; } } -?> + diff --git a/lib/ShadowAttribute.php b/lib/ShadowAttribute.php index eeb7cd1..1921d6a 100644 --- a/lib/ShadowAttribute.php +++ b/lib/ShadowAttribute.php @@ -16,4 +16,4 @@ class ShadowAttribute extends Attribute { public $shadow_before_today_attrs = array('shadowLastChange','shadowMin'); public $shadow_after_today_attrs = array('shadowMax','shadowExpire','shadowWarning','shadowInactive'); } -?> + diff --git a/lib/Template.php b/lib/Template.php index a9f7a17..625383e 100644 --- a/lib/Template.php +++ b/lib/Template.php @@ -239,7 +239,7 @@ class Template extends xmlTemplate { /** * Return the templates of type (creation/modification) * - * @param $string type - creation/modification + * @param $type * @return array - Array of templates of that type */ protected function readTemplates($type) { @@ -257,6 +257,8 @@ class Template extends xmlTemplate { * After this action, the template should self describe as to whether it is an update, create * or delete. * (OLD values are IGNORED, we will have got them when we build this object from the LDAP server DN.) + * @param bool $makeVisible + * @param bool $nocache */ public function accept($makeVisible=false,$nocache=false) { if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS')) @@ -589,7 +591,7 @@ class Template extends xmlTemplate { * then the remaining RDNs will be returned. * * @param RDN - * @return RDN attributes not processed + * @return array attributes not processed */ public function setRDNAttributes($rdn) { if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS')) @@ -627,7 +629,7 @@ class Template extends xmlTemplate { # If DN is not set, our DN will be made from our RDN and Container. elseif ($this->getRDN() && $this->getContainer()) - return sprintf('%s,%s',$this->getRDN(),$this->GetContainer()); + return sprintf('%s,%s',$this->getRDN(),$this->getContainer()); # If container is not set, we're probably creating the base elseif ($this->getRDN() && get_request('create_base')) @@ -683,6 +685,9 @@ class Template extends xmlTemplate { /** * Copy a DN + * @param $template + * @param $rdn + * @param bool $asnew */ public function copy($template,$rdn,$asnew=false) { if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS')) @@ -752,9 +757,10 @@ class Template extends xmlTemplate { * Get Attributes by LDAP type * This function will return a list of attributes by LDAP type (MUST,MAY). * + * @param $type * @return array Array of attributes. */ - function getAttrbyLdapType($type) { + public function getAttrbyLdapType($type) { if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS')) debug_log('Entered (%%)',5,0,__FILE__,__LINE__,__METHOD__,$fargs); @@ -770,8 +776,11 @@ class Template extends xmlTemplate { /** * Return true if this is a MUST,MAY attribute + * @param $attr + * @param $type + * @return bool */ - function isAttrType($attr,$type) { + public function isAttrType($attr, $type) { if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS')) debug_log('Entered (%%)',5,0,__FILE__,__LINE__,__METHOD__,$fargs); @@ -1039,6 +1048,7 @@ class Template extends xmlTemplate { * Set a template as invalid * * @param string Message indicating the reason the template has been invalidated + * @param bool $admin */ public function setInvalid($msg,$admin=false) { if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS')) @@ -1107,6 +1117,8 @@ class Template extends xmlTemplate { /** * OnChangeAdd javascript processing + * @param $origin + * @param $value */ public function OnChangeAdd($origin,$value) { if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS')) @@ -1220,13 +1232,13 @@ class Template extends xmlTemplate { $attribute->js['autoFill'] .= sprintf(" %s = %s.split(':')[%s];\n",$match_attr,$match_attr,$tok_idx); } elseif (strstr($match_mod,'K')) { - preg_match_all('/([0-9]+)/',trim($match_subst),$substrarray); - if (isset($substrarray[1][0])) { - $tok_idx = $substrarray[1][0]; - } else { - $tok_idx = '0'; - } - $attribute->js['autoFill'] .= sprintf(" %s = %s.split(' ')[%s];\n",$match_attr,$match_attr,$tok_idx); + preg_match_all('/([0-9]+)/',trim($match_subst),$substrarray); + if (isset($substrarray[1][0])) { + $tok_idx = $substrarray[1][0]; + } else { + $tok_idx = '0'; + } + $attribute->js['autoFill'] .= sprintf(" %s = %s.split(' ')[%s];\n",$match_attr,$match_attr,$tok_idx); } else { preg_match_all('/([0-9]*)-([0-9]*)/',trim($match_subst),$substrarray); @@ -1388,6 +1400,8 @@ class Template extends xmlTemplate { /** * Return an array, that can be passed to ldap_add(). * Attributes with empty values will be excluded. + * @param bool $attrsOnly + * @return array */ public function getLDAPadd($attrsOnly=false) { if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS')) @@ -1423,6 +1437,8 @@ class Template extends xmlTemplate { * if there are changes, and if they are, the 2nd call will just return the results * * @param boolean Return the attribute objects (useful for a confirmation process), or the modification array for ldap_modify() + * @param int $index + * @return mixed */ public function getLDAPmodify($attrsOnly=false,$index=0) { if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS')) @@ -1568,4 +1584,4 @@ class Template extends xmlTemplate { usort($this->attributes,'sortAttrs'); } } -?> + diff --git a/lib/TemplateRender.php b/lib/TemplateRender.php index f761b86..90883e3 100644 --- a/lib/TemplateRender.php +++ b/lib/TemplateRender.php @@ -20,6 +20,7 @@ class TemplateRender extends PageRender { /** * Initialise and Render the TemplateRender + * @param bool $norender */ public function accept($norender=false) { if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS')) @@ -840,7 +841,10 @@ class TemplateRender extends PageRender { } } - /** PAGE ENTRY MENU ITEMS **/ + /** PAGE ENTRY MENU ITEMS * + * @param $i + * @return array|bool + */ private function getMenuItem($i) { if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS')) @@ -1302,6 +1306,7 @@ class TemplateRender extends PageRender { /** * Container Chooser + * @param $default_container */ protected function drawContainerChooser($default_container) { if (DEBUGTMP) printf('%s
',__METHOD__); @@ -1449,7 +1454,9 @@ class TemplateRender extends PageRender { _('Update Object')); } - /** STEP FORM METHODS **/ + /** STEP FORM METHODS * + * @param $page + */ private function drawStepTitle($page) { if (DEBUGTMP) printf('%s
',__METHOD__); @@ -1757,7 +1764,9 @@ function fillRec(id,value) { echo "\n"; } - /** ATTRIBUTE TITLE **/ + /** ATTRIBUTE TITLE * + * @param $attribute + */ protected function drawTitleAttribute($attribute) { if (DEBUGTMP) printf('%s
',__METHOD__); @@ -1782,7 +1791,9 @@ function fillRec(id,value) { echo ''; } - /** ATTRIBUTE LINE **/ + /** ATTRIBUTE LINE * + * @param $attribute + */ protected function drawStartValueLineAttribute($attribute) { if (DEBUGTMP) printf('%s
',__METHOD__); @@ -1845,7 +1856,10 @@ function fillRec(id,value) { echo "\n"; } - /** DRAW ICONS FOR ATTRIBUTES VALUES **/ + /** DRAW ICONS FOR ATTRIBUTES VALUES * + * @param $attribute + * @param $val + */ protected function drawIconAttribute($attribute,$val) { if (DEBUGTMP) printf('%s
',__METHOD__); @@ -1901,7 +1915,9 @@ function fillRec(id,value) { /** DEFAULT ATTRIBUTE RENDERING **/ - /** javacript */ + /** javacript + * @param $attribute + */ protected function drawJavascriptAttribute($attribute) { if (! $attribute->needJS()) { @@ -2004,7 +2020,9 @@ function fillRec(id,value) { echo '}'; } - /** ATTRIBUTE MENU **/ + /** ATTRIBUTE MENU * + * @param $attribute + */ protected function drawMenuAttribute($attribute) { if (DEBUGTMP) printf('%s
',__METHOD__); @@ -2135,7 +2153,10 @@ function fillRec(id,value) { return sprintf('(%s)',htmlspecialchars($href),_('rename')); } - /** values **/ + /** values * + * @param $attribute + * @param $i + */ protected function drawValueAttribute($attribute,$i) { if (DEBUGTMP) printf('%s
',__METHOD__); @@ -2263,7 +2284,9 @@ function fillRec(id,value) { echo '*'; } - /** BINARY ATTRIBUTE RENDERING **/ + /** BINARY ATTRIBUTE RENDERING * + * @param $attribute + */ #@todo do we need a $this->drawJavascriptAttribute($attribute) here too ? protected function drawJavascriptBinaryAttribute($attribute) { @@ -2308,7 +2331,9 @@ function deleteAttribute(attrName,friendlyName,i) echo "\n"; } - /** DATE ATTRIBUTE RENDERING **/ + /** DATE ATTRIBUTE RENDERING * + * @param $attribute + */ protected function drawJavaScriptDateAttribute($attribute) { if (DEBUGTMP) printf('%s
',__METHOD__); @@ -2316,7 +2341,7 @@ function deleteAttribute(attrName,friendlyName,i) printf('',__METHOD__,$attribute->getName()); echo "\n"; - $this->drawJavaScriptAttribute($attribute); + $this->drawJavascriptAttribute($attribute); static $drawn = false; @@ -2352,13 +2377,18 @@ function deleteAttribute(attrName,friendlyName,i) /** * Draws an HTML date selector button which, when clicked, pops up a date selector dialog. + * @param $attribute + * @param $i */ protected function drawSelectorPopupDateAttribute($attribute,$i) { printf('Calendar', $attribute->getName(),$i,_('Click to popup a dialog to select a date graphically'),IMGDIR,$attribute->getName(),$i); } - /** DN ATTRIBUTES **/ + /** DN ATTRIBUTES * + * @param $attribute + * @param $val + */ protected function drawIconDnAttribute($attribute,$val) { if (DEBUGTMP) printf('%s
',__METHOD__); @@ -2366,7 +2396,10 @@ function deleteAttribute(attrName,friendlyName,i) $this->draw('DnValueIcon',$attribute,$val); } - /** OBJECT CLASS ATTRIBUTE **/ + /** OBJECT CLASS ATTRIBUTE * + * @param $attribute + * @param $val + */ protected function drawIconObjectClassAttribute($attribute,$val) { if (DEBUGTMP) printf('%s
',__METHOD__); @@ -2382,7 +2415,9 @@ function deleteAttribute(attrName,friendlyName,i) } } - /** PASSWORD ATTRIBUTES **/ + /** PASSWORD ATTRIBUTES * + * @param $attribute + */ protected function drawJavascriptPasswordAttribute($attribute) { static $drawn = array(); @@ -2426,6 +2461,7 @@ function deleteAttribute(attrName,friendlyName,i) * This will draw the javascript that displays to the user the random password generated * * @todo This function doesnt work well if there are more than 1 RandomPasswordAttributes on the form for the same attribute (unlikely situation) + * @param $attribute */ protected function drawJavascriptRandomPasswordAttribute($attribute) { if (DEBUGTMP) printf('%s
',__METHOD__); @@ -2500,7 +2536,10 @@ function deleteAttribute(attrName,friendlyName,i) $id,htmlspecialchars($attribute->getName()),$i,$enc); } - /** SELECTION ATTRIBUTE RENDERING **/ + /** SELECTION ATTRIBUTE RENDERING * + * @param $attribute + * @param $val + */ protected function drawIconSelectionAttribute($attribute,$val) { if (DEBUGTMP) printf('%s
',__METHOD__); @@ -2530,4 +2569,4 @@ function deleteAttribute(attrName,friendlyName,i) } } } -?> + diff --git a/lib/Tree.php b/lib/Tree.php index e7542fc..648688f 100644 --- a/lib/Tree.php +++ b/lib/Tree.php @@ -36,6 +36,7 @@ abstract class Tree { * Create an instance of the tree - this is used when we call this class directly * Tree::getInstance($index) * + * @param $server_id * @return object Tree */ static public function getInstance($server_id) { @@ -162,7 +163,6 @@ abstract class Tree { * Add an entry in the tree view ; the entry is added in the * children array of its parent * - * @param dn DN to add * @param string $dn the dn of the entry to create */ public function addEntry($dn) { @@ -348,4 +348,4 @@ abstract class Tree { return count($this->entries[$dnlower]->getChildren()); } } -?> + diff --git a/lib/TreeItem.php b/lib/TreeItem.php index 8c95ad8..12f44b3 100644 --- a/lib/TreeItem.php +++ b/lib/TreeItem.php @@ -71,7 +71,7 @@ class TreeItem { if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS')) debug_log('Entered (%%)',33,0,__FILE__,__LINE__,__METHOD__,$fargs); - return get_rdn($this->getDn(),0,true); + return get_rdn($this->getDN(),0,true); } /** @@ -309,4 +309,4 @@ class TreeItem { return $this->template; } } -?> + diff --git a/lib/Visitor.php b/lib/Visitor.php index fca5099..3e98dbf 100644 --- a/lib/Visitor.php +++ b/lib/Visitor.php @@ -96,4 +96,4 @@ abstract class Visitor { return $_SESSION[APPCONFIG]->getServer($this->getServerID()); } } -?> + diff --git a/lib/blowfish.php b/lib/blowfish.php index 1c69aa9..2cdee47 100644 --- a/lib/blowfish.php +++ b/lib/blowfish.php @@ -297,7 +297,7 @@ class Horde_Cipher_blowfish { public $_rounds = 16; /* Constructor */ - function Cipher_blowfish($params = null) + public function Cipher_blowfish($params = null) { } @@ -306,7 +306,7 @@ class Horde_Cipher_blowfish { * * @param String $key The key to use */ - function setKey($key) + public function setKey($key) { $key = $this->_formatKey($key); $keyPos = $keyXor = 0; @@ -365,7 +365,7 @@ class Horde_Cipher_blowfish { * * @return Integer The number of characters per block */ - function getBlockSize() + public function getBlockSize() { return 8; } @@ -378,7 +378,7 @@ class Horde_Cipher_blowfish { * * @return String the encrypted output */ - function encryptBlock($block, $key = null) + public function encryptBlock($block, $key = null) { if (!is_null($key)) { $this->setKey($key); @@ -389,15 +389,15 @@ class Horde_Cipher_blowfish { return pack("NN", $parts['L'], $parts['R']); } - /** - * Encrypt a block on data. - * - * @param String $L The data to encrypt. - * @param String $R The data to encrypt. - * - * @return String The encrypted output. - */ - function _encryptBlock($L, $R) + /** + * Encrypt a block on data. + * + * @param String $L The data to encrypt. + * @param String $R The data to encrypt. + * + * @return array The encrypted output. + */ + public function _encryptBlock($L, $R) { $L ^= $this->p[0]; $R ^= ((($this->s1[($L >> 24) & 0xFF] + $this->s2[($L >> 16) & 0x0ff]) ^ $this->s3[($L >> 8) & 0x0ff]) + $this->s4[$L & 0x0ff]) ^ $this->p[1]; @@ -429,7 +429,7 @@ class Horde_Cipher_blowfish { * * @return String the decrypted output */ - function decryptBlock($block, $key = null) + public function decryptBlock($block, $key = null) { if (!is_null($key)) { $this->setKey($key); @@ -466,15 +466,16 @@ class Horde_Cipher_blowfish { return $decrypted; } - /** - * Converts a text key into an array. - * - * @return array The key. - */ - function _formatKey($key) + /** + * Converts a text key into an array. + * + * @param $key + * @return array The key. + */ + public function _formatKey($key) { return array_values(unpack('C*', $key)); } } -?> + diff --git a/lib/config_default.php b/lib/config_default.php index b0c05ca..ca837b0 100644 --- a/lib/config_default.php +++ b/lib/config_default.php @@ -214,14 +214,14 @@ class Config { 'default'=>'AJAXTree'); /** Tree display - * An array of format strings used to display enties in the - * tree viewer (left-hand side). The first format string that - * is completely defined (i.e., does not reference attributes - * that are not defined the object). If there is no format - * string that is completely defined, the last one is used. - * - * You can use special tokens to draw the entries as you wish. - * You can even mix in HTML to format the string. + * An array of format strings used to display enties in the + * tree viewer (left-hand side). The first format string that + * is completely defined (i.e., does not reference attributes + * that are not defined the object). If there is no format + * string that is completely defined, the last one is used. + * + * You can use special tokens to draw the entries as you wish. + * You can even mix in HTML to format the string. * Here are all the tokens you can use: * %rdn - draw the RDN of the entry (ie, "cn=Dave") * %dn - draw the DN of the entry (ie, "cn=Dave,ou=People,dc=example,dc=com" @@ -578,6 +578,8 @@ class Config { /** * Access the configuration, taking into account the defaults and the customisations + * @param bool $usecache + * @return array */ private function getConfigArray($usecache=true) { static $CACHE = array(); @@ -597,6 +599,10 @@ class Config { /** * Get a configuration value. + * @param $key + * @param $index + * @param bool $fatal + * @return string */ public function getValue($key,$index,$fatal=true) { $config = $this->getConfigArray(); @@ -685,6 +691,8 @@ class Config { /** * Simple ACL to see if commands can be run + * @param string $index + * @return bool */ public function isCommandAvailable($index='cmd') { if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS')) @@ -805,4 +813,4 @@ class Config { return $this->servers->getServerList($visible); } } -?> + diff --git a/lib/createlm.php b/lib/createlm.php index 3dc4bb1..e0b1872 100644 --- a/lib/createlm.php +++ b/lib/createlm.php @@ -133,8 +133,10 @@ private $sbox = array(array(array(14, 4, 13, 1, 2, 15, 11, 8, 3, 10, 6, 12 array( 2, 1, 14, 7, 4, 10, 8, 13, 15, 12, 9, 0, 3, 5, 6, 11))); /** - * Fixes too large numbers - */ + * Fixes too large numbers + * @param $i + * @return int + */ private function x($i) { if ($i < 0) return 4294967296 - $i; else return $i; @@ -154,10 +156,11 @@ private $sbox = array(array(array(14, 4, 13, 1, 2, 15, 11, 8, 3, 10, 6, 12 } /** - * @param array in input data - * @param array p permutation - * @return array - */ + * @param $in + * @param $p + * @param $n + * @return array + */ private function permute($in, $p, $n) { $ret = array(); for ($i = 0; $i < $n; $i++) { @@ -185,41 +188,41 @@ private $sbox = array(array(array(14, 4, 13, 1, 2, 15, 11, 8, 3, 10, 6, 12 * @param boolean $forw * @return array */ - function doHash($in, $key, $forw) { + public function doHash($in, $key, $forw) { $ki = array(); - + $pk1 = $this->permute($key, $this->perm1, 56); - + $c = array(); $d = array(); for ($i = 0; $i < 28; $i++) { $c[$i] = $pk1[$i]; $d[$i] = $pk1[28 + $i]; } - + for ($i = 0; $i < 16; $i++) { $c = $this->lshift($this->sc[$i], $c); $d = $this->lshift($this->sc[$i], $d); - + $cd = $c; for ($k = 0; $k < sizeof($d); $k++) $cd[] = $d[$k]; $ki[$i] = $this->permute($cd, $this->perm2, 48); } - + $pd1 = $this->permute($in, $this->perm3, 64); - + $l = array(); $r = array(); for ($i = 0; $i < 32; $i++) { $l[$i] = $pd1[$i]; $r[$i] = $pd1[32 + $i]; } - + for ($i = 0; $i < 16; $i++) { $er = $this->permute($r, $this->perm4, 48); if ($forw) $erk = $this->mxor($er, $ki[$i]); else $erk = $this->mxor($er, $ki[15 - $i]); - + for ($j = 0; $j < 8; $j++) { for ($k = 0; $k < 6; $k++) { $b[$j][$k] = $erk[($j * 6) + $k]; @@ -230,12 +233,12 @@ private $sbox = array(array(array(14, 4, 13, 1, 2, 15, 11, 8, 3, 10, 6, 12 $n = array(); $m = ($b[$j][0] << 1) | $b[$j][5]; $n = ($b[$j][1] << 3) | ($b[$j][2] << 2) | ($b[$j][3] << 1) | $b[$j][4]; - + for ($k = 0; $k < 4; $k++) { $b[$j][$k]=($this->sbox[$j][$m][$n] & (1 << (3-$k)))?1:0; } } - + for ($j = 0; $j < 8; $j++) { for ($k = 0; $k < 4; $k++) { $cb[($j * 4) + $k] = $b[$j][$k]; @@ -282,7 +285,7 @@ private $sbox = array(array(array(14, 4, 13, 1, 2, 15, 11, 8, 3, 10, 6, 12 */ private function smb_hash($in, $key, $forw){ $key2 = $this->str_to_key($key); - + for ($i = 0; $i < 64; $i++) { $inb[$i] = ($in[$i/8] & (1<<(7-($i%8)))) ? 1:0; $keyb[$i] = ($key2[$i/8] & (1<<(7-($i%8)))) ? 1:0; @@ -358,24 +361,27 @@ private $sbox = array(array(array(14, 4, 13, 1, 2, 15, 11, 8, 3, 10, 6, 12 } /** - * Unsigned shift operation for 32bit values. - * - * PHP 4 only supports signed shifts by default. - */ - private function unsigned_shift_r($a, $b) { - $z = 0x80000000; - if ($z & $a) { - $a = ($a >> 1); - $a &= (~$z); - $a |= 0x40000000; - $a = ($a >> ($b - 1)); - } - else { - $a = ($a >> $b); - } - return $a; - } + * Unsigned shift operation for 32bit values. + * + * PHP 4 only supports signed shifts by default. + * @param $a + * @param $b + * @return bool|int + */ + private function unsigned_shift_r($a, $b) { + $z = 0x80000000; + if ($z & $a) { + $a = ($a >> 1); + $a &= (~$z); + $a |= 0x40000000; + $a = ($a >> ($b - 1)); + } + else { + $a = ($a >> $b); + } + return $a; + } } -?> + diff --git a/lib/ds.php b/lib/ds.php index e7f4589..c046ae8 100644 --- a/lib/ds.php +++ b/lib/ds.php @@ -21,10 +21,12 @@ abstract class DS { protected $custom; protected $type; - abstract function __construct($index); + abstract public function __construct($index); /** * This will make the connection to the datasource + * @param $method + * @param bool $debug */ abstract protected function connect($method,$debug=false); @@ -33,11 +35,18 @@ abstract class DS { * method: default = anon, connect to ds using bind_id not auth_id. * method: 'user', connect with auth_id * method: '', any custom extra connection to ds. + * @param null $user + * @param null $pass + * @param null $method */ abstract public function login($user=null,$pass=null,$method=null); /** * Query the datasource + * @param $query + * @param $method + * @param null $index + * @param bool $debug */ abstract public function query($query,$method,$index=null,$debug=false); @@ -49,6 +58,7 @@ abstract class DS { /** * Functions that set and verify object configuration details + * @param $defaults */ public function setDefaults($defaults) { foreach ($defaults as $key => $details) @@ -66,6 +76,10 @@ abstract class DS { /** * Return a configuration value + * @param $key + * @param $setting + * @param bool $fatal + * @return |null |null |null */ public function getValue($key,$setting,$fatal=true) { if (defined('DEBUG_ENABLED') && DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS')) @@ -86,6 +100,9 @@ abstract class DS { /** * Set a configuration value + * @param $key + * @param $setting + * @param $value */ public function setValue($key,$setting,$value) { if (isset($this->custom->{$key}[$setting])) @@ -151,6 +168,8 @@ abstract class DS { * Get the login name of the user logged into this datastore's connection method * If this returns null, we are not logged in. * If this returns '', we are logged in with anonymous + * @param null $method + * @return string|null */ public function getLogin($method=null) { if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS')) @@ -201,6 +220,10 @@ abstract class DS { /** * Set the login details of the user logged into this datastore's connection method + * @param $user + * @param $pass + * @param null $method + * @return bool */ protected function setLogin($user,$pass,$method=null) { if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS')) @@ -236,6 +259,8 @@ abstract class DS { /** * Get the login password of the user logged into this datastore's connection method + * @param null $method + * @return string|null */ protected function getPassword($method=null) { if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS')) @@ -281,6 +306,8 @@ abstract class DS { /** * Return if this datastore's connection method has been logged into + * @param null $method + * @return mixed */ public function isLoggedIn($method=null) { if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS')) @@ -385,6 +412,8 @@ abstract class DS { /** * Logout of this datastore's connection method + * @param null $method + * @return bool */ public function logout($method=null) { if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS')) @@ -443,7 +472,7 @@ abstract class DS { return $this->index; } - /** + /** * Work out which connection method to use. * If a method is passed, then it will be passed back. If no method is passed, then we'll * check to see if the user is logged in. If they are, then 'user' is used, otherwise @@ -600,6 +629,8 @@ class Datastore { /** * Create a new database object + * @param $type + * @return int */ public function newServer($type) { if (class_exists($type)) { @@ -617,6 +648,9 @@ class Datastore { /** * Set values for a database object. + * @param $key + * @param $setting + * @param $value */ public function setValue($key,$setting,$value) { if (! $this->objects[$this->index]->isDefaultKey($key)) @@ -681,7 +715,7 @@ class Datastore { # If no index defined, then pick the lowest one. if (is_null($index) || ! trim($index) || ! is_numeric($index)) - $index = min($this->GetServerList())->getIndex(); + $index = min($this->getServerList())->getIndex(); if (! isset($this->objects[$index])) debug_dump_backtrace(sprintf('Error: Datastore instance [%s] doesnt exist?',htmlspecialchars($index)),1); @@ -728,4 +762,4 @@ class Datastore { return null; } } -?> + diff --git a/lib/ds_ldap.php b/lib/ds_ldap.php index c3d4267..d1131d7 100644 --- a/lib/ds_ldap.php +++ b/lib/ds_ldap.php @@ -117,6 +117,8 @@ class ldap extends DS { * Connect and Bind to the Database * * @param string Which connection method resource to use + * @param bool $debug + * @param bool $new * @return resource|null Connection resource if successful, null if not. */ protected function connect($method,$debug=false,$new=false) { @@ -235,6 +237,10 @@ class ldap extends DS { /** * Login to the database with the application user/password * + * @param null $user + * @param null $pass + * @param null $method + * @param bool $new * @return boolean true|false for successful login. */ public function login($user=null,$pass=null,$method=null,$new=false) { @@ -459,7 +465,9 @@ class ldap extends DS { /** * Get a user ID * - * @param string Which connection method resource to use + * @param $user + * @param null $method + * @return |null */ public function getLoginID($user,$method=null) { if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS')) @@ -548,6 +556,8 @@ class ldap extends DS { /** * If TLS is configured, then start it + * @param $resource + * @return bool */ private function startTLS($resource) { if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS')) @@ -597,6 +607,9 @@ class ldap extends DS { * To be able to use SASL, PHP should have been compliled with --with-ldap-sasl=DIR * * @todo This has not been tested, please let the developers know if this function works as expected. + * @param $resource + * @param $method + * @return bool */ private function startSASL($resource,$method) { if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS')) @@ -681,6 +694,9 @@ class ldap extends DS { /** * If PROXY AUTH is configured, then start it + * @param $resource + * @param $method + * @return bool */ private function startProxy($resource,$method) { if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS')) @@ -770,6 +786,10 @@ class ldap extends DS { /** * Modify attributes of a DN + * @param $dn + * @param $attrs + * @param null $method + * @return bool */ public function modify($dn,$attrs,$method=null) { if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS')) @@ -962,32 +982,31 @@ class ldap extends DS { * child entries one level beneath the parent. For example, for the following tree: * * - * dc=example,dc=com - * ou=People - * cn=Dave - * cn=Fred - * cn=Joe - * ou=More People - * cn=Mark - * cn=Bob + * dc=example,dc=com + * ou=People + * cn=Dave + * cn=Fred + * cn=Joe + * ou=More People + * cn=Mark + * cn=Bob * * * Calling getContainerContents("ou=people,dc=example,dc=com") * would return the following list: * * - * cn=Dave - * cn=Fred - * cn=Joe - * ou=More People + * cn=Dave + * cn=Fred + * cn=Joe + * ou=More People * * - * @param string The DN of the entry whose children to return. - * @param string Which connection method resource to use - * @param int (optional) The maximum number of entries to return. - * If unspecified, no limit is applied to the number of entries in the returned. - * @param string (optional) An LDAP filter to apply when fetching children, example: "(objectClass=inetOrgPerson)" - * @param constant (optional) The LDAP deref setting to use in the query + * @param $dn + * @param null $method + * @param int $size_limit + * @param string $filter + * @param int $deref * @return array An array of DN strings listing the immediate children of the specified entry. */ public function getContainerContents($dn,$method=null,$size_limit=0,$filter='(objectClass=*)',$deref=LDAP_DEREF_NEVER) { @@ -1087,6 +1106,8 @@ class ldap extends DS { /** * Parse a DN and escape any special characters + * @param $dn + * @return string|string[]|null */ protected function escapeDN($dn) { if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS')) @@ -1109,6 +1130,8 @@ class ldap extends DS { /** * Parse a DN and unescape any special characters + * @param $dn + * @return array|string|string[]|null */ private function unescapeDN($dn) { if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS')) @@ -1159,8 +1182,8 @@ class ldap extends DS { * If we cant connect to the LDAP server, we'll return false. * If we can connect but cant get the entry, then we'll return null. * - * @param string Which connection method resource to use * @param dn The DN to use to obtain the schema + * @param string $dn * @return array|false Schema if available, null if its not or false if we cant connect. */ private function getSchemaDN($method=null,$dn='') { @@ -1249,23 +1272,14 @@ class ldap extends DS { * Please note: On FC systems, it seems that php_ldap uses /etc/openldap/ldap.conf in * the search base if it is blank - so edit that file and comment out the BASE line. * - * @param string Which connection method resource to use - * @param string A string indicating which type of schema to - * fetch. Five valid values: 'objectclasses', 'attributetypes', - * 'ldapsyntaxes', 'matchingruleuse', or 'matchingrules'. - * Case insensitive. - * @param dn (optional) This paremeter is the DN of the entry whose schema you - * would like to fetch. Entries have the option of specifying - * their own subschemaSubentry that points to the DN of the system - * schema entry which applies to this attribute. If unspecified, - * this will try to retrieve the schema from the RootDSE subschemaSubentry. - * Failing that, we use some commonly known schema DNs. Default - * value is the Root DSE DN (zero-length string) + * @param $method + * @param $schema_to_fetch + * @param string $dn * @return array an array of strings of this form: - * Array ( - * [0] => "(1.3.6.1.4.1.7165.1.2.2.4 NAME 'gidPool' DESC 'Pool ... - * [1] => "(1.3.6.1.4.1.7165.2.2.3 NAME 'sambaAccount' DESC 'Sa ... - * etc. + * Array ( + * [0] => "(1.3.6.1.4.1.7165.1.2.2.4 NAME 'gidPool' DESC 'Pool ... + * [1] => "(1.3.6.1.4.1.7165.2.2.3 NAME 'sambaAccount' DESC 'Sa ... + * etc. */ private function getRawSchema($method,$schema_to_fetch,$dn='') { if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS')) @@ -1549,6 +1563,7 @@ class ldap extends DS { * Gets a single ObjectClass object specified by name. * * @param string $oclass_name The name of the objectClass to fetch. + * @param null $method * @param string $dn (optional) It is easier to fetch schema if a DN is provided * which defines the subschemaSubEntry attribute (all entries should). * @@ -1579,7 +1594,8 @@ class ldap extends DS { /** * Gets a single AttributeType object specified by name. * - * @param string $oclass_name The name of the AttributeType to fetch. + * @param $attr_name + * @param null $method * @param string $dn (optional) It is easier to fetch schema if a DN is provided * which defines the subschemaSubEntry attribute (all entries should). * @@ -1612,6 +1628,7 @@ class ldap extends DS { * server. Each array entry's key is the name of the objectClass * in lower-case and the value is an ObjectClass object. * + * @param null $method * @param string $dn (optional) It is easier to fetch schema if a DN is provided * which defines the subschemaSubEntry attribute (all entries should). * @@ -1671,6 +1688,7 @@ class ldap extends DS { * server. Each array entry's key is the name of the attributeType * in lower-case and the value is an AttributeType object. * + * @param null $method * @param string $dn (optional) It is easier to fetch schema if a DN is provided * which defines the subschemaSubEntry attribute (all entries should). * @@ -1854,6 +1872,9 @@ class ldap extends DS { /** * Returns an array of MatchingRule objects for the specified server. * The key of each entry is the OID of the matching rule. + * @param null $method + * @param string $dn + * @return array|Returns|null */ public function MatchingRules($method=null,$dn='') { if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS')) @@ -1930,6 +1951,9 @@ class ldap extends DS { /** * Returns an array of Syntax objects that this LDAP server uses mapped to * their descriptions. The key of each entry is the OID of the Syntax. + * @param null $method + * @param string $dn + * @return array|Returns|null */ public function SchemaSyntaxes($method=null,$dn='') { if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS')) @@ -1980,9 +2004,10 @@ class ldap extends DS { * This function determines if the specified attribute is contained in the force_may list * as configured in config.php. * + * @param $attr_name * @return boolean True if the specified attribute is configured to be force as a may attribute */ - function isForceMay($attr_name) { + public function isForceMay($attr_name) { if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS')) debug_log('Entered (%%)',17,0,__FILE__,__LINE__,__METHOD__,$fargs); @@ -1994,25 +2019,22 @@ class ldap extends DS { * one attribute of an object. Example calls: * * - * print_r(getDNAttrValue('cn=Bob,ou=people,dc=example,dc=com','sn')); - * Array ( - * [0] => Smith - * ) + * print_r(getDNAttrValue('cn=Bob,ou=people,dc=example,dc=com','sn')); + * Array ( + * [0] => Smith + * ) * * print_r(getDNAttrValue('cn=Bob,ou=people,dc=example,dc=com','objectClass')); - * Array ( - * [0] => top - * [1] => person - * ) + * Array ( + * [0] => top + * [1] => person + * ) * * - * @param string The distinguished name (DN) of the entry whose attributes/values to fetch. - * @param string The attribute whose value(s) to return (ie, "objectClass", "cn", "userPassword") - * @param string Which connection method resource to use - * @param constant For aliases and referrals, this parameter specifies whether to - * follow references to the referenced DN or to fetch the attributes for - * the referencing DN. See http://php.net/ldap_search for the 4 valid - * options. + * @param $dn + * @param $attr + * @param null $method + * @param int $deref * @return array * @see getDNAttrValues * @todo Caching these values may be problematic with multiple calls and different deref values. @@ -2044,29 +2066,28 @@ class ldap extends DS { * Example of its usage: * * print_r(getDNAttrValues('cn=Bob,ou=pepole,dc=example,dc=com') - * Array ( - * [objectClass] => Array ( - * [0] => person - * [1] => top - * ) - * [cn] => Array ( - * [0] => Bob - * ) - * [sn] => Array ( - * [0] => Jones - * ) - * [dn] => Array ( - * [0] => cn=Bob,ou=pepole,dc=example,dc=com - * ) - * ) + * Array ( + * [objectClass] => Array ( + * [0] => person + * [1] => top + * ) + * [cn] => Array ( + * [0] => Bob + * ) + * [sn] => Array ( + * [0] => Jones + * ) + * [dn] => Array ( + * [0] => cn=Bob,ou=pepole,dc=example,dc=com + * ) + * ) * * - * @param string The distinguished name (DN) of the entry whose attributes/values to fetch. - * @param string Which connection method resource to use - * @param constant For aliases and referrals, this parameter specifies whether to - * follow references to the referenced DN or to fetch the attributes for - * the referencing DN. See http://php.net/ldap_search for the 4 valid - * options. + * @param $dn + * @param null $method + * @param int $deref + * @param array $attrs + * @param bool $nocache * @return array * @see getDNSysAttrs * @see getDNAttrValue @@ -2127,9 +2148,10 @@ class ldap extends DS { * Some examples include 'distinguishedName', 'member' and 'uniqueMember'. * * @param string $attr_name The name of the attribute of interest (case insensitive) + * @param null $method * @return boolean */ - function isDNAttr($attr_name,$method=null) { + public function isDNAttr($attr_name, $method=null) { if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS')) debug_log('Entered (%%)',17,0,__FILE__,__LINE__,__METHOD__,$fargs); @@ -2170,7 +2192,7 @@ class ldap extends DS { * @return boolean * @see draw_jpeg_photo */ - function isJpegPhoto($attr_name) { + public function isJpegPhoto($attr_name) { if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS')) debug_log('Entered (%%)',17,0,__FILE__,__LINE__,__METHOD__,$fargs); @@ -2201,7 +2223,7 @@ class ldap extends DS { * @param string $attr_name The name of the attribute to test. * @return boolean */ - function isAttrBoolean($attr_name) { + public function isAttrBoolean($attr_name) { if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS')) debug_log('Entered (%%)',17,0,__FILE__,__LINE__,__METHOD__,$fargs); @@ -2227,7 +2249,7 @@ class ldap extends DS { * * @see isJpegPhoto */ - function isAttrBinary($attr_name) { + public function isAttrBinary($attr_name) { if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS')) debug_log('Entered (%%)',17,0,__FILE__,__LINE__,__METHOD__,$fargs); @@ -2313,7 +2335,7 @@ class ldap extends DS { * @param dn $group DN to see if user is a member * @return bool true|false */ - function userIsMember($user,$group) { + public function userIsMember($user, $group) { if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS')) debug_log('Entered (%%)',17,0,__FILE__,__LINE__,__METHOD__,$fargs); @@ -2343,6 +2365,8 @@ class ldap extends DS { /** * This function will determine if the user is allowed to login based on a filter + * @param $dn + * @return bool */ protected function userIsAllowedLogin($dn) { if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS')) @@ -2410,4 +2434,4 @@ class ldap extends DS { return false; } } -?> + diff --git a/lib/ds_ldap_pla.php b/lib/ds_ldap_pla.php index 7ece393..41e68b1 100644 --- a/lib/ds_ldap_pla.php +++ b/lib/ds_ldap_pla.php @@ -13,7 +13,7 @@ * @subpackage DataStore */ class ldap_pla extends ldap { - function __construct($index) { + public function __construct($index) { parent::__construct($index); $this->default->appearance['password_hash'] = array( @@ -161,7 +161,7 @@ class ldap_pla extends ldap { * * @return boolean true if the feature is enabled and false otherwise. */ - function isShowCreateEnabled() { + public function isShowCreateEnabled() { if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS')) debug_log('Entered (%%)',17,0,__FILE__,__LINE__,__METHOD__,$fargs); @@ -206,7 +206,7 @@ class ldap_pla extends ldap { * * @return boolean */ - function isBranchRenameEnabled() { + public function isBranchRenameEnabled() { if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS')) debug_log('Entered (%%)',17,0,__FILE__,__LINE__,__METHOD__,$fargs); @@ -230,7 +230,7 @@ class ldap_pla extends ldap { * @param string (optional) The current value of the attribute (speeds up the process by searching for carriage returns already in the attribute value) * @return boolean */ - function isMultiLineAttr($attr_name,$val=null) { + public function isMultiLineAttr($attr_name, $val=null) { if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS')) debug_log('Entered (%%)',17,0,__FILE__,__LINE__,__METHOD__,$fargs); @@ -340,6 +340,10 @@ class ldap_pla extends ldap { /** * Add objects + * @param $dn + * @param $entry_array + * @param null $method + * @return bool */ public function add($dn,$entry_array,$method=null) { if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS')) @@ -384,6 +388,9 @@ class ldap_pla extends ldap { /** * Delete objects + * @param $dn + * @param null $method + * @return bool */ public function delete($dn,$method=null) { if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS')) @@ -410,6 +417,12 @@ class ldap_pla extends ldap { /** * Rename objects + * @param $dn + * @param $new_rdn + * @param $container + * @param $deleteoldrdn + * @param null $method + * @return bool */ public function rename($dn,$new_rdn,$container,$deleteoldrdn,$method=null) { if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS')) @@ -437,6 +450,10 @@ class ldap_pla extends ldap { /** * Modify objects + * @param $dn + * @param $attrs + * @param null $method + * @return bool */ public function modify($dn,$attrs,$method=null) { if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS')) @@ -656,4 +673,4 @@ class ldap_pla extends ldap { return true; } } -?> + diff --git a/lib/export_functions.php b/lib/export_functions.php index d98df2c..9eac6ad 100644 --- a/lib/export_functions.php +++ b/lib/export_functions.php @@ -32,7 +32,7 @@ class Exporter { $this->accept(); } - static function types() { + public static function types() { $type = array(); $details = ExportCSV::getType(); @@ -112,7 +112,7 @@ abstract class Export { /** * Return the LDAP server ID * - * @return int Server ID + * @return The Server ID */ protected function getServerID() { return get_request('server_id','REQUEST'); @@ -246,7 +246,7 @@ class ExportCSV extends Export { return array('type'=>'CSV','description' => 'CSV (Spreadsheet)','extension'=>'csv'); } - function export() { + public function export() { $server = $this->getServer(); /* Go thru and find all the attribute names first. This is needed, because, otherwise we have @@ -332,6 +332,8 @@ class ExportCSV extends Export { /** * Function to escape data, where the qualifier happens to also * be in the data. + * @param $var + * @return mixed */ private function LdapEscape ($var) { return str_replace($this->qualifier,$this->escapeCode.$this->qualifier,$var); @@ -352,7 +354,7 @@ class ExportDSML extends Export { /** * Export entries to DSML format */ - function export() { + public function export() { $server = $this->getServer(); # Not very elegant, but do the job for the moment as we have just 4 level @@ -576,7 +578,7 @@ class ExportVCARD extends Export { /** * Export entries to VCARD format */ - function export() { + public function export() { $server = $this->getServer(); $output = ''; @@ -640,4 +642,4 @@ class ExportVCARD extends Export { return $output; } } -?> + diff --git a/lib/functions.php b/lib/functions.php index 0e5c5d6..6b99c08 100644 --- a/lib/functions.php +++ b/lib/functions.php @@ -50,6 +50,7 @@ if (file_exists(LIBDIR.'functions.custom.php')) /** * Loads class definition + * @param $className */ function autoload($className) { if (file_exists(HOOKSDIR."classes/$className.php")) @@ -232,6 +233,8 @@ function app_version() { * This function will convert the browser two character language into the * default 5 character language, where the country portion should NOT be * assumed to be upper case characters of the first two characters. + * @param $lang + * @return string */ function auto_lang($lang) { switch ($lang) { @@ -243,6 +246,8 @@ function auto_lang($lang) { /** * Makes sure that the config file is properly setup. + * @param $config_file + * @return Config */ function check_config($config_file) { # Read in config_default.php @@ -310,7 +315,7 @@ function check_config($config_file) { $body .= ''; $block = new block(); - $block->SetBody($body); + $block->setBody($body); $www['page'] = new page(); $www['page']->block_add('body',$block); $www['page']->display(); @@ -341,6 +346,7 @@ function check_config($config_file) { /** * Commands available in the control_panel of the page * + * @param $type * @return array */ function cmd_control_pane($type) { @@ -414,7 +420,8 @@ function cmd_control_pane($type) { * This function dumps the $variable for debugging purposes * * @param string|array Variable to dump - * @param boolean Whether to stop execution or not. + * @param bool $die + * @param bool $onlydebugaddr */ function debug_dump($variable,$die=false,$onlydebugaddr=false) { if ($onlydebugaddr && @@ -441,6 +448,7 @@ function debug_dump($variable,$die=false,$onlydebugaddr=false) { /** * This function generates a backtrace * + * @param string $msg * @param boolean Whether to stop execution or not. */ function debug_dump_backtrace($msg='Calling BackTrace',$die=false) { @@ -449,6 +457,7 @@ function debug_dump_backtrace($msg='Calling BackTrace',$die=false) { /** * Send a debug as a sys message + * @param $msg */ function debug_sysmsg($msg) { system_message(array('title'=>_('Debug'),'body'=>$msg,'type'=>'debug')); @@ -459,12 +468,12 @@ function debug_sysmsg($msg) { * * The global debug level is turned on in your configuration file by setting: * - * $config->custom->debug['level'] = 255; + * $config->custom->debug['level'] = 255; * * together with atleast one output direction (currently file and syslog are supported). * - * $config->custom->debug['file'] = '/tmp/app_debug.log'; - * $config->custom->debug['syslog'] = true; + * $config->custom->debug['file'] = '/tmp/app_debug.log'; + * $config->custom->debug['syslog'] = true; * * * The debug level is turned into binary, then if the message levels bit is on @@ -481,8 +490,9 @@ function debug_sysmsg($msg) { * 7( 64) = Other non generic messages * 8(128) = Page Processing * 9(256) = Hooks Processing - * @param string Message to send to syslog - * @param int Log bit number for this message. + * @param $msg + * @param $level + * @param $indent * @see syslog.php */ function debug_log($msg,$level,$indent) { @@ -572,6 +582,11 @@ function debug_log($msg,$level,$indent) { /** * Display an error message in the system message panel of the page. + * @param $msg + * @param string $type + * @param null $redirect + * @param bool $fatal + * @param bool $backtrace */ function error($msg,$type='note',$redirect=null,$fatal=false,$backtrace=false) { global $www; @@ -599,7 +614,7 @@ function error($msg,$type='note',$redirect=null,$fatal=false,$backtrace=false) { # Do we have a backtrace to display? if ($backtrace) { $backtraceblock = new block(); - $backtraceblock->SetTitle('PHP Debug Backtrace'); + $backtraceblock->setTitle('PHP Debug Backtrace'); $body = ''; $body .= "\n"; @@ -632,7 +647,7 @@ function error($msg,$type='note',$redirect=null,$fatal=false,$backtrace=false) { $body .= '
'; $body .= "\n"; - $backtraceblock->SetBody($body); + $backtraceblock->setBody($body); $www['page']->block_add('body',$backtraceblock); } @@ -646,6 +661,10 @@ function error($msg,$type='note',$redirect=null,$fatal=false,$backtrace=false) { /** * Return the result of a form variable, with optional default * + * @param $attr + * @param string $type + * @param bool $die + * @param null $default * @return The form GET/REQUEST/SESSION/POST variable value or its default */ function get_request($attr,$type='POST',$die=false,$default=null) { @@ -682,6 +701,9 @@ function get_request($attr,$type='POST',$die=false,$default=null) { /** * Record a system message. * This function can be used as an alternative to generate a system message, if page hasnt yet been defined. + * @param $msg + * @param null $redirect + * @return null */ function system_message($msg,$redirect=null) { if (! is_array($msg)) @@ -873,6 +895,9 @@ function full_str_pad($input,$pad_length,$pad_string='',$pad_type=0) { * the same page load, and one in a session for multiple calls within * the same user session (spanning multiple page loads). * + * @param $index + * @param $item + * @param string $subitem * @return Returns the cached attributed requested, * or null if there is nothing cached.. */ @@ -897,6 +922,11 @@ function get_cached_item($index,$item,$subitem='null') { * Caches the specified $item for the specified $index. * * Returns true on success of false on failure. + * @param $index + * @param $item + * @param string $subitem + * @param $data + * @return bool */ function set_cached_item($index,$item,$subitem='null',$data) { if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS')) @@ -917,6 +947,9 @@ function set_cached_item($index,$item,$subitem='null',$data) { /** * Deletes the cache for a specified $item for the specified $index + * @param $index + * @param $item + * @param string $subitem */ function del_cached_item($index,$item,$subitem='null') { if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS')) @@ -973,9 +1006,9 @@ function set_cookie($name,$val,$expire=null,$dir=null) { * Get a customized file for a server * We don't need any caching, because it's done by PHP * - * @param int The ID of the server - * @param string The requested filename - * + * @param $index + * @param $filename + * @param $path * @return string The customized filename, if exists, or the standard one */ function get_custom_file($index,$filename,$path) { @@ -999,10 +1032,10 @@ function get_custom_file($index,$filename,$path) { /** * Sort a multi dimensional array. * - * @param array Multi demension array passed by reference - * @param string Comma delimited string of sort keys. - * @param boolean Whether to reverse sort. - * @return array Sorted multi demension array. + * @param $data + * @param $sortby + * @param int $rev + * @return void Sorted multi demension array. */ function masort(&$data,$sortby,$rev=0) { if (defined('DEBUG_ENABLED') && DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS')) @@ -1441,10 +1474,11 @@ function pla_compare_dns($dn1,$dn2) { * * See config.php.example for more notes on the two mechanisms. * - * @param string Base to start the search from - * @param string Attribute to query - * @param boolean Increment the result (for pool searches) - * @param string LDAP filter to use (for pool searches) + * @param $base + * @param $attr + * @param bool $increment + * @param bool $filter + * @param null $startmin * @return int */ function get_next_number($base,$attr,$increment=false,$filter=false,$startmin=null) { @@ -1636,7 +1670,9 @@ function get_next_number($base,$attr,$increment=false,$filter=false,$startmin=nu * are general to an LDAP audience, the phpLDAPadmin team will gladly accept them * as a patch. * - * @param string The DN of the entry whose icon you wish to fetch. + * @param $server_id + * @param $dn + * @param array $object_classes * @return string */ function get_icon($server_id,$dn,$object_classes=array()) { @@ -1869,7 +1905,8 @@ function random_salt($length) { * 'cn=Manager' (it is really the exact opposite of ds_ldap::getContainer()). * * @param string The DN whose RDN to return. - * @param boolean If true, include attributes in the RDN string. See http://php.net/ldap_explode_dn for details + * @param int $include_attrs + * @param bool $decode * @return string The RDN */ function get_rdn($dn,$include_attrs=0,$decode=false) { @@ -1893,6 +1930,8 @@ function get_rdn($dn,$include_attrs=0,$decode=false) { /** * Split an RDN into its attributes + * @param $rdn + * @return array */ function rdn_explode($rdn) { if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS')) @@ -2028,6 +2067,9 @@ function support_oid_to_text($key) { /** * Print an LDAP error message + * @param $msg + * @param $errnum + * @return string */ function ldap_error_msg($msg,$errnum) { if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS')) @@ -2311,8 +2353,9 @@ function hash_password($password_clear,$enc_type) { * Given a clear-text password and a hash, this function determines if the clear-text password * is the password that was used to generate the hash. This is handy to verify a user's password * when all that is given is the hash and a "guess". - * @param String The hash. - * @param String The password in clear text to test. + * @param $cryptedpassword + * @param $plainpassword + * @param string $attribute * @return Boolean True if the clear password matches the hash, and false otherwise. */ function password_check($cryptedpassword,$plainpassword,$attribute='userpassword') { @@ -2521,13 +2564,10 @@ function get_enc_type($user_password) { /** * Draws an HTML browse button which, when clicked, pops up a DN chooser dialog. - * @param string The name of the form element to which this chooser - * dialog will publish the user's choice. The form element must be a member - * of a form with the "name" or "id" attribute set in the form tag, and the element - * must also define "name" or "id" for JavaScript to uniquely identify it. - * Example $form_element values may include "creation_form.container" or - * "edit_form.member_uid". See /templates/modification/default.php for example usage. - * @param boolean (optional) If true, the function draws the localized text "choose" to the right of the button. + * @param $form + * @param $element + * @param bool $include_choose_text + * @param string $rdn */ function draw_chooser_link($form,$element,$include_choose_text=true,$rdn='none') { if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS')) @@ -2607,6 +2647,8 @@ function pla_explode_dn($dn,$with_attributes=0) { /** * Parse a DN and escape any special characters + * @param $dn + * @return string|string[]|null */ function dn_escape($dn) { if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS')) @@ -2628,6 +2670,8 @@ function dn_escape($dn) { /** * Parse a DN and unescape any special characters + * @param $dn + * @return array|string|string[]|null */ function dn_unescape($dn) { if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS')) @@ -2658,8 +2702,8 @@ function dn_unescape($dn) { * Fetches the URL for the specified item. This is a convenience function for * fetching project HREFs (like bugs) * - * @param string One of "open_bugs", "add_bug", "donate", or "add_rfe" - * (rfe = request for enhancement) + * @param $type + * @param string $extra_info * @return string The URL to the requested item. */ function get_href($type,$extra_info='') { @@ -2786,6 +2830,9 @@ function pla_reverse_dn($dn) { /** * Attribute sorting + * @param $a + * @param $b + * @return int|lt */ function sortAttrs($a,$b) { if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS')) @@ -2873,6 +2920,9 @@ function in_array_ignore_case($needle,$haystack) { /** * Gets a DN string using the user-configured tree_display_format string to format it. + * @param $server + * @param $entry + * @return mixed */ function draw_formatted_dn($server,$entry) { if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS')) @@ -2931,6 +2981,12 @@ function draw_formatted_dn($server,$entry) { /** * Server html select list + * @param null $selected + * @param bool $logged_on + * @param string $name + * @param bool $isVisible + * @param null $js + * @return string */ function server_select_list($selected=null,$logged_on=false,$name='index',$isVisible=true,$js=null) { if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS')) @@ -2969,6 +3025,8 @@ function server_select_list($selected=null,$logged_on=false,$name='index',$isVis /** * Converts a little-endian hex-number to one, that 'hexdec' can convert + * @param $hex + * @return string */ function littleEndian($hex) { if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS')) @@ -3140,9 +3198,9 @@ function password_generate() { * This function returns an array of $num_req values * randomly picked from the $input array * - * @param array Array of values - * @param integer Number of values in returned array - * @return string The padded string + * @param $input + * @param $num_req + * @return array The padded string */ function a_array_rand($input,$num_req) { if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS')) @@ -3189,7 +3247,8 @@ function random_junk() { /** * Returns a HTML id that can be used in the URL after the #. * - * @param string The DN to pretty-print. + * @param $sid + * @param $dn * @return string */ function htmlid($sid,$dn) { @@ -3208,4 +3267,4 @@ function isAjaxEnabled() { else return false; } -?> + diff --git a/lib/import_functions.php b/lib/import_functions.php index 23a52f4..8252285 100644 --- a/lib/import_functions.php +++ b/lib/import_functions.php @@ -32,7 +32,7 @@ class Importer { $this->accept(); } - static function types() { + public static function types() { $type = array(); $details = ImportLDIF::getType(); @@ -117,7 +117,7 @@ abstract class Import { $server = $this->getServer(); switch ($template->getType()) { - case 'add': + case 'add': return $server->add($template->getDN(),$template->getLDAPadd()); case 'modify': @@ -247,6 +247,8 @@ class ImportLDIF extends Import { /** * Get the Attribute and Decoded Value + * @param $line + * @return array */ private function getAttrValue($line) { list($attr,$value) = explode(':',$line,2); @@ -263,7 +265,7 @@ class ImportLDIF extends Import { /** * Get the lines of the next entry * - * @return The lines (unfolded) of the next entry + * @return array lines (unfolded) of the next entry */ private function nextLines() { $current = array(); @@ -378,6 +380,8 @@ class ImportLDIF extends Import { /** * Method to retrieve the attribute value of a ldif line, * and get the base 64 decoded value if it is encoded + * @param $value + * @return bool|string */ private function getAttributeValue($value) { $return = ''; @@ -409,6 +413,7 @@ class ImportLDIF extends Import { /** * Build the attributes array when the change type is add. + * @param $lines */ private function getAddDetails($lines) { foreach ($lines as $line) { @@ -428,6 +433,8 @@ class ImportLDIF extends Import { /** * Build the attributes array for the entry when the change type is modify + * @param $lines + * @return bool */ private function getModifyDetails($lines) { if (! count($lines)) @@ -555,8 +562,10 @@ class ImportLDIF extends Import { /** * Build the attributes for the entry when the change type is modrdn + * @param $lines + * @return bool */ - function getModRDNAttributes($lines) { + public function getModRDNAttributes($lines) { $server = $this->getServer(); $attrs = array(); @@ -606,4 +615,4 @@ class ImportLDIF extends Import { return $this->template; } } -?> + diff --git a/lib/page.php b/lib/page.php index 59927ce..0c5a84a 100644 --- a/lib/page.php +++ b/lib/page.php @@ -298,7 +298,7 @@ class page { # Add the Session System Messages if (isset($_SESSION['sysmsg']) && is_array($_SESSION['sysmsg'])) { - foreach ($_SESSION['sysmsg'] as $msg) + foreach ($_SESSION['sysmsg'] as $msg) $this->setsysmsg($msg); unset($_SESSION['sysmsg']); @@ -328,6 +328,9 @@ class page { /** * Only show a particular page frame - used by an AJAX call + * @param $frame + * @param bool $compress + * @param bool $raw */ public function show($frame,$compress=false,$raw=false) { if (defined('DEBUG_ENABLED') && DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS')) @@ -375,7 +378,7 @@ class page { 'TREE'=>true, 'FOOT'=>true ); - + if ($_SESSION[APPCONFIG]->getValue('appearance','minimalMode')) { $display = array( 'HEAD'=>false, @@ -516,4 +519,4 @@ class block { return $output; } } -?> + diff --git a/lib/query_functions.php b/lib/query_functions.php index de47630..75c15dd 100644 --- a/lib/query_functions.php +++ b/lib/query_functions.php @@ -19,4 +19,4 @@ */ class Queries extends xmlTemplates { } -?> + diff --git a/lib/schema_functions.php b/lib/schema_functions.php index efa0cbc..56e58b3 100644 --- a/lib/schema_functions.php +++ b/lib/schema_functions.php @@ -68,6 +68,7 @@ abstract class SchemaItem { * Return the objects name. * * param boolean $lower Return the name in lower case (default) + * @param bool $lower * @return string The name */ public function getName($lower=true) { @@ -104,6 +105,8 @@ class ObjectClass extends SchemaItem { /** * Creates a new ObjectClass object given a raw LDAP objectClass string. + * @param $class + * @param $server */ public function __construct($class,$server) { if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS')) @@ -277,6 +280,10 @@ class ObjectClass extends SchemaItem { /** * Parse an LDAP schema list + * @param $i + * @param $strings + * @param $attrs + * @return */ private function parseList($i,$strings,&$attrs) { if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS')) @@ -368,7 +375,7 @@ class ObjectClass extends SchemaItem { * Gets an array of AttributeType objects that entries of this ObjectClass must define. * This differs from getMustAttrNames in that it returns an array of AttributeType objects * - * @param array $parents An array of ObjectClass objects to use when traversing + * @param bool $parents An array of ObjectClass objects to use when traversing * the inheritance tree. This presents some what of a bootstrapping problem * as we must fetch all objectClasses to determine through inheritance which * attributes this objectClass requires. @@ -409,7 +416,7 @@ class ObjectClass extends SchemaItem { * Gets an array of AttributeType objects that entries of this ObjectClass may define. * This differs from getMayAttrNames in that it returns an array of AttributeType objects * - * @param array $parents An array of ObjectClass objects to use when traversing + * @param bool $parents An array of ObjectClass objects to use when traversing * the inheritance tree. This presents some what of a bootstrapping problem * as we must fetch all objectClasses to determine through inheritance which * attributes this objectClass provides. @@ -459,7 +466,7 @@ class ObjectClass extends SchemaItem { * This differs from getMustAttrs in that it returns an array of strings rather than * array of AttributeType objects * - * @param array $parents An array of ObjectClass objects to use when traversing + * @param bool $parents An array of ObjectClass objects to use when traversing * the inheritance tree. This presents some what of a bootstrapping problem * as we must fetch all objectClasses to determine through inheritance which * attributes this objectClass provides. @@ -486,7 +493,7 @@ class ObjectClass extends SchemaItem { * This differs from getMayAttrs in that it returns an array of strings rather than * array of AttributeType objects * - * @param array $parents An array of ObjectClass objects to use when traversing + * @param bool $parents An array of ObjectClass objects to use when traversing * the inheritance tree. This presents some what of a bootstrapping problem * as we must fetch all objectClasses to determine through inheritance which * attributes this objectClass provides. @@ -622,6 +629,8 @@ class ObjectClass extends SchemaItem { /** * Determine if an array is listed in the force_may attrs + * @param $attr + * @return bool */ public function isForceMay($attr) { if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS')) @@ -736,6 +745,7 @@ class AttributeType extends SchemaItem { /** * Creates a new AttributeType object from a raw LDAP AttributeType string. + * @param $attr */ public function __construct($attr) { if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS')) @@ -1286,6 +1296,7 @@ class AttributeType extends SchemaItem { class Syntax extends SchemaItem { /** * Creates a new Syntax object from a raw LDAP syntax string. + * @param $class */ public function __construct($class) { if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS')) @@ -1333,8 +1344,9 @@ class MatchingRule extends SchemaItem { /** * Creates a new MatchingRule object from a raw LDAP MatchingRule string. + * @param $strings */ - function __construct($strings) { + public function __construct($strings) { if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS')) debug_log('Entered (%%)',9,0,__FILE__,__LINE__,__METHOD__,$fargs); @@ -1416,6 +1428,7 @@ class MatchingRule extends SchemaItem { /** * Adds an attribute name to the list of attributes who use this MatchingRule * + * @param $attr * @return true if the attribute was added and false otherwise (already in the list) */ public function addUsedByAttr($attr) { @@ -1454,7 +1467,7 @@ class MatchingRuleUse extends SchemaItem { # An array of attribute names who use this MatchingRule private $used_by_attrs = array(); - function __construct($strings) { + public function __construct($strings) { if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS')) debug_log('Entered (%%)',9,0,__FILE__,__LINE__,__METHOD__,$fargs); @@ -1536,4 +1549,4 @@ class MatchingRuleUse extends SchemaItem { return $this->used_by_attrs; } } -?> + diff --git a/lib/session_functions.php b/lib/session_functions.php index 30ae3c9..9b75e2e 100644 --- a/lib/session_functions.php +++ b/lib/session_functions.php @@ -72,7 +72,7 @@ function app_session_param() { * * @see common.php * @see APP_SESSION_ID - * @return boolean Returns true if the session was started the first time + * @return void Returns true if the session was started the first time */ function app_session_start() { $sysmsg = null; @@ -173,4 +173,4 @@ function app_session_start() { function app_session_close() { @session_write_close(); } -?> + diff --git a/lib/template_functions.php b/lib/template_functions.php index bb3b606..27f6cc3 100644 --- a/lib/template_functions.php +++ b/lib/template_functions.php @@ -20,4 +20,4 @@ */ class Templates extends xmlTemplates { } -?> + diff --git a/lib/xml2array.php b/lib/xml2array.php index d260c9e..377a16c 100644 --- a/lib/xml2array.php +++ b/lib/xml2array.php @@ -15,11 +15,11 @@ * @subpackage XML */ class xml2array { - var $stack = array(); - var $stack_ref; - var $arrOutput = array(); - var $resParser; - var $strXmlData; + public $stack = array(); + public $stack_ref; + public $arrOutput = array(); + public $resParser; + public $strXmlData; private function push_pos(&$pos) { $this->stack[count($this->stack)] = &$pos; @@ -102,6 +102,7 @@ class xml2array { /** * This function will parse an XML array and make a normal array. * + * @param $details * @return array - Clean XML data */ private function cleanXML($details) { diff --git a/lib/xmlTemplates.php b/lib/xmlTemplates.php index 1749bac..de4abb8 100644 --- a/lib/xmlTemplates.php +++ b/lib/xmlTemplates.php @@ -18,7 +18,7 @@ abstract class xmlTemplates { # Our array of the available templates. protected $templates = array(); - function __construct($server_id) { + public function __construct($server_id) { if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS')) debug_log('Entered (%%)',5,0,__FILE__,__LINE__,__METHOD__,$fargs); @@ -86,7 +86,7 @@ abstract class xmlTemplates { if (! in_array($filename,$this->getTemplateFiles())) { $templatename = preg_replace('/.xml$/','',$file); - + $this->templates[$index] = new $class['name']($this->server_id,$templatename,$filename,$type,$index); $index++; @@ -183,8 +183,9 @@ abstract class xmlTemplates { * Return a list of templates by their type * This function should return a sorted list, as the array is built sorted. * - * @param string Type of template, eg: creation, modification - * @param boolean Exclude templates purposely disabled. + * @param null $type + * @param null $container + * @param bool $disabled * @return array List of templates of the type */ public function getTemplates($type=null,$container=null,$disabled=false) { @@ -219,7 +220,7 @@ abstract class xmlTemplates { * @param string The template ID as it was when it was generated (normally used in $_REQUEST vars). * @return object Template (or default template if the ID doesnt exist) */ - function getTemplate($templateid) { + public function getTemplate($templateid) { if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS')) debug_log('Entered (%%)',5,0,__FILE__,__LINE__,__METHOD__,$fargs); @@ -385,6 +386,7 @@ abstract class xmlTemplate { /** * Test if a template is of a type * + * @param $type * @return boolean */ public function isType($type) { @@ -423,7 +425,10 @@ abstract class xmlTemplate { /** * Add another attribute to this template * - * @return int Attribute ID + * @param $name + * @param $value + * @param null $source + * @return Attribute|DnAttribute|GidAttribute|MultiLineAttribute Attribute ID */ public function addAttribute($name,$value,$source=null) { if (DEBUG_ENABLED && (($fargs=func_get_args())||$fargs='NOARGS')) @@ -493,4 +498,4 @@ abstract class xmlTemplate { */ public function isAdminDisabled() {} } -?> +