Discuz and Ucenter background can not login (login automatic exit) solution

Source: Internet
Author: User
Kangsheng Discuz and Ucenter often someone response backstage can not login or login automatically exit after the problem, it is very let a person egg pain, sometimes appear validation code CCCC problems and then prompted the verification code error.

Discuz better solution, the config.inc.php inside the Chekip off can be landed,

$ADMINCP [' checkip '] = 0; Background Admin operation verifies the administrator's IP, 1 = is [secure], 0 = No. Set 0 only when the administrator is unable to log in to the background.
$ADMINCP [' tpledit '] = 0; Whether to allow online editing forum Template 1 = is 0 = no [security]
$ADMINCP [' runquery '] = 1; Whether to allow the background to run SQL statement 1 = is 0 = no [security]
$ADMINCP [' dbimport '] = 1; Whether to allow background recovery Forum Data 1 = is 0 = no [security]
$ADMINCP [' checkip '] = 0; Background Admin operation verifies the administrator's IP, 1 = is [secure], 0 = No. Set 0 only when the administrator is unable to log in to the background.
$ADMINCP [' tpledit '] = 0; Whether to allow online editing forum Template 1 = is 0 = no [security] $admincp [' runquery '] = 1; Whether to allow the background to run SQL statement 1 = is 0 = no [security]
$ADMINCP [' dbimport '] = 1; Whether to allow background recovery Forum Data 1 = is 0 = no [security]
;
But Ucenter can not solve this method, Google for a long time, the official forum has no solution, had to do their own. Through the test found that my IP Refresh page is changed once, dynamic IP caused this problem. Had to use cookies to solve the problem. can now log on normally.
Check the data through this code, and then borrow the cookie's online IP. The problem was solved after the modification. Give it a try.
File found according to directory: Ucenter's model/base.php
Find:

$this->onlineip = $match [0]? $match [0]: ' Unknown ';
Insert a piece of code after this code:

Cookies <=> onlineip:2012-05-05 ipwise.cn
$isonlineIP = isset ($_cookie[' ONLINEIPD ']) &&!empty ($_cookie[' ONLINEIPD ']);
if ($isonlineIP) {
$this->onlineip = $_cookie[' ONLINEIPD '];
}else{
Setcookie ("ONLINEIPD", $this->onlineip, Time () +3600, "/");
}
Unset ($isonlineIP);

After saving the upload coverage problem is solved.

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.