Merge branch 'master' of git.neuf.no:edb/inside

This commit is contained in:
nikolark committed 2015-03-21 20:21:47 +01:00
commit a9705ecfae
3 files changed
+31 -1

No files matched your search

+4 -1
View File
@@ -7,6 +7,9 @@ $conn =& DB_connect();
$id = $_GET['id'];
if (!preg_match('/^\d+$/', $id))
die("That's not an id");
$nodelist = array();
// Pull file meta-data
@@ -56,4 +59,4 @@ for ($i = 0 ; $i < count($nodelist) ; $i++) {
}
}
?>
?>
+1
View File
@@ -5,4 +5,5 @@
define("REGISTRATION_URL_TIMEOUT_DAYS", 3);
define("MAILCHIMP_API_KEY", "");
define("MAILCHIMP_LIST_ID", "004f53d7c6");
define("TEKSTMELDING_API_KEY", 'qwertyuiop');
?>
+26
View File
@@ -588,7 +588,33 @@ function save_activation_form($data) {
return true;
}
function get_purchase_date($phone, $activation_code) {
$url = "https://tekstmelding.neuf.no/inside-code-purchase-date";
$params = array(
'api_key' => TEKSTMELDING_API_KEY,
'number' => str_replace('+', '', $phone),
'activation_code' => $activation_code,
);
$url .= '?' . http_build_query($params);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($ch);
curl_close($ch);
$timestamp = clean_timestamp($result);
if ($timestamp === false) {
return get_purchase_date_legacy($phone, $activation_code);
}
return $timestamp;
}
function get_purchase_date_legacy($phone, $activation_code) {
global $conn;
$gsm = substr($phone, 3); // strip off country code