Skip to content

Commit fa5d021

Browse files
committed
replace die with exception
1 parent 8814abd commit fa5d021

File tree

9 files changed

+11
-11
lines changed

9 files changed

+11
-11
lines changed

webroot/admin/ajax/get_group_members.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
use UnityWebPortal\lib\UnityGroup;
66

77
if (!$USER->isAdmin()) {
8-
die();
8+
throw new Exception("access denied");
99
}
1010

1111
if (!isset($_GET["pi_uid"])) {
12-
die("PI UID not set");
12+
throw new Exception("PI UID not set");
1313
}
1414

1515
$group = new UnityGroup($_GET["pi_uid"], $LDAP, $SQL, $MAILER, $REDIS, $WEBHOOK);

webroot/admin/ajax/get_page_contents.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
require_once __DIR__ . "/../../../resources/autoload.php";
44

55
if (!$USER->isAdmin()) {
6-
die();
6+
throw new Exception("access denied");
77
}
88

99
if (!isset($_GET["pageid"])) {
10-
die("Pageid not found");
10+
throw new Exception("Pageid not defined");
1111
}
1212

1313
$page = $SQL->getPage($_GET["pageid"]);

webroot/admin/content.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
require_once __DIR__ . "/../../resources/autoload.php";
44

55
if (!$USER->isAdmin()) {
6-
die();
6+
throw new Exception("access denied");
77
}
88

99
if ($_SERVER["REQUEST_METHOD"] == "POST") {

webroot/admin/notices.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
require_once __DIR__ . "/../../resources/autoload.php";
44

55
if (!$USER->isAdmin()) {
6-
die();
6+
throw new Exception("access denied");
77
}
88

99
if ($_SERVER["REQUEST_METHOD"] == "POST") {

webroot/admin/pi-mgmt.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
use UnityWebPortal\lib\UnityGroup;
77

88
if (!$USER->isAdmin()) {
9-
die();
9+
throw new Exception("access denied");
1010
}
1111

1212
if ($_SERVER["REQUEST_METHOD"] == "POST") {

webroot/admin/user-mgmt.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
use UnityWebPortal\lib\UnitySite;
66

77
if (!$USER->isAdmin()) {
8-
die();
8+
throw new Exception("access denied");
99
}
1010

1111
if ($_SERVER["REQUEST_METHOD"] == "POST") {

webroot/api/content/index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
}
1212

1313
if (!isset($_GET["content_name"])) {
14-
die();
14+
throw new Exception("content_name not set");
1515
}
1616

1717
echo $SQL->getPage($_GET["content_name"])["content"];

webroot/panel/ajax/get_group_members.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
use UnityWebPortal\lib\UnityGroup;
66

77
if (!isset($_GET["pi_uid"])) {
8-
die("PI UID not set");
8+
throw new Exception("PI UID not set");
99
}
1010

1111
$group = new UnityGroup($_GET["pi_uid"], $LDAP, $SQL, $MAILER, $REDIS, $WEBHOOK);

webroot/panel/pi.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
$group = $USER->getPIGroup();
99

1010
if (!$USER->isPI()) {
11-
die();
11+
throw new Exception("access denied");
1212
}
1313

1414
if ($_SERVER["REQUEST_METHOD"] == "POST") {

0 commit comments

Comments
 (0)