public attr / function, constructeurs __construct
[mtweb] / mw / app / data / modules / xml / mw_data_xml_users.php
index 96dc87d..12c0480 100644 (file)
@@ -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")){
       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")){
       return $EXISTS;
     }
 
-    function add_user($login, $password, $email, $roles){
+    public function add_user($login, $password, $email, $roles){
       $sgbd = $this->sgbd();
       if(
         (
       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(
       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;
       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",
       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;
     #                                                                                    roles
     #
 
-    function init_roles(){
+    public function init_roles(){
       $sgbd = $this->sgbd();
       $this->roles = array();
       if($rst = $sgbd->open_data("roles")){
       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",
       return $id_role;
     }
 
-    function get_role($id){
+    public function get_role($id){
       if($id === "0") return array(
         "id" => 0,
         "nom" => "",
       return $role ? $role : array();
     }
 
-    function set_role($id, $nom, $intitule){
+    public function set_role($id, $nom, $intitule){
       $sgbd = $this->sgbd();
       if(
         !$sgbd->set_data(
       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;
       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;
       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",
       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"])){
       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();
       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")){
       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){
     }
 
   }
-
-?>
\ No newline at end of file