Last active
August 29, 2015 14:18
-
-
Save azhurb/972d33fac8f94e72dbad to your computer and use it in GitHub Desktop.
on_subscribe.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| include "../common.php"; | |
| if (empty($_REQUEST['mac']) || empty($_REQUEST['tariff_id']) || empty($_REQUEST['package_id'])){ | |
| echo '{"status":"ERROR","results":false,"error":"mac and tariff_id required"}'; | |
| exit; | |
| } | |
| //$mac = $_REQUEST['mac']; | |
| //$tariff_id = $_REQUEST['tariff_id']; | |
| $logger = new Logger(); | |
| $logger->setPrefix("subscription_"); | |
| $date = new DateTime('now', new DateTimeZone(Config::get('default_timezone'))); | |
| $logger->access(sprintf("%s - [%s] subscribe mac:%s, tariff_id:%s, package_id:%s\n", | |
| empty($_SERVER['HTTP_X_REAL_IP']) ? $_SERVER['REMOTE_ADDR'] : $_SERVER['HTTP_X_REAL_IP'] , | |
| $date->format('r'), | |
| $_REQUEST['mac'], | |
| $_REQUEST['tariff_id'], | |
| $_REQUEST['package_id'] | |
| )); | |
| // Success! | |
| echo '{"status":"OK","results":true}'; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment