Gentics Portal.Node PHP API
 All Classes Namespaces Functions Variables Pages
Public Member Functions | List of all members
InstallController Class Reference
Inheritance diagram for InstallController:
RController

Public Member Functions

 init ()
 filters ()
 accessRules ()
 actionConfirm ()
 actionRun ()
 actionReady ()
 actionError ()
- Public Member Functions inherited from RController
 filterAccessControl ($filterChain)
 filterRights ($filterChain)
 allowedActions ()
 accessDenied ($message=null)

Additional Inherited Members

- Public Attributes inherited from RController
 $layout = '//layouts/column1'
 $menu = array()
 $breadcrumbs = array()

Detailed Description

Rights installation controller class file.

Author
Christoffer Niska cnisk.nosp@m.a@li.nosp@m.ve.co.nosp@m.m
Since
0.9.8

Definition at line 9 of file InstallController.php.

Member Function Documentation

InstallController::accessRules ( )

Specifies the access control rules. This method is used by the 'accessControl' filter.

Returns
array access control rules

Definition at line 51 of file InstallController.php.

{
return array(
array('allow', // Allow superusers to access Rights
'actions'=>array(
'confirm',
'run',
'error',
'ready',
),
'users'=>$this->_authorizer->getSuperusers(),
),
array('deny', // Deny all users
'users'=>array('*'),
),
);
}
InstallController::actionConfirm ( )

Displays the confirm overwrite page.

Definition at line 72 of file InstallController.php.

{
$this->render('confirm');
}
InstallController::actionError ( )

Displays the install ready page.

Definition at line 124 of file InstallController.php.

{
$this->render('error');
}
InstallController::actionReady ( )

Displays the install ready page.

Definition at line 116 of file InstallController.php.

{
$this->render('ready');
}
InstallController::actionRun ( )

Installs the module.

Exceptions
CHttpExceptionif the user is not logged in.

Definition at line 81 of file InstallController.php.

References RController\accessDenied(), and Rights\t().

{
// Make sure the user is not a guest.
if( true || Yii::app()->user->isGuest===false )
{
// Make sure that the module is not already installed.
if( isset($_GET['confirm'])===true || $this->_installer->installed===false )
{
// Run the installer and check for an error.
if( $this->_installer->run()===RInstaller::ERROR_NONE )
{
// Mark the user to have superuser privileges.
Yii::app()->user->isSuperuser = true;
$this->redirect(array('install/ready'));
}
// Redirect to the error page.
$this->redirect(array('install/error'));
}
// Module is already installed.
else
{
$this->redirect(array('install/confirm'));
}
}
// User is guest, deny access.
else
{
$this->accessDenied(Rights::t('install', 'You must be logged in to install Rights.'));
}
}
InstallController::filters ( )
Returns
array action filters

Definition at line 40 of file InstallController.php.

{
// Use access control when installed.
return $this->_installer->installed===true ? array('accessControl') : array();
}
InstallController::init ( )

Initializes the controller.

Definition at line 23 of file InstallController.php.

{
if( $this->module->install!==true )
$this->redirect(Yii::app()->homeUrl);
$this->_authorizer = $this->module->getAuthorizer();
$this->_installer = $this->module->getInstaller();
$this->layout = $this->module->layout;
$this->defaultAction = 'run';
// Register the scripts.
$this->module->registerScripts();
}

The documentation for this class was generated from the following file: