diff --git a/delete.php b/delete.php
index d0631128..62296a0b 100644
--- a/delete.php
+++ b/delete.php
@@ -19,6 +19,8 @@
require_once('common.php');
+if (safeget('token') != $_SESSION['PFA_token']) die('Invalid token!');
+
$username = authentication_get_username(); # enforce login
$id = safeget('delete');
diff --git a/login.php b/login.php
index 175eac96..3e68acc2 100644
--- a/login.php
+++ b/login.php
@@ -53,6 +53,8 @@ if ($_SERVER['REQUEST_METHOD'] == "POST")
$_SESSION['sessid']['roles'][] = 'admin';
$_SESSION['sessid']['username'] = $fUsername;
+ $_SESSION['PFA_token'] = md5(uniqid(rand(), true));
+
# they've logged in, so see if they are a domain admin, as well.
if (!$h->init($fUsername)) {
diff --git a/templates/adminlistadmin.tpl b/templates/adminlistadmin.tpl
index 59d66084..46a0f81c 100644
--- a/templates/adminlistadmin.tpl
+++ b/templates/adminlistadmin.tpl
@@ -20,7 +20,8 @@
{$admin.modified} |
{$admin._active} |
{$PALANG.edit} |
- {$PALANG.del} |
+ {$PALANG.del} |
{/foreach}
diff --git a/templates/adminlistdomain.tpl b/templates/adminlistdomain.tpl
index 65ad9290..93047663 100644
--- a/templates/adminlistdomain.tpl
+++ b/templates/adminlistdomain.tpl
@@ -35,7 +35,8 @@
{$domain.modified} |
{$domain._active} |
{$PALANG.edit} |
- {$PALANG.del} |
+ {$PALANG.del} |
{/foreach}
diff --git a/templates/fetchmail.tpl b/templates/fetchmail.tpl
index 0db31759..a1d7140b 100644
--- a/templates/fetchmail.tpl
+++ b/templates/fetchmail.tpl
@@ -39,7 +39,8 @@
{$row.date} |
{$row.returned_text}--x-- |
{$PALANG.edit} |
- {$PALANG.del} |
+ {$PALANG.del} |
{/foreach}
{/if}
diff --git a/templates/list-virtual_alias.tpl b/templates/list-virtual_alias.tpl
index 8242e5c6..1b04ad4a 100644
--- a/templates/list-virtual_alias.tpl
+++ b/templates/list-virtual_alias.tpl
@@ -40,7 +40,7 @@
{if $item.active==1}{$PALANG.YES}{else}{$PALANG.NO}{/if} |
{$PALANG.edit} |
- {$PALANG.del} |
{else}
{if $item.active==1}{$PALANG.YES}{else}{$PALANG.NO}{/if} |
diff --git a/templates/list-virtual_alias_domain.tpl b/templates/list-virtual_alias_domain.tpl
index 47864fe8..1b380f7c 100644
--- a/templates/list-virtual_alias_domain.tpl
+++ b/templates/list-virtual_alias_domain.tpl
@@ -32,7 +32,8 @@
{$item.modified} |
{if $item.active==1}{$PALANG.YES}{else}{$PALANG.NO}{/if} |
{$PALANG.edit} |
- {$PALANG.del} |
+ {$PALANG.del} |
{/foreach}
{/if}
diff --git a/templates/list-virtual_mailbox.tpl b/templates/list-virtual_mailbox.tpl
index a99f5644..d48a8471 100644
--- a/templates/list-virtual_mailbox.tpl
+++ b/templates/list-virtual_mailbox.tpl
@@ -87,7 +87,8 @@
{$PALANG.alias} |
{/if}
{$PALANG.edit} |
- {$PALANG.del} |
+ {$PALANG.del} |
{/foreach}
diff --git a/users/login.php b/users/login.php
index 66426bfa..bc2744e0 100644
--- a/users/login.php
+++ b/users/login.php
@@ -48,6 +48,7 @@ if ($_SERVER['REQUEST_METHOD'] == "POST")
$_SESSION['sessid']['roles'] = array();
$_SESSION['sessid']['roles'][] = 'user';
$_SESSION['sessid']['username'] = $fUsername;
+ $_SESSION['PFA_token'] = md5(uniqid(rand(), true));
header("Location: main.php");
exit;
}