Esempio n. 1
0
 * Admin creation page for first setup
 *
 * @author Parsa Nikpour <*****@*****.**>
 * @license http://www.opensource.org/licenses/mit-license.html MIT License
 * @copyright 2015 Parsa Nikpour
 */
?>

<?php 
ini_set('display_startup_errors', 1);
ini_set('display_errors', 1);
error_reporting(-1);
include '../assets/php/lib.php';
dontCache();
// If user tried accessing this page directly, redirect to login page
if (adminExists()) {
    header('Location: ../index.php');
}
?>

<html>
<head>
	<?php 
importResources();
?>
	<title>Setup Admin</title>
</head>
<body>

<div class='container'>
<?php 
Esempio n. 2
0
 * @author Parsa Nikpour <*****@*****.**>
 * @license http://www.opensource.org/licenses/mit-license.html MIT License
 * @copyright 2015 Parsa Nikpour
 */
?>

<?php 
// Write errors to screen as needed
ini_set('display_startup_errors', 1);
ini_set('display_errors', 1);
error_reporting(-1);
// Include external functions for getting the current database connection
include 'assets/php/lib.php';
dontCache();
// If admin user does not exist, redirect to admin setup page
if (!adminExists()) {
    setupAdmin();
}
// If logon failed, print error and display logon form again; otherwise, redirect to user dashboard
if (!isset($_SESSION['user'])) {
    //	destroySessionsButKeepErrors();
} else {
    header('Location: main');
}
?>

<html>
<head>
	<?php 
importResourcesFromLogin();
?>