aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAqua-sama <aqua@iserlohn-fortress.net>2021-04-07 13:45:29 +0300
committerAqua-sama <aqua@iserlohn-fortress.net>2021-04-07 13:45:29 +0300
commit1dd25bf2c0249308e2f5806d38deeeeda7b29aba (patch)
tree3c1d990ba63dfadb1248aa546d7ce2cb60b955e7
parentMarkdown formatting for descriptions (diff)
downloadbugtracker-1dd25bf2c0249308e2f5806d38deeeeda7b29aba.tar.xz
Add base url config
-rw-r--r--config.php3
-rw-r--r--templates/footer.php4
-rw-r--r--templates/header.php2
-rw-r--r--templates/panel.php14
4 files changed, 12 insertions, 11 deletions
diff --git a/config.php b/config.php
index 7555eee..eaaa132 100644
--- a/config.php
+++ b/config.php
@@ -5,6 +5,9 @@ $config = array(
'dsn' => 'pgsql:dbname=bugtracker;host=localhost;port=5432',
'username' => 'red',
'password' => 'red'
+ ),
+ 'urls' => array(
+ 'base' => 'http://localhost:8080'
)
);
diff --git a/templates/footer.php b/templates/footer.php
index 38ed8a6..72bd200 100644
--- a/templates/footer.php
+++ b/templates/footer.php
@@ -1,5 +1,5 @@
<hr>
-<p><a href='index.php'>index</a></p>
-<p><a href='license/agpl-3.0-standalone.html'>AGPL 3.0</a>; Dobromir Petrov</p>
+<p><a href='<?php echo $config['urls']['base']; ?>'>index</a></p>
+<p><a href='<?php echo $config['urls']['base']; ?>/license/agpl-3.0-standalone.html'>AGPL 3.0</a>; Dobromir Petrov</p>
</body>
</html>
diff --git a/templates/header.php b/templates/header.php
index 3a228e1..71bcbcc 100644
--- a/templates/header.php
+++ b/templates/header.php
@@ -4,7 +4,7 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>localhost: ~red</title>
- <link rel="stylesheet" href="style.css">
+ <link rel="stylesheet" href='<?php echo $config['urls']['base']; ?>/style.css'>
</head>
<body>
diff --git a/templates/panel.php b/templates/panel.php
index b670442..c7fc578 100644
--- a/templates/panel.php
+++ b/templates/panel.php
@@ -3,16 +3,14 @@
session_start();
if (isset($_SESSION['user_id']) && $_SESSION['user_id'] != "") {
- echo "Welcome, $_SESSION[user_name] <a href='user/logout.php'>logout</a>";
+ echo "Welcome, $_SESSION[user_name] <a href='{$config['urls']['base']}/user/logout.php'>logout</a>";
echo "<p>Create | View new issues | View active issues</p>";
} else {
-?>
-<form action="user/login.php" method="post">
- <input name="username" type="text" >
- <input name="password" type="password" >
- <input type="submit" value="login" >
-</form>
-<?php
+echo "<form action='{$config['urls']['base']}/user/login.php' method='post'>";
+echo " <input name='username' type='text' >";
+echo " <input name='password' type='password' >";
+echo " <input type='submit' value='login' >";
+echo "</form>";
}
?>
</div>