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.15 Stable for Joomla! 1.5.15 Stable
    jaclplus_pro_1.5.15_stable_unzipfirst_zend.zip
    jaclplus_pro_1.5.15_stable_unzipfirst_ioncube_zend.zip
    joomla_1.5.0_to_1.5.15-stable-patch_package-jaclpluspro_zend.zip
    joomla_1.5.0_to_1.5.15-stable-patch_package-jaclpluspro_ioncube.zip
    joomla_1.5.14_to_1.5.15-stable-patch_package-jaclpluspro_zend.zip
    joomla_1.5.14_to_1.5.15-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: 6045408
Who's Online
We have 15 guests and 4 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
buy cheap generic levitra online
Cialis samples
cheap levitra tablets
viagra where to buy
buy viagra online cheap
Buy levitra online no prescription
where can i purchase viagra online
Buy discount viagra
Levitra without prescription
where to purchase viagra
buying viagra online
Professional cialis online
best cialis price
cheap viagra from pfizer
cialis 20 mg tablet
Levitra sex pill
Cialis india pharmacy
overnight delivery cialis
Best levitra price
Should i chew cialis
does propecia work
buy cialis pharmacy
cialis and levitra
Cialis canada illegal buy
get viagra fast
original viagra
cialis canadian
cheap viagra pill
where to buy vardenafil
buy cheap viagra
Brand name cialis
Online levitra
Buy propecia now
Next day viagra
buy cialis tadalafil
buy cheap cialis
cialis cheap
side effects of propecia
where can i get viagra
cialis buy on line
order viagra softtabs
canadian viagra
Info levitra
cialis next day
buy generic 50mg cialis
Best price levitra
buy cialis us
Women levitra
Generic online propecia
propecia lowest canadian pharmacies
order viagra usa
how to buy cialis in canada
buy cialis online viagra
cheapest viagra online in the uk
Cheap levitra without prescription
cheap viagra sales
private uk viagra prescription
pfizer viagra
purchase sildenafil
buy cialis pills generic
viagra woman
viagra prescription
cialis 10mg
buy viagra with discount
viagra womens
Viagra order
generic viagra propecia
price of cialis in canada
uk biggest viagra gang
viagra rx in canada
free viagra without prescription
canadian pharmacy
Cialis order
viagra soft tabs 100 mg
where to buy viagra from
how to get cialis
viagra online pharamcy

real viagra
buy viagra at the best price
cialis on line
viagra online
cheap generic viagra on line
Similar cialis
cialis online sale
viagra from canada
generic propecia without prescription
buy cialis
Cialis delivered overnight
cialis soft
viagra next day delivery
Cialis online usa
cheap generic india viagra
50mg generic viagra
viagra order online
buy viagra discrete uk
cheap viagra 25mg
viagra uk without prescription
buy viagra online uk
cialis alternatives
pfizer viagra uk
order propecia
real viagra without prescription
generic cialis
cheapest viagra next day delivery uk
Mail order levitra
viagra uk cheap
buy generic cialis uk
Generic levitra vardenafil
buy cialis pill
low cost viagra online
order cheap cialis
buy viagra without prescription online pharmacy
cialis on line canada
buy viagra now online
effects of cialis
buy viagra all information
buy lady uk viagra
cheap online generic viagra
viagra online uk
buy cheap online viagra
womens viagra
how to get propecia
order 50mg viagra
viagra discount sale
buy viagra pharmacy online
buy cheap cialis online
Drug hair loss propecia
viagra rrp australia cost
Online propecia cheap
buy viagra here in the uk
purchase viagra soft tabs
Buying propecia
cialis sales
order pfizer viagra with mastercard
buy viagra australian
Viagra injectable
cialis price
viagra uk retail price
Canadian pharmacy viagra legal
Buy cialis canada
viagra for sale in the uk
buy viagra without prescription
buy cialis online, canada
cheap genefric viagra online
Original brand cialis
Brand viagra professional
viagra suppliers in the uk
viagra propranodol
Cialis dose
propecia propak
viagra uk cheap purchase buy
Order viagra online
buy cialis online sildenafil
cialis in canada
spain female viagra
Low price propecia
viagra alternatives
Levitra in uk
Buy pfizer viagra online
where to get viagra
viagra sales uk
low cost canadian viagra
Usa cialis sales
Buy levitra lowest prices
viagra buy now
once daily cialis online prescription
buy cialis uk
ByOSTech Chartered Membership!