18 require_once SQ_CORE_PACKAGE_PATH.
'/system/authentication/authentication/authentication.inc';
19 require_once SQ_PACKAGES_PATH.
'/ipb/ipb.inc';
20 require_once SQ_FUDGE_PATH.
'/general/www.inc';
66 $bridges = $GLOBALS[
'SQ_SYSTEM']->am->getChildren($this->
id,
'ipb_bridge', TRUE);
67 foreach ($bridges as $bridgeid => $type_code) {
69 $bridge =& $GLOBALS[
'SQ_SYSTEM']->am->getAsset($bridgeid);
70 if (is_null($bridge))
continue;
73 if ($bridge->status != SQ_STATUS_LIVE)
continue;
75 $ipb =& $bridge->getIpbConn();
78 if (valid_email($username)) $email_login = TRUE;
80 if (!$this->
attr(
'allow_banned')) {
82 $result = $ipb->canViewBoard($username);
83 if (empty($result))
return $user;
84 $can_view = intval($result[
'g_view_board']);
85 if (!$can_view)
return $user;
87 $result = $ipb->authenticateUser($bridge, $username, $password, $email_login);
89 $GLOBALS[
'SQ_SYSTEM']->am->includeAsset(
'ipb_user');
90 $data = $ipb->getMemberInfoByName($username);
91 $data[
'id'] =
'u_'.$data[
'id'];
92 $user =
new Ipb_User($bridge->id, $data);
118 $bridges = $GLOBALS[
'SQ_SYSTEM']->am->getChildren($this->
id,
'ipb_bridge', TRUE);
119 foreach ($bridges as $bridgeid => $type_code) {
120 $bridge =& $GLOBALS[
'SQ_SYSTEM']->am->getAsset($bridgeid);
121 if (is_null($bridge))
continue;
124 if ($bridge->status != SQ_STATUS_LIVE)
continue;
126 $ipb =& $bridge->getIpbConn();
127 $data = $ipb->getMemberByName($username);
128 if (empty($data))
continue;
130 $GLOBALS[
'SQ_SYSTEM']->am->includeAsset(
'ipb_user');
131 $user =
new Ipb_User($bridge->id, $data);
149 $username = $user->attr(
'name');
150 if (!isset($_SESSION[
'user_login_attempts'])) {
151 $_SESSION[
'user_login_attempts'] = Array();
153 if (empty($_SESSION[
'user_login_attempts'][$username])) {
154 $_SESSION[
'user_login_attempts'][$username] = 1;
156 $_SESSION[
'user_login_attempts'][$username]++;
159 if ($_SESSION[
'user_login_attempts'][$username] >= SQ_CONF_MAX_LOGIN_ATTEMPTS) {
160 if (!is_null($user) && $user->canLogin()) {
162 $ms =& $GLOBALS[
'SQ_SYSTEM']->getMessagingService();
164 'asset_name' => $user->name,
165 'user_name' => $username,
166 'num_attempts' => (
int)SQ_CONF_MAX_LOGIN_ATTEMPTS,
168 $log = $ms->newMessage(Array(),
'system.security.login.ipb', $msg_reps);
169 $log->parameters[
'remote_addr'] = $_SERVER[
'REMOTE_ADDR'];
170 $log->parameters[
'sessionid'] = session_id();
188 SQ_LINK_TYPE_1 => Array(
189 'ipb_bridge' => Array(
191 'exclusive' => FALSE,