File tree Expand file tree Collapse file tree 1 file changed +3
-0
lines changed Expand file tree Collapse file tree 1 file changed +3
-0
lines changed Original file line number Diff line number Diff line change @@ -1005,6 +1005,9 @@ protected function _detect_api_key()
10051005 // you can also perform an extra check for this
10061006
10071007 $ existsactive = $ this ->db ->query ("SELECT api_key_activated FROM api_keys WHERE api_key = ' " .$ key ."' " );
1008+ // Using the Query builder method. This will only work if you have a column named activated in the api_key table.
1009+ //If you also want to add this as a config item replace the get('activated') with $this->config->item('rest_key_activated_column').
1010+ $ existsactive = $ this ->rest ->db ->where ($ this ->config ->item ('rest_key_column ' ), $ key )->get ('activated ' )->result ();
10081011 $ isactive = $ existsactive ->result ();
10091012 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 ' )
10101013 {
You can’t perform that action at this time.
0 commit comments