public function actionCreateAdmin()
    {        
        $model = new UserForm;
        
        if (Cii::get($_POST, 'UserForm') != NULL)
        {
            $model->attributes = Cii::get($_POST, 'UserForm', array());
            if ($model->validate())
            {
                $response = $this->runInstaller($model);
                if (file_exists(Yii::getPathOfAlias('application.config').DS.'/main.php'))
                {
                    $this->render('admin');
                    Yii::app()->end();
                }
                else
                    Yii::app()->user->setFlash('error', $response);
            }
            
            $errors = $model->getErrors();
            $firstError = array_values($errors);
            Yii::app()->user->setFlash('error',  Yii::t('Install.main', '{{warning}} {{error}}', array(
                '{{warning}}' => CHtml::tag('strong', array(), Yii::t('Install.main', 'Warning!')),
                '{{error}}' => $firstError[0][0]
            )));
        }
        
        $this->render('createadmin', array('model' => $model));
    }
public function actionCreateAdmin()
    {        
        $model = new UserForm;
        
        if (Cii::get($_POST, 'UserForm') != NULL)
        {
            $model->attributes = Cii::get($_POST, 'UserForm', array());
            if ($model->validate())
            {
                $response = $this->runInstaller($model);
                if (file_exists(Yii::getPathOfAlias('application.config').DS.'/main.php'))
                {
                    $this->render('admin');
                    Yii::app()->end();
                }
                else
                    Yii::app()->user->setFlash('error', $response);
            }
            
            $errors = $model->getErrors();
            $firstError = array_values($errors);
            Yii::app()->user->setFlash('error',  Yii::t('Install.main', '{{warning}} {{error}}', array(
                '{{warning}}' => CHtml::tag('strong', array(), Yii::t('Install.main', 'Warning!')),
                '{{error}}' => $firstError[0][0]
            )));
        }
        
        $this->render('createadmin', array('model' => $model));
    }
public function actionCreateAdmin ( ) { $ model = new UserForm ; if ( Cii :: get ( $ _POST , 'UserForm' ) != NULL ) { $ model -> attributes = Cii :: get ( $ _POST , 'UserForm' , array ( ) ) ; if ( $ model -> validate ( ) ) { $ response = $ this -> runInstaller ( $ model ) ; if ( file_exists ( Yii :: getPathOfAlias ( 'application.config' ) . DS . '/main.php' ) ) { $ this -> render ( 'admin' ) ; Yii :: app ( ) -> end ( ) ; } else Yii :: app ( ) -> user -> setFlash ( 'error' , $ response ) ; } $ errors = $ model -> getErrors ( ) ; $ firstError = array_values ( $ errors ) ; Yii :: app ( ) -> user -> setFlash ( 'error' , Yii :: t ( 'Install.main' , '{{warning}} {{error}}' , array ( '{{warning}}' => CHtml :: tag ( 'strong' , array ( ) , Yii :: t ( 'Install.main' , 'Warning!' ) ) , '{{error}}' => $ firstError [ 0 ] [ 0 ] ) ) ) ; } $ this -> render ( 'createadmin' , array ( 'model' => $ model ) ) ; }
This action enables us to create an admin user for CiiMS
This action enables us to create an admin user for CiiMS