Esempio n. 1
0
 function logout()
 {
     removeToken($this->userid);
     $this->username = '******';
     $this->userid = -1;
     $this->token = 'Guest';
     $this->type = -1;
     $this->first_name = NULL;
     $this->last_name = NULL;
 }
Esempio n. 2
0
require_once ROOT_PATH . "php/functions/lib_files.php";
require_once ROOT_PATH . "php/functions/lib_movies.php";
if (!isset($_POST['path']) || empty($_POST['path'])) {
    $error = "Path for scanning is empty !";
    return false;
}
$paths = array($_POST['path']);
$db = connectDB();
if (($paths_checking = getTokenChecking($db)) === false) {
    $error = "Internal server error";
    return false;
} elseif (!empty($paths_checking)) {
    foreach ($paths_checking as $row) {
        $return = strpos($paths[0], $row["path"], 0);
        if ($return !== false) {
            $error = "This path is being processed !";
            return false;
        }
    }
}
$id_token = setToken($db, $paths[0], "Getting all files in source");
//echo $id_token;
$result = array();
if (getFilms($result, $paths) === false) {
    removeToken($db, $id_token);
    return false;
}
updateToken($db, $id_token, "Getting information for all movies find in the source");
recoverInfoMovies($result);
removeToken($db, $id_token);
Esempio n. 3
0
 print "<hr>";
 print '<h3><a href="' . 'http://' . $_SERVER['HTTP_HOST'] . '/reset_session.php"' . '> Session Reset Page </a></h3>';
 print "<hr>";
 print '<h3><a href="' . 'http://' . $_SERVER['HTTP_HOST'] . '/oauthcallback.php"' . '> Oauth Callback Page </a></h3>';
 print "<hr>";
 print "<h3>Token in Session:</h3>";
 print "<pre>";
 print_r($_SESSION['token']);
 print "</pre>";
 print "<hr>";
 try {
     $resourceOwner = $oauthClient->getResourceOwner();
 } catch (MailiumOauthClientException $e) {
     if ($e->getCode() === MailiumOauthClientException::ACCESS_DENIED) {
         print "<h3>Access Token Has Been Revoked</h3>";
         removeToken($resourceOwner);
         // Redirect To Authorization URL
         header('Location: ' . $redirectUri);
     } else {
         print "<h3>Exception Occured</h3>";
         print "<pre>";
         print "Exception Message : " . $e->getMessage();
         print "Exception Code : " . $e->getCode();
         print "</pre>";
     }
 } catch (\Exception $e) {
     print "<h3>Exception Occured</h3>";
     var_dump($e);
 }
 print "<h3>Resource Owner</h3>";
 print "<pre>";
Esempio n. 4
0
function logout($token)
{
    return removeToken($token);
}