Esempio n. 1
0
 if (strlen($_REQUEST["recovery_code"]) > 0) {
     $recovery = new Recovery();
     $status = $recovery->hash_authenticated($_REQUEST["recovery_code"]);
     if ($status == True) {
         $webid = $recovery->get_webid();
         $_SESSION['recovery_status'] = null;
         $ok = True;
     } else {
         $_SESSION['recovery_status'] = error('Your recovery code does not match any records in our database.');
     }
 }
 if (strlen($_REQUEST["pairing_pin"]) > 0) {
     $recovery = new Recovery();
     $status = $recovery->pin_authenticated($_REQUEST["pairing_pin"]);
     if ($status == True) {
         $webid = $recovery->get_webid();
         $_SESSION['recovery_status'] = null;
         $ok = True;
     } else {
         $_SESSION['recovery_status'] = error('Your recovery PIN does not match any records in our database.');
     }
 }
 // DEBUG
 //echo "\n<!-- WEBID=".$webid."\nSESSION=\n".print_r($_SESSION, true)."-->\n";
 if ($ok == True) {
     if (!isset($_SESSION['myprofile'])) {
         $_SESSION['webid'] = $webid;
         $_SESSION['myprofile'] = new MyProfile($webid, BASE_URI, SPARQL_ENDPOINT);
         // load rest of data only if we can load the profile
         if ($_SESSION['myprofile']->load()) {
             $_SESSION['usr'] = $_SESSION['myprofile']->get_name();