aman16
Posts: 19
|
| Posted: 09/15/2010, 5:34 AM |
|
hiii
i m a newbie to codechrge,. i m trying to build a project in which i need to LOGIN as two differnt user, ONE as ADMIN n Other as USER with the same login page n most important.... when i login as ADMIN it wil REDIRECT to a page n When i login as USER it will redirect to a different page
when logged in as ADMIN, next page (say homepage.php) where menu will be different AND
when logged in as USER, next page is abc.php
what is the code to do this
plzzz help me out
thanksssssssss [n advance]
_________________
Mc T
......................................
|
 |
 |
CodeChargeMVP
Posts: 473
|
| Posted: 09/15/2010, 11:02 AM |
|
Hello,
What you want to do is settled up on the project settings,
please download and read carefoully the introduction manual to CCS.
_________________
Best Regards
Entrepeneur | NT Consultant
|
 |
 |
andy
Posts: 183
|
| Posted: 09/16/2010, 1:32 AM |
|
Just to get you going in the right direction, go to your Project Settings dialog (Project menu | Settings) and look at the Security and Security Groups sections.
Read up on how to implement these.
Basically you need a field in your main user table that defines their security level (an integer between 0-9). By default assign new users as a basic level (e.g. 1) and yourself as the administrator (9). You can have different groups but keep it simple to start with!
Then on each and every page (and you can also do it per object on a page but I would recommend you make separate admin and user pages) at page level in the Data tab under Properties, find "Restricted". Set it to yes and click the elipsis (...) to define which groups have access.
Note that you first need to define your Security groups in the Settings dialog as described above.
Then every time a user logs on, CCS identifies their security level and gives them access to pages or blocks them. If they are blocked you can direct them to an AccessDenied page of your own making.
You wouldn't use this Access Denied Page setting though to redirect your users as part of the normal redirection process. This is just for naughty users who try to access an admin page.
Do some research on "Redirect" for redirecting according to parameters.
The normal way to redirect users is using the "Return Page" setting on a form's (or button's) Data tab under Properties.
Personally, I find it better and easier to create one version of a page for administrators and another version of a page for users. You usually would want to add different features. You still enable security settings accordingly. You may find it easier to manage your project this way.
I personally prefix my admin pages with ad_ (e.g. ad_profilepage.php and just profilepage.php for users).
Hope that gets you on the right track! Good luck and enjoy...
_________________
Andy
RAD tools for rich UI controls:
http://www.koolphptools.com |
 |
 |
aman16
Posts: 19
|
| Posted: 09/20/2010, 12:34 AM |
|
thankss a lot ........
ok As u told me , you use two different upages as ad_profilepage.php for admin AND profilepage.php for USER
okkkkkkk
--- if a user logged in using a login page, he will be redirected to ad_profilepage.php AND if a USER logged in using the same login page , he will be redirected to profilepage.php
now my Question is???---1) HOW U WILL DO THIS , WHAT IS THE CODING
2) there might b a need to store the session in a variable--Isn't it?
So tel me how will u proceed ????????
[thanks in advance]
_________________
Mc T
......................................
|
 |
 |
|