Пример #1
0
 function list_all_rights()
 {
     if (is_null($this->ds)) {
         return array();
     }
     $results = $this->ds->search('/rights', '', 0, 1000);
     return table_get_assoc($results['data'], 'title', 'name');
 }
 function get_user_data($user_id)
 {
     if (!$this->db) {
         return NULL;
     }
     $sql = "SELECT name,value FROM UserData WHERE user_id={$user_id}";
     $result = $this->db->queryAll($sql, NULL, DB_FETCHMODE_ASSOC);
     if (PEAR::isError($result)) {
         return NULL;
     }
     return table_get_assoc($result, 'value', 'name');
 }