Exemple #1
0
 * June 22, 2009
 */
// Includes
require_once __DIR__ . '/lib/appdb/appdb.inc.php';
use hydrogen\config\Config;
use hydrogen\errorhandler\ErrorHandler;
use appdb\usersession\UserSession;
// Are we mobile?
if (preg_match('/(iPod|iPhone)/', $_SERVER['HTTP_USER_AGENT'])) {
    die(header('Location: ' . Config::getVal('urls', 'base_url') . '/i'));
}
// Open up our session
UserSession::open_session();
// Honor any requests to log out
if (isset($_GET['action']) && $_GET['action'] == "logout") {
    UserSession::logout();
}
// Get the user
$user = UserSession::getUserBean();
// Turn off caching
header('Expires: Thu, 21 Jul 1977 07:30:00 GMT');
header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');
// Detect if this is an AJAX call and handle appropriately
if (isset($_GET['call']) && isset($_GET['calltype']) && $_GET['calltype'] == 'ajax') {
    $validAjax = array('applisting', 'appsubmit', 'itunesinfo', 'login', 'register');
    $handler = false;
    foreach ($validAjax as $callopt) {
        if ($callopt == $_GET['call']) {
            $handler = true;