* @copyright 2004 by gERD Schaufelberger * @package wombat * @subpackage admin */ /** * admin interface * * * @version 0.1.0 * @package wombat * @subpackage Admin */ class wbAdminApp_User extends wbAdminApp { /** * default values for request variables * @access protected * @var array $_requestDefaults * @see $_request */ var $_requestDefaults = array( ); /** * name of this application * @var string $appName */ var $_appName = 'User'; /** * account manager * @var object $_acc */ var $_acc; /** * run admin interface * * @access public * @return boolean true on success */ function process( $path ) { $this->_loadAccountManager(); // process path if( is_array( $path ) ) { $path = array_shift( $path ); } // set default actions if( !isset( $this->_request['action'] ) ) { switch( $path ) { case 'User': $this->_request['action'] = 'userlist'; break; case 'Group': $this->_request['action'] = 'grouplist'; break; } } $this->_acc->setRequest( $this->_request ); return true; } /** * recieve html * * display account manager * * @access public * @return sting $html parsed templates */ function getHtml() { return $this->_acc->processManager(); } /** * load account manager * * @access private * @return boolean true on success, patError on error */ function _loadAccountManager() { $baseDir = wbFactory::getParam( 'systemDir' ) . '/admin/templates'; $this->_acc =& wbFactory::singleton( 'wbAccount' ); if( patErrorManager::isError( $this->_acc ) ) { return $this->_acc; } $conf =& wbFactory::singleton( 'patConfiguration' ); $conf->loadConfig( 'contact.xml' ); $contact = $conf->getConfigValue(); $conf->clearConfigValue(); $this->_acc->setContactDetails( $contact['default'] ); $this->_acc->setEmailHeader( 'from', $contact['default']['from'] ); if( isset( $contact['admin'] ) && !empty( $contact['admin'] ) ) { $this->_acc->setContactDetails( $contact['admin'] ); if( isset( $contact['admin']['from'] ) ) { $this->_acc->setEmailHeader( 'from', $contact['admin']['from'] ); } } $this->_acc->setTemplateDir( $this->_appName, $baseDir ); // load user mangement config $conf->loadConfig( 'user.xml' ); $config = $conf->getConfigValue(); $conf->clearConfigValue(); if( isset( $config['default']['group'] ) ) { $this->_acc->setDefaultGroups( explode( ',', $config['default']['group'] ) ); } return true; } } ?>