überfuzz wrote:First of all, how do you store user_data? In an sql-table? Check the file session.php You need to add some info about access level. Then you'll be able to check users access level and hide parts of a file or whole files to dfferent users.
Yes, one way you would do
is to create a new table in database with 2-3 fields
it would take UserID number from Users table
and add a user LEVEL for each user.
Banned IP-numbersshould have Level=0 ... you do not want them at your pages, at all
Guests could have a default level of 1
Normal User = Level 2
Special users Groups, level = 3-8
Admin level= 9
and so on
CREATE TABLE user_level {
ItemID integer AUTO_INCREMENT,
UserID integer UNIQUE, (this is the UserID, taken from UserTable)
ULevel integer ( range from 0-9 )
----------
BannedIP string ( this is probably only makingcomplications, but an Idea )
.. it is much better to make a new special 'TABLE banned_ips' ... for this!
}
===========================
I want to know if you have access to a web interface called phpMyAdmin.
With this you should be able to login and CREATE new table, very easy 🙂
This is the start.
Then, like told, have a look where user BECOMES 'logged_in',
most probably in file: includes/session.php
If we are very lucky 🙂 it could be enough if you add a new function, method in this file. this class.
A function to get level from user_level TABLE, each time somebody Login.
The default visitor would get the default Level = 1, ( or 0 ), without Logging in.
This could also be set in same file: session.php
Inside session.php you would probably see this or something like it:
<?php
class session {
function check_login (){
//code
}
// this one function we need to add
function set_user_level(){
// code for this operation
// get 'level' from TABLE user_level
// for UserID #nn
return $level
}
?>
regars 🙂
halojoy