Skip to content

Commit e28c89c

Browse files
authored
absolute require, trailing whitespace, newline@eof (#189)
1 parent ab79344 commit e28c89c

20 files changed

+47
-48
lines changed

webroot/admin/ajax/get_group_members.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
require_once "../../../resources/autoload.php";
3+
require_once __DIR__ . "/../../../resources/autoload.php";
44

55
use UnityWebPortal\lib\UnityGroup;
66

webroot/admin/ajax/get_page_contents.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
require_once "../../../resources/autoload.php";
3+
require_once __DIR__ . "/../../../resources/autoload.php";
44

55
if (!$USER->isAdmin()) {
66
die();

webroot/admin/content.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
require_once "../../resources/autoload.php";
3+
require_once __DIR__ . "/../../resources/autoload.php";
44

55
if (!$USER->isAdmin()) {
66
die();

webroot/admin/notices.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
require_once "../../resources/autoload.php";
3+
require_once __DIR__ . "/../../resources/autoload.php";
44

55
if (!$USER->isAdmin()) {
66
die();

webroot/admin/pi-mgmt.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
require_once "../../resources/autoload.php";
3+
require_once __DIR__ . "/../../resources/autoload.php";
44

55
use UnityWebPortal\lib\UnityUser;
66
use UnityWebPortal\lib\UnityGroup;
@@ -90,9 +90,9 @@
9090
"<form action='' method='POST'>
9191
<input type='hidden' name='form_name' value='req'>
9292
<input type='hidden' name='uid' value='" . $request_user->getUID() . "'>
93-
<input type='submit' name='action' value='Approve'
93+
<input type='submit' name='action' value='Approve'
9494
onclick='return confirm(\"Are you sure you want to approve " . $request_user->getUID() . "?\");'>
95-
<input type='submit' name='action' value='Deny'
95+
<input type='submit' name='action' value='Deny'
9696
onclick='return confirm(\"Are you sure you want to deny " . $request_user->getUID() . "?\");'>
9797
</form>";
9898
echo "</td>";
@@ -130,7 +130,7 @@
130130
echo "<td><a href='mailto:" . $pi_user->getMail() . "'>" . $pi_user->getMail() . "</a></td>";
131131
echo "<td>";
132132
echo
133-
"<form action='' method='POST'
133+
"<form action='' method='POST'
134134
onsubmit='return confirm(\"Are you sure you want to remove " . $pi_group->getPIUID() . "?\")'>
135135
<input type='hidden' name='form_name' value='remGroup'>
136136
<input type='hidden' name='pi' value='" . $pi_group->getPIUID() . "'>

webroot/admin/user-mgmt.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
require_once "../../resources/autoload.php";
3+
require_once __DIR__ . "/../../resources/autoload.php";
44

55
use UnityWebPortal\lib\UnitySite;
66

@@ -63,7 +63,7 @@
6363
}
6464
echo "</td>";
6565
echo "<td>";
66-
echo "<form class='viewAsUserForm' action='' method='POST'
66+
echo "<form class='viewAsUserForm' action='' method='POST'
6767
onsubmit='return confirm(\"Are you sure you want to switch to the user " . $user->getUID() . "?\");'>
6868
<input type='hidden' name='form_name' value='viewAsUser'>
6969
<input type='hidden' name='uid' value='" . $user->getUID() . "'>

webroot/api/content/index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
header('Content-type: text/plain');
44

5-
require_once "../../../resources/autoload.php";
5+
require_once __DIR__ . "/../../../resources/autoload.php";
66

77
if (isset($_GET["line_wrap"])) {
88
$CHAR_WRAP = $_GET["line_wrap"];

webroot/api/notices/index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
header('Content-type: text/plain');
44

5-
require_once "../../../resources/autoload.php";
5+
require_once __DIR__ . "/../../../resources/autoload.php";
66

77
$notices = $SQL->getNotices();
88
$jsonArray = [];

webroot/index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
require_once "../resources/autoload.php";
3+
require_once __DIR__ . "/../resources/autoload.php";
44

55
require_once $LOC_HEADER;
66
?>

webroot/panel/account.php

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
require_once "../../resources/autoload.php";
3+
require_once __DIR__ . "/../../resources/autoload.php";
44

55
use UnityWebPortal\lib\UnitySite;
66

@@ -77,7 +77,6 @@
7777
case "account_deletion_request":
7878
$hasGroups = count($USER->getGroups()) > 0;
7979
if ($hasGroups) {
80-
die();
8180
break;
8281
}
8382
if (!$SQL->accDeletionRequestExists($USER->getUID())) {
@@ -115,16 +114,16 @@
115114
} elseif ($isActive) {
116115
echo "<p>You are curently a <strong>user</strong> on the Unity Cluster</p>";
117116
} else {
118-
echo "<p>You are currently not assigned to any PI, and will be
119-
<strong>unable to use the cluster</strong>. Go to the <a href='groups.php'>My PIs</a>
117+
echo "<p>You are currently not assigned to any PI, and will be
118+
<strong>unable to use the cluster</strong>. Go to the <a href='groups.php'>My PIs</a>
120119
page to join a PI, or click on the button below if you are a PI</p>";
121120
echo "<p>Students should not request a PI account.</p>";
122121
}
123122

124123
if (!$isPI) {
125124
if ($SQL->accDeletionRequestExists($USER->getUID())) {
126125
echo
127-
"<form action='' method='POST' id='piReq'
126+
"<form action='' method='POST' id='piReq'
128127
onsubmit='return confirm(\"Are you sure you want to request a PI account?\")'>
129128
<input type='hidden' name='form_type' value='pi_request'>";
130129
echo "<input type='submit' value='Request PI Account' disabled>";
@@ -135,7 +134,7 @@
135134
echo "</form>";
136135
} else {
137136
echo
138-
"<form action='' method='POST' id='piReq'
137+
"<form action='' method='POST' id='piReq'
139138
onsubmit='return confirm(\"Are you sure you want to request a PI account?\")'>
140139
<input type='hidden' name='form_type' value='pi_request'>";
141140
if ($SQL->requestExists($USER->getUID())) {
@@ -163,7 +162,7 @@
163162
echo
164163
"<div class='key-box'>
165164
<textarea spellcheck='false' readonly>" . $sshPubKeys[$i] . "</textarea>
166-
<form action='' id='del-" . $i . "'
165+
<form action='' id='del-" . $i . "'
167166
onsubmit='return confirm(\"Are you sure you want to delete this SSH key?\");' method='POST'>
168167
<input type='hidden' name='delIndex' value='$i'>
169168
<input type='hidden' name='form_type' value='delKey'>
@@ -182,7 +181,7 @@
182181

183182
<input type="hidden" name="form_type" value="loginshell">
184183

185-
<select id="loginSelector" name= "shellSelect">
184+
<select id="loginSelector" name= "shellSelect">
186185

187186
<option value="" disabled hidden>Select Login Shell...</option>
188187

@@ -209,10 +208,10 @@
209208
<?php
210209

211210
if ($found_selector) {
212-
echo "<input id='customLoginBox' type='text'
211+
echo "<input id='customLoginBox' type='text'
213212
placeholder='Enter login shell path (ie. /bin/bash)' name='shell'>";
214213
} else {
215-
echo "<input id='customLoginBox' type='text'
214+
echo "<input id='customLoginBox' type='text'
216215
placeholder='Enter login shell path (ie. /bin/bash)' name='shell' value='$cur_shell'>";
217216
}
218217

@@ -232,7 +231,7 @@
232231
echo "<p>You cannot request to delete your account while you are in a PI group.</p>";
233232
} else {
234233
echo
235-
"<form action='' method='POST' id='accDel'
234+
"<form action='' method='POST' id='accDel'
236235
onsubmit='return confirm(\"Are you sure you want to request an account deletion?\")'>
237236
<input type='hidden' name='form_type' value='account_deletion_request'>";
238237
if ($SQL->accDeletionRequestExists($USER->getUID())) {

webroot/panel/ajax/get_group_members.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
require_once "../../../resources/autoload.php";
3+
require_once __DIR__ . "/../../../resources/autoload.php";
44

55
use UnityWebPortal\lib\UnityGroup;
66

webroot/panel/groups.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
require_once "../../resources/autoload.php";
3+
require_once __DIR__ . "/../../resources/autoload.php";
44

55
use UnityWebPortal\lib\UnityGroup;
66

@@ -85,12 +85,12 @@
8585
echo "<h5>Current Groups</h5>";
8686

8787
if ($USER->isPI() && count($groups) == 1) {
88-
echo "You are only a member of your own PI group.
88+
echo "You are only a member of your own PI group.
8989
Navigate to the <a href='" . $CONFIG["site"]["prefix"] . "/panel/pi.php'>my users</a> page to see your group.";
9090
}
9191

9292
if (count($groups) == 0) {
93-
echo "You are not a member of any groups. Request to join a PI using the button below,
93+
echo "You are not a member of any groups. Request to join a PI using the button below,
9494
or request your own PI account on the <a href='" . $CONFIG["site"]["prefix"] .
9595
"/panel/account.php'>account settings</a> page";
9696
}
@@ -112,7 +112,7 @@
112112
echo "<td><a href='mailto:" . $owner->getMail() . "'>" . $owner->getMail() . "</a></td>";
113113
echo
114114
"<td>
115-
<form action='' method='POST'
115+
<form action='' method='POST'
116116
onsubmit='return confirm(\"Are you sure you want to leave the PI group " . $group->getPIUID() . "?\")'>
117117
<input type='hidden' name='form_name' value='removePIForm'>
118118
<input type='hidden' name='pi' value='" . $group->getPIUID() . "'>

webroot/panel/modal/new_key.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<?php
22

3-
require_once "../../../resources/autoload.php"; // Load required libs
3+
require_once __DIR__ . "/../../../resources/autoload.php"; // Load required libs
44
?>
55

6-
<form id="newKeyform" enctype="multipart/form-data" method="POST"
6+
<form id="newKeyform" enctype="multipart/form-data" method="POST"
77
action="<?php echo $CONFIG["site"]["prefix"]; ?>/panel/account.php">
88
<input type='hidden' name='form_type' value='addKey'>
99

@@ -16,12 +16,12 @@
1616
<input type="radio" id="import" name="add_type" value="import">
1717
<label for="import">Local File</label>
1818
</div>
19-
19+
2020
<div class='inline'>
2121
<input type="radio" id="generate" name="add_type" value="generate">
2222
<label for="generate">Generate Key</label>
2323
</div>
24-
24+
2525
<div class='inline'>
2626
<input type="radio" id="github" name="add_type" value="github">
2727
<label for="github">Import from GitHub</label>

webroot/panel/modal/new_pi.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
require_once "../../../resources/autoload.php"; // Load required libs
3+
require_once __DIR__ . "/../../../resources/autoload.php"; // Load required libs
44
?>
55

66
<form id="newPIform" method="POST" action="<?php echo $CONFIG["site"]["prefix"]; ?>/panel/groups.php">
@@ -40,4 +40,4 @@
4040
$(document).click(function() {
4141
$("div.searchWrapper").hide();
4242
});
43-
</script>
43+
</script>

webroot/panel/modal/pi_search.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
require_once "../../../resources/autoload.php"; // Load required libs
3+
require_once __DIR__ . "/../../../resources/autoload.php"; // Load required libs
44

55
$search_query = $_GET["search"]; // Search is passed as a get var
66
if (empty($search_query)) {

webroot/panel/new_account.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
require_once "../../resources/autoload.php";
3+
require_once __DIR__ . "/../../resources/autoload.php";
44

55
use UnityWebPortal\lib\UnitySite;
66
use UnityWebPortal\lib\UnityGroup;
@@ -50,7 +50,7 @@
5050
</div>
5151
<p>Your unity cluster username will be <strong><?php echo $SSO["user"]; ?></strong></p>
5252

53-
<p>In order to activate your account on the Unity cluster,
53+
<p>In order to activate your account on the Unity cluster,
5454
you must join an existing PI group, or request your own PI group.</p>
5555

5656
<hr>
@@ -59,7 +59,7 @@
5959
$pending_requests = $SQL->getRequestsByUser($USER->getUID());
6060
if (count($pending_requests) > 0) {
6161
// already has pending requests
62-
echo "<p>Your request to activate your account has been submitted.
62+
echo "<p>Your request to activate your account has been submitted.
6363
You will receive an email when your account is activated.</p>";
6464
} else {
6565
echo "<label><input type='radio' name='new_user_sel' value='pi'>Request a PI account (I am a PI)</label>";

webroot/panel/pi.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
require_once "../../resources/autoload.php";
3+
require_once __DIR__ . "/../../resources/autoload.php";
44

55
use UnityWebPortal\lib\UnityUser;
66
use UnityWebPortal\lib\UnitySite;
@@ -49,7 +49,7 @@
4949
$assocs = $group->getGroupMembers();
5050

5151
if (count($requests) + count($assocs) == 1) {
52-
echo "<p>You do not have any users attached to your PI account.
52+
echo "<p>You do not have any users attached to your PI account.
5353
Ask your users to request to join your account on the <a href='" . $CONFIG["site"]["prefix"] .
5454
"/panel/groups.php'>My PIs</a> page.</p>";
5555
}
@@ -69,9 +69,9 @@
6969
"<form action='' method='POST'>
7070
<input type='hidden' name='form_name' value='userReq'>
7171
<input type='hidden' name='uid' value='" . $request[0]->getUID() . "'>
72-
<input type='submit' name='action' value='Approve'
72+
<input type='submit' name='action' value='Approve'
7373
onclick='return confirm(\"Are you sure you want to approve " . $request[0]->getUID() . "?\")'>
74-
<input type='submit' name='action' value='Deny'
74+
<input type='submit' name='action' value='Deny'
7575
onclick='return confirm(\"Are you sure you want to deny " . $request[0]->getUID() . "?\")'>
7676
</form>";
7777
echo "</td>";
@@ -99,7 +99,7 @@
9999
"<form action='' method='POST'>
100100
<input type='hidden' name='form_name' value='remUser'>
101101
<input type='hidden' name='uid' value='" . $assoc->getUID() . "'>
102-
<input type='submit' value='Remove'
102+
<input type='submit' value='Remove'
103103
onclick='return confirm(\"Are you sure you want to remove " . $assoc->getUID() . " from your PI group?\")'>
104104
</form>";
105105
echo "</td>";

workers/clear-audit-log.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

3-
require_once "../resources/autoload.php";
4-
require_once "../resources/init.php";
3+
require_once __DIR__ . "/../resources/autoload.php";
4+
require_once __DIR__ . "/../resources/init.php";
55

66
# Days to keep
77
$days = 30;

workers/group_user_request_owner_reminder.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
Removes the request after 34 days have passed.
66
*/
77

8-
require_once "../resources/autoload.php";
8+
require_once __DIR__ . "/../resources/autoload.php";
99
use UnityWebPortal\lib\UnityGroup;
1010

1111
$today = time();

workers/update-ldap-cache.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
require_once "../resources/autoload.php";
3+
require_once __DIR__ . "/../resources/autoload.php";
44

55
// Get Users
66
$users = $LDAP->getAllUsers($SQL, $MAILER, $REDIS, $WEBHOOK, true);

0 commit comments

Comments
 (0)