WebMods: Following the last commit, this adds the CSRF check token

to existing action="post" forms. Right now, we don't have much of a
real protection against CSRF yet, but psychon is working on making
that happen :)


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1933 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
cflakes
2010-04-25 13:35:06 +00:00
parent 16a55d09df
commit da954bb4a6
7 changed files with 7 additions and 0 deletions
+1
View File
@@ -307,6 +307,7 @@ void CWebSock::SetVars() {
m_Template["SessionIP"] = GetRemoteIP();
m_Template["Tag"] = CZNC::GetTag(GetSession()->GetUser() != NULL);
m_Template["SkinName"] = GetSkinName();
m_Template["_CSRF_Check"] = GetCSRFCheck();
if (GetSession()->IsAdmin()) {
m_Template["IsAdmin"] = "true";
+1
View File
@@ -1,6 +1,7 @@
<? INC Header.tmpl ?>
<form method="post" action="/mods/notes/addnote">
<? INC _csrf_check.tmpl ?>
<div class="section">
<h3>Add A Note</h3>
<div class="sectionbg">
+1
View File
@@ -1,6 +1,7 @@
<? INC Header.tmpl ?>
<form action="" method="post">
<? INC _csrf_check.tmpl ?>
<table class="data">
<thead>
<tr>
+1
View File
@@ -1,6 +1,7 @@
<? INC Header.tmpl ?>
<form action="<? IF Edit ?>editchan<? ELSE ?>addchan<? ENDIF ?>" method="post">
<? INC _csrf_check.tmpl ?>
<div class="section">
<input type="hidden" name="submitted" value="1" />
<input type="hidden" name="user" value="<? VAR User ?>" />
+1
View File
@@ -1,6 +1,7 @@
<? INC Header.tmpl ?>
<form action="<? IF Edit ?>edituser<? ELSE ?>adduser<? ENDIF ?>" method="post">
<? INC _csrf_check.tmpl ?>
<div class="section">
<input type="hidden" name="submitted" value="1" />
+1
View File
@@ -1,6 +1,7 @@
<? INC Header.tmpl ?>
<form action="settings" method="post">
<? INC _csrf_check.tmpl ?>
<div class="section">
<input type="hidden" name="submitted" value="1" />
+1
View File
@@ -0,0 +1 @@
<input type="hidden" name="_CSRF_Check" value="<? VAR _CSRF_Check TOP ?>" />