--- FreeBSD/tinderbox/webui/module/moduleUsers.php 2007/11/02 20:55:00 1.1.1.1 +++ FreeBSD/tinderbox/webui/module/moduleUsers.php 2007/11/13 07:36:19 1.1.1.1.2.1 @@ -24,22 +24,21 @@ # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF # SUCH DAMAGE. # +# $Paefchen$ # $MCom: portstools/tinderbox/webui/module/moduleUsers.php,v 1.18 2007/10/13 02:28:48 ade Exp $ # -require_once 'module/module.php'; -require_once 'module/moduleBuilds.php'; - class moduleUsers extends module { - var $permissions; + private $permissions = null; + private $moduleBuilds = null; - function moduleUsers() { - $this->module(); - $this->moduleBuilds = new moduleBuilds(); + public function __construct() { + parent::__construct(); + $this->moduleBuilds = new moduleBuilds; } - function display_login() { + public function display_login() { global $moduleSession; if( $this->is_logged_in() ) { @@ -59,7 +58,7 @@ class moduleUsers extends module { return $this->template_parse( 'display_login.tpl' ); } - function display_add_user( $user_name, $user_email, $user_password, $www_enabled ) { + public function display_add_user( $user_name, $user_email, $user_password, $www_enabled ) { if( !$this->is_logged_in() ) { return $this->template_parse( 'please_login.tpl' ); } elseif ( $this->checkWwwAdmin() ) { @@ -75,7 +74,7 @@ class moduleUsers extends module { return $this->template_parse( 'user_admin.tpl' ); } - function display_modify_user( $first, $user_id, $user_name, $user_email, $user_password, $www_enabled ) { + public function display_modify_user( $first, $user_id, $user_name, $user_email, $user_password, $www_enabled ) { if( !$this->is_logged_in() ) { return $this->template_parse( 'please_login.tpl' ); } @@ -101,7 +100,7 @@ class moduleUsers extends module { return $this->template_parse( 'user_admin.tpl' ); } - function display_properties( $user_id, $user_name, $user_email, $user_password, $www_enabled ) { + public function display_properties( $user_id, $user_name, $user_email, $user_password, $www_enabled ) { $this->template_assign( 'user_id', $user_id ); $this->template_assign( 'user_name', $user_name ); $this->template_assign( 'user_email', $user_email ); @@ -111,7 +110,7 @@ class moduleUsers extends module { return $this->template_parse( 'user_properties.tpl' ); } - function action_user( $action, $user_id, $user_name, $user_email, $user_password, $www_enabled ) { + public function action_user( $action, $user_id, $user_name, $user_email, $user_password, $www_enabled ) { if( !$this->is_logged_in() ) { return $this->template_parse( 'please_login.tpl' ); } elseif( empty( $user_name ) ) { @@ -207,7 +206,7 @@ class moduleUsers extends module { return '1'; } - function do_login( $username, $password ) { + public function do_login( $username, $password ) { global $moduleSession; $user = $this->TinderboxDS->getUserByLogin( $username, $password ); @@ -225,7 +224,7 @@ class moduleUsers extends module { return false; } - function do_logout() { + public function do_logout() { global $moduleSession; $moduleSession->removeAttribute( 'user' ); @@ -234,7 +233,7 @@ class moduleUsers extends module { return true; } - function is_logged_in() { + public function is_logged_in() { global $moduleSession; $user = $moduleSession->getAttribute( 'user' ); @@ -245,7 +244,7 @@ class moduleUsers extends module { return false; } - function get_www_enabled() { + public function get_www_enabled() { global $moduleSession; $user = $moduleSession->getAttribute( 'user' ); @@ -257,14 +256,14 @@ class moduleUsers extends module { return false; } - function get_id() { + public function get_id() { global $moduleSession; $user = $moduleSession->getAttribute( 'user' ); return $user->getId(); } - function get_all_users() { + public function get_all_users() { $all_users_raw = $this->TinderboxDS->getAllUsers(); $all_users = array(); foreach( $all_users_raw as $user ) { @@ -273,7 +272,7 @@ class moduleUsers extends module { return $all_users; } - function fetch_permissions( $object_type, $object_id ) { + public function fetch_permissions( $object_type, $object_id ) { global $moduleSession; if( $this->is_logged_in() ) { @@ -288,7 +287,7 @@ class moduleUsers extends module { } } - function get_permission( $object_type, $object_id, $permission ) { + public function get_permission( $object_type, $object_id, $permission ) { if( !is_array( $this->permissions[$object_type][$object_id] ) && !isset( $this->permissions[$object_type][$object_id]['set'] ) ) { $this->fetch_permissions( $object_type, $object_id ); } @@ -299,11 +298,12 @@ class moduleUsers extends module { } } - function checkWwwAdmin() { + public function checkWwwAdmin() { return $this->get_permission( 'users', $this->get_id(), 'IS_WWW_ADMIN' ); } } +/* old? function checkPermAddQueue( $object_type, $object_id ) { return $this->get_permission( $object_type, $object_id, 'PERM_ADD_QUEUE' ); } @@ -329,5 +329,6 @@ class moduleUsers extends module { { return $this->get_permission( $object_type, $object_id, 'PERM_DELETE_OTHER_QUEUE' ); } +*/ ?>