Skip to content

Instantly share code, notes, and snippets.

@kaiohken1982
Created November 11, 2013 20:12
Show Gist options
  • Save kaiohken1982/7419560 to your computer and use it in GitHub Desktop.
Save kaiohken1982/7419560 to your computer and use it in GitHub Desktop.
Zend Framework 1 Acl implementation #4
<?php
class My_Acl_Assert_CleanIPAssertion implements Zend_Acl_Assert_Interface
{
public function assert(Zend_Acl $acl, Zend_Acl_Role_Interface $role = null,
Zend_Acl_Resource_Interface $resource = null, $privilege = null)
{
return $this->_isCleanIP($_SERVER['REMOTE_ADDR']);
}
protected function _isCleanIP($ip)
{
// check if the remote ip is not on a blacklist, must return a boolean
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment