Author Topic: How can you register users for certain period?  (Read 3806 times)

0 Members and 1 Guest are viewing this topic.

Offline Sun Zaza

  • Sr. Member
  • ****
  • Posts: 399
    • View Profile
How can you register users for certain period?
« on: January 06, 2010, 10:42:42 AM »
Hello,

I started 2010 with a lot of questions.

How can you register users for certain period? For example:

Via admin area I register the userA for a period of 1 month, after that he wil not be able to log in again.

PS: 4IMAGES has this option for goups, not yet for users

Many thanks in advance for your help.
Cruxy

Offline Sun Zaza

  • Sr. Member
  • ****
  • Posts: 399
    • View Profile
Re: How can you register users for certain period?
« Reply #1 on: January 09, 2010, 05:00:45 PM »
Hey php guys, I don't believe that my request is a mission impossible. Maybe you can give us a hint, tip or something to help me or someone else to code this.

Do not forget: Nothing is impossible. Just give it a try.

I appreciate your reactions,
Cruxy

Offline V@no

  • If you don't tell me what to do, I won't tell you where you should go :)
  • Global Moderator
  • 4images Guru
  • *****
  • Posts: 17.849
  • mmm PHP...
    • View Profile
    • 4images MODs Demo
Re: How can you register users for certain period?
« Reply #2 on: January 09, 2010, 08:38:27 PM »
It's not impossible, it's just I don't think this will be useful many people...


Not tested.
In includes/sessions.php find:
    return $user_info;

Insert above:
    if ($user_info['user_level'] != GUEST && $user_info['user_level'] != ADMIN && $user_info['user_joindate'] < time() - 2678400//2678400 = 60sec * 60min * 24hours * 31days
      
return $this->load_user_info();


If it works, you can easily expand this to an additional field routine and then replace number 2678400 with $user_info['user_expire'] (assuming user_expire is the name of the additional field, which will store the number of seconds before user is become locked out)
Your first three "must do" before you ask a question:
Please do not PM me asking for help unless you've been specifically asked to do so. Such PMs will be deleted without answer. (forum rule #6)
Extension for Firefox/Thunderbird: Master Password+    Back/Forward History Tweaks (restartless)    Cookies Manager+    Fit Images (restartless for Thunderbird)

Offline Sun Zaza

  • Sr. Member
  • ****
  • Posts: 399
    • View Profile
Re: How can you register users for certain period?
« Reply #3 on: January 11, 2010, 08:25:28 PM »
Thanks V@no. I will test it later.
Cheers man.