How can I forbid users to change their username and email address? Would it make sense to have a global option for this?
I think this is a small security issue in bigger installations where accounts are made automatically and are not of the form firstname_lastname: a user can change name and email so that he/she will appear to be different person.
User name : what for ? Nor related to security in my opinion ?
Logi is already update disable.
About email : by plugin in my opinion. Not add again and again and again and again a new settings ....
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member. -
Professional support
-
Plugins, theme and development
. I don't answer to private message.
beforeUserSave, but there are a lack of isValid update.
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member. -
Professional support
-
Plugins, theme and development
. I don't answer to private message.
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member. -
Professional support
-
Plugins, theme and development
. I don't answer to private message.
DenisChenu wrote: but there are a lack of isValid update.
You can make a feature request please.
BUT : you can reset value.
1. get the model with $model = $this->getEvent()->get('model');
2. Check if isNewrecord
www.yiiframework.com/doc/api/1.1/CActive...d#isNewRecord-detail
3. if not reset previous value ($his->email=User::model()->getByPk($model->getPrimaryKey())->getAttribute('email');
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member. -
Professional support
-
Plugins, theme and development
. I don't answer to private message.
public function beforeUserSave()
{
$user = $this->getEvent()->get('model');
$user->email = "denis@example.org";
}
With your code : you update current user ....
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member. -
Professional support
-
Plugins, theme and development
. I don't answer to private message.
Thanks, now I got this to work. Here is the code snippet:
$user = $this->getEvent()->get('model');
if ($user->isNewRecord) {
// Nothing, setting the name and email for a new user.
return;
}
// Revert to old email address and full name.
$iUserid = Permission::getUserId();
$oUser = User::model()->findByPk($iUserid);
$user->email = $oUser->email;
$user->full_name = $oUser->full_name;
Please : think have a isValid allowed update still better
Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member. -
Professional support
-
Plugins, theme and development
. I don't answer to private message.