Skip to content

Commit ea8260d

Browse files
committed
added some comments
1 parent 60ad84a commit ea8260d

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

application/libraries/REST_Controller.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -611,19 +611,24 @@ protected function _detect_api_key()
611611
isset($row->ignore_limits) AND $this->rest->ignore_limits = $row->ignore_limits;
612612
*/
613613

614+
/*
615+
* If "is private key" is enabled, compare the ip address with the list
616+
* of valid ip addresses stored in the database.
617+
*/
614618
if(!empty($row->is_private_key))
615619
{
616-
617620
// Check for a list of valid ip addresses
618621
if(isset($row->ip_addresses))
619622
{
623+
// multiple ip addresses must be separated using a comma, explode and loop
620624
$list_ip_addresses = explode(",", $row->ip_addresses);
621625
$found_address = FALSE;
622626

623627
foreach($list_ip_addresses as $ip_address)
624628
{
625629
if($this->input->ip_address() == trim($ip_address))
626630
{
631+
// there is a match, set the the value to true and break out of the loop
627632
$found_address = TRUE;
628633
break;
629634
}

0 commit comments

Comments
 (0)