X-Git-Url: http://git.dj3c1t.com/?a=blobdiff_plain;f=mw%2Fapp%2Fdata%2Fmodules%2Fxml%2Fmw_data_xml_users.php;h=12c0480a2faf37496c823b8c104fc688ab4c9d93;hb=ad9756b0b72852c82165e824570f21b039fcb359;hp=96dc87d7f360d796c5aaabd91bb467b763fae022;hpb=0203b41650cb99aa63c69a00432d8a39553f1eb6;p=mtweb diff --git a/mw/app/data/modules/xml/mw_data_xml_users.php b/mw/app/data/modules/xml/mw_data_xml_users.php index 96dc87d..12c0480 100644 --- a/mw/app/data/modules/xml/mw_data_xml_users.php +++ b/mw/app/data/modules/xml/mw_data_xml_users.php @@ -2,16 +2,16 @@ class mw_data_xml_users extends mw_data{ - var $users; - var $user; - var $roles; - var $actions_roles; + public $users; + public $user; + public $roles; + public $actions_roles; # ---------------------------------------------------------------------------------------- # users # - function users($start = 0, $alpha = null, $id_role = null){ + public function users($start = 0, $alpha = null, $id_role = null){ $sgbd = $this->sgbd(); $env = $this->env(); $users = array("list" => array(), "total" => 0); @@ -77,7 +77,7 @@ return $users; } - function list_user_roles($id_user){ + public function list_user_roles($id_user){ $sgbd = $this->sgbd(); $roles = array(); if($rst = $sgbd->open_data("users_roles")){ @@ -98,21 +98,21 @@ return $roles; } - function user_by_id($id){ + public function user_by_id($id){ $env = $this->env(); $user = $env->get_model("users"); if($user->load("id", $id) === false) return false; return $user->get_values(); } - function user($login){ + public function user($login){ $env = $this->env(); $user = $env->get_model("users"); if($user->load("login", $login) === false) return false; return $user->get_values(); } - function user_exists($login){ + public function user_exists($login){ $sgbd = $this->sgbd(); $EXISTS = 0; if($rst = $sgbd->open_data("users")){ @@ -133,7 +133,7 @@ return $EXISTS; } - function add_user($login, $password, $email, $roles){ + public function add_user($login, $password, $email, $roles){ $sgbd = $this->sgbd(); if( ( @@ -162,7 +162,7 @@ return $id_user; } - function set_user($id, $login, $password, $email, $roles){ + public function set_user($id, $login, $password, $email, $roles){ $sgbd = $this->sgbd(); if( !$sgbd->set_data( @@ -206,7 +206,7 @@ return true; } - function clear_user_roles($id_user){ + public function clear_user_roles($id_user){ $sgbd = $this->sgbd(); if($rst = $sgbd->open_data("users_roles")){ $OK = true; @@ -227,7 +227,7 @@ return $OK; } - function add_user_role($id_user, $id_role){ + public function add_user_role($id_user, $id_role){ $sgbd = $this->sgbd(); $OK = $sgbd->add_data( "users_roles", @@ -240,7 +240,7 @@ return true; } - function del_user($login){ + public function del_user($login){ if(($user = $this->user($login)) !== false){ $sgbd = $this->sgbd(); if(!$sgbd->del_data("users", $user["id"])) return false; @@ -268,7 +268,7 @@ # roles # - function init_roles(){ + public function init_roles(){ $sgbd = $this->sgbd(); $this->roles = array(); if($rst = $sgbd->open_data("roles")){ @@ -287,12 +287,12 @@ return $this->roles; } - function roles(){ + public function roles(){ if(!isset($this->roles)) return false; return $this->roles; } - function add_role($nom, $intitule){ + public function add_role($nom, $intitule){ $sgbd = $this->sgbd(); $id_role = $sgbd->add_data( "roles", @@ -305,7 +305,7 @@ return $id_role; } - function get_role($id){ + public function get_role($id){ if($id === "0") return array( "id" => 0, "nom" => "", @@ -317,7 +317,7 @@ return $role ? $role : array(); } - function set_role($id, $nom, $intitule){ + public function set_role($id, $nom, $intitule){ $sgbd = $this->sgbd(); if( !$sgbd->set_data( @@ -332,7 +332,7 @@ return true; } - function clear_role_actions($id_role){ + public function clear_role_actions($id_role){ $sgbd = $this->sgbd(); if($rst = $sgbd->open_data("actions_roles")){ $OK = true; @@ -353,7 +353,7 @@ return false; } - function clear_role_users($id_role){ + public function clear_role_users($id_role){ $sgbd = $this->sgbd(); if($rst = $sgbd->open_data("users_roles")){ $OK = true; @@ -374,7 +374,7 @@ return false; } - function add_role_action($id_role, $action){ + public function add_role_action($id_role, $action){ $sgbd = $this->sgbd(); $id_action_role = $sgbd->add_data( "actions_roles", @@ -392,7 +392,7 @@ return $sgbd->del_data("roles", $id_role) ? true : false; } - function get_user_roles(){ + public function get_user_roles(){ $user_roles = array(); $user = $this->get_session_user(); if($user && isset($user["id"])){ @@ -419,13 +419,13 @@ return $user_roles; } - function init_actions_roles(){ + public function init_actions_roles(){ if(!isset($this->roles)) return false; $this->actions_roles = $this->read_actions_roles(); return $this->actions_roles; } - function read_actions_roles($params = array()){ + public function read_actions_roles($params = array()){ if(!isset($this->roles)) return false; $group_by_action = isset($params["group_by_action"]) ? $params["group_by_action"] : false; $sgbd = $this->sgbd(); @@ -452,7 +452,7 @@ return $actions_roles; } - function get_action_roles($mod, $controller = "index", $action = "index"){ + public function get_action_roles($mod, $controller = "index", $action = "index"){ $sgbd = $this->sgbd(); $roles = array(); if($rst = $sgbd->open_data("actions_roles")){ @@ -475,7 +475,7 @@ return $roles; } - function get_actions($id_role = null){ + public function get_actions($id_role = null){ $env = $this->env(); if($actions = $env->get_actions()){ if(($actions_roles = $this->read_actions_roles(array("group_by_action" => true))) !== false){ @@ -534,5 +534,3 @@ } } - -?> \ No newline at end of file