File tree Expand file tree Collapse file tree 2 files changed +31
-14
lines changed
Expand file tree Collapse file tree 2 files changed +31
-14
lines changed Original file line number Diff line number Diff line change @@ -380,6 +380,11 @@ public function requestAccountDeletion(): void
380380 ]);
381381 }
382382
383+ public function cancelRequestAccountDeletion (): void
384+ {
385+ $ this ->SQL ->deleteAccountDeletionRequest ($ this ->uid );
386+ }
387+
383388 /**
384389 * Checks if the user has requested account deletion
385390 */
Original file line number Diff line number Diff line change 9090 $ USER ->requestAccountDeletion ();
9191 }
9292 break ;
93+ case "account_deletion_request_cancel " :
94+ $ USER ->cancelRequestAccountDeletion ();
95+ break ;
9396 }
9497}
9598
245248if ($ hasGroups ) {
246249 echo "<p>You cannot request to delete your account while you are in a PI group.</p> " ;
247250} else {
248- echo "
249- <form
250- action=''
251- method='POST'
252- id='accDel'
253- onsubmit='return confirm( \"Are you sure you want to request an account deletion? \")'
254- >
255- <input type='hidden' name='form_type' value='account_deletion_request' />
256- " ;
257251 if ($ SQL ->accDeletionRequestExists ($ USER ->uid )) {
258- echo "<input type='submit' value='Request Account Deletion' disabled /> " ;
259252 echo "
260- <label style='margin-left: 10px'>
261- Your request has been submitted and is currently pending</label>
253+ <p>Your request has been submitted and is currently pending.</p>
254+ <form
255+ action=''
256+ method='POST'
257+ onsubmit='
258+ return confirm(
259+ \"Are you sure you want to cancel your request for account deletion? \"
260+ )
261+ '
262+ >
263+ <input type='hidden' name='form_type' value='account_deletion_request_cancel' />
264+ <input type='submit' value='Cancel Account Deletion Request' />
265+ </form>
262266 " ;
263267 } else {
264- echo "<input type='submit' value='Request Account Deletion' /> " ;
268+ echo "
269+ <form
270+ action=''
271+ method='POST'
272+ onsubmit='return confirm( \"Are you sure you want to request an account deletion? \")'
273+ >
274+ <input type='hidden' name='form_type' value='account_deletion_request' />
275+ <input type='submit' value='Request Account Deletion' />
276+ </form>
277+ " ;
265278 }
266- echo "</form> " ;
267279}
268280
269281?>
You can’t perform that action at this time.
0 commit comments