PHP Login System with Admin Features

This forum was created to talk about the PHP Login System with admin features created by jpmaster77 on evolt's website


    Admin only can add users

    Share

    curiousme

    Number of posts : 1
    Registration date : 2009-01-15

    Admin only can add users

    Post  curiousme on Thu Jan 15, 2009 3:32 pm

    I am trying to figure out how to make it so users cannot register themselves and the only way to gain access is for the admin to add you as a user. Is there a code out there for that?
    Thanks
    avatar
    Linchpin311

    Number of posts : 220
    Age : 33
    Localisation : Long Island
    Registration date : 2007-05-14

    Re: Admin only can add users

    Post  Linchpin311 on Mon Feb 09, 2009 4:35 pm

    Not really... but its simple enough to implement.

    1) First i would remove the "register" link anywhere it appears on the site.

    2) Then add a conditional in register.php that verifies the user viewing the page is an admin (or you could even check for your username which would block other admin's who arent you). If not, have the page redirect to main.php or index.php or whatever.

    3) Voila! you now have a form that will register new users that only you have access to!

    Hope that helps!


    _________________
    in the end, the universe tends to unfold as it should...

    Also note that it is your responsibility to die() if necessary.

      Current date/time is Tue Oct 23, 2018 9:26 am