Skip to content

Commit ba60df1

Browse files
committed
removed code that was causing issues due to hard codes and non-config options.
1 parent 565ab53 commit ba60df1

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

application/libraries/REST_Controller.php

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -999,16 +999,7 @@ protected function _detect_api_key()
999999
// Find the key from server or arguments
10001000
if (($key = isset($this->_args[$api_key_variable]) ? $this->_args[$api_key_variable] : $this->input->server($key_name)))
10011001
{
1002-
//if you have a field to check if the API KEY provided by the user is activated or not
1003-
//(in case you quickly want to deactivate specific users)
1004-
// you can also perform an extra check for this
1005-
1006-
$existsactive = $this->db->query("SELECT api_key_activated FROM api_keys WHERE api_key = '".$key."' ");
1007-
// Using the Query builder method. This will only work if you have a column named activated in the api_key table.
1008-
//If you also want to add this as a config item replace the get('activated') with $this->config->item('rest_key_activated_column').
1009-
$existsactive = $this->rest->db->where($this->config->item('rest_key_column'), $key)->get('activated')->result();
1010-
$isactive = $existsactive->result();
1011-
if ( ! ($row = $this->rest->db->where($this->config->item('rest_key_column'), $key)->get($this->config->item('rest_keys_table'))->row() ) || $isactive[0]->api_key_activated == 'no' )
1002+
if ( ! ($row = $this->rest->db->where($this->config->item('rest_key_column'), $key)->get($this->config->item('rest_keys_table'))->row()))
10121003
{
10131004
return FALSE;
10141005
}

0 commit comments

Comments
 (0)