Example #1
0
        ?>
</div>
    		</div>
    	</div>    
        <?php 
    } else {
        ?>
    	<div class="span-18 comments">
    		Sorry, the has been an error.
    	</div>    
        <?php 
    }
}
if ($_REQUEST['method'] == 'login') {
    try {
        $user = $services->login($_REQUEST['email'], $_REQUEST['password']);
        echo $user['username'];
    } catch (Exception $e) {
        echo 'invalid';
    }
    die;
}
if ($_REQUEST['method'] == 'logout') {
    $services->logout();
    echo "ok";
}
if ($_REQUEST['method'] == 'register') {
    $result = $services->registerUser($_REQUEST['username'], $_REQUEST['project'], $_REQUEST['email'], $_REQUEST['password']);
    echo $result;
}
?>