mirror of
https://github.com/znc/znc.git
synced 2026-08-09 10:23:14 +02:00
Add methods to CModule to get the web path
Add these values to the template and use them when linking to any module
This commit is contained in:
+2
-2
@@ -73,11 +73,11 @@ public:
|
||||
fPemFile.Close();
|
||||
}
|
||||
|
||||
WebSock.Redirect("/mods/cert/");
|
||||
WebSock.Redirect(GetWebPath());
|
||||
return true;
|
||||
} else if (sPageName == "delete") {
|
||||
CFile::Delete(PemFile());
|
||||
WebSock.Redirect("/mods/cert/");
|
||||
WebSock.Redirect(GetWebPath());
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -249,7 +249,7 @@ public:
|
||||
return true;
|
||||
} else if (sPageName == "add") {
|
||||
AddKey(pUser, WebSock.GetParam("key"));
|
||||
WebSock.Redirect("/mods/certauth/");
|
||||
WebSock.Redirect(GetWebPath());
|
||||
return true;
|
||||
} else if (sPageName == "delete") {
|
||||
MSCString::iterator it = m_PubKeys.find(pUser->GetUserName());
|
||||
@@ -263,7 +263,7 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
WebSock.Redirect("/mods/certauth/");
|
||||
WebSock.Redirect(GetWebPath());
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
<? INC Header.tmpl ?>
|
||||
|
||||
<? IF Cert ?>
|
||||
<p>You already have a certificate set, use the form below to overwrite the current certificate. Alternatively click <a href="/mods/cert/delete">here</a> to <a href="/mods/cert/delete">delete</a> your certificate.</p>
|
||||
<p>You already have a certificate set, use the form below to overwrite the current certificate. Alternatively click <a href="<? VAR ModPath ?>delete">here</a> to <a href="<? VAR ModPath ?>delete">delete</a> your certificate.</p>
|
||||
<? ELSE ?>
|
||||
<p>You do not have a cert.</p>
|
||||
<? ENDIF ?>
|
||||
|
||||
<form method="post" action="/mods/cert/update">
|
||||
<form method="post" action="<? VAR ModPath ?>update">
|
||||
<? INC _csrf_check.tmpl ?>
|
||||
<div class="section">
|
||||
<h3>Certificate</h3>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<? INC Header.tmpl ?>
|
||||
|
||||
<form method="post" action="/mods/certauth/add">
|
||||
<form method="post" action="<? VAR ModPath ?>add">
|
||||
<? INC _csrf_check.tmpl ?>
|
||||
<div class="section">
|
||||
<h3>Add A Note</h3>
|
||||
@@ -32,7 +32,7 @@
|
||||
<tbody>
|
||||
<? LOOP KeyLoop ?>
|
||||
<tr class="<? IF __EVEN__ ?>evenrow<? ELSE ?>oddrow<? ENDIF ?>">
|
||||
<td>[<a href="/mods/certauth/delete?key=<? VAR Key ESC=URL,HTML ?>">del</a>]</td>
|
||||
<td>[<a href="<? VAR ModPath ?>delete?key=<? VAR Key ESC=URL,HTML ?>">del</a>]</td>
|
||||
<td><? VAR Key ?></td>
|
||||
</tr>
|
||||
<? ENDLOOP ?>
|
||||
|
||||
@@ -17,8 +17,8 @@
|
||||
<td><? VAR LastSeen DEFAULT="- unknown -" ?></td>
|
||||
<td><? VAR Info ?></td>
|
||||
<? IF WebAdminLoaded TOP ?><td><span class="nowrap">
|
||||
[<a href="/mods/webadmin/edituser?user=<?VAR Username ESC=URL?>">Edit</a>]
|
||||
<? IF !IsSelf ?>[<a href="/mods/webadmin/deluser?user=<?VAR Username ESC=URL?>">Delete</a>]<? ENDIF ?>
|
||||
[<a href="/mods/global/webadmin/edituser?user=<?VAR Username ESC=URL?>">Edit</a>]
|
||||
<? IF !IsSelf ?>[<a href="/mods/global/webadmin/deluser?user=<?VAR Username ESC=URL?>">Delete</a>]<? ENDIF ?>
|
||||
</span></td><? ENDIF ?>
|
||||
</tr>
|
||||
<? ENDLOOP ?>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<? INC Header.tmpl ?>
|
||||
|
||||
<form method="post" action="/mods/notes/addnote">
|
||||
<form method="post" action="<? VAR ModPath ?>addnote">
|
||||
<? INC _csrf_check.tmpl ?>
|
||||
<div class="section">
|
||||
<h3>Add A Note</h3>
|
||||
@@ -37,7 +37,7 @@
|
||||
<tbody>
|
||||
<? LOOP NotesLoop ?>
|
||||
<tr class="<? IF __EVEN__ ?>evenrow<? ELSE ?>oddrow<? ENDIF ?>">
|
||||
<td><a href="/mods/notes/delnote?key=<? VAR Key ESC=URL,HTML ?>"><img src="/modfiles/<? VAR ModName TOP ?>/trash.gif" alt="[del]" /></a></td>
|
||||
<td><a href="<? VAR ModPath TOP ?>delnote?key=<? VAR Key ESC=URL,HTML ?>"><img src="<? VAR ModFilesPath TOP ?>trash.gif" alt="[del]" /></a></td>
|
||||
<td><? VAR Key ?></td>
|
||||
<td><? VAR Note ?></td>
|
||||
</tr>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<? INC Header.tmpl ?>
|
||||
|
||||
<form method="post" action="/mods/perform/">
|
||||
<form method="post" action="<? VAR ModPath ?>">
|
||||
<? INC _csrf_check.tmpl ?>
|
||||
<div class="section">
|
||||
<h3>Perform</h3>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<? INC Header.tmpl ?>
|
||||
|
||||
<form method="post" action="/mods/send_raw/">
|
||||
<form method="post" action="<? VAR ModPath ?>">
|
||||
<? INC _csrf_check.tmpl ?>
|
||||
|
||||
<div class="section">
|
||||
|
||||
+2
-2
@@ -200,11 +200,11 @@ public:
|
||||
return true;
|
||||
} else if (sPageName == "delnote") {
|
||||
DelNote(WebSock.GetParam("key", false));
|
||||
WebSock.Redirect("/mods/notes/");
|
||||
WebSock.Redirect(GetWebPath());
|
||||
return true;
|
||||
} else if (sPageName == "addnote") {
|
||||
AddNote(WebSock.GetParam("key"), WebSock.GetParam("note"));
|
||||
WebSock.Redirect("/mods/notes/");
|
||||
WebSock.Redirect(GetWebPath());
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -136,7 +136,7 @@ public:
|
||||
|
||||
virtual bool OnWebRequest(CWebSock& WebSock, const CString& sPageName, CTemplate& Tmpl) {
|
||||
if (sPageName != "index") {
|
||||
// only accept requests to /mods/perform/
|
||||
// only accept requests to index
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user