<span><?php echo $_SESSION['user']['email']; ?> </span> | <a href="<?php ViewHelper::url('?page=logout'); ?> ">Logout</a> <?php } else { ?> <a href="<?php ViewHelper::url('?page=login'); ?> "> <img width="150px" height="26px" src="<?php ViewHelper::url('assets/images/google_signin.png'); ?> " alt="Sign in with Google"> </a> <?php } ?> </span> </div> </div> </div> <div class="container">
echo $category['title']; ?> </a></li> <?php } ?> </ul> </div> <div class="widget"> <h4>Submit your event</h4> <p>Arranging an event that is not listed here? Let us know! We love to get the word out about events the community would be interested in.</p> <p style="text-align: center;"><a href="<?php ViewHelper::url('?page=add-event'); ?> " class="btn success">Submit your event!</a></p> </div> </div> </div> </div> <?php include_once 'footer.php';
?> " 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; }