Esempio n. 1
0
        ?>
" method="post">
        <button>Login with Google</button>
    </form>

<?php 
    } elseif ($openid->mode == 'cancel') {
        $_SESSION['flash']['message'] = 'User has cancelled authentication!';
    } else {
        if ($openid->validate()) {
            $authData = $openid->getAttributes();
            $_SESSION['user']['openid'] = $openid->identity;
            $_SESSION['user']['email'] = $authData['contact/email'];
            $_SESSION['flash']['type'] = 'success';
            $_SESSION['flash']['message'] = '<b>Successfully authenticated!</b>. Welcome ' . $authData['contact/email'];
            $userRepository = App::getRepository('User');
            if (!$userRepository->getUserByEmail($_SESSION['user']['email'])) {
                $userRepository->create($_SESSION['user']['email']);
            }
            $user = $userRepository->getUserByEmail($_SESSION['user']['email']);
            $_SESSION['user'] = $user;
        } else {
            $_SESSION['flash']['message'] = 'User was not authenticated!';
            $_SESSION['flash']['type'] = 'error';
        }
        header('Location: ' . ViewHelper::url('', true));
    }
} catch (ErrorException $e) {
    echo $e->getMessage();
    die;
}
Esempio n. 2
0
<?php

include_once 'header.php';
$activeEvents = App::getRepository('Event')->getActiveEvents();
$categories = App::getRepository('Category')->getAllCategories();
?>

<div class="content">

    <div class="row">

        <div id="main-content" class="span10">

            <h4>About</h4>

            <p>Tech Adda is the platform for sharing technical ideas and viewpoints. The site gives details of events past, present and future, the sessions, and speakers at each, and allows all attendees to register and leave feedback - for the sessions and for the event itself.</p>

        </div>

        <div class="span4">

            <div class="widget">

                <h4>Categories</h4>

                <ul>
                    <?php 
foreach ($categories as $category) {
    ?>
                    <li><a href="<?php 
    ViewHelper::url('?page=cat&id=' . $category['category_id']);
Esempio n. 3
0
<?php

if (!empty($_POST)) {
    App::getRepository('Comment')->create($_POST);
    header('Location: ' . ViewHelper::url('?page=talk&id=' . $_POST['talk_id'], true));
} else {
    header('Location: ' . ViewHelper::url('', true));
}