24 'users' => array(
'*'),
27 'users' => array(
'*'),
47 $this->render(
'profile', array(
49 'profile' => $model->profile,
60 $profile = $model->profile;
63 if (isset($_POST[
'ajax']) && $_POST[
'ajax'] ===
'profile-form') {
64 echo UActiveForm::validate(array($model, $profile));
68 if (isset($_POST[
'User'])) {
69 $model->attributes = $_POST[
'User'];
70 $profile->attributes = $_POST[
'Profile'];
72 if ($model->validate() && $profile->validate()) {
75 Yii::app()->user->updateSession();
76 Yii::app()->user->setFlash(
'profileMessage',
UserModule::t(
"Changes is saved."));
77 $this->redirect(array(
'/user/profile'));
83 $this->render(
'edit', array(
85 'profile' => $profile,
95 if (Yii::app()->user->id) {
98 if (isset($_POST[
'ajax']) && $_POST[
'ajax'] ===
'changepassword-form') {
99 echo UActiveForm::validate($model);
103 if (isset($_POST[
'UserChangePassword'])) {
104 $model->attributes = $_POST[
'UserChangePassword'];
105 if ($model->validate()) {
106 $new_password =
User::model()->notsafe()->findbyPk(Yii::app()->user->id);
109 $new_password->save();
110 Yii::app()->user->setFlash(
'profileMessage',
UserModule::t(
"New password is saved."));
111 $this->redirect(array(
"profile"));
114 $this->render(
'changepassword', array(
'model' => $model));
126 if ($this->_model === null) {
127 if (Yii::app()->user->id) {
128 $this->_model = Yii::app()->controller->module->user();
130 if ($this->_model === null) {
131 $this->redirect(Yii::app()->controller->module->loginUrl);