[Phpcms-plugins-cvs] admin4phpCMS/modules/user class.module_user.php,1.4,1.5
Brought to you by:
mjahn
From: Martin J. <mj...@us...> - 2004-06-18 15:17:40
|
Update of /cvsroot/phpcms-plugins/admin4phpCMS/modules/user In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28241/modules/user Modified Files: class.module_user.php Log Message: module filemanager and editor included Index: class.module_user.php =================================================================== RCS file: /cvsroot/phpcms-plugins/admin4phpCMS/modules/user/class.module_user.php,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- class.module_user.php 5 Jun 2004 12:44:23 -0000 1.4 +++ class.module_user.php 18 Jun 2004 15:17:01 -0000 1.5 @@ -30,6 +30,9 @@ /* * $Log$ +* Revision 1.5 2004/06/18 15:17:01 mjahn +* module filemanager and editor included +* * Revision 1.4 2004/06/05 12:44:23 mjahn * separated layout-files * @@ -48,6 +51,22 @@ /** * Class for user- and permission-managment * +* <p> +* The class module_user uses {@link http://pear.php.net/packages/LiveUser PEAR::LiveUser} +* for managing the user-accounts and the permissions. LiveUser can use several sources +* for user- and permission-data. See {@link http://pear.php.net/packages/LiveUser/docs LiveUser-Manual} +* for details. +* </p> +* <p> +* This module <b>provides</b> some events for use in the other modules: +* </p> +* <ul> +* <li><b>USER_GET_DATA</b> provides the user-data (see {@link getUserData() getUserData} for details)</li> +* <li><b>USER_GET_STATUS</b> provides status-information about the user logged in +* (see {@link getUserData() getUserData} for details)</li> +* <li><b>USER_SET_DATA</b> set the user-data in the db (see {@link setUserData() setUserData} for details)</li> +* </ul> +* * @package admin4phpCMS * @subpackage module_user * @todo Get the class work completly @@ -60,6 +79,11 @@ **/ var $_USER; + /** + * Initialization of the module + * + * The module registers its own events and connects his methods to some actions + **/ function init () { $liveuserConfig = array( 'session' => array('name' => 'PHPSESSID','varname' => 'loginInfo'), @@ -95,15 +119,24 @@ $this->_registerAction ('doSetUserData', 'setUserData'); $this->_registerEvent ('USER_GET_STATUS', 'doGetUserStatus'); $this->_registerAction ('doGetUserStatus', 'getUserStatus'); + + return true; } + /** + * Parse the URI-params + * + * @param array $actiondata $actiondata contains the URI-param-arrays + **/ function parseParam (&$actiondata) { $logout = false; $username = ''; $password = ''; if (isset ($actiondata['post']['logout'])) { $logout = true; + unset ($_POST['logout']); } elseif (isset ($actiondata['get']['logout'])) { + unset ($_GET['logout']); $logout = true; } $passwd = ''; @@ -125,16 +158,25 @@ if (isset ($actiondata['request']['action'])) { $this->action = $actiondata['request']['action']; } + return true; } + /** + * Process-methode of the module + * + * @param array $actiondata + **/ function process (&$actiondata) { + return true; } - function getUserStatus (&$actiondata) { - $actiondata ['isLoggedIn'] = $this->_USER->isLoggedIn (); - } + /** + * Get content for mainmenu + * + * @param array $actiondata $actiondata['_root'] must provide the id of the parental element + **/ function getMenuMain (&$actiondata) { if (!$this->_USER->isLoggedIn ()) { return true; @@ -142,8 +184,15 @@ $root = $actiondata['_root']; $actiondata = array ('_type'=>'menu_main_entry', '_root'=>$root, 'name'=>'Benutzerverwaltung', 'module'=>'user', '_id'=>'usermenu', '_root'=>'mainmenu', 'id'=>'', 'class'=>''); $this->_callEvent('LAYOUT_ADD_ELEMENT', $actiondata); + return true; } + + /** + * Get submenu of module + * + * @param array $actiondata $actiondata['_root'] must provide the id of the parental element + **/ function getMenuSub (&$actiondata) { if (!$this->_USER->isLoggedIn ()) { return true; @@ -166,8 +215,14 @@ $actiondata['id'] = 'current'; } $this->_callEvent('LAYOUT_ADD_ELEMENT', $actiondata); + return true; } + /** + * Get content of the module + * + * @param array $actiondata $actiondata['_root'] must provide the id of the parental element + **/ function getContent (&$actiondata) { if (!$this->_USER->isLoggedIn ()) { @@ -176,7 +231,7 @@ $actiondata = array ('_id'=>'benutzerlogin', '_root'=>$root, '_type'=>'headline', 'content'=>'Benutzerlogin', 'id'=>'', 'class'=>''); $this->_callEvent('LAYOUT_ADD_ELEMENT', $actiondata); - $actiondata = array ('_id'=>'loginform', '_root'=>$root, '_type'=>'form', 'method'=>'post', 'id'=>'', 'class'=>''); + $actiondata = array ('_id'=>'loginform', '_root'=>$root, '_type'=>'form', 'method'=>'post', 'id'=>'', 'class'=>'', 'action'=>'index.php'); $this->_callEvent('LAYOUT_ADD_ELEMENT', $actiondata); $actiondata = array ('_id'=>'method', '_type'=>'form_input_hidden', 'value'=>'post', 'name'=>'method','_root'=>'loginform', 'id'=>'', 'class'=>''); @@ -190,14 +245,19 @@ $actiondata = array ('_id'=>'submit', '_type'=>'form_button', 'value'=>'Absenden', 'name'=>'submit','text'=>'Absenden', '_root'=>'loginform', 'id'=>'', 'class'=>''); $this->_callEvent('LAYOUT_ADD_ELEMENT', $actiondata); - return; + return true; } if (!$this->display) { return true; } - + return true; } + /** + * Get content for statusbar + * + * @param array $actiondata $actiondata['_root'] must provide the id of the parental element + **/ function getContentBar (&$actiondata) { if ($this->_USER->isLoggedIn ()) { @@ -206,12 +266,59 @@ $actiondata = array ('_id'=>'1', '_root'=>$root, '_type'=>'paragraph', 'content'=>$this->_USER->getProperty ('handle').' (<a href="?logout=logout">abmelden</a>)'); $this->_callEvent('LAYOUT_ADD_ELEMENT', $actiondata); } - + return true; + } + + /** + * Get content for statusbar + * + * This function provides the following information about the user-status + * <ul> + * <li><b>$actiondata['isLoggedIn']</b> is the user logged in</li> + * </ul> + * + * @param array $actiondata + **/ + function getUserStatus (&$actiondata) { + $actiondata ['isLoggedIn'] = $this->_USER->isLoggedIn (); + return true; } + + /** + * Get userdata from the user-array + * + * This function provides the following information about the user + * <ul> + * <li><b>$actiondata['']</b> contains</li> + * </ul> + * + * @param array $actiondata + **/ function getUserData (&$actiondata) { + return true; } + /** + * Set userdata in the user-array + * + * @param array $actiondata + **/ function setUserData (&$actiondata) { + return true; + } + + /** + * + **/ + function displayUserList ($list, $template) { + if (!is_array ($list)) { + return true; + } + + $num = count ($list); + for ($i = 0; $i < num; $i++ ) { + + } } } |