Skip to content

absolute require, trailing whitespace, newline@eof #189

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion webroot/admin/ajax/get_group_members.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

require_once "../../../resources/autoload.php";
require_once __DIR__ . "/../../../resources/autoload.php";

use UnityWebPortal\lib\UnityGroup;

Expand Down
2 changes: 1 addition & 1 deletion webroot/admin/ajax/get_page_contents.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

require_once "../../../resources/autoload.php";
require_once __DIR__ . "/../../../resources/autoload.php";

if (!$USER->isAdmin()) {
die();
Expand Down
2 changes: 1 addition & 1 deletion webroot/admin/content.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

require_once "../../resources/autoload.php";
require_once __DIR__ . "/../../resources/autoload.php";

if (!$USER->isAdmin()) {
die();
Expand Down
2 changes: 1 addition & 1 deletion webroot/admin/notices.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

require_once "../../resources/autoload.php";
require_once __DIR__ . "/../../resources/autoload.php";

if (!$USER->isAdmin()) {
die();
Expand Down
8 changes: 4 additions & 4 deletions webroot/admin/pi-mgmt.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

require_once "../../resources/autoload.php";
require_once __DIR__ . "/../../resources/autoload.php";

use UnityWebPortal\lib\UnityUser;
use UnityWebPortal\lib\UnityGroup;
Expand Down Expand Up @@ -90,9 +90,9 @@
"<form action='' method='POST'>
<input type='hidden' name='form_name' value='req'>
<input type='hidden' name='uid' value='" . $request_user->getUID() . "'>
<input type='submit' name='action' value='Approve'
<input type='submit' name='action' value='Approve'
onclick='return confirm(\"Are you sure you want to approve " . $request_user->getUID() . "?\");'>
<input type='submit' name='action' value='Deny'
<input type='submit' name='action' value='Deny'
onclick='return confirm(\"Are you sure you want to deny " . $request_user->getUID() . "?\");'>
</form>";
echo "</td>";
Expand Down Expand Up @@ -130,7 +130,7 @@
echo "<td><a href='mailto:" . $pi_user->getMail() . "'>" . $pi_user->getMail() . "</a></td>";
echo "<td>";
echo
"<form action='' method='POST'
"<form action='' method='POST'
onsubmit='return confirm(\"Are you sure you want to remove " . $pi_group->getPIUID() . "?\")'>
<input type='hidden' name='form_name' value='remGroup'>
<input type='hidden' name='pi' value='" . $pi_group->getPIUID() . "'>
Expand Down
4 changes: 2 additions & 2 deletions webroot/admin/user-mgmt.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

require_once "../../resources/autoload.php";
require_once __DIR__ . "/../../resources/autoload.php";

use UnityWebPortal\lib\UnitySite;

Expand Down Expand Up @@ -63,7 +63,7 @@
}
echo "</td>";
echo "<td>";
echo "<form class='viewAsUserForm' action='' method='POST'
echo "<form class='viewAsUserForm' action='' method='POST'
onsubmit='return confirm(\"Are you sure you want to switch to the user " . $user->getUID() . "?\");'>
<input type='hidden' name='form_name' value='viewAsUser'>
<input type='hidden' name='uid' value='" . $user->getUID() . "'>
Expand Down
2 changes: 1 addition & 1 deletion webroot/api/content/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

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

require_once "../../../resources/autoload.php";
require_once __DIR__ . "/../../../resources/autoload.php";

if (isset($_GET["line_wrap"])) {
$CHAR_WRAP = $_GET["line_wrap"];
Expand Down
2 changes: 1 addition & 1 deletion webroot/api/notices/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

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

require_once "../../../resources/autoload.php";
require_once __DIR__ . "/../../../resources/autoload.php";

$notices = $SQL->getNotices();
$jsonArray = [];
Expand Down
2 changes: 1 addition & 1 deletion webroot/index.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

require_once "../resources/autoload.php";
require_once __DIR__ . "/../resources/autoload.php";

require_once $LOC_HEADER;
?>
Expand Down
21 changes: 10 additions & 11 deletions webroot/panel/account.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

require_once "../../resources/autoload.php";
require_once __DIR__ . "/../../resources/autoload.php";

use UnityWebPortal\lib\UnitySite;

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

if (!$isPI) {
if ($SQL->accDeletionRequestExists($USER->getUID())) {
echo
"<form action='' method='POST' id='piReq'
"<form action='' method='POST' id='piReq'
onsubmit='return confirm(\"Are you sure you want to request a PI account?\")'>
<input type='hidden' name='form_type' value='pi_request'>";
echo "<input type='submit' value='Request PI Account' disabled>";
Expand All @@ -135,7 +134,7 @@
echo "</form>";
} else {
echo
"<form action='' method='POST' id='piReq'
"<form action='' method='POST' id='piReq'
onsubmit='return confirm(\"Are you sure you want to request a PI account?\")'>
<input type='hidden' name='form_type' value='pi_request'>";
if ($SQL->requestExists($USER->getUID())) {
Expand Down Expand Up @@ -163,7 +162,7 @@
echo
"<div class='key-box'>
<textarea spellcheck='false' readonly>" . $sshPubKeys[$i] . "</textarea>
<form action='' id='del-" . $i . "'
<form action='' id='del-" . $i . "'
onsubmit='return confirm(\"Are you sure you want to delete this SSH key?\");' method='POST'>
<input type='hidden' name='delIndex' value='$i'>
<input type='hidden' name='form_type' value='delKey'>
Expand All @@ -182,7 +181,7 @@

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

<select id="loginSelector" name= "shellSelect">
<select id="loginSelector" name= "shellSelect">

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

Expand All @@ -209,10 +208,10 @@
<?php

if ($found_selector) {
echo "<input id='customLoginBox' type='text'
echo "<input id='customLoginBox' type='text'
placeholder='Enter login shell path (ie. /bin/bash)' name='shell'>";
} else {
echo "<input id='customLoginBox' type='text'
echo "<input id='customLoginBox' type='text'
placeholder='Enter login shell path (ie. /bin/bash)' name='shell' value='$cur_shell'>";
}

Expand All @@ -232,7 +231,7 @@
echo "<p>You cannot request to delete your account while you are in a PI group.</p>";
} else {
echo
"<form action='' method='POST' id='accDel'
"<form action='' method='POST' id='accDel'
onsubmit='return confirm(\"Are you sure you want to request an account deletion?\")'>
<input type='hidden' name='form_type' value='account_deletion_request'>";
if ($SQL->accDeletionRequestExists($USER->getUID())) {
Expand Down
2 changes: 1 addition & 1 deletion webroot/panel/ajax/get_group_members.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

require_once "../../../resources/autoload.php";
require_once __DIR__ . "/../../../resources/autoload.php";

use UnityWebPortal\lib\UnityGroup;

Expand Down
8 changes: 4 additions & 4 deletions webroot/panel/groups.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

require_once "../../resources/autoload.php";
require_once __DIR__ . "/../../resources/autoload.php";

use UnityWebPortal\lib\UnityGroup;

Expand Down Expand Up @@ -85,12 +85,12 @@
echo "<h5>Current Groups</h5>";

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

if (count($groups) == 0) {
echo "You are not a member of any groups. Request to join a PI using the button below,
echo "You are not a member of any groups. Request to join a PI using the button below,
or request your own PI account on the <a href='" . $CONFIG["site"]["prefix"] .
"/panel/account.php'>account settings</a> page";
}
Expand All @@ -112,7 +112,7 @@
echo "<td><a href='mailto:" . $owner->getMail() . "'>" . $owner->getMail() . "</a></td>";
echo
"<td>
<form action='' method='POST'
<form action='' method='POST'
onsubmit='return confirm(\"Are you sure you want to leave the PI group " . $group->getPIUID() . "?\")'>
<input type='hidden' name='form_name' value='removePIForm'>
<input type='hidden' name='pi' value='" . $group->getPIUID() . "'>
Expand Down
8 changes: 4 additions & 4 deletions webroot/panel/modal/new_key.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php

require_once "../../../resources/autoload.php"; // Load required libs
require_once __DIR__ . "/../../../resources/autoload.php"; // Load required libs
?>

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

Expand All @@ -16,12 +16,12 @@
<input type="radio" id="import" name="add_type" value="import">
<label for="import">Local File</label>
</div>

<div class='inline'>
<input type="radio" id="generate" name="add_type" value="generate">
<label for="generate">Generate Key</label>
</div>

<div class='inline'>
<input type="radio" id="github" name="add_type" value="github">
<label for="github">Import from GitHub</label>
Expand Down
4 changes: 2 additions & 2 deletions webroot/panel/modal/new_pi.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

require_once "../../../resources/autoload.php"; // Load required libs
require_once __DIR__ . "/../../../resources/autoload.php"; // Load required libs
?>

<form id="newPIform" method="POST" action="<?php echo $CONFIG["site"]["prefix"]; ?>/panel/groups.php">
Expand Down Expand Up @@ -40,4 +40,4 @@
$(document).click(function() {
$("div.searchWrapper").hide();
});
</script>
</script>
2 changes: 1 addition & 1 deletion webroot/panel/modal/pi_search.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

require_once "../../../resources/autoload.php"; // Load required libs
require_once __DIR__ . "/../../../resources/autoload.php"; // Load required libs

$search_query = $_GET["search"]; // Search is passed as a get var
if (empty($search_query)) {
Expand Down
6 changes: 3 additions & 3 deletions webroot/panel/new_account.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

require_once "../../resources/autoload.php";
require_once __DIR__ . "/../../resources/autoload.php";

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

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

<hr>
Expand All @@ -59,7 +59,7 @@
$pending_requests = $SQL->getRequestsByUser($USER->getUID());
if (count($pending_requests) > 0) {
// already has pending requests
echo "<p>Your request to activate your account has been submitted.
echo "<p>Your request to activate your account has been submitted.
You will receive an email when your account is activated.</p>";
} else {
echo "<label><input type='radio' name='new_user_sel' value='pi'>Request a PI account (I am a PI)</label>";
Expand Down
10 changes: 5 additions & 5 deletions webroot/panel/pi.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

require_once "../../resources/autoload.php";
require_once __DIR__ . "/../../resources/autoload.php";

use UnityWebPortal\lib\UnityUser;
use UnityWebPortal\lib\UnitySite;
Expand Down Expand Up @@ -49,7 +49,7 @@
$assocs = $group->getGroupMembers();

if (count($requests) + count($assocs) == 1) {
echo "<p>You do not have any users attached to your PI account.
echo "<p>You do not have any users attached to your PI account.
Ask your users to request to join your account on the <a href='" . $CONFIG["site"]["prefix"] .
"/panel/groups.php'>My PIs</a> page.</p>";
}
Expand All @@ -69,9 +69,9 @@
"<form action='' method='POST'>
<input type='hidden' name='form_name' value='userReq'>
<input type='hidden' name='uid' value='" . $request[0]->getUID() . "'>
<input type='submit' name='action' value='Approve'
<input type='submit' name='action' value='Approve'
onclick='return confirm(\"Are you sure you want to approve " . $request[0]->getUID() . "?\")'>
<input type='submit' name='action' value='Deny'
<input type='submit' name='action' value='Deny'
onclick='return confirm(\"Are you sure you want to deny " . $request[0]->getUID() . "?\")'>
</form>";
echo "</td>";
Expand Down Expand Up @@ -99,7 +99,7 @@
"<form action='' method='POST'>
<input type='hidden' name='form_name' value='remUser'>
<input type='hidden' name='uid' value='" . $assoc->getUID() . "'>
<input type='submit' value='Remove'
<input type='submit' value='Remove'
onclick='return confirm(\"Are you sure you want to remove " . $assoc->getUID() . " from your PI group?\")'>
</form>";
echo "</td>";
Expand Down
4 changes: 2 additions & 2 deletions workers/clear-audit-log.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

require_once "../resources/autoload.php";
require_once "../resources/init.php";
require_once __DIR__ . "/../resources/autoload.php";
require_once __DIR__ . "/../resources/init.php";

# Days to keep
$days = 30;
Expand Down
2 changes: 1 addition & 1 deletion workers/group_user_request_owner_reminder.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Removes the request after 34 days have passed.
*/

require_once "../resources/autoload.php";
require_once __DIR__ . "/../resources/autoload.php";
use UnityWebPortal\lib\UnityGroup;

$today = time();
Expand Down
2 changes: 1 addition & 1 deletion workers/update-ldap-cache.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

require_once "../resources/autoload.php";
require_once __DIR__ . "/../resources/autoload.php";

// Get Users
$users = $LDAP->getAllUsers($SQL, $MAILER, $REDIS, $WEBHOOK, true);
Expand Down
Loading