|
4 | 4 |
|
5 | 5 | use UnityWebPortal\lib\UnitySite;
|
6 | 6 |
|
| 7 | +$hasGroups = count($USER->getPIGroupGIDs()) > 0; |
| 8 | + |
7 | 9 | if ($_SERVER['REQUEST_METHOD'] == "POST") {
|
8 | 10 | switch (UnitySite::arrayGetOrBadRequest($_POST, "form_type")) {
|
9 | 11 | case "addKey":
|
|
78 | 80 | $USER->getPIGroup()->cancelGroupRequest();
|
79 | 81 | break;
|
80 | 82 | case "account_deletion_request":
|
81 |
| - $hasGroups = count($USER->getPIGroupGIDs()) > 0; |
82 | 83 | if ($hasGroups) {
|
83 | 84 | break;
|
84 | 85 | }
|
|
90 | 91 | }
|
91 | 92 |
|
92 | 93 | include $LOC_HEADER;
|
93 |
| -?> |
94 |
| - |
95 |
| -<h1>Account Settings</h1> |
96 |
| - |
97 |
| -<hr> |
98 |
| -<h5>Account Details</h5> |
99 |
| -<table> |
100 |
| - <tr> |
101 |
| - <th>Username</th> |
102 |
| - <td><code><?php echo $USER->uid; ?></code></td> |
103 |
| - </tr> |
104 |
| - <tr> |
105 |
| - <th>Organization</th> |
106 |
| - <td><code><?php echo $USER->getOrg(); ?></code></td> |
107 |
| - </tr> |
108 |
| - <tr> |
109 |
| - <th>Email</th> |
110 |
| - <td><code><?php echo $USER->getMail(); ?></code></td> |
111 |
| - </tr> |
112 |
| -</table> |
113 |
| - |
114 |
| -<hr> |
115 |
| -<h5>Account Status</h5> |
116 | 94 |
|
| 95 | +$uid = $USER->uid; |
| 96 | +$org = $USER->getOrg(); |
| 97 | +$mail = $USER->getMail(); |
| 98 | +echo " |
| 99 | + <h1>Account Settings</h1> |
| 100 | + <hr> |
| 101 | + <h5>Account Details</h5> |
| 102 | + <table> |
| 103 | + <tr> |
| 104 | + <th>Username</th> |
| 105 | + <td><code>$uid</code></td> |
| 106 | + </tr> |
| 107 | + <tr> |
| 108 | + <th>Organization</th> |
| 109 | + <td><code>$org</code></td> |
| 110 | + </tr> |
| 111 | + <tr> |
| 112 | + <th>Email</th> |
| 113 | + <td> |
| 114 | + <code>$mail</code></td> |
| 115 | + </tr> |
| 116 | + </table> |
| 117 | + <hr> |
| 118 | + <h5>AccountStatus</h5> |
| 119 | +"; |
117 | 120 |
|
118 |
| -<?php |
119 |
| - |
120 |
| -$isActive = count($USER->getPIGroupGIDs()) > 0; |
121 | 121 | $isPI = $USER->isPI();
|
122 | 122 |
|
123 | 123 | if ($isPI) {
|
124 | 124 | echo "<p>You are curently a <strong>principal investigator</strong> on the Unity Cluster</p>";
|
125 |
| -} elseif ($isActive) { |
| 125 | +} elseif ($hasGroups) { |
126 | 126 | echo "<p>You are curently a <strong>user</strong> on the Unity Cluster</p>";
|
127 | 127 | } else {
|
128 | 128 | echo "
|
|
170 | 170 | }
|
171 | 171 | echo "</form>";
|
172 | 172 | }
|
173 |
| -?> |
| 173 | +echo "<hr><h5>SSH Keys</h5>"; |
174 | 174 |
|
175 |
| -<hr> |
176 |
| -<h5>SSH Keys</h5> |
177 |
| - |
178 |
| -<?php |
179 | 175 | $sshPubKeys = $USER->getSSHKeys(); // Get ssh public key attr
|
180 | 176 |
|
181 | 177 | if (count($sshPubKeys) == 0) {
|
|
198 | 194 | </div>";
|
199 | 195 | }
|
200 | 196 |
|
201 |
| -?> |
202 |
| - |
203 |
| -<button type="button" class="plusBtn btnAddKey"><span>+</span></button> |
204 |
| - |
205 |
| -<hr> |
206 |
| -<h5>Login Shell</h5> |
207 |
| - |
208 |
| -<form action="" method="POST"> |
209 |
| -<input type="hidden" name="form_type" value="loginshell" /> |
210 |
| -<select id="loginSelector" class="code" name="shellSelect"> |
211 |
| -<?php |
| 197 | +echo ' |
| 198 | + <button type="button" class="plusBtn btnAddKey"><span>+</span></button> |
| 199 | + <hr> |
| 200 | + <h5>Login Shell</h5> |
| 201 | + <form action="" method="POST"> |
| 202 | + <input type="hidden" name="form_type" value="loginshell" /> |
| 203 | + <select id="loginSelector" class="code" name="shellSelect"> |
| 204 | +'; |
212 | 205 | foreach ($CONFIG["loginshell"]["shell"] as $shell) {
|
213 | 206 | echo "<option>$shell</option>";
|
214 | 207 | }
|
215 |
| -?> |
216 |
| -</select> |
217 |
| -<br> |
218 |
| -<input id='submitLoginShell' type='submit' value='Set Login Shell' /> |
219 |
| -</form> |
220 |
| - |
221 |
| -<hr> |
222 |
| -<h5>Account Deletion</h5> |
223 |
| - |
224 |
| -<?php |
225 |
| -$hasGroups = count($USER->getPIGroupGIDs()) > 0; |
| 208 | +echo " |
| 209 | + </select> |
| 210 | + <br> |
| 211 | + <input id='submitLoginShell' type='submit' value='Set Login Shell' /> |
| 212 | + </form> |
| 213 | + <hr> |
| 214 | + <h5>Account Deletion</h5> |
| 215 | +"; |
226 | 216 |
|
227 | 217 | if ($hasGroups) {
|
228 | 218 | echo "<p>You cannot request to delete your account while you are in a PI group.</p>";
|
|
0 commit comments