Options +FollowSymlinks
#Запрещаем загрузку файлов с внешних сайтов
RewriteEngine On
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www.)?domainname.com/ [nc]
RewriteRule .*.(gif|jpg|png)$ http://domainname.com/img/stop_stealing_bandwidth.gif[nc]
/**
* Logs in a user using the provided username and password.
* @return boolean whether the user is logged in successfully
*/
public function login()
{
return Yii::$app->user->login($this->getUser(Yii::$app->request->userIP));
}
/**
* Finds user by [[ip]]
*
* @return User|null
*/
public function getUser()
{
if ($this->_user === false) {
$this->_user = User::findByIp(Yii::$app->request->userIP);
}
return $this->_user;
}
public static function findByIp($ip)
{
return new static(['id'=>$ip ]);
}
DELETE from POSTS where time_to_delete<NOW()
<?= Html::encode($model->message) ?>
$this->content = HtmlPurifier::process($this->content) ;