Skip to content

Commit c25e8bc

Browse files
committed
Instalator fixes and lots and lots of other bugfixes
1 parent e19fd0d commit c25e8bc

16 files changed

+432
-168
lines changed

admin/dashboard.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
<div class="timeline">
3838
<div class="line text-muted"></div>
3939
<h3><?php echo _("New incident");?></h3>
40-
<form id="new-incident" action="/admin/?new=incident" method="POST" class="clearfix">
40+
<form id="new-incident" action="<?php echo WEB_URL;?>/admin/?new=incident" method="POST" class="clearfix">
4141
<article class="panel">
4242
<?php if (isset($message))
4343
{?>
@@ -52,11 +52,12 @@
5252
}else{
5353
$post_services = array();
5454
}
55+
5556
foreach($services as $service){
5657
?>
5758
<div class="item clearfix">
5859
<div class="service"><?php if ($service->get_status()!=-1){?><input type="checkbox" name="services[]" value="<?php echo $service->get_id(); ?>" <?php echo (in_array($service->get_id(), $post_services))?"checked":'';?> id="service-<?php echo $service->get_id(); ?>"><?php } ?><label for="service-<?php echo $service->get_id(); ?>"><?php echo $service->get_name(); ?></label></div>
59-
<div class="status <?php echo $classes[$service->get_status()];?>"><?php echo $statuses[$service->get_status()];?></div>
60+
<div class="status <?php if ($service->get_status()!=-1){echo $classes[$service->get_status()];}?>"><?php if ($service->get_status()!=-1){echo $statuses[$service->get_status()];}?></div>
6061
</div>
6162
<?php
6263
}

admin/login-form.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<?php }else{?>
1111
<p class="alert alert-info"><?php echo _("Please login to continue.");?></p>
1212
<?php }?>
13-
<form action="/admin/" method="post">
13+
<form action="<?php echo WEB_URL;?>/admin/" method="post">
1414
<div class="form-group">
1515
<label for="email"><?php echo _("Email");?></label>
1616
<input placeholder="<?php echo _("Email");?>" class="form-control" name="email" id="email" type="email" tabindex="1" value="<?php echo htmlspecialchars((isset($_POST['email'])?$_POST['email']:''),ENT_QUOTES);?>" required>
@@ -19,7 +19,7 @@
1919
<label for="pass"><?php echo _("Password");?></label>
2020
<input placeholder="<?php echo _("Password");?>" class="form-control" name="pass" id="pass" type="password" tabindex="2" required>
2121
<div style="padding-top: 8px; position: relative;">
22-
<a href="?do=lost-password" class="pull-right noselect" tabindex="5"><?php echo _("Forgotten password?");?></a>
22+
<a href="<?php echo WEB_URL;?>/admin/?do=lost-password" class="pull-right noselect" tabindex="5"><?php echo _("Forgotten password?");?></a>
2323
<input name="remember" id="remember" type="checkbox" tabindex="3"> <label class="lbl-login noselect" style="color: black;" for="remember"><?php echo _("Remember me");?></label>
2424
</div>
2525
</div>

admin/lost-password.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@
1313
$user->change_password($_POST['token']);
1414
if (isset($message)){?>
1515
<p class="alert alert-danger"><?php echo $message?></p>
16-
<a href="/admin/?do=lost-password<?php echo "&id=".$_POST['id']."&token=".$_POST['token'];?>"><?php echo _("Go back");?> </a>
16+
<a href="<?php echo WEB_URL;?>/admin/?do=lost-password<?php echo "&id=".$_POST['id']."&token=".$_POST['token'];?>"><?php echo _("Go back");?> </a>
1717
<?php
1818
}
1919
else{?>
2020
<p class="alert alert-success"><?php echo _("Password changed successfully!");?></p>
21-
<a href="/admin/"><?php echo _("Go back to login page");?></a>
21+
<a href="<?php echo WEB_URL;?>/admin/"><?php echo _("Go back to login page");?></a>
2222
<?php
2323
}
2424
}
@@ -27,12 +27,12 @@
2727
User::password_link();
2828
if (isset($message)){?>
2929
<p class="alert alert-danger"><?php echo $message?></p>
30-
<a href="/admin/?do=lost-password"><?php echo _("Go back to start");?></a>
30+
<a href="<?php echo WEB_URL;?>/admin/?do=lost-password"><?php echo _("Go back to start");?></a>
3131
<?php
3232
}
3333
else{?>
3434
<p class="alert alert-success"><?php echo _("Email with password reset link has been sent!");?></p>
35-
<a href="/admin/"><?php echo _("Go back to login page");?></a>
35+
<a href="<?php echo WEB_URL;?>/admin/"><?php echo _("Go back to login page");?></a>
3636
<?php
3737
}
3838
}
@@ -41,7 +41,7 @@
4141
if (isset($message)){?>
4242
<p class="alert alert-danger"><?php echo $message?></p>
4343
<?php }?>
44-
<form action="/admin/?do=lost-password" method="post">
44+
<form action="<?php echo WEB_URL;?>/admin/?do=lost-password" method="post">
4545
<?php if (!isset($_GET['id'])||!isset($_GET['token'])){?>
4646
<label for="email"><?php echo _("Email");?>:</label>
4747
<div class="input-group pull-right">

admin/new-user.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<h2>Add new user</h2>
1010
</div>
1111

12-
<form action="/admin/?do=new-user&new=user" method="POST" class="form-horizontal">
12+
<form action="<?php echo WEB_URL;?>/admin/?do=new-user&new=user" method="POST" class="form-horizontal">
1313
<?php if (isset($message))
1414
{?>
1515
<p class="alert alert-danger"><?php echo $message?></p>

admin/settings.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
echo "<td>".$result['name']."</td>";
5353
if ($user->get_rank()<=1)
5454
{
55-
echo '<td><a href="?do=settings&delete='.$result['id'].'" class="pull-right delete-service"><i class="fa fa-trash"></i></a></td>';
55+
echo '<td><a href="'.WEB_URL.'/admin/?do=settings&delete='.$result['id'].'" class="pull-right delete-service"><i class="fa fa-trash"></i></a></td>';
5656
}
5757
echo "</tr>";
5858
}?>
@@ -63,7 +63,7 @@
6363

6464
<section>
6565
<h3 class="pull-left"><?php echo _("Users");?></h3>
66-
<?php if ($user->get_rank() == 0){?> <a href="?do=new-user" class="btn btn-success pull-right"><?php echo _("Add new user");?></a><?php }?>
66+
<?php if ($user->get_rank() == 0){?> <a href="<?php echo WEB_URL;?>/admin/?do=new-user" class="btn btn-success pull-right"><?php echo _("Add new user");?></a><?php }?>
6767
<table class="table">
6868

6969
<thead><tr><th scope="col"><?php echo _("ID");?></th><th scope="col"><?php echo _("Username");?></th><th scope="col"><?php echo _("Name");?></th><th scope="col"><?php echo _("Surname");?></th><th scope="col"><?php echo _("Email");?></th><th scope="col"><?php echo _("Role");?></th><th scope="col">Active</th></tr></thead>
@@ -74,7 +74,7 @@
7474
{
7575
echo "<tr>";
7676
echo "<td>".$result['id']."</td>";
77-
echo "<td><a href='/admin/?do=user&id=".$result['id']."'>".$result['username']."</a></td>";
77+
echo "<td><a href='".WEB_URL."/admin/?do=user&id=".$result['id']."'>".$result['username']."</a></td>";
7878
echo "<td>".$result['name']."</td>";
7979
echo "<td>".$result['surname']."</td>";
8080
echo "<td><a href=\"mailto:".$result['email']."\">".$result['email']."</a></td>";

admin/user.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
try {
88
$displayed_user = new User($id);
99
} catch (Exception $e) {
10-
header("Location: /admin/?do=user");
10+
header("Location: ".WEB_URL."/admin/?do=user");
1111
}
1212

1313

classes/constellation.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public function render_incidents($future=false, $offset=0, $limit = 5, $admin =
3939
{
4040
if ($offset)
4141
{
42-
echo '<noscript><div class="centered"><a href="?offset='.($offset-$limit+1).'&timestamp='.$timestamp.'" class="btn btn-default">'._("Back").'</a></div></noscript>';
42+
echo '<noscript><div class="centered"><a href="'.WEB_URL.'/?offset='.($offset-$limit+1).'&timestamp='.$timestamp.'" class="btn btn-default">'._("Back").'</a></div></noscript>';
4343
}
4444
echo "<h3>"._("Past incidents")."</h3>";
4545
}
@@ -59,7 +59,7 @@ public function render_incidents($future=false, $offset=0, $limit = 5, $admin =
5959
}
6060
if ($show)
6161
{
62-
echo '<div class="centered"><a href="?offset='.($offset).'&timestamp='.$timestamp.'" id="loadmore" class="btn btn-default">'._("Load more").'</a></div>';
62+
echo '<div class="centered"><a href="'.WEB_URL.'/?offset='.($offset).'&timestamp='.$timestamp.'" id="loadmore" class="btn btn-default">'._("Load more").'</a></div>';
6363
}
6464
}
6565
}

classes/incident.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public static function delete($id){
4949
$stmt->bind_param("i", $id);
5050
$stmt->execute();
5151
$query = $stmt->get_result();
52-
header("Location: /admin");
52+
header("Location: ".WEB_URL."/admin");
5353
}
5454

5555
/**
@@ -132,7 +132,7 @@ public static function add()
132132
$stmt->execute();
133133
$query = $stmt->get_result();
134134
}
135-
header("Location: /admin");
135+
header("Location: ".WEB_URL."/admin");
136136
}
137137
}
138138

@@ -154,7 +154,7 @@ public function render($admin=0){
154154
<div class="panel-heading clearfix">
155155
<h2 class="panel-title"><?php echo $this->title; ?></h2>
156156
<?php if ($admin){
157-
echo '<a href="?delete='.$this->id.'" class="pull-right delete"><i class="fa fa-trash"></i></a>';
157+
echo '<a href="'.WEB_URL.'/?delete='.$this->id.'" class="pull-right delete"><i class="fa fa-trash"></i></a>';
158158
}?>
159159
<time class="pull-right timeago" datetime="<?php echo $this->date; ?>"><?php echo $this->date; ?></time>
160160
</div>
@@ -165,7 +165,7 @@ public function render($admin=0){
165165
<small><?php echo _("Posted by");?>: <?php echo $this->username;
166166
if (isset($this->end_date)){?>
167167
<span class="pull-right"><?php echo strtotime($this->end_date)>time()?_("Ending"):_("Ended");?>:&nbsp;<time class="pull-right timeago" datetime="<?php echo $this->end_date; ?>"><?php echo $this->end_date; ?></time></span>
168-
<?}?>
168+
<?php } ?>
169169
</small>
170170
</div>
171171
</article>

0 commit comments

Comments
 (0)