returnAjax(hasTOTP($_REQUEST)); break; case 'cansms': returnAjax(canSMS($_REQUEST)); break; case 'verifyphone': returnAjax(verifyPhone($_REQUEST)); break; case 'verifyemail': returnAjax(verifyEmail($_REQUEST)); break; case 'addalternateemail': returnAjax(addAlternateEmail($_REQUEST)); break; case 'removeaccount': returnAjax(removeAccount($_REQUEST)); break; case 'verifynewuser': returnAjax(verifyUserAuth($_REQUEST)); break; case 'startpasswordreset': returnAjax(doStartResetPassword($_REQUEST)); break; case 'finishpasswordreset': returnAjax(finishResetPassword($_REQUEST)); break; case 'changepassword': returnAjax(changePassword($_REQUEST)); break; default: returnAjax(getLoginState($_REQUEST, true));
} else { echo json_encode(['error' => 'No phone number supplied!', 'code' => 400]); } break; /** * Stop tracking the user and delete ALL data of this user. */ /** * Stop tracking the user and delete ALL data of this user. */ case 'deleteContact': requireAuth(); // We need the exact ID: this means no 003106 (only 316...) if (isset($_GET['number'])) { $number = preg_replace('/\\D/', '', $_GET['number']); removeAccount($number); $result = ['success' => true, 'number' => $number]; echo json_encode($result); } else { echo json_encode(['error' => 'No phone number supplied!', 'code' => 400]); } break; /** * Update information of the account. */ /** * Update information of the account. */ case 'updateAccount': requireAuth(); if (isset($_GET['number'])) {