Home arrow Enhance Access Control!
Font Size: larger smaller Font Color:                                                 reset
ByOS Technologies Logo
Newsflash

ByOSTech Chartered Membership
In stead of collecting donations, we have decided to implement Chartered Membership. Chartered Members will have access to earlier releases, special releases and other priceless support services. We need your supports and in return we will support you either. Subscribe to our Chartered Membership is fully OPTIONAL. Read more...

Earlier Access and Special Releases:

  1. JACLPlus Pro v1.5.25 Stable for Joomla! 1.5.25 Stable
    jaclplus_pro_1.5.25_stable_unzipfirst_zend.zip
    jaclplus_pro_1.5.25_stable_unzipfirst_ioncube.zip
    joomla_1.5.0_to_1.5.25-stable-patch_package-jaclpluspro_zend.zip
    joomla_1.5.0_to_1.5.25-stable-patch_package-jaclpluspro_ioncube.zip
    joomla_1.5.24_to_1.5.25-stable-patch_package-jaclpluspro_zend.zip
    joomla_1.5.24_to_1.5.25-stable-patch_package-jaclpluspro_ioncube.zip
  2. JACLPlus v1.0.15a for Joomla! 1.0.15 Stable Free!!!
    com_jaclplus_1.0.15a.zip
    com_patch_joomla!_n_jaclplus_to_1.0.15a.zip
    joomla_1.0.12_to_1.0.15-stable-patch_package_jaclplus1.0.15a.zip
  3. JACLPlus Pro v1.0.15 for Joomla! 1.0.15 Stable
    com_jaclplus_1.0.15pro.zip
    com_patch_joomla!_n_jaclplus_to_1.0.15pro.zip
    joomla_1.0.12_to_1.0.15-stable-patch_package_jaclpluspro.zip
  4. MACLPlus Pro v4.6.2 for Mambo 4.6.2
    com_maclpluspro_462.zip
    mambo_patch_4.6.1complete_to_4.6.2_maclplus_pro.tar.gz
  5. Patch File for Joomla/Coppermine Bridge
    patch_files_joomcpg-brigde.zip
  6. MACLPlus v4.5.4 for Mambo 4.5.4 Stable with Mamlang 1.2
    com_maclplus_4.5.4_mamlang1.2.zip
  7. Extended Menu 1.0.5 (JACLPlus Ready)
    mod_exmenu_1.0.5_jaclplus.zip
    Extended Menu 1.0.3 (MACLPlus Ready)
    mod_exmenu_1.0.3_maclplus.zip
  8. Infinity Menus V1-0-83 (JACLPlus Ready)
    infinity_menus_V1-0-83-Stable_JACLPlus.zip
    Infinity Menus V1-0-83 (MACLPlus Ready)
    infinity_menus_V1-0-83-Stable_MACLPlus.zip



How to use JACLPlus/MACLPlus to Enhance Your Component Access Control Print E-mail
Written by Web Master   
Thursday, 03 August 2006

How to use JACLPlus/MACLPlus To Enhance Your Component Access Control (Part 1)
(
This article is new and still under improvement)

This article intend to show you how to use JACLPlus/MACLPlus to enhance your component access control either at backend or at frontend. When we say enhance, we really mean that we will add advanced access controls into the component. It is not just mean to add some basic access checking to the component to make it controllable by JACLPlus/MACLPlus. Anyway, in this article we will try the best to cover up all the necessary information and how to add the necessary access control checking from basic to advanced to enhance your component access control.

In this article, we will use weblinks component as our example and guide you step by step to enhance its access control. After complete reading this article (including part 2), you will be able to use the same concept to enhance your other components' access control. This article will show you how to enhance your weblinks component access control by using JACLPlus/MACLPlus to manage:
1) who can submit weblinks. (completed) (Chartered Member Only)
2) who can view the weblink (click on weblink to follow its url). Coming soon...(Chartered Member Only)
3) who can view weblinks in certain categories (access certain weblink categories). Coming soon... (Chartered Member Only)
*Special: Put access checking code in template file to enhance backend access control. (completed) (Chartered Member Only)

Requirements to use this article:
1) Basic knowledge of backup and modify PHP files.
2) Joomla system with JACLPlus or Mambo system with MACLPlus.
3) Familiar with Joomla/Mambo.
4) Know where to add Access Control Rule (ACR) thru JACLPlus or MACLPlus.
5) Basic knowledge of PHP if you want to add advanced access controls.

The Location of Main Files of a Component
As we know, Joomla/Mambo have backend and frontend access. Component files used for backend are normally located in /administrator/components/ directory. Meanwhile, component files used for frontend are normally located in /components/ directory. Upon access a component, Joomla/Mambo will load the component main file. At frontend, the component main file will be the PHP file with a filename that same to component name. For example, the weblinks component frontend main file is weblinks.php that located under /components/com_weblinks/ directory. At backend, the component main file will be the PHP file with a filename that same to component name and with a prefix of "admin.". Therefore, in our example, the backend main file for weblinks component is admin.weblinks.php which is located in /administrator/components/com_weblinks/ directory. Figure 1 show you how to determine component main files through access URL.


Figure 1: Use URL to determine the main files of a component.

How to determine there is Access Control/Checking in Component
In order to control the access of a component, you need to make sure there is an access checking in the component main file. For example, if you want to implement frontend access control for the weblinks component, you will have to make sure there is an access checking in weblinks.php file. If you want to implement backend access control for the weblinks component, then you will have to make sure there is an access checking in admin.weblinks.php file. How to determine there is Access Control/Checking in a component? The answer is to look for a function called $acl->acl_check(). Joomla/Mambo and JACLPlus/MACLPlus use this function to check access permission. This function receive 6 arguements based on user and will return a value of true or false based on ACR either predefined by Joomla/Mambo or defined/added by you thru JACLPlus/MACLPlus. For example, $acl->acl_check( 'administration', 'edit', 'users', $my->usertype, 'components', 'com_weblinks' ) will look for the administration->edit->users->User Group->components->com_weblinks ACR in Joomla/Mambo ACL.  If it found the ACR and the ACR is enable, then it will return true or else it will return false.

Add Basic Access Control/Checking to Component
If you open weblinks.php file, you may notice that there is no access checking for that file. Therefore, there is no Access Control Rule(ACR) can control the access of this weblinks component at frontend. In order to use ACR to control this component at frontend, you can add the below access checking code on top of the weblinks.php file just after the "defined( '_VALID_MOS' ) or die( 'Restricted access' );" code.

Basic Frontend Access Checking Code to add in on top of the weblinks.php file: 

// ensure user has access to this function
if (!($acl->acl_check( 'administration', 'edit', 'users', $my->usertype, 'components', 'all' )
        | $acl->acl_check( 'administration', 'edit', 'users', $my->usertype, 'components', 'com_weblinks' ))) {
    mosRedirect( 'index.php', _NOT_AUTH );
} 

Explanation: The above code will look for  administration->edit->users->User Group->components->all or administration->edit->users->User Group->components->com_weblinks ACRs for the user. If it found one of them and is enable, then it will continue to process other code or else it will stop and redirect the user to index.php page. Therefore, by adding this access checking code on top of the weblinks.php file, you can use these two ACRs to control the frontend access of the weblinks component now! However, this is not so good because now ONLY login user can use the component at frontend due to "Public Frontend" group for public user can't support ACR yet.

Once you have added the above access checking code into weblinks.php, you will need to add administration->edit>users->Super Administrator->components->com_weblinks ACR to Super Administrator group before you can add this type of ACR to other group.
By adding this administration->edit>users->Registered->components->com_weblinks ACR to Registered group and enable it, all your Registered group users will be able to access weblinks component or vice versa.

If you open admin.weblinks.php file, you may notice that there is access checking in that file. The access checking code is just below the "defined( '_VALID_MOS' ) or die( 'Restricted access' );" code. Therefore, there are two ACRs can control the access of this weblinks component at backend.

Basic Backend Access Checking Code that already in the admin.weblinks.php file:

// ensure user has access to this function
if (!($acl->acl_check( 'administration', 'edit', 'users', $my->usertype, 'components', 'all' )
        | $acl->acl_check( 'administration', 'edit', 'users', $my->usertype, 'components', 'com_weblinks' ))) {
    mosRedirect( 'index2.php', _NOT_AUTH );
}

Note: Backend access checking code will redirect to index2.php page of backend instead of index.php upon no access.

Some of you may noticed that the backend com_content main file ( / administrator /components / com_content / admin.content.php) do not have access checking as well. Therefore, all backend users will be able to access the com_content at backend to add/edit/publish content items. You can add basic access checking code into the file to make it controllable by ACR. Using this simple concept, you will be able to make all your components controllable by JACLPlus/MACLPlus either at frontend or backend!

Add Advanced Access Control/Checking to Component (Chartered Member Only)

Last Updated ( Friday, 18 August 2006 )
 
Main Menu
Home
About Us
Product - JACLPlus!
JACLPlus Support List
How To - JACLPlus!
News
Forum
Contact Us / Help Support
Downloads
Chartered Member
Enhance Access Control!
New JACLPlus Demo
Installation Guide Installation Guide
Upgrading Guide Upgrading Guide
Uninstallation/Rescue Guide Uninstallation/Rescue Guide
Member Login
Statistics
Visitors: 11677037
Who's Online
We have 26 guests and 3 members online
ionCube PHP Encoder ionCube PHP Encoder
The ultimate security solution to protect & accelerate runtime performance for PHP 4 & PHP 5 scripts
 
ionCube Package Foundry ionCube Package Foundry
The installer creator for PHP and ASP web applications to eliminate end-user remote installation problems and failures
© 2012 ByOS Technologies
Joomla! is Free Software released under the GNU/GPL License.
CONTACT US NOW AT
enquiry@byostech.com
For Free Consultation
natural viagra
lowestpriecviagraincanada
can i buy viagra in canada
cialis 20 vs cialis
no prescription pfizer viagra
cialis okay for women
cialis buy overnight
viagra online store
internet viagra
cialis in canada
for sale cialis
viagra on line sales
online pharmacies
buy generic no online prescription viagra
pfizer viagra uk
levitra 100mg
viagra delivered one day
buy viagra for women
generic cialis fast delivery
where can i buy propecia
cialis for women
does propecia work
50mg viagra
how to get inexpensive propecia
cialis delivered canada
finasteride generic
cialis vs viagra
cheap drugs, viagra
buy viagra in canada
cialis 5mg brand name
cheap cialis online
viagra sales
canadian healthcare viagra
how do u buy propecia in canada
viagra canada cheapest
cialis on prescrition in australia
viagra 100mg
viagra us pharmacy
viagra gel
bought cialis in mexico?
cialis next day delivery
buy viagra cialis levitra
buying viagra without prescription
viagra for her
viagra for mail order
viagra order online canada
how to buy cialis in canada
generic levitra 10mg
viagra to buy in uk
fill prescription for levitra in canada
purchase cialis
how to get cialis no prescription
viagra canadian health
propecia pills
cialis professional 20 mg
buy viagra online without prescription canada
buy viagara online cheap
australia viagra onlineorder viagra online no prescription
inexpensive viagra
propecia online pharmacy canada
viagra online canadian pharmacy
viagra online paypal
ci alis canada 5mg
mexico pharmacy
cost of viagra
cheap viagra per pill
generic viagra without prescription au
levitra side effects
viagra australia no prescription
purchase viagra from canada
cheap real viagra england
generic fda approved
buy viagra 50mg
shop online viagra
propecia for sale
cialis no rx
buy online cialis
my canadian pharmacy online
viagra mexico
cialis 100mg
online canadian pharmacy levitra
levitra cialis
purchase viagra in canada
natural viagra
professional cialis
cheapest propecia us
levitra no prescription uk
propecia online pharmacy no prescription
buy cialis online pharmacy
what is viagra soft tabs
fast shiping viagra
canadian low price cialis and viagra
generic cialis 40mg without prescription
50mg generic viagra
female viagra next day delivery
levitra lowest price
purchasing cialis with next day delivery
going off propecia
propecia or finasteride
viagra canada online pharmacy
womens cialis cheap no prescriptionwomens viagra no prescription
canadian cialis
propecia cheapest
viagra to order
where can i buy viagra without a perscription?
viagra canada online pharmacy
cialis 5mg
viagra for women online without prescription
viagra canada no prescription
propecia best price no prescription
cialis prices
cialis delivered canada
canadian viagra 25
levitra 10 mg canada
order viagra online uk
viagra for sale
buy brand name cialis no prescription needed
canadian viagra online
where to get a precription filled for viagra
nz online viagra
recommended sites for cialis in canada
cialis canadian cost
viagra for salelevitra
generic viagra 10mg
buy cialis online canada
cialis free delivery
canadian viagra
order pfizer viagra on line
cheap levitra no prescription
online pharmacy australia no prescription
generic levitra 10mg
cialis canada 5mg
generic viagra fda approved
viagra and cialis in canada free samples
viagra canadian
levitra without perscription
buy cialis profes
propecia in canada
non prescription cialis
buy viagra pills
mexicanviagra
viagra for sale no proscription
25mg viagra online
cialis at real low prices
levitra dosage
viagra online shop
how to order cialis online
viagra in china
buy cheap generic cialis
viagra for women
canadian pharmacy no prescription required
canada propecia
india cialis
viagra canada
viagra without prsecription
viagra without a prescription
viagra price germany
where can i get viagra
viagra tablets sale
canadian pharmacy no prescriptioncialas overnight
viagra on line switzerland
cialis discount
brand viagra canada online
levitra sales from canada
canadian daily cialis
cialis
viagra fed ex
viagra generic best prpice
ed canadian pharmacy
levitra purchase
canadian meds viagra
buy levitra online without prescription
where to buy cialis
brand viagra online without prescription
cialis 10mg
buy cialis from mexico
viagra dose
cheapest propecia in uk
buy viagra canada
viagra online without prescription united states
viagra cialis online
purchase cialis cheap
how to buy viagra from canada
buy viagra online australia
viagra, canada
viagra canada cheapest
best price on propecia generic
cialis online
viagra to sell
buy vardenafil get free viagra
buy online viagra
buy viagra online
cheapest viagra to buy online in uk
viagra online in canada
cialis 5mg canada
buy cialis online
cheap online pharmacy no prescription
generic viagra compare
how to buy levitra online
online pharmacy
viagra online reviews
viagra north shore
american made viagra
viagra in uk
cialis +2 free viagra
cialis 5mg online
cialis canada
5mg cialis
cialis 20 mg 10 pills
cialis fast delivery
online brand viagra
viagra for less in the usa
viagara substitution
where do i get cialis
canadian viagra 50mg
canadian pharmacy no prescription needed viagra
viagra on sale
viagra 50 mg pfizer
female viagra next day delivery
cialis 20
cialis without rx
buy cialis from canada
canadain drugs
generic levitra usa
how to get inexpensive propecia
cialis cheap
generic viagra australia
canadian pharmacy viagra prescription
cialis delivery in canada
daily viagra cost
i need cialis
real propecia online
purchase cialis 5 mg
propecia generic
buy cheap propecia
viagra no prescription overnight
ByOSTech Chartered Membership!