checkValidity() public method

public checkValidity ( $secret )
Ejemplo n.º 1
0
/* Routes acceptable not logged in */
try {
    switch (true) {
        case validateRoute('GET', 'auth'):
            $user->login($_GET["username"], $_GET["password"]);
            httpResponse($user->getStatus());
            break;
        case validateRoute('POST', 'auth'):
            httpResponse($user->create($postdata));
            break;
        case validateRoute('POST', 'recover/by-passkey'):
            httpResponse($user->recoverByPasskey($postdata));
            break;
        case validateRoute('GET', 'invite-validity'):
            $invite = new Invite($db, $user);
            httpResponse($invite->checkValidity($_GET["secret"]));
            break;
        case validateRoute('POST', 'recover/by-email'):
            httpResponse($user->recoverByEmail($postdata));
            break;
        case validateRoute('GET', 'recover/by-email'):
            httpResponse($user->gotRecoverByEmail($_GET["secret"]));
            break;
        case validateRoute('GET', 'torrents-matcher/torrents'):
            $torrentsMatcher = new TorrentsMatcher($db);
            httpResponse($torrentsMatcher->getTorrents($_GET["passkey"]));
            break;
        case validateRoute('GET', 'torrents-matcher/configs'):
            $torrentsMatcher = new TorrentsMatcher($db);
            httpResponse($torrentsMatcher->getSettings($_GET["passkey"]));
            break;