Thinkphp member registration expires after 1 years auto-black

Source: Internet
Author: User

//Login Verification Submission     Public functionDologin () {$use= M ("Users"); $username=i (' Post.username '); $yh=$use->where ("User_login = ' {$username} ' ")->select ();//Search for user- created time based on user-submitted user name        $tim=$yh[0] [' Create_time '];//time the user was created        $timec=Strtotime("$tim+ 1 Year ");//Timestamp (time + 1 years) of the creation of the user        $notim=Strtotime(' Now ');//The time stamp now, if the timestamp is now greater than the timestamp (created time + 1), performs a pull-black operation (user_status = 0) and a friendly prompt, else performs normal access        if($notim>$timec)        {            $data[' user_status '] = 0; $use->where ("User_login = ' {$username} ' ")->save ($data); $this->error ("Your registered member has expired, please contact customer service or renew use!") "); }        Else        {            if(!Sp_check_verify_code ()) {            $this->error ("Captcha Error! "); }            $users _model=m ("Users"); $rules=Array(                    //Array (validation fields, validation rules, error prompts, validation criteria, additional rules, validation time)                    Array(' username ', ' require ', ' mobile phone number/email/username cannot be empty! ', 0),Array(' Password ', ' Require ', ' password cannot be empty! ', 0),            ); if($users _model->validate ($rules)->create () = = =false){                $this->error ($users _model-GetError ()); }            $username=i (' Post.username '); if(Preg_match('/(^ (13\d|15[^4\d]|17[13678]|18\d) \d{8}|170[^346\d]\d{7}) $/',$username)){//Mobile phone Number login                $this-_do_mobile_login (); }Else{                $this->_do_email_login ();//user name or email loginSession (' Uname ',$username); }        }    }
View Code

Thinkphp member registration expires after 1 years auto-black

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.