Quantcast
Channel: Yii Framework Forum
Viewing all articles
Browse latest Browse all 18717

Prevent To Display Password In Crud

$
0
0
Hi

How can I prevent to fetch a field like password from model ?

A way to do that is to override the afterFind() method of the Model like that

function afterFind(){
$this->password =null;
parent::afterFind();
}


Everything workd fine, all the views not display this field but I cannot get the password (because set null) to Identify the user on login action. (UserIdentity)

I don't want just to remove the code in view files but I want to prevent from Model to give the value of password.

Also I want a robust way (without trick) to do that

Is it possible ?


Thanks

Viewing all articles
Browse latest Browse all 18717

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>