PHP Codeigniter REST Api limit not working -
i have similar issue this one since no 1 answered reposting question, dont see errors or limits not working, tried debug rest_controller, problem on line 695
// doing key related stuff? can if have key right? if ($this->config->item('rest_enable_keys') && empty($this->rest->key) === false) { // check limit if ($this->config->item('rest_enable_limits') && $this->_check_limit($controller_method) === false) { $response = [$this->config->item('rest_status_field_name') => false, $this->config->item('rest_message_field_name') => $this->lang->line('text_rest_api_key_time_limit')]; $this->response($response, self::http_unauthorized); } // if no level set use 0, aren't using permissions $level = isset($this->methods[$controller_method]['level']) ? $this->methods[$controller_method]['level'] : 0; // if no level set, or lower than/equal key's level $authorized = $level <= $this->rest->level; // im tellin! if ($this->config->item('rest_enable_logging') && $log_method) { $this->_log_request($authorized); } if($authorized === false) { // don't have enough perms $response = [$this->config->item('rest_status_field_name') => false, $this->config->item('rest_message_field_name') => $this->lang->line('text_rest_api_key_permissions')]; $this->response($response, self::http_unauthorized); } }
this condition false
empty($this->rest->key) === false
what should make work? in advance
Comments
Post a Comment