Back-end: User vs Admin rights

Use GitHub to post feature requests for phpwcms.
Locked
User avatar
Kosse
Posts: 1066
Joined: Thu 9. Sep 2004, 12:08
Location: Brussels, Belgium
Contact:

Back-end: User vs Admin rights

Post by Kosse »

Hi,

I'm trying to find a solution to get a "user" (means NOT admin) to login into the back-end and only be able to "see":
- files
- discussions
- profile
- messages

I don't want them to access the " phpwcms.php?do=articles " page, as I am not a php specialist, how could I get a simple way to do that? (instead of "waiting" for the front end to come out? ... ;-)

Thank you if anybody has a clue.
brans

Post by brans »

ouhm so simply create a new field in your user-Table and set some rights there... you can figure out a mathematic system to check what category ppl are able to see. In your case you would just need two numbers... (ex. 1 and 2) simply enter a check wether users are from the first or the second group before allowing them to acces the pages and to see the links to those pages...
User avatar
Kosse
Posts: 1066
Joined: Thu 9. Sep 2004, 12:08
Location: Brussels, Belgium
Contact:

Thanks

Post by Kosse »

Thank you I will try that,

so if I understood I go to the Mysql tables and create rights there.
Mmm, I forgot to say that I'm neither a Mysql specialist but I will try, if I get something ok, I'll post it here.

Thanks again
Last edited by Kosse on Sun 19. Dec 2004, 19:57, edited 1 time in total.
User avatar
Kosse
Posts: 1066
Joined: Thu 9. Sep 2004, 12:08
Location: Brussels, Belgium
Contact:

Tables right and php in phpwcms.php

Post by Kosse »

Ok,

I'm kinda noob but I got this figured out:

1) In my Mysql table [ phpwcms_user ]
I have a column: [ usr_admin ] , there it says 1 if admin or 0 if user. So I guess there are my "rights".

2) I went to the phpwcms.php page, I guess there I have to write somewhere a line that says something like:
SELECT * FROM `phpwcms_user` WHERE `usr_admin` ...

In words: I guess here is where I have to say get the user table, check if usr_admin is 1 or 0 and then show or not the section. Like in line 60 if usr_admin is 1 show:
case "articles" --> blabla
if not, don't show
case "articles" --> blabla

But as I said I am a noob, so I'm stuck here...

Sorry to bother if someone (and I'm sure there are a lot) could take 5 minutes (or is it more complicated than that?) to check this out
10.000 times thanks!
Last edited by Kosse on Sun 19. Dec 2004, 19:56, edited 1 time in total.
User avatar
Kosse
Posts: 1066
Joined: Thu 9. Sep 2004, 12:08
Location: Brussels, Belgium
Contact:

is this the right place?

Post by Kosse »

Again me,

is this the right place to put this post or should it be in section hack and enhancements?


------------------------------------------------
Thank you Frold, I've moved the post to:

http://www.phpwcms.de/forum/viewtopic.php?p=28521

You can delete this one.
------------------------------------------------
Last edited by Kosse on Mon 20. Dec 2004, 10:44, edited 1 time in total.
frold
Posts: 2151
Joined: Tue 25. Nov 2003, 22:42

Post by frold »

yep I would post it in the hack section
http://www.studmed.dk Portal for doctors and medical students in Denmark
Locked