Skip to content

Commit 1abb726

Browse files
committed
webroot linting
1 parent 6470ce4 commit 1abb726

27 files changed

+290
-247
lines changed

resources/lib/UnitySite.php

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,39 @@ public static function redirect($destination)
1212
}
1313
}
1414

15+
public static function removeTrailingWhitespace($arr)
16+
{
17+
$out = array();
18+
foreach ($arr as $str) {
19+
$new_string = rtrim($str);
20+
array_push($out, $new_string);
21+
}
22+
23+
return $out;
24+
}
25+
26+
public static function getGithubKeys($username)
27+
{
28+
$url = "https://api.github.com/users/$username/keys";
29+
$headers = array(
30+
"User-Agent: Unity Cluster User Portal"
31+
);
32+
33+
$curl = curl_init();
34+
curl_setopt($curl, CURLOPT_URL, $url);
35+
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
36+
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
37+
$output = json_decode(curl_exec($curl), true);
38+
curl_close($curl);
39+
40+
$out = array();
41+
foreach ($output as $value) {
42+
array_push($out, $value["key"]);
43+
}
44+
45+
return $out;
46+
}
47+
1548
public static function getConfig($conf_path)
1649
{
1750
$arr = parse_ini_file($conf_path, true);

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 "../../resources/autoload.php";
3+
require_once "../../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 "../../resources/autoload.php";
3+
require_once "../../resources/autoload.php";
44

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

webroot/admin/pi-mgmt.php

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

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

55
use UnityWebPortal\lib\UnityGroup;
66

webroot/admin/user-mgmt.php

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

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

55
use UnityWebPortal\lib\UnitySite;
66

webroot/api/notices/index.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
<?php
2+
23
header('Content-type: text/plain');
34

4-
require "../../../resources/autoload.php";
5+
require_once "../../../resources/autoload.php";
56

67
if (isset($_GET["line_wrap"])) {
78
$CHAR_WRAP = $_GET["line_wrap"];
@@ -10,7 +11,7 @@
1011
}
1112

1213
$notices = $SQL->getNotices();
13-
foreach($notices as $notice) {
14+
foreach ($notices as $notice) {
1415
echo $notice["title"] . "\r\n";
1516
echo date('m-d-Y', strtotime($notice["date"])) . "\r\n";
1617

@@ -20,4 +21,4 @@
2021
}
2122

2223
echo "\r\n\r\n";
23-
}
24+
}

webroot/css/global.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -330,12 +330,12 @@ div.searchWrapper {
330330
border-radius: 5px;
331331
}
332332

333-
div.searchWrapper > * {
333+
div.searchWrapper>* {
334334
display: block;
335335
cursor: pointer;
336336
padding: 4px 10px 4px 10px;
337337
}
338338

339-
div.searchWrapper > *:hover {
339+
div.searchWrapper>*:hover {
340340
background: var(--light_panel_background);
341341
}

webroot/css/modal.css

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ div.modalContent {
1616
background: var(--light_background);
1717
padding: 15px;
1818
width: calc(100% - 30px);
19-
box-shadow: 0px 0px 20px 0px rgba(0,0,0,0.4);
19+
box-shadow: 0px 0px 20px 0px rgba(0, 0, 0, 0.4);
2020
border-radius: 5px;
2121
max-width: 600px;
2222
}
@@ -35,12 +35,12 @@ div.modalMessages {
3535
font-size: 11pt;
3636
}
3737

38-
div.modalMessages > * {
38+
div.modalMessages>* {
3939
margin-top: 7px;
4040
display: block;
4141
}
4242

43-
div.modalBody > * {
43+
div.modalBody>* {
4444
margin: 0;
4545
}
4646

@@ -61,7 +61,7 @@ div.modalBody > * {
6161
margin-top: 10px;
6262
}
6363

64-
.buttonList > * {
64+
.buttonList>* {
6565
display: inline-block;
6666
margin-right: 10px;
6767
}

webroot/css/navbar.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,11 @@ header>button.hamburger>img {
8787
nav.mainNav {
8888
right: 0;
8989
}
90+
9091
header {
9192
width: 100%;
9293
}
94+
9395
main {
9496
/* Header element height + 2*element padding */
9597
margin-top: 45px;
@@ -103,12 +105,15 @@ header>button.hamburger>img {
103105
bottom: 0;
104106
width: 250px;
105107
}
108+
106109
header>button.hamburger {
107110
display: none;
108111
}
112+
109113
main {
110114
margin-left: 250px;
111115
}
116+
112117
footer {
113118
margin-left: 250px;
114119
}

webroot/css/tables.css

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,15 @@ table {
66
max-width: 100%;
77
}
88

9-
table tr, table td {
9+
table tr,
10+
table td {
1011
padding: 8px 20px 8px 4px;
1112
overflow: hidden;
1213
white-space: nowrap;
1314
}
1415

15-
table button, table input[type=submit] {
16+
table button,
17+
table input[type=submit] {
1618
padding: 5px 10px 5px 10px;
1719
}
1820

@@ -32,7 +34,7 @@ tr.expanded {
3234
border: 0;
3335
}
3436

35-
tr.expanded > td {
37+
tr.expanded>td {
3638
background: var(--light_panel_background);
3739
}
3840

@@ -44,41 +46,41 @@ tr.expandable:hover {
4446
background: var(--light_footer_background);
4547
}
4648

47-
tr.expandable:hover > td:first-child {
49+
tr.expandable:hover>td:first-child {
4850
border-top-left-radius: 10px;
4951
border-bottom-left-radius: 10px;
5052
}
5153

52-
tr.expandable:hover > td:last-child {
54+
tr.expandable:hover>td:last-child {
5355
border-top-right-radius: 10px;
5456
border-bottom-right-radius: 10px;
5557
}
5658

57-
tr.expandable.first > td:first-child {
59+
tr.expandable.first>td:first-child {
5860
border-bottom-left-radius: 0;
5961
}
6062

61-
tr.expandable.first > td:last-child {
63+
tr.expandable.first>td:last-child {
6264
border-bottom-right-radius: 0;
6365
}
6466

6567
tr.expanded.first {
6668
border-bottom: 2px solid var(--light_borders);
6769
}
6870

69-
tr.expanded.first > td:first-child {
71+
tr.expanded.first>td:first-child {
7072
border-top-left-radius: 10px;
7173
}
7274

73-
tr.expanded.first > td:last-child {
75+
tr.expanded.first>td:last-child {
7476
border-top-right-radius: 10px;
7577
}
7678

77-
tr.expanded.last > td:first-child {
79+
tr.expanded.last>td:first-child {
7880
border-bottom-left-radius: 10px;
7981
}
8082

81-
tr.expanded.last > td:last-child {
83+
tr.expanded.last>td:last-child {
8284
border-bottom-right-radius: 10px;
8385
}
8486

@@ -87,7 +89,7 @@ tr.expanded:not(.expandable) {
8789
padding-bottom: 0;
8890
}
8991

90-
tr.expanded:not(.expandable) > td:first-child {
92+
tr.expanded:not(.expandable)>td:first-child {
9193
padding-left: 30px;
9294
}
9395

@@ -111,7 +113,7 @@ button.btnExpanded {
111113
transform: rotate(90deg);
112114
}
113115

114-
td:last-child > button {
116+
td:last-child>button {
115117
float: right;
116118
}
117119

@@ -121,12 +123,12 @@ tr.key {
121123
font-weight: bold;
122124
}
123125

124-
tr.key > td:first-child {
126+
tr.key>td:first-child {
125127
border-top-left-radius: 10px;
126128
border-bottom-left-radius: 10px;
127129
}
128130

129-
tr.key > td:last-child {
131+
tr.key>td:last-child {
130132
border-top-right-radius: 10px;
131133
border-bottom-right-radius: 10px;
132134
}

0 commit comments

Comments
 (0)