<?php // Attogram Framework - User Module - Login Page v0.0.12 namespace Attogram; if (!class_exists('\\Attogram\\AttogramUser')) { $this->log->error('login.php: AttogramUser class not found'); $this->error404('Login Disbled. Attogram User module missing in action!'); } $message = ''; if (isset($_POST['login'])) { // attempt to login, buffer errors to show later if (\Attogram\AttogramUser::login($this->log, $this->database)) { $this->event->info($this->clientIp . ' LOGIN: id: ' . $_SESSION['attogram_id'] . ' username: '******'AttogramUsername']); header('Location: ' . $this->path . '/'); $this->shutdown(); } $message = '<p class="alert alert-warning">Login failed</p>'; } $this->pageHeader('Login'); ?> <div class="container"> <div class="col-xs-6 col-xs-offset-2"> <?php if ($message) { print $message; } ?> <form action="." method="POST"> <div class="form-group"> <input type="hidden" name="login" value="login">
<?php // Attogram Framework - User Module - User Page v0.0.11 namespace Attogram; if (!class_exists('\\Attogram\\AttogramUser')) { $this->log->error('modules/user/actions/user.php: AttogramUser class not found'); $this->error404('User Page Disbled. Attogram User module missing in action!'); } if (!\Attogram\AttogramUser::isLoggedIn()) { header('Location: ' . $this->path . '/login/'); $this->shutdown(); } $this->pageHeader('👤 User page'); print '<div class="container"><h1>👤 User</h1><hr />' . 'ID: <code>' . @$_SESSION['attogram_id'] . '</code>' . '<br />username: <code>' . @$_SESSION['AttogramUsername'] . '</code>' . '<br />level: <code>' . @$_SESSION['attogram_level'] . '</code>' . '<br />email: <code>' . @$_SESSION['attogram_email'] . '</code>' . '<br />isAdmin?: ' . ($this->isAdmin ? 'Yes' : 'No') . '</div>'; $this->pageFooter();