daily pastebin goal
80%
SHARE
TWEET

Untitled

a guest Aug 10th, 2018 66 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.     public function actionCreate()
  3.     {
  4.         $model=new User;
  5.        
  6.         // Uncomment the following line if AJAX validation is needed
  7.         // $this->performAjaxValidation($model);
  8.  
  9.         if(isset($_POST['User']))
  10.         {
  11.             $model->attributes=$_POST['User'];
  12.             // сносим хэширование
  13.             /*$model->salt = User::generateSalt();
  14.             $model->password = User::hashPassword($model->password, $model->salt);*/
  15.             if($model->save()) {
  16.                 Yii::log("New user created: user_id" . Yii::app()->user->id.", insert_id:" . $model->id, "info", "application.controllers.LessonController");
  17.                 Yii::app()->user->setFlash('new_user', 'Пользователь успешно добавлен. '.CHtml::link('Добавить еще?', array('user/create')));
  18.                 $this->redirect(array('index'));
  19.             }
  20.         }
  21.  
  22.         $this->render('create',array(
  23.             'model'=>$model,
  24.         ));
  25.     }
  26.  
  27. ?>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top