mirror of
https://github.com/znc/znc.git
synced 2026-08-08 01:43:03 +02:00
Webadmin: Use a dedicated page for confirming user deletes
The old Javascript way didn't work when one had javascript disabled. git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1937 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
@@ -293,6 +293,20 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!WebSock.IsPost()) {
|
||||
CString sUser = WebSock.GetParam("user", true);
|
||||
CUser* pUser = CZNC::Get().FindUser(sUser);
|
||||
|
||||
if (!pUser) {
|
||||
WebSock.PrintErrorPage("No such username");
|
||||
return true;
|
||||
}
|
||||
|
||||
Tmpl.SetFile("del_user.tmpl");
|
||||
Tmpl["Username"] = sUser;
|
||||
return true;
|
||||
}
|
||||
|
||||
CString sUser = WebSock.GetParam("user");
|
||||
CUser* pUser = CZNC::Get().FindUser(sUser);
|
||||
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
<? INC Header.tmpl ?>
|
||||
|
||||
<div class="section">
|
||||
Are you sure you want to delete "<? VAR Username ?>"?
|
||||
|
||||
<form action="deluser" method="post">
|
||||
<? INC _csrf_check.tmpl ?>
|
||||
<input type="hidden" name="submitted" value="1" />
|
||||
<input type="hidden" name="user" value="<? VAR Username ?>" />
|
||||
|
||||
<input type="submit" value="Yes" />
|
||||
</form>
|
||||
<form action="listusers" method="get">
|
||||
<input type="submit" value="No" />
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<? INC Footer.tmpl ?>
|
||||
@@ -23,7 +23,7 @@
|
||||
<td>
|
||||
<span class="nowrap">
|
||||
[<a href="edituser?user=<?VAR Username ESC=URL?>">Edit</a>]
|
||||
<? IF !IsSelf ?>[<a href="deluser?user=<?VAR Username ESC=URL?>" onClick="return confirm('Do you really wish to remove this user?');">Delete</a>]<? ENDIF ?>
|
||||
<? IF !IsSelf ?>[<a href="deluser?user=<?VAR Username ESC=URL?>">Delete</a>]<? ENDIF ?>
|
||||
</span>
|
||||
</td>
|
||||
<td><? VAR Username ?></td>
|
||||
|
||||
Reference in New Issue
Block a user