Created
September 10, 2011 06:59
-
-
Save kirs/1208048 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
public function actionCreate() | |
{ | |
$model=new User; | |
// Uncomment the following line if AJAX validation is needed | |
// $this->performAjaxValidation($model); | |
if(isset($_POST['User'])) | |
{ | |
$model->attributes=$_POST['User']; | |
// сносим хэширование | |
/*$model->salt = User::generateSalt(); | |
$model->password = User::hashPassword($model->password, $model->salt);*/ | |
if($model->save()) { | |
Yii::log("New user created: user_id" . Yii::app()->user->id.", insert_id:" . $model->id, "info", "application.controllers.LessonController"); | |
Yii::app()->user->setFlash('new_user', 'Пользователь успешно добавлен. '.CHtml::link('Добавить еще?', array('user/create'))); | |
$this->redirect(array('index')); | |
} | |
} | |
$this->render('create',array( | |
'model'=>$model, | |
)); | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment