webservice-auth-ip.conf.dist.php 974 B

12345678910111213141516171819202122232425262728
  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')) {
  10. die();
  11. }
  12. /**
  13. * Define here the IPs or ranges that will be authorized to access the
  14. * webservice. When this is in place, the security key check will be made on
  15. * the string given here in $ws_auth_ip, and not anymore on
  16. * $_SERVER['REMOTE_ADDR'], but $_SERVER['REMOTE_ADDR'] will still be checked
  17. * against the IP or range provided. It doesn't support IPv6 yet.
  18. * If $ws_auth_ip is not defined, this file will be ignored. If $ws_auth_ip *is*
  19. * defined, then the only security key expected from the client is the
  20. * $_configuration['security_key'] encrypted through SHA1.
  21. *
  22. * @example
  23. * <pre>
  24. * $ws_auth_ip = '192.168.1.1/22';
  25. * $ws_auth_ip = '192.168.1.5';
  26. * $ws_auth_ip = '192.168.1.5,192.168.1.9';
  27. * </pre>
  28. */