Commit b1409ccb authored by Shakarim Sapa's avatar Shakarim Sapa

- Correct the check to stop words rule

parent 2719bafd
......@@ -2,6 +2,7 @@
namespace common\modules\users\models;
use common\components\UnisenderAPI;
use common\modules\analyticsSchool\models\UserStopWords;
use common\modules\messageTemplate\controllers\TemplateAdminController;
use common\modules\messageTemplate\models\MessageTemplate;
use common\modules\triggers\components\conditions\Conditions;
......@@ -248,8 +249,11 @@ class User extends \common\components\ActiveRecordModel implements IdentityInter
* @return bool
*/
public function checkToStopWord($attribute, $params) {
$this->addError($attribute, 'Name cant be a '.$this->$attribute);
return false;
if (UserStopWords::find()->where(['word' => $this->$attribute, 'active' => 1])->exists()==true) {
$this->addError($attribute, 'Имя не может принимать значение '.$this->$attribute);
return false;
}
return true;
}
public function getEavAttributes() {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment