SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Thread: admin area, deactivate/reactivate account?

  1. #1
    SitePoint Enthusiast gillian's Avatar
    Join Date
    Oct 2005
    Location
    Scotland
    Posts
    66
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question admin area, deactivate/reactivate account?

    Hey folks =)

    Hope all is well.

    When making an admin area i have always just allowed 'delete the user', but is it possible to deactivate and reactivate a username and password.

    I can picture it in my noggin. when viewing all the users there is the ability to check a box selecting deactive or reactivate depending on the state of the username at the time.

    What do you think, is it more hassle than its worth to allow this?

    Any thoughts is much appreciated.
    thanks in advance,
    gillian

  2. #2
    HardCoder md_irfan_amu's Avatar
    Join Date
    May 2005
    Location
    Asia
    Posts
    215
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This is better way than deleteing a user permanently, have an extra field in database that whether a user is activa or inactive, and admin can update this anytime, to make active or inactive....
    Irfan
    Find Tutors Easyway to get connect with your tutor in india

  3. #3
    SitePoint Enthusiast gillian's Avatar
    Join Date
    Oct 2005
    Location
    Scotland
    Posts
    66
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    excellent, thanks =)

    I've never coded this before by any happy chance could you break down exactly how i would do this...

    as you said the database would have an extra field.... would the code be simply an if statement..

    if inactive redirect user to page 'this login is disabled'
    else let user in.

    must admit, it is sounding like a pretty nifty wee function.

    thanks again,
    gillian

  4. #4
    SitePoint Guru SSJ's Avatar
    Join Date
    Jan 2007
    Posts
    828
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes you can do this easily.

    For this functionality,
    You have to add an extra field in DB as said.
    This field should be BIT type which will accept only 2 values. True or False.
    and you have to set it accordingly...

    If user is disabled then set it to 0 Else 1.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •