Sahana Advanced Web Setup

Introduction

The sahana advanced web setup, is an extended version of the existing sahana web setup, in order to include more advanced installation options, as well as to make the installation process more user friendly and robust.

The Web Setup Process

The web setup process has been broken down in to three categories which provide different levels of customizability. The y are as follows.

  • The simple setup - Same as the existing setup, except that the requirement of a 8 character password has been dropped out.
  • The advanced setup - Provides the highest level of customizability by providing options to change the system wide password policy, and other system wide configuration values.
  • The scenario based setup - Provides a relatively low customizability compared to the advanced setup, but is more concerned on setting up only the necessary modules for a given scenario. (Even though additional modules may be selected).

How it works

The first time the sahana main page (index.php) is requested, it hands over control to the setup controller (setup.php) (different from the front controller due to its architecture) which in turn controls the entire setup process.
Each step of the setup is defined as a STATE. The setup.php has a mapping from states to a set of four core functions. They are as follows.

  • PAGE - The function to be called to show the required setup step. (Form) *REQUIRED
  • VALIDATE - The function to be called to validate the page data. (Validate Form Data) *REQUIRED
  • NEXT - The function to be called to do some action , (should call the next step function in code.) *REQUIRED
  • BACK - The function to be called when the user clicks the back button on the page. *REQUIRED IF The page has a Back Button.
  • CH_STATE - The function to be called to change the current state. This will be executed soon after calling the NEXT function. OPTIONAL
  • ON_COMPLETE - The function to be called at the end of the setup to complete and commit any required changes to the database or file system or any other means.


The mapping for the simple setup is as follows.

global $_state_funct_map;
$_state_funct_map = array(
	'CHECK_DEPS'=>array(	'PAGE'=>'shn_setup_general_dependancies',
				'VALIDATE'=>'shn_setup_validate_general_dependancies',
				'NEXT'=>'shn_setup_select_setup',
				'CH_STATE'=>'shn_setup_general_dependencies_ch_state'),
 
	'SELECT_SETUP'=>array(	'PAGE'=>'shn_setup_select_setup',
				'NEXT'=>'shn_setup_select_setup_next',
				'CH_STATE'=>'shn_setup_select_setup_ch_state'),
 
	'SIMPLE_DB_SETUP'=>array(	'PAGE'=>'shn_setup_simple_dbsetup',
					'VALIDATE'=>'shn_setup_validate_simple_dbsetup',
					'NEXT'=>'shn_setup_simple_dbsetup_next',
					'BACK'=>'shn_setup_simple_dbsetup_back',
					'CH_STATE'=>'shn_setup_simple_dbsetup_ch_state',
					'ON_COMPLETE'=>'shn_setup_simple_dbsetup_complete'),
 
	'SIMPLE_CFG_SETUP'=>array(	'PAGE'=>'shn_setup_simple_config',
					'VALIDATE'=>'shn_setup_validate_simple_config',
					'NEXT'=>'shn_setup_simple_config_next',
					'BACK'=>'shn_setup_simple_config_back',
					'CH_STATE'=>'shn_setup_simple_config_ch_state',
					'ON_COMPLETE'=>'shn_setup_simple_config_complete'),
);

The Source Files

The setup has been broken down in to several source files. Each file contains functions for a specific functionality. The files are as follows.

  • setup.inc - The setup controller and the function callback definitions.
  • setup_actions.inc - Action functions
  • setup_actions_sun.inc - Action implementations
  • setup_pages.inc - Page generation functions
  • setup_validations.inc - Validation functions
  • setup_utils.inc - Utility functions

Navigation
QR Code
QR Code dev:saws (generated for current page)