function appClientData() { $data = array("version" => $version, "user-list-empty" => emptyObj(readAccountsDb()->users)); return json_encode($data); }
$app->get('/test/', function () use($app) { $app->render('test.php'); }); $app->get('/test/2016-08/', function () use($app) { $app->render('test-newFeatures.Aug2016.php'); }); $app->get('/test/npi/:npi/', function ($npi) use($app) { //echo "\n\n**** Testing ValidateNPI Method ****\n\n"; $HIPAAClient = new HIPAASpaceWebService(); // $response = $HIPAAClient->validateNPI("1215930367", array( // QueryField::getArray("LastName", "GRESSOT", true), // QueryField::getArray("FirstName", "LAURENT", true) // )); $resultsArray = array(); $response = $HIPAAClient->queryItem("NPI", $npi); if (!emptyObj($response)) { foreach ($response->QueryItemResult->ResultSet->Pair as $pair) { if ($pair->Value != "") { $resultsArray[$pair->Name] = $pair->Value; } } } else { $resultsArray = array('Hey' => 'You failed!'); } echo '<pre>'; print_r($resultsArray); //$HIPAAClient->dumpResultItem($response->QueryItemResult); echo '</pre>'; //echo getcwd(); }); $app->post('/test/upload/', function () use($app) {
function validateCreateUser($accountsDb, $email, $password, $confirm, $inviteCode, $securityMsgs) { if (!validEmailFormat($email)) { $code = "invalid-email"; } elseif ($accountsDb->users->{$email}) { $code = "user-exists"; } elseif ($password !== $confirm) { $code = "mismatch"; } elseif (emptyObj($accountsDb->users) || useInvite($accountsDb, $inviteCode)) { createUser($accountsDb, $email, $password); } else { $code = "bad-invite-code"; } logEvent("validate-create-user", is_null($code), $code, $email, $inviteCode); return $code ? $securityMsgs[$code] : null; }