Jump to content

adding users to an existing login script


wezze

Recommended Posts

Hi

i was wondering how to add userlvls to an existing login script.

this is what i alrdy did

 

constant.php

efine("ADMIN_NAME", "admin");
define("MOD_NAME", "Mod");
define("MEMBER_NAME", "Member");
define("USER_NAME", "User");
define("GUEST_NAME", "Guest");
define("ADMIN_LEVEL", 9);
define("MOD_LEVEL", 7);
define("MEMBER_LEVEL", 5);
define("USER_LEVEL",  2);
define("GUEST_LEVEL", 0);

 

now i was wondering how to use this in this part

 

index.php

if($session->logged_in){
echo 'some text';


if($session->isAdmin()){
echo "some text";

}
echo "<p>  </p>"
."<center>[<a href=\"process.php\">Logout</a>]</center>";
}
?>

 

and if i need to add/change more then this?

 

thx

Link to comment
Share on other sites

ok ive added this

if ($_SESSION[ 'member' ]==2) { 
echo 'some text';

} elseif ($_SESSION[ 'user' ]==5) { 
echo 'some text';
}

 

but the problem i have is in my admin center when i change a userslvl it doesnt change i can only change it to 1or9

when i choose 2,5,7 it becomes 1.

 

Any ideas what im doing wrong or forgetting?

This is my DB

var $connection;         //The MySQL database connection
   var $num_active_users;   //Number of active users viewing site
   var $num_active_guests;  //Number of active guests viewing site
   var $num_members;        //Number of signed-up users
   /* Note: call getNumMembers() to access $num_members! */

 

do i need to add something here?

 

thx

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.