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.20 Stable for Joomla! 1.5.20 Stable
    jaclplus_pro_1.5.20_stable_unzipfirst_zend.zip
    jaclplus_pro_1.5.20_stable_unzipfirst_ioncube.zip
    joomla_1.5.0_to_1.5.20-stable-patch_package-jaclpluspro_zend.zip
    joomla_1.5.0_to_1.5.20-stable-patch_package-jaclpluspro_ioncube.zip
    joomla_1.5.18_to_1.5.20-stable-patch_package-jaclpluspro_zend.zip
    joomla_1.5.18_to_1.5.20-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: 7037901
Who's Online
We have 45 guests and 2 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
© 2010 ByOS Technologies
Joomla! is Free Software released under the GNU/GPL License.
CONTACT US NOW AT
enquiry@byostech.com
For Free Consultation
propecia sale
cialis 100 mg
order sildenafil online with no prescription
cialis canadian generic
viagra ordering canada
viagra ordering canada
pharmacy fast delivery viagra
buy viagra mexico
get levitra online
cialis soft
canadian viagra without prescription
viagra online without prescription
buy viagra online paypal vipps
price of propecia
discount brand name cialis
discount us propecia
large pharmacy discount code
mexico viagra
cialis 20 mg tablet
generic propecia mastercard
pfizer viagra online
cialis endurance
healthcare canadian pharmacy
viagra next day delivery
viagra tablets
viagra pills
tennessee online pharmacy propecia
propecia without a prescription
cialis 20 mg tablet
viagra cialis online
viagra online without prescription best price
viagra.com
best viagra and popular in uk
purchasing cialis with next day delivery
viagra usa
purchase of viagra or cialis etc
25mg viagra
viagra for men
china viagra
cialis prices in austral
viagra online deals
propecia sell england
buy real cialis online
cialis from canada
cheapest price levitra 10mg
cialis next day delivery uk
cheap onlin viagra in usa
buy cialis without prescription
propecia.com
best doses for propecia
levitra uphs
cialis for sale
approved on line drug stores
buy cheapest propecia
viagra india
cheap viagra for men
cheap propecia
purchase viagra in canada
canadian pharmacy cialis generic
brand cialis
100mg viagra
cialis samples
cheapest overnight cialis
buy viagra online canadian phamacy
free viagra without prescription
propecia libido
female viagra
brand cialis for sale
canadian pharmacy shop
viagra canada online
alternatives to cialis
fast dilivery viagra to canada
levitra tablet
cialis buy online
viagra next day delivery
cialis levitra
canadian pharmacy nizagara
cialis on line canada
viagra.com
canadian healthcare pharmacy
buy propecia 5mg
low price propecia
cialis germany
propecia generic
buy viagra in canada no prescription
buy 10 mg levitra without prescription
viagra for canada
cialisis in canada
where do you get viagra from
buying viagra without prescription
buy viagara online cheap
best price for levitra
canadian healthcare viagra
cialis professional
levitra sale
levitra tablets
discount cialis
buy cialis free shipping
daily cialis for sale
levitra without prescription
viagra overnight mail
buy cialis online
propecia buy
cialis 5mg online
cheap fast viagra
levitra uphs
cheap viagra sales
canadian cialis online
viagra online shop uk
non generic levitra
buy viagra for women
propecia fast no prescription
cialis alternatives
viagra purchesed on line out of canada
buy viagra
buy online viagra
generic propecia mastercard
order pfizer viagra with mastercard
buy cialis once daily
viagra for cheap
cialis online
china viagra
cialis generic recommended
cialis women
how do u buy propecia in canada
generic viagra canada
where can i buy propecia
get levitra online
viagra online without prescription from india
viagra or cialis for sale
www.levitra.com
propecia 5mg
prespitionless viagra
levitra without prescription
levitra purchase
cialis online without prescription
free viagra without prescription
order levitra online
buy cialis uk
pfizer viagra 50 mg online
viagra replacement
fast dilivery viagra to canada
viagra 50 mg
viagra sale
cialis by mail
canadi an pharmacy propecia
order generic levitra
generic propecia
female viagra cheap
cialis online doctor
viagra pharmacy
online pharmacy fast delivery
viagra cheap no prescription
cheap viagra from canada
buy generic levitra from uk
cialis germany
cialis soft pills
cheap levitra without prescription
cialis mexico
#1 canada pharmacy no prescription
pfizer viagra usa
buy viagra low cost
buy now online sildenafil
canadian healthcare rx no prescription
generic cialis canada
generic cialis mexico
cialis by mail
cialis next day delivery
buy viagra pharmacy online
buy cheap cialis online
cialis canada online pharmacy
canada price cialis
buy cialis netherlands
best price for generic cialis
cheap viagra on line
propecia studies
cialis online cheap
canadian viagra
viagra online canada pharmacy
order cialis online without prescription
cheap viagra overnight
how much is viagra 50
which is better viagra or cialis
buy cialis canada
buy levitra online without prescription
best discount cialis
where is propecia manufactured
canadian generic cialis
viagra uk delivery
canadian non prescription viagra
viagra online
buy propecia online
cialis professional 20 mg
soft tab generic cialis online pharmacy
purchase cialis overnight delivery
generic cialis 100
we deliver to canada viagra
propecia pills
propecia
viagra 100
viagra uk shop
levitra sex pill
buy viagra without a prescription
buy viagra online in uk
how to buy viagra in canada
viagra usa
cialis by women
viagr a pfizer
how to get viagra from canada
online pharmacy europe sildelafil
canadameds.com
indian cialis generic
generic viagra
buy viagra softtabs
proprecia how to buy
cialis overdose
buy cialis next day delivery
viagra from uk
generic viagra propecia
canadian pharmacy viagra
is it legal to buy viagra from canada
viagra from canada
viagra buy uk 50mg
50mg viagra retail price
buy viagra online in canada
viagra online no prescription
how to buy cialis
cheap viagra canada
buy cheap viagra online
cheap viagra canadian pharmacy
pharmacies in uk
viagra online canadiain
viagra online paypal
viagra canada
get cialis fast
buy pfizer viagra without prescription
prescription required viagra online 50mg
cheap drugs viagra cialas
buy 5 mg cialis
cialis on line india
buying cialis
viagra on line
generic propecia without prescription
fast working viagra in uk
cialis soft
buy viagra and receive it in canada fast
buy cialis cannada
viagra buy
when will viagra be generic
cialis levitra on line
viagra jelly
genetic viagra
viagra canada without prescription
bruising on cialis
cost of cialis
cialis from mexico
propecia mexico
india cialis
buy cialis online pharmacy
no prescription viagra
cialis for less 20 mg
real viagra
were to buy viagra
canadian non prescription viagra
canadian pharmacy viagra
canadian cialis
how much does cialis cost
cheap viagra 100mg
cialis on sale
cialis levitra viagra
viagra cost
viagra original buy uk
viagra for sale without a prescription
where to get levitra
viagra sales online
shop viagra
propecia fast no prescription
cialis from mexico
cialis from india
viagra online without prescription from canada
where do i get viagra
fast delivery canada cialis
non generic levitra
cialis 5 mg buy
purchase cialis overnight delivery
canadian pharmacy shop
viagra professional
viagra through canada
ByOSTech Chartered Membership!