|
158 | 158 | id='piReq' |
159 | 159 | > |
160 | 160 | "; |
| 161 | + echo UnityHTTPD::getCSRFTokenHiddenFormInput(); |
161 | 162 | if ($SQL->accDeletionRequestExists($USER->uid)) { |
162 | 163 | echo "<input type='submit' value='Request PI Account' disabled />"; |
163 | 164 | echo " |
|
207 | 208 | } |
208 | 209 |
|
209 | 210 | for ($i = 0; $sshPubKeys != null && $i < count($sshPubKeys); $i++) { |
| 211 | + $CSRFTokenHiddenFormInput = UnityHTTPD::getCSRFTokenHiddenFormInput(); |
210 | 212 | echo |
211 | 213 | "<div class='key-box'> |
212 | 214 | <textarea spellcheck='false' readonly>" . $sshPubKeys[$i] . "</textarea> |
|
215 | 217 | onsubmit='return confirm(\"Are you sure you want to delete this SSH key?\");' |
216 | 218 | method='POST' |
217 | 219 | > |
| 220 | + $CSRFTokenHiddenFormInput |
218 | 221 | <input type='hidden' name='delIndex' value='$i' /> |
219 | 222 | <input type='hidden' name='form_type' value='delKey' /> |
220 | 223 | <input type='submit' value='×' /> |
221 | 224 | </form> |
222 | 225 | </div>"; |
223 | 226 | } |
224 | 227 |
|
225 | | -echo ' |
226 | | - <button type="button" class="plusBtn btnAddKey"><span>+</span></button> |
| 228 | +$CSRFTokenHiddenFormInput = UnityHTTPD::getCSRFTokenHiddenFormInput(); |
| 229 | +echo " |
| 230 | + <button type='button' class='plusBtn btnAddKey'><span>+</span></button> |
227 | 231 | <hr> |
228 | 232 | <h5>Login Shell</h5> |
229 | | - <form action="" method="POST"> |
230 | | - <input type="hidden" name="form_type" value="loginshell" /> |
231 | | - <select id="loginSelector" class="code" name="shellSelect"> |
232 | | -'; |
| 233 | + <form action='' method='POST'> |
| 234 | + $CSRFTokenHiddenFormInput |
| 235 | + <input type='hidden' name='form_type' value='loginshell' /> |
| 236 | + <select id='loginSelector' class='code' name='shellSelect'> |
| 237 | +"; |
233 | 238 | foreach (CONFIG["loginshell"]["shell"] as $shell) { |
234 | 239 | echo "<option>$shell</option>"; |
235 | 240 | } |
236 | 241 | echo " |
237 | | - </select> |
238 | | - <br> |
239 | | - <input id='submitLoginShell' type='submit' value='Set Login Shell' /> |
| 242 | + </select> |
| 243 | + <br> |
| 244 | + <input id='submitLoginShell' type='submit' value='Set Login Shell' /> |
240 | 245 | </form> |
241 | 246 | <hr> |
242 | 247 | <h5>Account Deletion</h5> |
|
245 | 250 | if ($hasGroups) { |
246 | 251 | echo "<p>You cannot request to delete your account while you are in a PI group.</p>"; |
247 | 252 | } else { |
| 253 | + $CSRFTokenHiddenFormInput = UnityHTTPD::getCSRFTokenHiddenFormInput(); |
248 | 254 | echo " |
249 | 255 | <form |
250 | 256 | action='' |
251 | 257 | method='POST' |
252 | 258 | id='accDel' |
253 | 259 | onsubmit='return confirm(\"Are you sure you want to request an account deletion?\")' |
254 | 260 | > |
| 261 | + $CSRFTokenHiddenFormInput |
255 | 262 | <input type='hidden' name='form_type' value='account_deletion_request' /> |
256 | 263 | "; |
257 | 264 | if ($SQL->accDeletionRequestExists($USER->uid)) { |
|
0 commit comments