Skip to content

Commit 77d871d

Browse files
authored
Merge pull request #91 from sheldor1510/small-fixes
Fixes
2 parents bf2e212 + 6b448ac commit 77d871d

File tree

3 files changed

+88
-78
lines changed

3 files changed

+88
-78
lines changed

tools/docker-dev/sql/bootstrap.sql

+75-70
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22
-- version 4.9.5deb2
33
-- https://www.phpmyadmin.net/
44
--
5-
-- Host: localhost:3306
6-
-- Generation Time: Sep 22, 2022 at 08:36 PM
7-
-- Server version: 10.3.34-MariaDB-0ubuntu0.20.04.1
8-
-- PHP Version: 7.4.3
5+
-- Host: 127.0.0.1
6+
-- Generation Time: Jul 11, 2023 at 04:05 PM
7+
-- Server version: 10.3.37-MariaDB-0ubuntu0.20.04.1
8+
-- PHP Version: 7.4.3-4ubuntu2.17
99

1010
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
1111
SET AUTOCOMMIT = 0;
@@ -24,6 +24,33 @@ SET time_zone = "+00:00";
2424

2525
-- --------------------------------------------------------
2626

27+
--
28+
-- Table structure for table `account_deletion_requests`
29+
--
30+
31+
CREATE TABLE `account_deletion_requests` (
32+
`id` int(11) NOT NULL,
33+
`timestamp` timestamp NOT NULL DEFAULT current_timestamp(),
34+
`uid` varchar(1000) NOT NULL
35+
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
36+
37+
-- --------------------------------------------------------
38+
39+
--
40+
-- Table structure for table `audit_log`
41+
--
42+
43+
CREATE TABLE `audit_log` (
44+
`id` int(11) NOT NULL,
45+
`timestamp` timestamp NOT NULL DEFAULT current_timestamp(),
46+
`operator` varchar(1000) NOT NULL,
47+
`operator_ip` varchar(1000) NOT NULL,
48+
`action_type` varchar(1000) NOT NULL,
49+
`recipient` varchar(1000) NOT NULL
50+
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
51+
52+
-- --------------------------------------------------------
53+
2754
--
2855
-- Table structure for table `events`
2956
--
@@ -34,7 +61,7 @@ CREATE TABLE `events` (
3461
`action` varchar(300) NOT NULL,
3562
`entity` varchar(300) NOT NULL,
3663
`timestamp` timestamp NOT NULL DEFAULT current_timestamp()
37-
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
64+
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
3865

3966
-- --------------------------------------------------------
4067

@@ -47,7 +74,7 @@ CREATE TABLE `notices` (
4774
`date` timestamp NOT NULL DEFAULT current_timestamp(),
4875
`title` varchar(300) NOT NULL,
4976
`message` longtext NOT NULL
50-
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
77+
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
5178

5279
--
5380
-- Dumping data for table `notices`
@@ -67,16 +94,15 @@ CREATE TABLE `pages` (
6794
`id` int(11) NOT NULL,
6895
`page` varchar(300) NOT NULL,
6996
`content` longtext NOT NULL
70-
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
97+
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
7198

7299
--
73100
-- Dumping data for table `pages`
74101
--
75102

76103
INSERT INTO `pages` (`id`, `page`, `content`) VALUES
77104
(1, 'support', '<h3>Docmentation and FAQ</h3>\r\n<p>You can find our documentation <a href=\"https://esdconfluence.it.umass.edu/confluence/display/UNITY/Unity+Cluster+Documentation+Home\" target=\"_blank\">here</a>. We also have an <a target=\"_blank\" href=\"https://esdconfluence.it.umass.edu/confluence/display/UNITY/Frequently+Asked+Questions\">FAQ</a> page which could help answer quick questions.\r\n\r\n<h3>Office Hours</h3>\r\n<p>We offer office hours every week on <strong>Tuesdays 2-4 PM</strong> in-person at <strong>W.E.B. DuBois Library 786</strong> or remote on <strong><a target=\"_blank\" href=\"https://umass-amherst.zoom.us/j/95663998309\">Zoom</a></strong>. Be sure to check the <a href=\"<?php echo $CONFIG[\"site\"][\"prefix\"]; ?>/index.php\">cluster notes</a> page for up-to-date information on any canceled/delayed office hours.</p>\r\n\r\n<h3>Support Email</h3>\r\n<p>You can create a support ticket by emailing <a target=\"_blank\" href=\"mailto:[email protected]\">[email protected]</a>. We will do our best to reply as fast as possible!</p>'),
78-
(2, 'policy', '<p>By using resources associated with Unity, you agree to comply with the following conditions of use. This is an extension of the University of Massachussetts Amherst Information Technology Acceptable Use Policy, which can be found <a target=\"_blank\" href=\"https://www.umass.edu/it/security/acceptable-use-policy\">here</a>.</p>\r\n\r\n<ol>\r\n <li>You will not use Unity resources for illicit financial gain, such as virtual currency mining, or any unlawful purpose, nor attempt to breach or circumvent any Unity administrative or security controls. You will comply with all applicable laws, working with your home institution and the specific Unity service providers utilized to determine what constraints may be placed on you by any relevant regulations such as export control law or HIPAA.</li>\r\n <li>You will respect intellectual property rights and observe confidentiality agreements.</li>\r\n <li>You will protect the access credentials (e.g., passwords, private keys, and/or tokens) issued to you or generated to access Unity resources; these are issued to you for your sole use.</li>\r\n <li>You will immediately report any known or suspected security breach or loss or misuse of Unity access credentials to <a href=\"mailto:[email protected]\">[email protected]</a>.</li>\r\n <li>You will have only one Unity User account and will keep your profile information up-to-date.</li>\r\n <li>Use of resources and services through Unity is at your own risk. There are no guarantees that resources and services will be available, that they will suit every purpose, or that data will never be lost or corrupted. Users are responsible for backing up critical data.</li>\r\n <li>Logged information, including information provided by you for registration purposes, is used for administrative, operational, accounting, monitoring and security purposes. This information may be disclosed, via secured mechanisms, only for the same purposes and only as far as necessary to other organizations cooperating with Unity .</li>\r\n</ol>\r\n\r\n<p>The Unity team reserves the right to restrict access to any individual/group found to be in breach of the above.</p>'),
79-
(3, 'home', '<p>Home page content</p><p>Other line</p>');
105+
(2, 'policy', '<p>By using resources associated with Unity, you agree to comply with the following conditions of use. This is an extension of the University of Massachussetts Amherst Information Technology Acceptable Use Policy, which can be found <a target=\"_blank\" href=\"https://www.umass.edu/it/security/acceptable-use-policy\">here</a>.</p>\r\n\r\n<ol>\r\n <li>You will not use Unity resources for illicit financial gain, such as virtual currency mining, or any unlawful purpose, nor attempt to breach or circumvent any Unity administrative or security controls. You will comply with all applicable laws, working with your home institution and the specific Unity service providers utilized to determine what constraints may be placed on you by any relevant regulations such as export control law or HIPAA.</li>\r\n <li>You will respect intellectual property rights and observe confidentiality agreements.</li>\r\n <li>You will protect the access credentials (e.g., passwords, private keys, and/or tokens) issued to you or generated to access Unity resources; these are issued to you for your sole use.</li>\r\n <li>You will immediately report any known or suspected security breach or loss or misuse of Unity access credentials to <a href=\"mailto:[email protected]\">[email protected]</a>.</li>\r\n <li>You will have only one Unity User account and will keep your profile information up-to-date.</li>\r\n <li>Use of resources and services through Unity is at your own risk. There are no guarantees that resources and services will be available, that they will suit every purpose, or that data will never be lost or corrupted. Users are responsible for backing up critical data.</li>\r\n <li>Logged information, including information provided by you for registration purposes, is used for administrative, operational, accounting, monitoring and security purposes. This information may be disclosed, via secured mechanisms, only for the same purposes and only as far as necessary to other organizations cooperating with Unity .</li>\r\n</ol>\r\n\r\n<p>The Unity team reserves the right to restrict access to any individual/group found to be in breach of the above.</p>');
80106

81107
-- --------------------------------------------------------
82108

@@ -89,56 +115,50 @@ CREATE TABLE `requests` (
89115
`request_for` varchar(1000) NOT NULL,
90116
`uid` varchar(1000) NOT NULL,
91117
`timestamp` timestamp NOT NULL DEFAULT current_timestamp()
92-
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
118+
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
93119

94120
-- --------------------------------------------------------
95121

96122
--
97-
-- Table structure for table `audit_log`
123+
-- Table structure for table `sitevars`
98124
--
99125

100-
CREATE TABLE `audit_log` (
126+
CREATE TABLE `sitevars` (
101127
`id` int(11) NOT NULL,
102-
`timestamp` timestamp NOT NULL DEFAULT current_timestamp(),
103-
`operator` varchar(1000) NOT NULL,
104-
`operator_ip` varchar(1000) NOT NULL,
105-
`action_type` varchar(1000) NOT NULL,
106-
`recipient` varchar(1000) NOT NULL
107-
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
108-
109-
-- --------------------------------------------------------
128+
`name` varchar(1000) NOT NULL,
129+
`value` varchar(1000) NOT NULL
130+
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
110131

111132
-- --------------------------------------------------------
112133

113134
--
114-
-- Table structure for table `account_deletion_requests`
135+
-- Table structure for table `sso_log`
115136
--
116137

117-
CREATE TABLE `account_deletion_requests` (
118-
`id` int(11) NOT NULL,
119-
`timestamp` timestamp NOT NULL DEFAULT current_timestamp(),
120-
`uid` varchar(1000) NOT NULL,
121-
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
122-
123-
-- --------------------------------------------------------
124-
125-
-- --------------------------------------------------------
138+
CREATE TABLE `sso_log` (
139+
`id` int(10) NOT NULL,
140+
`uid` varchar(300) NOT NULL,
141+
`firstname` varchar(300) NOT NULL,
142+
`lastname` varchar(300) NOT NULL,
143+
`mail` varchar(300) NOT NULL,
144+
`org` varchar(300) NOT NULL
145+
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
126146

127147
--
128-
-- Table structure for table `sitevars`
148+
-- Indexes for dumped tables
129149
--
130150

131-
CREATE TABLE `sitevars` (
132-
`id` int(11) NOT NULL,
133-
`name` varchar(1000) NOT NULL,
134-
`value` varchar(1000) NOT NULL
135-
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
136-
137-
-- --------------------------------------------------------
151+
--
152+
-- Indexes for table `account_deletion_requests`
153+
--
154+
ALTER TABLE `account_deletion_requests`
155+
ADD PRIMARY KEY (`id`);
138156

139157
--
140-
-- Indexes for dumped tables
158+
-- Indexes for table `audit_log`
141159
--
160+
ALTER TABLE `audit_log`
161+
ADD PRIMARY KEY (`id`);
142162

143163
--
144164
-- Indexes for table `events`
@@ -165,32 +185,32 @@ ALTER TABLE `requests`
165185
ADD PRIMARY KEY (`id`);
166186

167187
--
168-
-- Indexes for table `sso_log`
188+
-- Indexes for table `sitevars`
169189
--
170-
ALTER TABLE `sso_log`
190+
ALTER TABLE `sitevars`
171191
ADD PRIMARY KEY (`id`);
172192

173193
--
174-
-- Indexes for table `audit_log`
194+
-- Indexes for table `sso_log`
175195
--
176-
ALTER TABLE `audit_log`
196+
ALTER TABLE `sso_log`
177197
ADD PRIMARY KEY (`id`);
178198

179199
--
180-
-- Indexes for table `audit_log`
200+
-- AUTO_INCREMENT for dumped tables
181201
--
182-
ALTER TABLE `account_deletion_requests`
183-
ADD PRIMARY KEY (`id`);
184202

185203
--
186-
-- Indexes for table `sitevars`
204+
-- AUTO_INCREMENT for table `account_deletion_requests`
187205
--
188-
ALTER TABLE `sitevars`
189-
ADD PRIMARY KEY (`id`);
206+
ALTER TABLE `account_deletion_requests`
207+
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
190208

191209
--
192-
-- AUTO_INCREMENT for dumped tables
210+
-- AUTO_INCREMENT for table `audit_log`
193211
--
212+
ALTER TABLE `audit_log`
213+
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
194214

195215
--
196216
-- AUTO_INCREMENT for table `events`
@@ -217,31 +237,16 @@ ALTER TABLE `requests`
217237
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=1031;
218238

219239
--
220-
-- AUTO_INCREMENT for table `sso_log`
221-
--
222-
ALTER TABLE `sso_log`
223-
MODIFY `id` int(10) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8;
224-
225-
--
226-
-- AUTO_INCREMENT for table `audit_log`
227-
--
228-
ALTER TABLE `audit_log`
229-
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
230-
COMMIT;
231-
232-
--
233-
--
234-
-- AUTO_INCREMENT for table `account_deletion_requests`
240+
-- AUTO_INCREMENT for table `sitevars`
235241
--
236-
ALTER TABLE `account_deletion_requests`
242+
ALTER TABLE `sitevars`
237243
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
238-
COMMIT;
239244

240245
--
241-
-- AUTO_INCREMENT for table `sitevars`
246+
-- AUTO_INCREMENT for table `sso_log`
242247
--
243-
ALTER TABLE `sitevars`
244-
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
248+
ALTER TABLE `sso_log`
249+
MODIFY `id` int(10) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8;
245250
COMMIT;
246251

247252
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;

webroot/panel/account.php

+1
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@
114114
echo "<p>You are currently not assigned to any PI, and will be
115115
<strong>unable to use the cluster</strong>. Go to the <a href='groups.php'>My PIs</a>
116116
page to join a PI, or click on the button below if you are a PI</p>";
117+
echo "<p>Students should not request a PI account.</p>";
117118
}
118119

119120
if (!$isPI) {

webroot/panel/modal/new_key.php

+12-8
Original file line numberDiff line numberDiff line change
@@ -63,18 +63,11 @@
6363
}
6464
});
6565

66-
$("div#key_generate > button").click(function() {
66+
function generateKey(type) {
6767
var pubSection = "<section class='pubKey'>";
6868
var privSection = "<section class='privKey'>";
6969
var endingSection = "</section>";
7070

71-
// get type
72-
if ($(this).hasClass('btnWin')) {
73-
var type = "ppk";
74-
} else if ($(this).hasClass('btnLin')) {
75-
var type = "key";
76-
}
77-
7871
$.ajax({
7972
url: "<?php echo $CONFIG["site"]["prefix"]; ?>/js/ajax/ssh_generate.php?type=" + type,
8073
success: function(result) {
@@ -89,6 +82,17 @@
8982
$("#newKeyform").submit();
9083
}
9184
});
85+
}
86+
87+
$("div#key_generate > button").click(function() {
88+
// get type
89+
if ($(this).hasClass('btnWin')) {
90+
var type = "ppk";
91+
} else if ($(this).hasClass('btnLin')) {
92+
var type = "key";
93+
}
94+
95+
setTimeout(() => generateKey(type), 300);
9296
});
9397

9498
$("textarea[name=key]").on("input", function() {

0 commit comments

Comments
 (0)