0
0

Ran the formatter on all PHP files, added userbar.css

This commit is contained in:
Bryan Pedini 2019-07-17 10:37:44 +02:00
parent 923184ab68
commit f2a56c2abc
No known key found for this signature in database
GPG Key ID: F59032DC40EB11E0
8 changed files with 159 additions and 119 deletions

View File

@ -0,0 +1,4 @@
html,body {
height: 100%;
width: 100%;
}

4
lib/css/userbar.css Normal file
View File

@ -0,0 +1,4 @@
.userbar {
width: 100%;
height: 50px;
}

View File

@ -24,14 +24,20 @@
?> ?>
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<link href="<?=$GLOBALS['config']['installation_path']?>/favicon.ico" rel="icon" type="image/x-icon"> <link href="<?=$GLOBALS['config']['installation_path']?>/favicon.ico" rel="icon" type="image/x-icon">
<link href="<?=$GLOBALS['config']['installation_path']?>/lib/css/manage.css" rel="stylesheet">
<title>Dashboard Home | <?=$GLOBALS['config']['website_name']?></title> <title>Dashboard Home | <?=$GLOBALS['config']['website_name']?></title>
</head> </head>
<body> <body>
<div class="userbar">
</div>
<a href="<?=$GLOBALS['config']['installation_path']?>/dashboard/manage">Open Management Console</a> <a href="<?=$GLOBALS['config']['installation_path']?>/dashboard/manage">Open Management Console</a>
</body> </body>
</html> </html>
<?php <?php
} }

View File

@ -10,14 +10,17 @@
?> ?>
<!DOCTYPE HTML> <!DOCTYPE HTML>
<html> <html>
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<link href="<?=$GLOBALS['config']['installation_path']?>/favicon.ico" rel="icon" type="image/x-icon"> <link href="<?=$GLOBALS['config']['installation_path']?>/favicon.ico" rel="icon" type="image/x-icon">
<title>Password Reset | <?=$GLOBALS['config']['website_name']?></title> <title>Password Reset | <?=$GLOBALS['config']['website_name']?></title>
</head> </head>
<body> <body>
<center> <center>
<p>Reset your password here - Placeholder</p> <p>Reset your password here - Placeholder</p>
</center> </center>
</body> </body>
</html> </html>

View File

@ -21,30 +21,37 @@
?> ?>
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<link href="<?=$GLOBALS['config']['installation_path']?>/favicon.ico" rel="icon" type="image/x-icon"> <link href="<?=$GLOBALS['config']['installation_path']?>/favicon.ico" rel="icon" type="image/x-icon">
<title id="title">Redirect in 5 seconds | <?=$GLOBALS['config']['website_name']?></title> <title id="title">Redirect in 5 seconds | <?=$GLOBALS['config']['website_name']?></title>
</head> </head>
<body> <body>
<center> <center>
<h1>You will be redirected to <?=$row['URL']?> in <span id="body-timeout">5</span></h1> <h1>You will be redirected to <?=$row['URL']?> in <span id="body-timeout">5</span></h1>
</center> </center>
<script> <script>
window.onload = function() { window.onload = function() {
var seconds = 5; var seconds = 5;
function update_timeout (interval) {
document.getElementById("title").innerHTML = "Redirect in " + seconds +" seconds | <?=$GLOBALS['config']['website_name']?>"; function update_timeout(interval) {
document.getElementById("body-timeout").innerHTML = seconds; document.getElementById("title").innerHTML = "Redirect in " + seconds + " seconds | <?=$GLOBALS['config']['website_name']?>";
if (seconds == 0) { document.getElementById("body-timeout").innerHTML = seconds;
window.location.href = "<?=$row['URL']?>"; if (seconds == 0) {
clearInterval (interval); window.location.href = "<?=$row['URL']?>";
} clearInterval(interval);
} }
interval = setInterval (function() {update_timeout(interval); seconds = seconds - 1;}, 1000);
} }
interval = setInterval(function() {
update_timeout(interval);
seconds = seconds - 1;
}, 1000);
}
</script> </script>
</body> </body>
</html> </html>
<?php <?php
} }

View File

@ -35,92 +35,95 @@
else { else {
?> ?>
<DOCTYPE HTML> <DOCTYPE HTML>
<html> <html>
<head>
<meta charset="UTF-8"> <head>
<title>Installer | OpenShorte</title> <meta charset="UTF-8">
<link href="./favicon.ico" rel="icon" type="image/x-icon"> <title>Installer | OpenShorte</title>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous"> <link href="./favicon.ico" rel="icon" type="image/x-icon">
<style> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<style>
.centered-container { .centered-container {
border: solid; border: solid;
border-radius: 25px; border-radius: 25px;
border-color: #ABABAB; border-color: #ABABAB;
} }
</style>
</head> </style>
<body> </head>
<div class="mx-auto my-5 col-sm-8 col-md-6 col-xl-4 centered-container">
<div class="my-2"></div> <body>
<section id="section_welcome"> <div class="mx-auto my-5 col-sm-8 col-md-6 col-xl-4 centered-container">
<p> <div class="my-2"></div>
Welcome to the OpenShorte installer.<br> <section id="section_welcome">
Since it seems that there are no installation found for this website, we'll proceed now with creating one.<br> <p>
Please click 'Next' and provide all the necessary informations for the database and the site name in order to let this website work correctly. Welcome to the OpenShorte installer.<br>
</p> Since it seems that there are no installation found for this website, we'll proceed now with creating one.<br>
<button id="btn_next_sitename" class="btn btn-secondary">Next</button> Please click 'Next' and provide all the necessary informations for the database and the site name in order to let this website work correctly.
</section> </p>
<section id="section_sitename"> <button id="btn_next_sitename" class="btn btn-secondary">Next</button>
<form class="form form-inline"> </section>
<div class="input-group col-sm-7 mx-auto"> <section id="section_sitename">
<div class="input-group-prepend"> <form class="form form-inline">
<span class="input-group-text" id="sitename_label">Website Name:</span> <div class="input-group col-sm-7 mx-auto">
<div class="input-group-prepend">
<span class="input-group-text" id="sitename_label">Website Name:</span>
</div>
<input type="text" class="form-control" aria-describedby="sitename_label" id="site_name" required>
</div> </div>
<input type="text" class="form-control" aria-describedby="sitename_label" id="site_name" required> </form>
</div> <button id="btn_next_dbdata" class="btn btn-secondary">Next</button>
</form> </section>
<button id="btn_next_dbdata" class="btn btn-secondary">Next</button> <section id="section_dbdata">
</section> <form class="form form-inline">
<section id="section_dbdata"> <div class="input-group col-sm-7 mx-auto">
<form class="form form-inline"> <div class="input-group-prepend">
<div class="input-group col-sm-7 mx-auto"> <span class="input-group-text" id="dbdata_label-1">Host:</span>
<div class="input-group-prepend"> </div>
<span class="input-group-text" id="dbdata_label-1">Host:</span> <input type="text" class="form-control" aria-describedby="dbdata_label-1" id="db_host" required>
</div> </div>
<input type="text" class="form-control" aria-describedby="dbdata_label-1" id="db_host" required> <div class="input-group col-sm-5 mx-auto">
</div> <div class="input-group-prepend">
<div class="input-group col-sm-5 mx-auto"> <span class="input-group-text" id="dbdata_label-2">Port:</span>
<div class="input-group-prepend"> </div>
<span class="input-group-text" id="dbdata_label-2">Port:</span> <input type="text" class="form-control" aria-describedby="dbdata_label-2" id="db_port" required>
</div> </div>
<input type="text" class="form-control" aria-describedby="dbdata_label-2" id="db_port" required> </form>
</div> <form class="form">
</form> <div class="input-group col-sm-12 mx-auto">
<form class="form"> <div class="input-group-prepend">
<div class="input-group col-sm-12 mx-auto"> <span class="input-group-text" id="dbdata_label-3">Username:</span>
<div class="input-group-prepend"> </div>
<span class="input-group-text" id="dbdata_label-3">Username:</span> <input type="text" class="form-control" aria-describedby="dbdata_label-3" id="db_username" required>
</div> </div>
<input type="text" class="form-control" aria-describedby="dbdata_label-3" id="db_username" required> <div class="input-group col-sm-12 mx-auto">
</div> <div class="input-group-prepend">
<div class="input-group col-sm-12 mx-auto"> <span class="input-group-text" id="dbdata_label-5">Password:</span>
<div class="input-group-prepend"> </div>
<span class="input-group-text" id="dbdata_label-5">Password:</span> <input type="password" class="form-control" aria-describedby="dbdata_label-5" id="db_password" required>
</div> </div>
<input type="password" class="form-control" aria-describedby="dbdata_label-5" id="db_password" required> <div class="input-group col-sm-12 mx-auto">
</div> <div class="input-group-prepend">
<div class="input-group col-sm-12 mx-auto"> <span class="input-group-text" id="dbdata_label-6">Repeat Password:</span>
<div class="input-group-prepend"> </div>
<span class="input-group-text" id="dbdata_label-6">Repeat Password:</span> <input type="password" class="form-control" aria-describedby="dbdata_label-6" id="db_confirmpassword" required>
</div> </div>
<input type="password" class="form-control" aria-describedby="dbdata_label-6" id="db_confirmpassword" required> <div class="input-group col-sm-12 mx-auto">
</div> <div class="input-group-prepend">
<div class="input-group col-sm-12 mx-auto"> <span class="input-group-text" id="dbdata_label-4">Database Name:</span>
<div class="input-group-prepend"> </div>
<span class="input-group-text" id="dbdata_label-4">Database Name:</span> <input type="text" class="form-control" aria-describedby="dbdata_label-4" id="db_name" required>
</div> </div>
<input type="text" class="form-control" aria-describedby="dbdata_label-4" id="db_name" required> </form>
</div> <button id="btn_next_complete" class="btn btn-secondary">Next</button>
</form> </section>
<button id="btn_next_complete" class="btn btn-secondary">Next</button> <section id="section_complete">
</section> <div class="mx-auto"></div>
<section id="section_complete"> </section>
<div class="mx-auto"></div> <div class="my-2"></div>
</section> </div>
<div class="my-2"></div> <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script>
</div> <script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script>
<script>
$('section:not(#section_welcome)').hide(); $('section:not(#section_welcome)').hide();
$('#btn_next_sitename').click(function() { $('#btn_next_sitename').click(function() {
$('section').hide(); $('section').hide();
@ -131,7 +134,7 @@
$('#section_dbdata').show(); $('#section_dbdata').show();
}); });
$('#btn_next_complete').click(function() { $('#btn_next_complete').click(function() {
if ( $('#db_password').val() == $('#db_confirmpassword').val() ) { if ($('#db_password').val() == $('#db_confirmpassword').val()) {
$.ajax({ $.ajax({
method: "POST", method: "POST",
datatype: "JSON", datatype: "JSON",
@ -143,22 +146,25 @@
db_password: $('#db_password').val(), db_password: $('#db_password').val(),
db_name: $('#db_name').val(), db_name: $('#db_name').val(),
}, },
success: function (data) { success: function(data) {
if (data.status == 200) { if (data.status == 200) {
$('section').hide(); $('section').hide();
$('#section_complete').show(); $('#section_complete').show();
$('#section_complete div').html(data.message); $('#section_complete div').html(data.message);
setInterval(function(){window.location.href=data.homelocation;},5000); setInterval(function() {
window.location.href = data.homelocation;
}, 5000);
} }
}, },
error: function (xhr, ajaxOptions, thrownError) { error: function(xhr, ajaxOptions, thrownError) {
alert(xhr.responseText.message); alert(xhr.responseText.message);
} }
}); });
} }
}); });
</script> </script>
</body> </body>
</html>
<?php </html>
<?php
} }

View File

@ -49,40 +49,45 @@
?> ?>
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<title>Login | <?=$GLOBALS['config']['website_name']?></title> <title>Login | <?=$GLOBALS['config']['website_name']?></title>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" rel="stylesheet"> <link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css" rel="stylesheet">
<link href="<?=$GLOBALS['config']['installation_path']?>/lib/css/login.css" rel="stylesheet"> <link href="<?=$GLOBALS['config']['installation_path']?>/lib/css/login.css" rel="stylesheet">
<link href="<?=$GLOBALS['config']['installation_path']?>/favicon.ico" rel="icon" type="image/x-icon"> <link href="<?=$GLOBALS['config']['installation_path']?>/favicon.ico" rel="icon" type="image/x-icon">
</head> </head>
<body> <body>
<div class="container col-lg-6 col-md-8 col-sm-12 col-xs-12 login-container" id="login-container"> <div class="container col-lg-6 col-md-8 col-sm-12 col-xs-12 login-container" id="login-container">
<div class="row"> <div class="row">
<div class="col-xs-12 login-form-1"> <div class="col-xs-12 login-form-1">
<h3>Login</h3> <h3>Login</h3>
<form> <form>
<div class="form-group"> <div class="form-group">
<input type="text" class="form-control" placeholder="Username" value="" id="form-username" required /> <input type="text" class="form-control" placeholder="Username" value="" id="form-username" required />
</div> </div>
<div class="form-group"> <div class="form-group">
<input type="password" class="form-control" placeholder="Password" value="" id="form-password" required /> <input type="password" class="form-control" placeholder="Password" value="" id="form-password" required />
</div> </div>
<div class="form-group"> <div class="form-group">
<input type="button" class="col-md-6 btnSubmit" value="Login" onclick="login()" /> <input type="button" class="col-md-6 btnSubmit" value="Login" onclick="login()" />
<input type="button" class="col-md-6 btnForget" value="Forgot Password?" onclick="window.location.href='<?=$GLOBALS['config']['installation_path']."/login/forgot"?>'"> <input type="button" class="col-md-6 btnForget" value="Forgot Password?" onclick="window.location.href='<?=$GLOBALS['config']['installation_path']."/login/forgot"?>'">
</div> </div>
<div class="form-group"> <div class="form-group">
<div id="login-response" class="login-response"></div> <div id="login-response" class="login-response"></div>
</div> </div>
</form> </form>
</div>
</div> </div>
</div> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js" integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js" integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script> <script src="<?=$GLOBALS['config']['installation_path']?>/lib/js/sha512.min.js"></script>
<script src="<?=$GLOBALS['config']['installation_path']?>/lib/js/sha512.min.js"></script> <script src="<?=$GLOBALS['config']['installation_path']?>/lib/js/login.js"></script>
<script src="<?=$GLOBALS['config']['installation_path']?>/lib/js/login.js"></script> <script>
<script>var script_name = "<?=$GLOBALS['config']['installation_path']?>/dashboard";</script> var script_name = "<?=$GLOBALS['config']['installation_path']?>/dashboard";
</script>
</body> </body>
</html> </html>
<?php <?php
} }

View File

@ -10,16 +10,18 @@
?> ?>
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<title>Management Panel | <?=$GLOBALS['config']['website_name']?></title> <title>Management Panel | <?=$GLOBALS['config']['website_name']?></title>
<link href="<?=$GLOBALS['config']['installation_path']?>/favicon.ico" rel="icon" type="image/x-icon"> <link href="<?=$GLOBALS['config']['installation_path']?>/favicon.ico" rel="icon" type="image/x-icon">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.8.2/css/all.css" integrity="sha256-39jKbsb/ty7s7+4WzbtELS4vq9udJ+MDjGTD5mtxHZ0=" crossorigin="anonymous" /> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.8.2/css/all.css" integrity="sha256-39jKbsb/ty7s7+4WzbtELS4vq9udJ+MDjGTD5mtxHZ0=" crossorigin="anonymous" />
<link href="<?=$GLOBALS['config']['installation_path']?>/lib/css/manage.css" rel="stylesheet"> <link href="<?=$GLOBALS['config']['installation_path']?>/lib/css/manage.css" rel="stylesheet">
</head> </head>
<body> <body>
<button onclick="logout()">Logout</button> <button onclick="logout()">Logout</button>
<div class="urlList"> <div class="urlList">
<?php <?php
if ( $result->rowCount ( ) == 0 ) { if ( $result->rowCount ( ) == 0 ) {
echo ( "You have not created any URL yet.<br>" ); echo ( "You have not created any URL yet.<br>" );
} }
@ -41,8 +43,11 @@
<input type="text" id="form-url" placeholder="URL:"> <input type="text" id="form-url" placeholder="URL:">
<button onclick="insertNewURL()">Insert new URL</button><br> <button onclick="insertNewURL()">Insert new URL</button><br>
<div id="responsetext"></div> <div id="responsetext"></div>
<script>var script_name = "<?=$GLOBALS['config']['installation_path']?>";</script> <script>
var script_name = "<?=$GLOBALS['config']['installation_path']?>";
</script>
<script src="<?=$GLOBALS['config']['installation_path']?>/lib/js/manage.js"></script> <script src="<?=$GLOBALS['config']['installation_path']?>/lib/js/manage.js"></script>
<script src="<?=$GLOBALS['config']['installation_path']?>/lib/js/logout.js"></script> <script src="<?=$GLOBALS['config']['installation_path']?>/lib/js/logout.js"></script>
</body> </body>
</html> </html>