Incam_PROFIND_Web/yii/framework/gii/controllers/DefaultController.php
roberto 1e044b6498 Subida inicial.
Funciona:
- Usuario
- Empresa

git-svn-id: https://192.168.0.254/svn/Proyectos.Incam_PROFIND_Web/trunk@2 3fe1ab16-cfe0-e34b-8c9f-7d8c168d430d
2012-09-20 19:38:42 +00:00

58 lines
1.3 KiB
PHP

<?php
class DefaultController extends CController
{
public $layout='/layouts/column1';
public function getPageTitle()
{
if($this->action->id==='index')
return 'Gii: a Web-based code generator for Yii';
else
return 'Gii - '.ucfirst($this->action->id).' Generator';
}
public function actionIndex()
{
$this->render('index');
}
public function actionError()
{
if($error=Yii::app()->errorHandler->error)
{
if(Yii::app()->request->isAjaxRequest)
echo $error['message'];
else
$this->render('error', $error);
}
}
/**
* Displays the login page
*/
public function actionLogin()
{
$model=Yii::createComponent('gii.models.LoginForm');
// collect user input data
if(isset($_POST['LoginForm']))
{
$model->attributes=$_POST['LoginForm'];
// validate user input and redirect to the previous page if valid
if($model->validate() && $model->login())
$this->redirect(Yii::app()->createUrl('gii/default/index'));
}
// display the login form
$this->render('login',array('model'=>$model));
}
/**
* Logs out the current user and redirect to homepage.
*/
public function actionLogout()
{
Yii::app()->user->logout(false);
$this->redirect(Yii::app()->createUrl('gii/default/index'));
}
}