本文整理汇总了PHP中WCF::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP WCF::__construct方法的具体用法?PHP WCF::__construct怎么用?PHP WCF::__construct使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WCF
的用法示例。
在下文中一共展示了WCF::__construct方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* @see WCF::__construct()
*/
public function __construct()
{
// include options before locking
try {
$this->initOptions();
} catch (Exception $e) {
// ignore ...
}
// check locking
$userID = @intval($_COOKIE[COOKIE_PREFIX . 'userID']);
if ($userID) {
$i = 0;
do {
try {
LWUtil::checkLock($userID);
// everything okay
break;
} catch (SystemException $e) {
if ($i >= 6) {
die($e->getMessage());
}
++$i;
usleep(500000);
}
} while (true);
}
// bugfix
if (WCF::getDB() !== null) {
return false;
}
parent::__construct();
// game-frontend only
if ($this->getUser()->userID == 0) {
return;
}
$args = array_merge($_GET, $_POST);
if (isset($args['password'])) {
unset($args['password']);
}
// log request
$sql = "INSERT INTO ugml_request\r\n\t\t\t\t(userID, `time`, ip,\r\n\t\t\t\t data)\r\n\t\t\t\tVALUES\r\n\t\t\t\t(" . $this->getUser()->userID . ", " . TIME_NOW . ", INET_ATON('" . $_SERVER['REMOTE_ADDR'] . "'),\r\n\t\t\t\t '" . escapeString(SerializeUtil::serialize(array('page' => LWUtil::getFileName(), 'args' => $args))) . "')";
WCF::getDB()->sendQuery($sql);
self::$requestID = WCF::getDB()->getInsertID();
if ($this->getUser()->lastLoginTime < TIME_NOW - 60 * 60 * 12 && $this->getUser()->lastLoginTime > 1188597600 && !defined('LOGIN')) {
self::logout('index.htm');
}
if ($this->getUser()) {
if ($this->getUser()->urlaubs_modus == 2) {
$sql = "UPDATE ugml_users\r\n\t\t\t\t\t\tSET urlaubs_modus = 0\r\n\t\t\t\t\t\tWHERE id = " . $this->getUser()->userID;
WCF::getDB()->sendQuery($sql);
Session::resetSessions($this->getUser()->userID);
$this->getUser()->urlaubs_modus = 0;
}
}
$this->initPlanet();
// detect bots
/*require_once(LW_DIR.'lib/data/protection/BotDetector.class.php');
new BotDetector();*/
$this->initSpec();
}
示例2: __construct
/**
* @see WCF::__construct()
*/
public function __construct()
{
parent::__construct();
// call custom construct methods
$this->initHostManager();
}
示例3: __construct
/**
* @see WCF::__construct()
*/
public function __construct()
{
// include options before locking
try {
$this->initOptions();
} catch (Exception $e) {
// ignore ...
}
// check locking
$userID = @intval($_COOKIE[COOKIE_PREFIX . 'userID']);
if ($userID) {
$i = 0;
do {
try {
LWUtil::checkLock($userID);
// everything okay
break;
} catch (SystemException $e) {
if ($i >= 6) {
die($e->getMessage());
}
++$i;
usleep(500000);
}
} while (true);
}
// bugfix
if (WCF::getDB() !== null) {
return false;
}
parent::__construct();
// game-frontend only
if ($this->getUser()->userID == 0) {
return;
}
$args = array_merge($_GET, $_POST);
if (isset($args['password'])) {
unset($args['password']);
}
// log request
$sql = "INSERT INTO ugml_request\n\t\t\t\t(userID, `time`, ip,\n\t\t\t\t data)\n\t\t\t\tVALUES\n\t\t\t\t(" . $this->getUser()->userID . ", " . TIME_NOW . ", INET_ATON('" . $_SERVER['REMOTE_ADDR'] . "'),\n\t\t\t\t '" . escapeString(SerializeUtil::serialize(array('page' => LWUtil::getFileName(), 'args' => $args))) . "')";
WCF::getDB()->sendQuery($sql);
self::$requestID = WCF::getDB()->getInsertID();
if ($this->getUser()->lastLoginTime < TIME_NOW - 60 * 60 * 12 && $this->getUser()->lastLoginTime > 1188597600 && !defined('LOGIN')) {
self::logout('index.htm');
}
if ($this->getUser()) {
if ($this->getUser()->urlaubs_modus == 2) {
$sql = "UPDATE ugml_users\n\t\t\t\t\t\tSET urlaubs_modus = 0\n\t\t\t\t\t\tWHERE id = " . $this->getUser()->userID;
WCF::getDB()->sendQuery($sql);
Session::resetSessions($this->getUser()->userID);
$this->getUser()->urlaubs_modus = 0;
}
}
// TODO dirty banned-fix
if ($this->getUser()->wotBanned) {
$row = WCF::getDB()->getFirstRow("SELECT * FROM ugml_banned WHERE who = '" . WCF::getUser()->username . "' ORDER BY id DESC");
require_once WCF_DIR . 'lib/system/exception/NamedUserException.class.php';
throw new NamedUserException('Du bist bis ' . date("d.m.Y G:i:s", $row['longer']) . ' von <a href="mailto:' . $row['email'] . '?subject=banned:' . $row['who'] . '">' . $row['author'] . '</a> gesperrt. Grund:<br><br>' . $row['theme'], 'Gebannt');
}
$this->initPlanet();
// detect bots
/*require_once(LW_DIR.'lib/data/protection/BotDetector.class.php');
new BotDetector();*/
$this->initSpec();
}