Skip to content

Commit c62e28f

Browse files
committed
remove cluster notice feature
1 parent 4781ffb commit c62e28f

File tree

10 files changed

+2
-334
lines changed

10 files changed

+2
-334
lines changed

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,7 @@ Typical Usage:
2222
Admin Features:
2323

2424
- Automatic updating of LDAP to reflect current state of users, groups, organizations, PI groups
25-
- Cluster notices
26-
- Added to front page, mailed, and exposed via REST API
27-
- WYSIWYG HTML editor for webpage contents, cluster notices
25+
- WYSIWYG HTML editor for webpage contents
2826
- Branding customization for multiple domains simultaneously
2927
- Custom UIDNumber / GIDNumber mappings for specific users
3028
- Login as another user

defaults/config.ini.default

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ light_foreground_smallheader = "#666666" ; Disabled text when in light mode
5959
light_borders = "#dddddd" ; Color used for borders and dividers in light mode
6060
light_footer_background = "#fafafa" ; Background color for footer in light mode
6161
light_footer_foreground = "#bbbbbb" ; Text color for footer in light mode
62-
light_panel_background = "#e6e6e6" ; Background color for panels on the page (ie. cluster notices)
62+
light_panel_background = "#e6e6e6" ; Background color for panels on the page
6363
accent = "#881c1c" ; Primary accent color
6464
accent_1 = "#941e1e" ; a little brighter
6565
accent_2 = "#9c2020" ; On hover color for element using accent color

resources/lib/UnitySQL.php

Lines changed: 0 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
class UnitySQL
88
{
99
private const string TABLE_REQS = "requests";
10-
private const string TABLE_NOTICES = "notices";
1110
private const string TABLE_PAGES = "pages";
1211
private const string TABLE_AUDIT_LOG = "audit_log";
1312
private const string TABLE_ACCOUNT_DELETION_REQUESTS = "account_deletion_requests";
@@ -139,67 +138,6 @@ public function deleteRequestsByUser(string $user): void
139138
$stmt->execute();
140139
}
141140

142-
public function addNotice(
143-
string $title,
144-
string $date,
145-
string $content,
146-
UnityUser $operator,
147-
): void {
148-
$table = self::TABLE_NOTICES;
149-
$stmt = $this->conn->prepare(
150-
"INSERT INTO $table (date, title, message) VALUES (:date, :title, :message)",
151-
);
152-
$stmt->bindParam(":date", $date);
153-
$stmt->bindParam(":title", $title);
154-
$stmt->bindParam(":message", $content);
155-
156-
$stmt->execute();
157-
158-
$this->addLog($operator->uid, $_SERVER["REMOTE_ADDR"], "added_cluster_notice", $operator);
159-
}
160-
161-
public function editNotice(string $id, string $title, string $date, string $content): void
162-
{
163-
$table = self::TABLE_NOTICES;
164-
$stmt = $this->conn->prepare(
165-
"UPDATE $table SET date=:date, title=:title, message=:message WHERE id=:id",
166-
);
167-
$stmt->bindParam(":date", $date);
168-
$stmt->bindParam(":title", $title);
169-
$stmt->bindParam(":message", $content);
170-
$stmt->bindParam(":id", $id);
171-
172-
$stmt->execute();
173-
}
174-
175-
public function deleteNotice(string $id): void
176-
{
177-
$stmt = $this->conn->prepare("DELETE FROM " . self::TABLE_NOTICES . " WHERE id=:id");
178-
$stmt->bindParam(":id", $id);
179-
180-
$stmt->execute();
181-
}
182-
183-
public function getNotice(string $id): array
184-
{
185-
$stmt = $this->conn->prepare("SELECT * FROM " . self::TABLE_NOTICES . " WHERE id=:id");
186-
$stmt->bindParam(":id", $id);
187-
188-
$stmt->execute();
189-
190-
return $stmt->fetchAll()[0];
191-
}
192-
193-
public function getNotices(): array
194-
{
195-
$stmt = $this->conn->prepare(
196-
"SELECT * FROM " . self::TABLE_NOTICES . " ORDER BY date DESC",
197-
);
198-
$stmt->execute();
199-
200-
return $stmt->fetchAll();
201-
}
202-
203141
public function getPages(): array
204142
{
205143
$stmt = $this->conn->prepare("SELECT * FROM " . self::TABLE_PAGES);

resources/templates/header.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,6 @@
114114
// Admin only pages
115115
echo getHyperlink("User Management", "admin/user-mgmt.php");
116116
echo getHyperlink("PI Management", "admin/pi-mgmt.php");
117-
echo getHyperlink("Cluster Notices", "admin/notices.php");
118117
echo getHyperlink("Content Management", "admin/content.php");
119118
}
120119
} else {

test/functional/PageLoadTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ public static function provider()
1414
[$admin, __DIR__ . "/../../webroot/admin/pi-mgmt.php"],
1515
[$admin, __DIR__ . "/../../webroot/admin/user-mgmt.php"],
1616
[$admin, __DIR__ . "/../../webroot/admin/content.php"],
17-
[$admin, __DIR__ . "/../../webroot/admin/notices.php"],
1817
[$nonexistent_user, __DIR__ . "/../../webroot/panel/new_account.php"],
1918
[$normal_user, __DIR__ . "/../../webroot/panel/account.php"],
2019
[$normal_user, __DIR__ . "/../../webroot/panel/groups.php"],

tools/docker-dev/sql/bootstrap.sql

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -75,27 +75,6 @@ DELIMITER ;
7575

7676
-- --------------------------------------------------------
7777

78-
--
79-
-- Table structure for table `notices`
80-
--
81-
82-
CREATE TABLE `notices` (
83-
`id` int(11) NOT NULL,
84-
`date` timestamp NOT NULL DEFAULT current_timestamp(),
85-
`title` varchar(300) NOT NULL,
86-
`message` longtext NOT NULL
87-
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
88-
89-
--
90-
-- Dumping data for table `notices`
91-
--
92-
93-
INSERT INTO `notices` (`id`, `date`, `title`, `message`) VALUES
94-
(9, '2022-09-19 15:49:10', 'Example Notice 1', '<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>'),
95-
(10, '2022-09-14 11:48:39', 'Example Notice 2', '<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>');
96-
97-
-- --------------------------------------------------------
98-
9978
--
10079
-- Table structure for table `pages`
10180
--
@@ -144,12 +123,6 @@ ALTER TABLE `account_deletion_requests`
144123
ALTER TABLE `audit_log`
145124
ADD PRIMARY KEY (`id`);
146125

147-
--
148-
-- Indexes for table `notices`
149-
--
150-
ALTER TABLE `notices`
151-
ADD PRIMARY KEY (`id`);
152-
153126
--
154127
-- Indexes for table `pages`
155128
--
@@ -178,12 +151,6 @@ ALTER TABLE `account_deletion_requests`
178151
ALTER TABLE `audit_log`
179152
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
180153

181-
--
182-
-- AUTO_INCREMENT for table `notices`
183-
--
184-
ALTER TABLE `notices`
185-
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=12;
186-
187154
--
188155
-- AUTO_INCREMENT for table `pages`
189156
--

webroot/admin/notices.php

Lines changed: 0 additions & 160 deletions
This file was deleted.

webroot/api/notices/index.php

Lines changed: 0 additions & 19 deletions
This file was deleted.

webroot/css/global.css

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -266,44 +266,6 @@ footer #footerLogos img {
266266
}
267267
}
268268

269-
/* notices */
270-
div.notice {
271-
background: var(--light_panel_background);
272-
border-radius: 10px;
273-
margin: 20px 0 20px 0;
274-
padding-bottom: 5px;
275-
}
276-
277-
div.notice > span.noticeTitle {
278-
display: block;
279-
background: var(--accent);
280-
color: var(--accent_foreground);
281-
border-radius: 8px 8px 0 0;
282-
padding: 10px 10px 0 10px;
283-
font-size: 14pt;
284-
font-weight: bold;
285-
}
286-
287-
div.notice > span.noticeDate {
288-
display: block;
289-
background: var(--accent);
290-
color: var(--accent_foreground);
291-
padding: 0 10px 10px 10px;
292-
}
293-
294-
div.notice > p {
295-
margin: 10px 15px 10px 15px;
296-
padding: 0;
297-
}
298-
299-
div.notice > div.noticeText {
300-
padding: 0 10px 0 10px;
301-
}
302-
303-
div.notice > button {
304-
margin: 0 0 5px 10px;
305-
}
306-
307269
#viewAsBar {
308270
background: orange;
309271
padding: 10px;

0 commit comments

Comments
 (0)