X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=includes%2Fcurrent_user.inc;h=3c5a92a82f9c4d0af0f17e2e758ac43b91ff4e37;hb=0c794db98d716ec8823435d8423c98a12bebba66;hp=512d09f02de223d4486d623a5306f442d6bbcf58;hpb=2cfbce12fc0d75cdda07fc427c1636f00c988d56;p=fa-stable.git diff --git a/includes/current_user.inc b/includes/current_user.inc index 512d09f0..3c5a92a8 100644 --- a/includes/current_user.inc +++ b/includes/current_user.inc @@ -163,6 +163,74 @@ class current_user return $this->can_access($page_level); } + function check_application_access($waapp) + { + if (!$this->hide_inaccessible_menu_items()) + { + return true; + } + + foreach ($waapp->modules as $module) + { + if ($this->check_module_access($module)) + { + return true; + } + } + + return false; + + } + + function check_module_access($module) + { + + if (!$this->hide_inaccessible_menu_items()) + { + return true; + } + + if (sizeof($module->lappfunctions) > 0) + { + foreach ($module->lappfunctions as $appfunction) + { + if ($appfunction->label != "" && $this->can_access_page($appfunction->access)) + { + return true; + } + } + } + + if (sizeof($module->rappfunctions) > 0) + { + foreach ($module->rappfunctions as $appfunction) + { + if ($appfunction->label != "" && $this->can_access_page($appfunction->access)) + { + return true; + } + } + } + + return false; + + } + + function hide_inaccessible_menu_items() + { + global $hide_inaccessible_menu_items; + + if (!isset($hide_inaccessible_menu_items) || $hide_inaccessible_menu_items == 0) + { + return false; + } + + else + { + return true; + } + } + function set_db_connection($id = -1) { return set_global_connection($id); @@ -571,4 +639,5 @@ function company_path($comp=null) . '/'.$comp; } + ?> \ No newline at end of file