If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > webdatabase help!

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-24-08, 17:54
l3g0m&n l3g0m&n is offline
Registered User
 
Join Date: Apr 2008
Posts: 5
webdatabase help!

hello!

im creating a webdatabase program thats kind of like flickr
im abit stuck and could really use some help! so thanks in advanced!

ive managed to get session authentication through username password verification from a table in the database.

im abit confused now, as it seems i need to grant every user specifically with rights to do certain things.

say i want users to only be able to edit their own photos but view all photos , how do i do this? andif i give them that access will they not be able to view all the data from say the user tables which isnt good?

i assume the best way would be to write some php code that will selfcode the GRANT SELECT etc etc for each user during the registration step?

please give me some pointers!


even then how will i make
Reply With Quote
  #2 (permalink)  
Old 04-25-08, 16:54
Jackboy Jackboy is offline
Registered User
 
Join Date: Apr 2008
Location: West Sussex
Posts: 19
I have something similar to what you want on my site.

Let me find the code...

I have a table called usergroup. It has a groupid, for example groupid "1" is administrators.

In the users table i would have a collumn called level, which for ME would contain the level "1" (the super admin level).

Then it selects my level from the table usergroups and checks if my permissions = yes

ie
PHP Code:
if ($userlevel[caneditphoto] == "yes"){

etc

PHP Code:
// User Permission check, tested 11/04/08
//
if ($_SESSION[id] != ""){
$userpermcheck mysql_query("SELECT * FROM `usergroup` WHERE `groupid` = '$userdet[level]'");
$userperm mysql_fetch_array($userpermcheck);
}
//
// User Permission check, tested 11/04/08 
Excuse messy coding, only 14 years old lmao.


But still its easy to do. If you need any more help then just reply, if i have posted the wrong response feel free to spam me lmao

Oh and you would have the default table values for permissions such as logout as yes. :P

Last edited by Jackboy; 04-25-08 at 16:57.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On