How to use:
- First Scenario / Basic Setting - you want to create one new page named "TESTING" and can only access it by user named "norman".
- Second Scenario / Advanced Setting - you want to add specific access to "TESTING" to specific user named "norman".
First Scenario / Basic Setting :
- Create new user/register named "norman" (you can do it, i don't need explain it to you).
- Create new page named "TESTING". create a new blank text document and renamed it "testing.php" on your php-fusion root folder. open and copy paste it with this code below:
<?php
require_once "maincore.php";
require_once THEMES."templates/header.php";
opentable('testing');
?>
hello, ACL!
<?php
closetable();
require_once THEMES."templates/footer.php";
?>
- Now, we would like to make a new menu link named "TESTING" and link url targeted to "testing.php" (you can do it, i don't need explain it to you). hint : located at admin panel -> system admin tab -> site links.
- To test it if you made it right or not. Go to home page then click the navigation menu "TESTING" then it should be like this :
- Go to ACL admin page. On the section "Assign Access". Choose user named "norman" and checked the menu named "TESTING". save it. (Note *: if not even a single user have access on certain page then that page is assumed as public page, meaning can be accessed by any one).
- Ok now you have already set "norman" have an access on "TESTING" page. You can try yourself as admin won't able to access "TESTING" page anymore.
- To test it. you can go to home page. then try to click access the "TESTING" page. if it success blocking the user then it'll look like this :
if you use "norman"
- There is a section called "Copy User Access". It is for copycat like function. so you won't have to assign access one by one. how to use it? simply choose user then checked one to many user you like to copycat.
Second Scenario / Advanced Setting :
- You must follow the "First Scenario" first.
- Next, go to ACL admin page. Click on the section "Advanced Setting" and focus on section "Manage Parameters" first . For the first time, you must add some parameters.
- Ok, now fill it on the parameter field and click save. in this example please fill 3 parameters (save, update, delete). if you made mistake, you can delete it by click on it delete button[x]. if you make it right then it should look like this :
- Next step is to focus on section "Assign Detail Access". Choose user named "norman" with page "TESTING" and checked in "save" parameters only for now. save it.
- Now open "testing.php" and edit it with this line of code :
<?php
require_once "maincore.php";
require_once THEMES."templates/header.php";
opentable('testing');
echo 'save='.acl_get_access('save').'<br>';
echo 'delete='.acl_get_access('delete').'<br>';
echo 'update='.acl_get_access('update').'<br><br>';
?>
hello, ACL!
<?php
closetable();
require_once THEMES."templates/footer.php";
?>
- Save it. then go to home page & visit the "TESTING" page. if you do it right then you should get a look like this :
- Ok, what can we conclude now? Actually we can retrieve page detail access parameters information using key word "acl_get_access('your parameters name')". This is usefull if we would like to specific some page with additional security access(is this user allow to save,update,delete, etc? like that...).
- Finish... have fun. Sorry if my English is bad. :p
|