mirror of
https://github.com/php/web-bugs.git
synced 2026-03-24 07:42:08 +01:00
This is initial patch of the series of patches that moves the most simple pages to templates.
32 lines
651 B
PHP
32 lines
651 B
PHP
<?php
|
|
|
|
/**
|
|
* Temporary helper placeholder file to overcome the authentication service
|
|
* migration.
|
|
*
|
|
* TODO: Refactor this into a better authentication service.
|
|
*/
|
|
|
|
// Start session
|
|
session_start();
|
|
|
|
// Authenticate
|
|
bugs_authenticate($user, $pw, $logged_in, $user_flags);
|
|
|
|
if ('developer' === $logged_in) {
|
|
$isLoggedIn = true;
|
|
$username = $auth_user->handle;
|
|
} elseif (!empty($_SESSION['user'])) {
|
|
$isLoggedIn = true;
|
|
$username = $_SESSION['user'];
|
|
} else {
|
|
$isLoggedIn = false;
|
|
$username = '';
|
|
}
|
|
|
|
$template->assign([
|
|
'authIsLoggedIn' => $isLoggedIn,
|
|
'authUsername' => $username,
|
|
'authRole' => $logged_in,
|
|
]);
|