Browse Source

Added direct load prevention in web service (BT#4158)

Yannick Warnier 12 years ago
parent
commit
da44b66e5e
1 changed files with 4 additions and 0 deletions
  1. 4 0
      main/webservices/webservice-auth-ip.conf.php

+ 4 - 0
main/webservices/webservice-auth-ip.conf.php

@@ -3,6 +3,10 @@
  * This file allows a Chamilo portal admin to authorize access from specific
  * IPs or ranges of IPs
  */
+/**
+ * Check no direct access to file using a constant defined in the calling script
+ */
+if (!defined('WS_ERROR_SECRET_KEY')) { die(); }
 /**
  * Define here the IPs or ranges that will be authorized to access the
  * webservice. When this is in place, the security key check will be made on