Lines Matching refs:this

32 		$this->lockfh        = null;
33 $this->users_tracker = null;
34 $this->blocked = null;
42 $controller->register_hook('AUTH_LOGIN_CHECK', 'BEFORE', $this, 'disable_login', array());
43 $controller->register_hook('AUTH_LOGIN_CHECK', 'AFTER', $this, 'register_login_fail', array());
53 if($ACT === 'login' || $this->getConf('tba_block_whole_wiki'))
55 $this->lock();
58 $banned_f = $conf['cachedir'] . '/' . $this->getConf('tba_block_file');
65 $this->blocked = array();
67 $this->blocked = @unserialize($content);
70 if($this->blocked === false)
71 $this->blocked = array();
75 $track_f = $conf['cachedir'] . '/' . $this->getConf('tba_iptime_file');
83 $this->users_tracker = array();
85 $this->users_tracker = @unserialize($content);
88 if($this->users_tracker === false)
89 $this->users_tracker = array();
96 …if(in_array($ip, preg_split('/[\s,]+/', $this->getConf('tba_whitelist'), null, PREG_SPLIT_NO_EMPTY…
98 $this->unlock();
103 if(array_key_exists($ip, $this->blocked))
105 if($this->blocked[$ip] + $this->getConf('tba_block_time') > $time)
108 $this->_do_disable_login($ip, $this->blocked[$ip]);
109 $this->unlock();
115 unset($this->blocked[$ip]);
119 $ts = $this->users_tracker[$ip];
120 $time = $time - $this->getConf('tba_mean_time');
121 $max = $this->getConf('tba_nb_attempt');
146 $this->users_tracker[$ip] = $ts;
150 $this->blocked[$ip] = $time + $this->getConf('tba_mean_time');
153 io_saveFile($track_f, serialize($this->users_tracker));
156 io_saveFile($banned_f, serialize($this->blocked));
159 $this->unlock();
161 if(array_key_exists($ip, $this->blocked))
162 $this->_do_disable_login($ip, $this->blocked[$ip], true);
175 $this->lock();
181 if(empty($this->users_tracker[$ip]))
182 $this->users_tracker[$ip] = array($time);
184 $this->users_tracker[$ip][] = $time;
187 …io_saveFile($conf['cachedir'] . '/' . $this->getConf('tba_iptime_file'), serialize($this->users_tr…
190 $this->unlock();
201 $lockf = $conf['cachedir'] . '/' . $this->getConf('tba_lockfile');
203 $this->lockfh = fopen($lockf, 'w', false);
205 if($this->lockfh === false)
208 if(flock($this->lockfh, LOCK_EX) === false)
210 fclose($this->lockfh);
211 $this->lockfh = null;
223 if(!is_null($this->lockfh))
225 flock($this->lockfh, LOCK_UN);
226 fclose($this->lockfh);
227 $this->lockfh = null;
242 $title = $this->getLang('page title');
243 $text = $this->locale_xhtml('banned');
244 …$text .= sprintf('<p>'.$this->getLang('page content').'</p>', $ip, strftime($conf['dformat'], $blo…
261 $to_be_notified = $this->getConf('tba_send_mail');
268 $subject = sprintf($this->getLang('mailsubject'), $conf['title']);
269 $body = $this->locale_xhtml('mailbody');