API-work for kassa.neuf.no
* Starts /api/register.php as primary endpoint for kassa * Started work on simple card number updates in cardnumber.php * Reworded sms/register.php * Update README with markdown syntax
This commit is contained in:
1 parent
6170baef22
commit
2615f7154d
10 files changed
+310
-110
No files matched your search
@@ -87,6 +87,4 @@ if($user['registration_status'] === "partial") {
|
||||
|
||||
/* Return encrypted user object */
|
||||
echo $crypt->json_encode_and_encrypt($user);
|
||||
//echo json_encode($user);
|
||||
|
||||
?>
|
||||
//echo json_encode($user);
|
||||
@@ -236,5 +236,3 @@ if($reg_type === "new") {
|
||||
|
||||
/* Return encrypted user object */
|
||||
echo $crypt->json_encode_and_encrypt($user);
|
||||
|
||||
?>
|
||||
@@ -67,8 +67,9 @@ function add_user($data, $source) {
|
||||
$user_id = get_user_id_by_username($data['username']);
|
||||
|
||||
/* Phonenumber table */
|
||||
$phone_number_validated = $source === 'snapporder' ? 1 : 0;
|
||||
$cols = array('user_id', 'number', 'validated');
|
||||
$values = array($user_id, $phone, 1);
|
||||
$values = array($user_id, $phone, $phone_number_validated);
|
||||
|
||||
$sth = $conn->autoPrepare("din_userphonenumber", $cols, DB_AUTOQUERY_INSERT);
|
||||
$res = $conn->execute($sth, $values);
|
||||
@@ -195,11 +196,12 @@ function renew_user($data) {
|
||||
|
||||
/* Phonenumber table, set validated */
|
||||
$fields_values = array('validated' => 1);
|
||||
if($source === "snapporder") {
|
||||
$res = $conn->autoExecute("din_userphonenumber", $fields_values, DB_AUTOQUERY_UPDATE, "user_id=$user_id AND number='$phone'");
|
||||
|
||||
$res = $conn->autoExecute("din_userphonenumber", $fields_values, DB_AUTOQUERY_UPDATE, "user_id=$user_id AND number='$phone'");
|
||||
|
||||
if( DB::isError($res) ) {
|
||||
throw new InsideDatabaseException($res->getMessage().". DEBUG: ".$res->getDebugInfo());
|
||||
if( DB::isError($res) ) {
|
||||
throw new InsideDatabaseException($res->getMessage().". DEBUG: ".$res->getDebugInfo());
|
||||
}
|
||||
}
|
||||
|
||||
if( isset($data['membership_trial']) && $in_autumn) {
|
||||
@@ -688,6 +690,4 @@ function send_confirmation_email($data, $user) {
|
||||
$message .= "</body></html>";
|
||||
|
||||
@mail($sendto, $subject, $message, $headers);
|
||||
}
|
||||
?>
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user