webservice-auth-ip.conf.php 966 B

1234567891011121314151617181920212223242526
  1. <?php
  2. /**
  3. * This file allows a Chamilo portal admin to authorize access from specific
  4. * IPs or ranges of IPs
  5. */
  6. /**
  7. * Check no direct access to file using a constant defined in the calling script
  8. */
  9. if (!defined('WS_ERROR_SECRET_KEY')) { die(); }
  10. /**
  11. * Define here the IPs or ranges that will be authorized to access the
  12. * webservice. When this is in place, the security key check will be made on
  13. * the string given here in $ws_auth_ip, and not anymore on
  14. * $_SERVER['REMOTE_ADDR'], but $_SERVER['REMOTE_ADDR'] will still be checked
  15. * against the IP or range provided. It doesn't support IPv6 yet.
  16. * If $ws_auth_ip is not defined, this file will be ignored. If $ws_auth_ip *is*
  17. * defined, then the only security key expected from the client is the
  18. * $_configuration['security_key'] encrypted through SHA1
  19. * @example
  20. * <pre>
  21. * $ws_auth_ip = '192.168.1.1/22';
  22. * $ws_auth_ip = '192.168.1.5';
  23. * $ws_auth_ip = '192.168.1.5,192.168.1.9';
  24. * </pre>
  25. */