CVE-2015-6545 (published 2015-09-03T17:59Z)

Cross-site request forgery (CSRF) vulnerability in ajax.php in Cerb before 7.0.4 allows remote attackers to hijack the authentication of administrators for requests that add an administrator account via a saveWorkerPeek action.

Severity: MEDIUM
CVSS v2 base score: 6.8 (AV:N/AC:M/Au:N/C:P/I:P/A:P)

Weakness information:
cwe_id: CWE-352
cwe_name: Cross-Site Request Forgery (CSRF)
description: The web application does not, or can not, sufficiently verify whether a well-formed, valid, consistent request was intentionally provided by the user who submitted the request.
extended_description: When a web server is designed to receive a request from a client without any mechanism for verifying that it was intentionally sent, then it might be possible for an attacker to trick a client into making an unintentional request to the web server which will be treated as an authentic request. This can be done via a URL, image load, XMLHttpRequest, etc. and can result in exposure of data or unintended code execution.
         

Fix information:
repo_url: https://github.com/wgm/cerb
commit_details: repo_url: https://github.com/wgm/cerb
author: Jeff Standen
author_date: 2015-08-13 01:52:07-07:00
msg: * [Security/CSRF] Fixed a medium risk CSRF (cross-site request forgery) vulnerability reported by High-Tech Bridge (HTB23269). We don't have any evidence of this having taken place in the wild, but we were able to reproduce the results with the proof-of-concept in the advisory. A logged in worker could be tricked into visiting a URL that could perform certain actions in their browser session. Cerb now uses the Synchronizer pattern: a session-based token included with every HTML FORM and Ajax request that is compared to the active session. This verifies that such requests are coming from an existing Cerb page rather than an external source. When a potential CSRF attack is detected, the event is now logged in the PHP log as a warning.
repository: repo_url: https://github.com/wgm/cerb
repo_name: wgm/cerb
description: Cerb brings order to a busy team inbox with bot powered email management and workflow automation. Used by thousands of teams for 15+ years. For production, use: https://github.com/cerb/cerb-release/
repo_language: PHP
owner: wgm
file_changes: filename: login.php
change_type: ModificationType.MODIFY
diff: @@ -304,6 +304,9 @@ class ChSignInPage extends CerberusPageExtension {
 
 		$session->setVisit($visit);
 		
+		// Generate a CSRF token for the session
+		$_SESSION['csrf_token'] = CerberusApplication::generatePassword(256);
+		
 		if(isset($_SESSION['login_post_url'])) {
 			$redirect_path = explode('/', $_SESSION['login_post_url']);
 			

programming_language: PHP
filename: edit_role.tpl
change_type: ModificationType.MODIFY
diff: @@ -4,6 +4,7 @@
 <input type="hidden" name="action" value="saveRole">
 <input type="hidden" name="id" value="{if !empty($role->id)}{$role->id}{else}0{/if}">
 <input type="hidden" name="do_delete" value="0">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 
 {if $saved}
 <div class="ui-widget">

programming_language: HTML
filename: index.tpl
change_type: ModificationType.MODIFY
diff: @@ -5,6 +5,7 @@
 <input type="hidden" name="a" value="handleSectionAction">
 <input type="hidden" name="section" value="branding">
 <input type="hidden" name="action" value="saveJson">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 
 <fieldset>
 	<legend>Settings</legend>

programming_language: PHP
filename: peek.tpl
change_type: ModificationType.MODIFY
diff: @@ -3,6 +3,7 @@
 <input type="hidden" name="a" value="handleSectionAction">
 <input type="hidden" name="section" value="cache">
 <input type="hidden" name="action" value="saveCachePeek">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 
 {foreach from=$engines item=engine key=engine_id}
 <fieldset class="peek" style="margin-bottom:0;">

programming_language: PHP
filename: index.tpl
change_type: ModificationType.MODIFY
diff: @@ -28,6 +28,7 @@
 <input type="hidden" name="section" value="license">
 <input type="hidden" name="action" value="saveJson">
 <input type="hidden" name="do_delete" value="0">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 	
 <fieldset>
 	<legend>Update License</legend>

programming_language: HTML
filename: index.tpl
change_type: ModificationType.MODIFY
diff: @@ -5,6 +5,7 @@
 <input type="hidden" name="a" value="handleSectionAction">
 <input type="hidden" name="section" value="localization">
 <input type="hidden" name="action" value="saveJson">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 
 <fieldset>
 	<legend>Date &amp; Time</legend>

programming_language: HTML
filename: peek.tpl
change_type: ModificationType.MODIFY
diff: @@ -5,6 +5,7 @@
 <input type="hidden" name="action" value="savePeekPopup">
 <input type="hidden" name="view_id" value="{$view_id}">
 <input type="hidden" name="do_delete" value="0">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 
 <b>storage/mail/fail/{$filename}:</b>
 <div>

programming_language: PHP
filename: view.tpl
change_type: ModificationType.MODIFY
diff: @@ -28,6 +28,8 @@
 <input type="hidden" name="section" value="mail_failed">
 <input type="hidden" name="action" value="">
 <input type="hidden" name="explore_from" value="0">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
+
 <table cellpadding="5" cellspacing="0" border="0" width="100%" class="worklistBody">
 
 	{* Column Headers *}

programming_language: HTML
filename: index.tpl
change_type: ModificationType.MODIFY
diff: @@ -11,11 +11,13 @@
 {/foreach}
 
 {if !$has_atleast_one}
-<form action="{devblocks_url}{/devblocks_url}">
+<form action="{devblocks_url}{/devblocks_url}" method="POST">
 <input type="hidden" name="c" value="config">
 <input type="hidden" name="a" value="handleSectionAction">
 <input type="hidden" name="section" value="mail_filtering">
 <input type="hidden" name="action" value="createDefaultVa">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
+
 <div class="help-box" style="padding:5px;border:0;">
 	<h1 style="margin-bottom:5px;text-align:left;">Create a global Virtual Attendant</h1>
 	

programming_language: HTML
filename: index.tpl
change_type: ModificationType.MODIFY
diff: @@ -5,6 +5,7 @@
 <input type="hidden" name="a" value="handleSectionAction">
 <input type="hidden" name="section" value="mail_from">
 <input type="hidden" name="action" value="saveJson">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 
 <div style="margin-bottom:10px;">
 	<button type="button" onclick="genericAjaxPopup('peek','c=config&a=handleSectionAction&section=mail_from&action=peek&id=0',null,false,'550');"><span class="glyphicons glyphicons-circle-plus" style="color:rgb(0,180,0);"></span> {'common.add'|devblocks_translate|capitalize}</button>

programming_language: HTML
filename: peek.tpl
change_type: ModificationType.MODIFY
diff: @@ -4,6 +4,7 @@
 <input type="hidden" name="section" value="mail_from">
 <input type="hidden" name="action" value="savePeek">
 <input type="hidden" name="id" value="{$address->address_id}">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 
 <fieldset class="peek">
 	<legend>Send worker replies as:</legend>

programming_language: HTML
filename: peek.tpl
change_type: ModificationType.MODIFY
diff: @@ -6,6 +6,7 @@
 <input type="hidden" name="view_id" value="{$view_id}">
 {if !empty($model) && !empty($model->id)}<input type="hidden" name="id" value="{$model->id}">{/if}
 <input type="hidden" name="do_delete" value="0">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 
 <div id="mailTemplateTabs">
 	<ul>

programming_language: HTML
filename: view.tpl
change_type: ModificationType.MODIFY
diff: @@ -33,6 +33,8 @@
 <input type="hidden" name="section" value="html_template">
 <input type="hidden" name="action" value="">
 <input type="hidden" name="explore_from" value="0">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
+
 <table cellpadding="5" cellspacing="0" border="0" width="100%" class="worklistBody">
 
 	{* Column Headers *}

programming_language: HTML
filename: index.tpl
change_type: ModificationType.MODIFY
diff: @@ -5,6 +5,7 @@
 <input type="hidden" name="a" value="handleSectionAction">
 <input type="hidden" name="section" value="mail_import">
 <input type="hidden" name="action" value="parseMessageJson">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 
 <b>Paste a message source:</b>
 <div>

programming_language: HTML
filename: index.tpl
change_type: ModificationType.MODIFY
diff: @@ -5,6 +5,7 @@
 <input type="hidden" name="a" value="handleSectionAction">
 <input type="hidden" name="section" value="mail_incoming">
 <input type="hidden" name="action" value="saveJson">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 
 <fieldset>
 	<legend>{'common.settings'|devblocks_translate|capitalize}</legend>

programming_language: PHP
filename: index.tpl
change_type: ModificationType.MODIFY
diff: @@ -5,6 +5,7 @@
 <input type="hidden" name="a" value="handleSectionAction">
 <input type="hidden" name="section" value="mail_relay">
 <input type="hidden" name="action" value="saveJson">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 
 <p>
 The email relay enables workers to respond to messages from external mail applications (e.g. Gmail, mobile phones, Outlook, etc) instead of always requiring them to use Cerb in the web browser.  

programming_language: HTML
filename: index.tpl
change_type: ModificationType.MODIFY
diff: @@ -12,6 +12,7 @@
 	<input type="hidden" name="a" value="handleSectionAction">
 	<input type="hidden" name="section" value="mail_routing">
 	<input type="hidden" name="action" value="saveRouting">
+	<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 
 	<b>Which group should receive any unrouted new mail?</b><br> 
 	<select name="default_group_id">

programming_language: HTML
filename: peek.tpl
change_type: ModificationType.MODIFY
diff: @@ -4,6 +4,7 @@
 <input type="hidden" name="section" value="mail_routing">
 <input type="hidden" name="action" value="saveMailRoutingRuleAdd">
 <input type="hidden" name="id" value="{$rule->id}">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 
 <b>Rule Name:</b> (e.g. ProductX Support)<br>
 <input type="text" name="name" value="{$rule->name}" size="45" style="width:95%;"><br>

programming_language: HTML
filename: download_popup.tpl
change_type: ModificationType.MODIFY
diff: @@ -1,12 +1,5 @@
 <form action="{devblocks_url}{/devblocks_url}" method="POST" id="frmCerb6PluginDownload">
-{*
-<input type="hidden" name="c" value="config">
-<input type="hidden" name="a" value="handleSectionAction">
-<input type="hidden" name="section" value="plugin_library">
-<input type="hidden" name="action" value="saveDownloadPopup">
-<input type="hidden" name="plugin_id" value="{$plugin->id}">
-<input type="hidden" name="view_id" value="{$view_id}">
-*}
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 
 <b>{$plugin->name}</b><br>
 <br>

programming_language: HTML
filename: view.tpl
change_type: ModificationType.MODIFY
diff: @@ -26,6 +26,8 @@
 <input type="hidden" name="context_id" value="">
 <input type="hidden" name="id" value="{$view->id}">
 <input type="hidden" name="explore_from" value="0">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
+
 <table cellpadding="1" cellspacing="0" border="0" width="100%" class="worklistBody">
 
 	{* Column Headers *}

programming_language: HTML
filename: popup.tpl
change_type: ModificationType.MODIFY
diff: @@ -6,6 +6,7 @@
 <input type="hidden" name="plugin_id" value="{$plugin->id}">
 <input type="hidden" name="view_id" value="{$view_id}">
 {if $is_uninstallable}<input type="hidden" name="uninstall" value="0">{/if}
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 
 <div>
 	<b>{'common.status'|devblocks_translate|capitalize}:</b> 

programming_language: HTML
filename: view.tpl
change_type: ModificationType.MODIFY
diff: @@ -26,6 +26,8 @@
 <input type="hidden" name="context_id" value="">
 <input type="hidden" name="id" value="{$view->id}">
 <input type="hidden" name="explore_from" value="0">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
+
 <table cellpadding="1" cellspacing="0" border="0" width="100%" class="worklistBody">
 
 	{* Column Headers *}

programming_language: HTML
filename: index.tpl
change_type: ModificationType.MODIFY
diff: @@ -5,6 +5,7 @@
 <input type="hidden" name="action" value="saveTabSettings">
 <input type="hidden" name="portal" value="{$instance->code}">
 <input type="hidden" name="do_delete" value="0">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 
 <b>Portal Name:</b> ("Support Portal", "Contact Form", "ProductX FAQ")<br>
 <input type="text" name="portal_name" value="{if !empty($instance->name)}{$instance->name}{else}{$instance->manifest->name}{/if}" size="65"><br>

programming_language: HTML
filename: add.tpl
change_type: ModificationType.MODIFY
diff: @@ -7,6 +7,7 @@
 		<input type="hidden" name="action" value="saveAddTemplatePeek">
 		<input type="hidden" name="view_id" value="{$view_id}">
 		<input type="hidden" name="portal" value="{$portal}">
+		<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 		
 		<b>Template:</b><br>
 		<select name="template">

programming_language: HTML
filename: bulk.tpl
change_type: ModificationType.MODIFY
diff: @@ -5,6 +5,7 @@
 <input type="hidden" name="action" value="doTemplatesBulkUpdate">
 <input type="hidden" name="view_id" value="{$view_id}">
 <input type="hidden" name="ids" value="{$ids}">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 
 <fieldset>
 	<legend>{'common.bulk_update.with'|devblocks_translate|capitalize}</legend>

programming_language: HTML
filename: export.tpl
change_type: ModificationType.MODIFY
diff: @@ -5,6 +5,7 @@
 <input type="hidden" name="action" value="saveExportTemplatesPeek">
 <input type="hidden" name="view_id" value="{$view_id}">
 <input type="hidden" name="portal" value="{$portal}">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 
 <b>Filename:</b> (.xml)<br>
 <input type="text" name="filename" size="45" value="cerb_portal_templates_{$smarty.const.APP_BUILD}.xml"><br>

programming_language: HTML
filename: import.tpl
change_type: ModificationType.MODIFY
diff: @@ -5,6 +5,7 @@
 <input type="hidden" name="action" value="saveImportTemplatesPeek">
 <input type="hidden" name="view_id" value="{$view_id}">
 <input type="hidden" name="portal" value="{$portal}">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 
 <b>Import File:</b> (.xml)<br>
 <input type="file" name="import_file" size="45"><br>

programming_language: HTML
filename: peek.tpl
change_type: ModificationType.MODIFY
diff: @@ -6,6 +6,7 @@
 <input type="hidden" name="id" value="{$template->id}">
 <input type="hidden" name="view_id" value="{$view_id}">
 <input type="hidden" name="do_delete" value="0">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 
 <b>{$template->path}:</b><br>
 <textarea name="content" wrap="off" style="height:300px;width:98%;">{$template->content}</textarea><br>

programming_language: HTML
filename: view.tpl
change_type: ModificationType.MODIFY
diff: @@ -20,6 +20,8 @@
 <input type="hidden" name="view_id" value="{$view->id}">
 <input type="hidden" name="c" value="config">
 <input type="hidden" name="a" value="">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
+
 <table cellpadding="1" cellspacing="0" border="0" width="100%" class="worklistBody">
 
 	{* Column Headers *}

programming_language: HTML
filename: add.tpl
change_type: ModificationType.MODIFY
diff: @@ -4,6 +4,7 @@
 	<input type="hidden" name="a" value="handleSectionAction">
 	<input type="hidden" name="section" value="portals">
 	<input type="hidden" name="action" value="saveAddPortalPeek">
+	<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 	
 	<b>Portal Name:</b> ("Support Portal", "Contact Form", "ProductX FAQ")<br>
 	<input type="text" name="name" value="" style="width:98%;" autofocus="true"><br>

programming_language: HTML
filename: view.tpl
change_type: ModificationType.MODIFY
diff: @@ -21,6 +21,8 @@
 <input type="hidden" name="view_id" value="{$view->id}">
 <input type="hidden" name="c" value="config">
 <input type="hidden" name="a" value="">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
+
 <table cellpadding="1" cellspacing="0" border="0" width="100%" class="worklistBody">
 
 	{* Column Headers *}

programming_language: HTML
filename: job_edit.tpl
change_type: ModificationType.MODIFY
diff: @@ -14,6 +14,7 @@
 	<input type="hidden" name="section" value="scheduler">
 	<input type="hidden" name="action" value="saveJobJson">
 	<input type="hidden" name="id" value="{$job->manifest->id}">
+	<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 	
 	<label><input type="checkbox" name="enabled" value="1" {if $enabled}checked{/if}> <b>Enabled</b></label>
 	

programming_language: HTML
filename: peek.tpl
change_type: ModificationType.MODIFY
diff: @@ -4,6 +4,7 @@
 <input type="hidden" name="section" value="search">
 <input type="hidden" name="action" value="saveSearchSchemaPeek">
 <input type="hidden" name="schema_extension_id" value="{$schema->id}">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 
 {foreach from=$search_engines item=engine key=engine_id}
 <fieldset class="peek">

programming_language: PHP
filename: index.tpl
change_type: ModificationType.MODIFY
diff: @@ -5,6 +5,7 @@
 <input type="hidden" name="a" value="handleSectionAction">
 <input type="hidden" name="section" value="security">
 <input type="hidden" name="action" value="saveJson">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 
 <fieldset>
 	<legend>Remote Administration</legend>

programming_language: HTML
filename: bulk.tpl
change_type: ModificationType.MODIFY
diff: @@ -5,6 +5,7 @@
 <input type="hidden" name="action" value="doSessionsBulkUpdate">
 <input type="hidden" name="view_id" value="{$view_id}">
 <input type="hidden" name="ids" value="{$ids}">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 
 <fieldset>
 	<legend>{'common.bulk_update.with'|devblocks_translate|capitalize}</legend>

programming_language: HTML
filename: view.tpl
change_type: ModificationType.MODIFY
diff: @@ -21,6 +21,8 @@
 <input type="hidden" name="view_id" value="{$view->id}">
 <input type="hidden" name="c" value="config">
 <input type="hidden" name="a" value="">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
+
 <table cellpadding="3" cellspacing="0" border="0" width="100%" class="worklistBody">
 
 	{* Column Headers *}

programming_language: HTML
filename: bulk.tpl
change_type: ModificationType.MODIFY
diff: @@ -5,6 +5,7 @@
 <input type="hidden" name="action" value="doAttachmentsBulkUpdate">
 <input type="hidden" name="view_id" value="{$view_id}">
 <input type="hidden" name="ids" value="{$ids}">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 
 <fieldset>
 	<legend>{'common.bulk_update.with'|devblocks_translate|capitalize}</legend>

programming_language: HTML
filename: view.tpl
change_type: ModificationType.MODIFY
diff: @@ -21,6 +21,8 @@
 <input type="hidden" name="view_id" value="{$view->id}">
 <input type="hidden" name="c" value="config">
 <input type="hidden" name="a" value="">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
+
 <table cellpadding="1" cellspacing="0" border="0" width="100%" class="worklistBody">
 
 	{* Column Headers *}

programming_language: HTML
filename: index.tpl
change_type: ModificationType.MODIFY
diff: @@ -3,6 +3,7 @@
 <form action="{devblocks_url}{/devblocks_url}" method="POST" style="margin-bottom:5px;">
 <input type="hidden" name="c" value="config">
 <input type="hidden" name="a" value="">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 
 <fieldset>
 	<legend>Database</legend>

programming_language: HTML
filename: peek.tpl
change_type: ModificationType.MODIFY
diff: @@ -4,6 +4,7 @@
 <input type="hidden" name="section" value="storage_content">
 <input type="hidden" name="action" value="saveStorageSchemaPeek">
 <input type="hidden" name="ext_id" value="{$schema->manifest->id}">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 
 {$schema->renderConfig()}
 

programming_language: HTML
filename: peek.tpl
change_type: ModificationType.MODIFY
diff: @@ -14,6 +14,7 @@
 <input type="hidden" name="id" value="{$profile->id}">
 <input type="hidden" name="view_id" value="{$view_id}">
 <input type="hidden" name="do_delete" value="0">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 
 <b>{'common.name'|devblocks_translate|capitalize}:</b><br>
 <input type="text" name="name" value="{$profile->name}" style="width:98%;" autofocus="true"><br>

programming_language: HTML
filename: view.tpl
change_type: ModificationType.MODIFY
diff: @@ -19,6 +19,8 @@
 <input type="hidden" name="view_id" value="{$view->id}">
 <input type="hidden" name="c" value="config">
 <input type="hidden" name="a" value="">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
+
 <table cellpadding="1" cellspacing="0" border="0" width="100%" class="worklistBody">
 
 	{* Column Headers *}

programming_language: HTML
filename: bulk.tpl
change_type: ModificationType.MODIFY
diff: @@ -5,6 +5,7 @@
 <input type="hidden" name="action" value="doWorkersBulkUpdate">
 <input type="hidden" name="view_id" value="{$view_id}">
 <input type="hidden" name="ids" value="{$ids}">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 
 <fieldset class="peek">
 	<legend>{'common.bulk_update.with'|devblocks_translate|capitalize}</legend>

programming_language: HTML
filename: peek.tpl
change_type: ModificationType.MODIFY
diff: @@ -6,6 +6,7 @@
 <input type="hidden" name="id" value="{$worker->id}">
 <input type="hidden" name="view_id" value="{$view_id}">
 <input type="hidden" name="do_delete" value="0">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 
 <fieldset class="peek">
 	<legend>{'common.properties'|devblocks_translate|capitalize}</legend>

programming_language: HTML
filename: bulk.tpl
change_type: ModificationType.MODIFY
diff: @@ -3,6 +3,7 @@
 <input type="hidden" name="a" value="doAddressBatchUpdate">
 <input type="hidden" name="view_id" value="{$view_id}">
 <input type="hidden" name="ids" value="{$ids}">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 
 <fieldset class="peek">
 	<legend>{'common.bulk_update.with'|devblocks_translate|capitalize}</legend>

programming_language: HTML
filename: peek.tpl
change_type: ModificationType.MODIFY
diff: @@ -7,6 +7,7 @@
 <input type="hidden" name="link_context_id" value="{$link_context_id}">
 {/if}
 <input type="hidden" name="view_id" value="{$view_id}">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 
 <fieldset class="peek">
 	<legend>{'common.properties'|devblocks_translate}</legend>

programming_language: HTML
filename: view.tpl
change_type: ModificationType.MODIFY
diff: @@ -33,6 +33,8 @@
 <input type="hidden" name="c" value="contacts">
 <input type="hidden" name="a" value="">
 <input type="hidden" name="explore_from" value="0">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
+
 <table cellpadding="1" cellspacing="0" border="0" width="100%" class="worklistBody">
 
 	{* Column Headers *}

programming_language: HTML
filename: bulk.tpl
change_type: ModificationType.MODIFY
diff: @@ -3,6 +3,7 @@
 <input type="hidden" name="a" value="doOrgBulkUpdate">
 <input type="hidden" name="view_id" value="{$view_id}">
 <input type="hidden" name="org_ids" value="{$org_ids}">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 
 <fieldset class="peek">
 	<legend>{'common.bulk_update.with'|devblocks_translate|capitalize}</legend>

programming_language: HTML
filename: org_merge_continue_peek.tpl
change_type: ModificationType.MODIFY
diff: @@ -6,6 +6,7 @@
 {foreach from=$orgs item=org key=org_id}
 <input type="hidden" name="org_id[]" value="{$org->id}">
 {/foreach}
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 
 <table cellpadding="3" cellspacing="0" border="0">
 	{foreach from=$combinations item=combo key=property}

programming_language: HTML
filename: org_merge_peek.tpl
change_type: ModificationType.MODIFY
diff: @@ -3,6 +3,7 @@
 <input type="hidden" name="c" value="contacts">
 <input type="hidden" name="a" value="showOrgMergeContinuePeek">
 <input type="hidden" name="view_id" value="{$view_id}">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 
 <b>Select organizations to merge:</b><br>
 <button type="button" class="chooser_orgs"><span class="glyphicons glyphicons-search"></span></button>

programming_language: HTML
filename: peek.tpl
change_type: ModificationType.MODIFY
diff: @@ -19,6 +19,7 @@
 	<input type="hidden" name="link_context_id" value="{$link_context_id}">
 	{/if}
 	<input type="hidden" name="do_delete" value="0">
+	<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 	
 	<fieldset class="peek">
 		<legend>{'common.properties'|devblocks_translate}</legend>

programming_language: HTML
filename: view.tpl
change_type: ModificationType.MODIFY
diff: @@ -32,6 +32,8 @@
 <input type="hidden" name="c" value="contacts">
 <input type="hidden" name="a" value="">
 <input type="hidden" name="explore_from" value="0">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
+
 <table cellpadding="1" cellspacing="0" border="0" width="100%" class="worklistBody">
 
 	{* Column Headers *}

programming_language: HTML
filename: bulk.tpl
change_type: ModificationType.MODIFY
diff: @@ -3,6 +3,7 @@
 <input type="hidden" name="a" value="doPeopleBulkUpdate">
 <input type="hidden" name="view_id" value="{$view_id}">
 <input type="hidden" name="ids" value="{$ids}">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 
 <fieldset class="peek">
 	<legend>{'common.bulk_update.with'|devblocks_translate|capitalize}</legend>

programming_language: HTML
filename: peek.tpl
change_type: ModificationType.MODIFY
diff: @@ -8,6 +8,7 @@
 <input type="hidden" name="context_id" value="{$context_id}">
 {/if}
 <input type="hidden" name="do_delete" value="0">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 
 <fieldset class="peek">
 	<legend>{'common.properties'|devblocks_translate}</legend>

programming_language: HTML
filename: view.tpl
change_type: ModificationType.MODIFY
diff: @@ -32,6 +32,8 @@
 <input type="hidden" name="c" value="contacts">
 <input type="hidden" name="a" value="">
 <input type="hidden" name="explore_from" value="0">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
+
 <table cellpadding="1" cellspacing="0" border="0" width="100%" class="worklistBody">
 
 	{* Column Headers *}

programming_language: HTML
filename: __file.tpl
change_type: ModificationType.MODIFY
diff: @@ -1,6 +1,7 @@
 <form action="{devblocks_url}{/devblocks_url}" method="POST" enctype="multipart/form-data" target="iframe_file_post" id="chooserFileUploadForm">
 <input type="hidden" name="c" value="internal">
 <input type="hidden" name="a" value="chooserOpenFileUpload">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 
 <fieldset class="peek">
 	<legend>{if $single}{'common.upload.file'|devblocks_translate|capitalize}{else}{'common.upload.files'|devblocks_translate|capitalize}{/if}</legend>

programming_language: PHP
filename: __generic.tpl
change_type: ModificationType.MODIFY
diff: @@ -7,6 +7,7 @@
 {include file="devblocks:cerberusweb.core::internal/views/search_and_view.tpl" view=$view}
 
 <form action="#" method="POST" id="chooser{$view->id}" style="{if $single}display:none;{/if}}">
+	<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 	<b>Selected:</b>
 	<ul class="buffer bubbles"></ul>
 	<br>

programming_language: PHP
filename: message.tpl
change_type: ModificationType.MODIFY
diff: @@ -148,6 +148,7 @@
 		  		<input type="hidden" name="c" value="display">
 		  		<input type="hidden" name="a" value="">
 		  		<input type="hidden" name="id" value="{$message->id}">
+		  		<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 		  		
 		  		<button type="button" onclick="document.frmPrint.action='{devblocks_url}c=print&a=message&id={$message->id}{/devblocks_url}';document.frmPrint.submit();"><span class="glyphicons glyphicons-print"></span> {'common.print'|devblocks_translate|capitalize}</button>
 		  		

programming_language: HTML
filename: index.tpl
change_type: ModificationType.MODIFY
diff: @@ -3,6 +3,8 @@
 	<input type="hidden" name="c" value="display">
 	<input type="hidden" name="a" value="">
 	<input type="hidden" name="id" value="{$ticket->id}">
+	<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
+	
 		<b>History for:</b> 
 		<label><input type="radio" name="scope" value="email" onclick="this.form.a.value='doTicketHistoryScope';this.form.submit();" {if empty($scope) || 'email'==$scope}checked="checked"{/if}> {'ticket.requesters'|devblocks_translate|capitalize}</label>
 		{if !empty($ticket->org_id)}<label><input type="radio" name="scope" value="org" onclick="this.form.a.value='doTicketHistoryScope';this.form.submit();" {if 'org'==$scope}checked="checked"{/if}> {'contact_org.name'|devblocks_translate|capitalize}</label>{/if}

programming_language: HTML
filename: add_note.tpl
change_type: ModificationType.MODIFY
diff: @@ -3,6 +3,7 @@
 <input type="hidden" name="a" value="doAddNote">
 <input type="hidden" name="id" value="{$message->id}">
 <input type="hidden" name="ticket_id" value="{$message->ticket_id}">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 
 <div class="block" style="width:98%;margin:10px;">
 <table cellpadding="2" cellspacing="0" border="0" width="100%">

programming_language: PHP
filename: merge_panel.tpl
change_type: ModificationType.MODIFY
diff: @@ -2,6 +2,7 @@
 <input type="hidden" name="c" value="display">
 <input type="hidden" name="a" value="saveMergePanel">
 <input type="hidden" name="src_ticket_id" value="{$ticket_id}">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 
 <b>Merge with tickets:</b><br>
 <button type="button" class="chooser_ticket"><span class="glyphicons glyphicons-search"></span></button>

programming_language: HTML
filename: relay_message.tpl
change_type: ModificationType.MODIFY
diff: @@ -4,6 +4,7 @@
 <input type="hidden" name="c" value="display">
 <input type="hidden" name="a" value="saveRelayMessagePopup">
 <input type="hidden" name="id" value="{$message->id}">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 
 <fieldset class="peek">
 	<legend>Message contents</legend>

programming_language: PHP
filename: reply.tpl
change_type: ModificationType.MODIFY
diff: @@ -1,6 +1,7 @@
 <div class="block reply_frame" style="width:98%;margin:10px;">
 
 <form id="reply{$message->id}_part1" onsubmit="return false;">
+
 <table cellpadding="2" cellspacing="0" border="0" width="100%">
 	<tr>
 		<td><h2 style="color:rgb(50,50,50);">{if $is_forward}{'display.ui.forward'|devblocks_translate|capitalize}{else}{'display.ui.reply'|devblocks_translate|capitalize}{/if}</h2></td>
@@ -171,6 +172,7 @@
 <input type="hidden" name="cc" value="{$cc}">
 <input type="hidden" name="bcc" value="{$bcc}">
 <input type="hidden" name="subject" value="{$subject}">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 
 {if $is_forward}
 <textarea name="content" id="reply_{$message->id}" class="reply" style="width:98%;height:{$mail_reply_textbox_size_px|default:300}px;border:1px solid rgb(180,180,180);padding:5px;">

programming_language: HTML
filename: requester_panel.tpl
change_type: ModificationType.MODIFY
diff: @@ -2,6 +2,7 @@
 <input type="hidden" name="c" value="display">
 <input type="hidden" name="a" value="saveRequestersPanel">
 <input type="hidden" name="ticket_id" value="{$ticket_id}">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 
 <b>{'display.ui.add_to_recipients'|devblocks_translate}:</b><br>
 <button type="button" class="chooser_address"><span class="glyphicons glyphicons-circle-plus" style="color:rgb(0,180,0);"></span></button>

programming_language: HTML
filename: peek.tpl
change_type: ModificationType.MODIFY
diff: @@ -6,6 +6,7 @@
 <input type="hidden" name="view_id" value="{$view_id}">
 {if !empty($group) && !empty($group->id)}<input type="hidden" name="id" value="{$group->id}">{/if}
 <input type="hidden" name="do_delete" value="0">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 
 <table cellpadding="2" cellspacing="0" border="0" width="98%">
 

programming_language: HTML
filename: view.tpl
change_type: ModificationType.MODIFY
diff: @@ -32,6 +32,8 @@
 <input type="hidden" name="section" value="group">
 <input type="hidden" name="action" value="">
 <input type="hidden" name="explore_from" value="0">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
+
 <table cellpadding="5" cellspacing="0" border="0" width="100%" class="worklistBody">
 
 	{* Column Headers *}

programming_language: HTML
filename: header.tpl
change_type: ModificationType.MODIFY
diff: @@ -5,6 +5,7 @@
 	<meta http-equiv="Cache-Control" content="no-cache">
 	<meta name="robots" content="noindex">
 	<meta name="googlebot" content="noindex">
+	<meta name="_csrf_token" content="{$session.csrf_token}">
 	<!--[if gte IE 9]>
 	<meta http-equiv="X-UA-Compatible" content="IE=Edge"/>
 	<![endif]-->

programming_language: HTML
filename: view.tpl
change_type: ModificationType.MODIFY
diff: @@ -27,6 +27,8 @@
 <input type="hidden" name="context_id" value="{$view_context}">
 <input type="hidden" name="c" value="internal">
 <input type="hidden" name="a" value="">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
+
 <table cellpadding="1" cellspacing="0" border="0" width="100%" class="worklistBody">
 
 	{* Column Headers *}

programming_language: HTML
filename: peek.tpl
change_type: ModificationType.MODIFY
diff: @@ -6,6 +6,7 @@
 <input type="hidden" name="view_id" value="{$view_id}">
 {if !empty($bucket) && !empty($bucket->id)}<input type="hidden" name="id" value="{$bucket->id}">{/if}
 <input type="hidden" name="do_delete" value="0">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 
 <table cellpadding="2" cellspacing="0" border="0" width="98%">
 	<tr>

programming_language: HTML
filename: view.tpl
change_type: ModificationType.MODIFY
diff: @@ -33,6 +33,8 @@
 <input type="hidden" name="section" value="bucket">
 <input type="hidden" name="action" value="">
 <input type="hidden" name="explore_from" value="0">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
+
 <table cellpadding="5" cellspacing="0" border="0" width="100%" class="worklistBody">
 
 	{* Column Headers *}

programming_language: HTML
filename: peek.tpl
change_type: ModificationType.MODIFY
diff: @@ -6,6 +6,7 @@
 <input type="hidden" name="view_id" value="{$view_id}">
 {if !empty($model) && !empty($model->id)}<input type="hidden" name="id" value="{$model->id}">{/if}
 <input type="hidden" name="do_delete" value="0">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 
 <table cellspacing="0" cellpadding="2" border="0" width="98%" style="margin-bottom:10px;">
 	<tr>

programming_language: HTML
filename: tab_availability.tpl
change_type: ModificationType.MODIFY
diff: @@ -1,11 +1,13 @@
 {$guid = uniqid()}
 
 {if empty($calendar) && $context == CerberusContexts::CONTEXT_WORKER && $context_id == $active_worker->id}
-<form action="{devblocks_url}{/devblocks_url}">
+<form action="{devblocks_url}{/devblocks_url}" method="post">
 <input type="hidden" name="c" value="profiles">
 <input type="hidden" name="a" value="handleSectionAction">
 <input type="hidden" name="section" value="worker">
 <input type="hidden" name="action" value="setAvailabilityCalendar">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
+
 <div class="help-box" style="padding:5px;border:0;">
 	<h1 style="margin-bottom:5px;text-align:left;">Configure your availability calendar</h1>
 	

programming_language: HTML
filename: view.tpl
change_type: ModificationType.MODIFY
diff: @@ -33,6 +33,8 @@
 <input type="hidden" name="section" value="calendar">
 <input type="hidden" name="action" value="">
 <input type="hidden" name="explore_from" value="0">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
+
 <table cellpadding="1" cellspacing="0" border="0" width="100%" class="worklistBody">
 
 	{* Column Headers *}

programming_language: HTML
filename: peek.tpl
change_type: ModificationType.MODIFY
diff: @@ -15,6 +15,7 @@
 <input type="hidden" name="link_context" value="{$link_context}">
 <input type="hidden" name="link_context_id" value="{$link_context_id}">
 {/if}
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 
 <table cellpadding="0" cellspacing="2" border="0" width="98%">
 	<tr>

programming_language: HTML
filename: view.tpl
change_type: ModificationType.MODIFY
diff: @@ -30,6 +30,8 @@
 <input type="hidden" name="c" value="internal">
 <input type="hidden" name="a" value="">
 <input type="hidden" name="explore_from" value="0">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
+
 <table cellpadding="1" cellspacing="0" border="0" width="100%" class="worklistBody">
 
 	{* Column Headers *}

programming_language: HTML
filename: peek.tpl
change_type: ModificationType.MODIFY
diff: @@ -9,6 +9,7 @@
 {/if}
 {if !empty($model) && !empty($model->id)}<input type="hidden" name="id" value="{$model->id}">{/if}
 <input type="hidden" name="do_delete" value="0">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 
 <table cellpadding="0" cellspacing="2" border="0" width="98%">
 	<tr>

programming_language: HTML
filename: view.tpl
change_type: ModificationType.MODIFY
diff: @@ -33,6 +33,8 @@
 <input type="hidden" name="section" value="calendar_recurring_profile">
 <input type="hidden" name="action" value="">
 <input type="hidden" name="explore_from" value="0">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
+
 <table cellpadding="1" cellspacing="0" border="0" width="100%" class="worklistBody">
 
 	{* Column Headers *}

programming_language: HTML
filename: peek.tpl
change_type: ModificationType.MODIFY
diff: @@ -3,6 +3,7 @@
 <input type="hidden" name="a" value="commentSavePopup">
 <input type="hidden" name="context" value="{$context}">
 <input type="hidden" name="context_id" value="{$context_id}">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 
 <b>Author:</b> {$active_worker->getName()}
 <div>

programming_language: PHP
filename: view.tpl
change_type: ModificationType.MODIFY
diff: @@ -31,6 +31,8 @@
 <input type="hidden" name="section" value="comment">
 <input type="hidden" name="action" value="">
 <input type="hidden" name="explore_from" value="0">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
+
 <table cellpadding="1" cellspacing="0" border="0" width="100%" class="worklistBody">
 
 	{* Column Headers *}

programming_language: PHP
filename: peek.tpl
change_type: ModificationType.MODIFY
diff: @@ -14,6 +14,7 @@
 <input type="hidden" name="id" value="{$custom_fieldset->id}">
 <input type="hidden" name="view_id" value="{$view_id}">
 <input type="hidden" name="do_delete" value="0">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 
 <fieldset class="peek cfield-props">
 	<legend>{'common.properties'|devblocks_translate|capitalize}</legend>

programming_language: PHP
filename: view.tpl
change_type: ModificationType.MODIFY
diff: @@ -28,6 +28,8 @@
 <input type="hidden" name="context_id" value="cerberusweb.contexts.custom_fieldset">
 <input type="hidden" name="c" value="tickets">
 <input type="hidden" name="a" value="">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
+
 <table cellpadding="5" cellspacing="0" border="0" width="100%" class="worklistBody">
 
 	{* Column Headers *}

programming_language: HTML
filename: _move.tpl
change_type: ModificationType.MODIFY
diff: @@ -3,6 +3,7 @@
 <input type="hidden" name="a" value="saveDecisionMovePopup">
 {if isset($node)}<input type="hidden" name="id" value="{$node->id}">{/if}
 {if isset($trigger)}<input type="hidden" name="trigger_id" value="{$trigger->id}">{/if}
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 
 <fieldset>
 	<legend>Move</legend>

programming_language: HTML
filename: _reorder.tpl
change_type: ModificationType.MODIFY
diff: @@ -3,6 +3,7 @@
 <input type="hidden" name="a" value="saveDecisionReorderPopup">
 {if isset($node)}<input type="hidden" name="id" value="{$node->id}">{/if}
 {if isset($trigger)}<input type="hidden" name="trigger_id" value="{$trigger->id}">{/if}
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 
 <fieldset>
 	<legend>{if !empty($node)}{$node->title}{elseif !empty($trigger)}{$trigger->event_point}{/if}</legend>

programming_language: HTML
filename: action.tpl
change_type: ModificationType.MODIFY
diff: @@ -5,6 +5,7 @@
 {if isset($parent_id)}<input type="hidden" name="parent_id" value="{$parent_id}">{/if}
 {if isset($type)}<input type="hidden" name="type" value="{$type}">{/if}
 {if isset($trigger_id)}<input type="hidden" name="trigger_id" value="{$trigger_id}">{/if}
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 
 <b>{'common.title'|devblocks_translate|capitalize}:</b><br>
 <input type="text" name="title" value="{$model->title}" style="width:100%;"><br>
@@ -69,6 +70,8 @@
 <input type="hidden" name="seq" value="{if !is_null($seq)}{$seq+1}{else}0{/if}">
 <input type="hidden" name="action" value="">
 {if isset($trigger_id)}<input type="hidden" name="trigger_id" value="{$trigger_id}">{/if}
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
+
 <fieldset>
 	<legend>Add Action</legend>
 

programming_language: PHP
filename: outcome.tpl
change_type: ModificationType.MODIFY
diff: @@ -5,6 +5,7 @@
 {if isset($parent_id)}<input type="hidden" name="parent_id" value="{$parent_id}">{/if}
 {if isset($type)}<input type="hidden" name="type" value="{$type}">{/if}
 {if isset($trigger_id)}<input type="hidden" name="trigger_id" value="{$trigger_id}">{/if}
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 
 <b>{'common.title'|devblocks_translate|capitalize}:</b><br>
 <input type="text" name="title" value="{$model->title}" style="width:100%;"><br>
@@ -80,6 +81,8 @@
 <input type="hidden" name="seq" value="{$seq}">
 <input type="hidden" name="condition" value="">
 {if isset($trigger_id)}<input type="hidden" name="trigger_id" value="{$trigger_id}">{/if}
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
+
 <fieldset>
 	<legend>Add Condition</legend>
 

programming_language: PHP
filename: simulate.tpl
change_type: ModificationType.MODIFY
diff: @@ -4,6 +4,7 @@
 {if isset($node)}<input type="hidden" name="id" value="{$node->id}">{/if}
 {if isset($trigger)}<input type="hidden" name="trigger_id" value="{$trigger->id}">{/if}
 <input type="hidden" name="event_params_json" value="{$event_params_json}">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 
 {* Target *}
 

programming_language: HTML
filename: switch.tpl
change_type: ModificationType.MODIFY
diff: @@ -5,6 +5,7 @@
 {if isset($parent_id)}<input type="hidden" name="parent_id" value="{$parent_id}">{/if}
 {if isset($type)}<input type="hidden" name="type" value="{$type}">{/if}
 {if isset($trigger_id)}<input type="hidden" name="trigger_id" value="{$trigger_id}">{/if}
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 
 <b>{'common.title'|devblocks_translate|capitalize}:</b><br>
 <input type="text" name="title" value="{$model->title}" style="width:100%;"><br>

programming_language: HTML
filename: trigger.tpl
change_type: ModificationType.MODIFY
diff: @@ -7,6 +7,7 @@
 {if empty($trigger->id)}
 <input type="hidden" name="va_id" value="{$va->id}">
 {/if}
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 
 <div>
 	<b>{'common.title'|devblocks_translate|capitalize}:</b><br>
@@ -116,6 +117,7 @@
 		<input type="hidden" name="c" value="internal">
 		<input type="hidden" name="a" value="">
 		<input type="hidden" name="va_id" value="{$va->id}">
+		<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 
 		<div class="import">
 			<b>Import:</b> (.json format)

programming_language: HTML
filename: peek.tpl
change_type: ModificationType.MODIFY
diff: @@ -6,6 +6,7 @@
 <input type="hidden" name="view_id" value="{$view_id}">
 {if !empty($model) && !empty($model->id)}<input type="hidden" name="id" value="{$model->id}">{/if}
 <input type="hidden" name="do_delete" value="0">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 
 <fieldset class="peek">
 	<legend>{'common.properties'|devblocks_translate}</legend>

programming_language: PHP
filename: view.tpl
change_type: ModificationType.MODIFY
diff: @@ -33,6 +33,8 @@
 <input type="hidden" name="section" value="file_bundle">
 <input type="hidden" name="action" value="">
 <input type="hidden" name="explore_from" value="0">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
+
 <table cellpadding="1" cellspacing="0" border="0" width="100%" class="worklistBody">
 
 	{* Column Headers *}

programming_language: HTML
filename: popup_mapping.tpl
change_type: ModificationType.MODIFY
diff: @@ -4,6 +4,7 @@
 <input type="hidden" name="a" value="doImport">
 <input type="hidden" name="context" value="{$context}">
 <input type="hidden" name="view_id" value="{$view_id}">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 
 <fieldset>
 	<legend>Associate Fields with Import Columns</legend>

programming_language: HTML
filename: popup_upload.tpl
change_type: ModificationType.MODIFY
diff: @@ -3,6 +3,7 @@
 <input type="hidden" name="a" value="parseImportFile">
 <input type="hidden" name="context" value="{$context}">
 <input type="hidden" name="view_id" value="{$view_id}">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 
 <fieldset>
 	<legend>Upload File</legend>

programming_language: PHP
filename: scheduler_popup.tpl
change_type: ModificationType.MODIFY
diff: @@ -12,6 +12,7 @@
 <input type="hidden" name="a" value="saveMacroSchedulerPopup">
 <input type="hidden" name="job_id" value="{$job->id}">
 {/if}
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 
 <b>Behavior:</b><br>
 {if !empty($macro->title)}

programming_language: HTML
filename: run_popup.tpl
change_type: ModificationType.MODIFY
diff: @@ -4,6 +4,7 @@
 <input type="hidden" name="macro" value="{$macro->id}">
 <input type="hidden" name="ticket_id" value="{$ticket_id}">
 <input type="hidden" name="message_id" value="{$message_id}">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 
 <b>Behavior:</b><br>
 {if !empty($macro->title)}

programming_language: HTML
filename: peek.tpl
change_type: ModificationType.MODIFY
diff: @@ -2,6 +2,7 @@
 <input type="hidden" name="view_id" value="{$view_id}">
 {if !empty($model) && !empty($model->id)}<input type="hidden" name="id" value="{$model->id}">{/if}
 <input type="hidden" name="do_delete" value="0">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 
 <fieldset class="peek" style="margin-bottom:0px;">
 	<legend>{'common.properties'|devblocks_translate}</legend>

programming_language: PHP
filename: view.tpl
change_type: ModificationType.MODIFY
diff: @@ -32,6 +32,8 @@
 <input type="hidden" name="section" value="mail_transport">
 <input type="hidden" name="action" value="">
 <input type="hidden" name="explore_from" value="0">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
+
 <table cellpadding="5" cellspacing="0" border="0" width="100%" class="worklistBody">
 
 	{* Column Headers *}

programming_language: HTML
filename: peek.tpl
change_type: ModificationType.MODIFY
diff: @@ -6,6 +6,7 @@
 <input type="hidden" name="view_id" value="{$view_id}">
 {if !empty($model) && !empty($model->id)}<input type="hidden" name="id" value="{$model->id}">{/if}
 <input type="hidden" name="do_delete" value="0">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 
 <fieldset class="peek">
 	<legend>{'common.properties'|devblocks_translate}</legend>

programming_language: HTML
filename: view.tpl
change_type: ModificationType.MODIFY
diff: @@ -33,6 +33,8 @@
 <input type="hidden" name="section" value="mailbox">
 <input type="hidden" name="action" value="">
 <input type="hidden" name="explore_from" value="0">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
+
 <table cellpadding="1" cellspacing="0" border="0" width="100%" class="worklistBody">
 
 	{* Column Headers *}

programming_language: HTML
filename: peek.tpl
change_type: ModificationType.MODIFY
diff: @@ -4,6 +4,7 @@
 <input type="hidden" name="view_id" value="{$view_id}">
 {if !empty($model) && !empty($model->id)}<input type="hidden" name="id" value="{$model->id}">{/if}
 <input type="hidden" name="do_delete" value="0">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 
 {$ticket = $model->getTicket()}
 {$headers = $model->getHeaders()}

programming_language: HTML
filename: context_recommend_peek.tpl
change_type: ModificationType.MODIFY
diff: @@ -13,6 +13,7 @@
 	<input type="hidden" name="context_id" value="{$context_id}">
 	<input type="hidden" name="group_id" value="{$group_id}">
 	<input type="hidden" name="bucket_id" value="{$bucket_id}">
+	<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 	
 	<div style="margin-bottom:10px;">
 	{include file="devblocks:cerberusweb.core::internal/workers/worker_picker_container.tpl" context=$context context_id=$context_id}

programming_language: PHP
filename: peek_by_group_editable.tpl
change_type: ModificationType.MODIFY
diff: @@ -5,6 +5,7 @@
 <input type="hidden" name="action" value="saveResponsibilitiesPopup">
 <input type="hidden" name="context" value="{CerberusContexts::CONTEXT_GROUP}">
 <input type="hidden" name="context_id" value="{$group->id}">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 
 {foreach from=$buckets item=bucket}
 	<fieldset class="peek cerb-delta-slider-container" style="display:inline-block;">

programming_language: PHP
filename: peek.tpl
change_type: ModificationType.MODIFY
diff: @@ -6,6 +6,7 @@
 <input type="hidden" name="view_id" value="{$view_id}">
 {if !empty($model) && !empty($model->id)}<input type="hidden" name="id" value="{$model->id}">{/if}
 <input type="hidden" name="do_delete" value="0">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 
 <fieldset class="peek">
 	<legend>{'common.properties'|devblocks_translate}</legend>

programming_language: HTML
filename: view.tpl
change_type: ModificationType.MODIFY
diff: @@ -33,6 +33,8 @@
 <input type="hidden" name="section" value="skill">
 <input type="hidden" name="action" value="">
 <input type="hidden" name="explore_from" value="0">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
+
 <table cellpadding="5" cellspacing="0" border="0" width="100%" class="worklistBody">
 
 	{* Column Headers *}

programming_language: HTML
filename: chooser_popup.tpl
change_type: ModificationType.MODIFY
diff: @@ -5,6 +5,7 @@
 <input type="hidden" name="action" value="saveSkillsForContext">
 <input type="hidden" name="context" value="{$context}">
 <input type="hidden" name="context_id" value="{$context_id}">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 
 {include file="devblocks:cerberusweb.core::internal/skillsets/fieldsets_and_menu.tpl" skill_labels=$skill_labels skillsets_linked=$skillsets}
 

programming_language: HTML
filename: peek.tpl
change_type: ModificationType.MODIFY
diff: @@ -6,6 +6,7 @@
 <input type="hidden" name="view_id" value="{$view_id}">
 {if !empty($model) && !empty($model->id)}<input type="hidden" name="id" value="{$model->id}">{/if}
 <input type="hidden" name="do_delete" value="0">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 
 <fieldset class="peek">
 	<legend>{'common.properties'|devblocks_translate}</legend>

programming_language: HTML
filename: tab_editable.tpl
change_type: ModificationType.MODIFY
diff: @@ -6,6 +6,7 @@
 <input type="hidden" name="action" value="saveSkillsForContext">
 <input type="hidden" name="context" value="{$context}">
 <input type="hidden" name="context_id" value="{$context_id}">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 
 {include file="devblocks:cerberusweb.core::internal/skillsets/fieldsets_and_menu.tpl" skill_labels=$skill_labels skillsets_linked=$skillsets}
 

programming_language: PHP
filename: view.tpl
change_type: ModificationType.MODIFY
diff: @@ -33,6 +33,8 @@
 <input type="hidden" name="section" value="skillset">
 <input type="hidden" name="action" value="">
 <input type="hidden" name="explore_from" value="0">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
+
 <table cellpadding="5" cellspacing="0" border="0" width="100%" class="worklistBody">
 
 	{* Column Headers *}

programming_language: HTML
filename: bulk.tpl
change_type: ModificationType.MODIFY
diff: @@ -3,6 +3,7 @@
 <input type="hidden" name="a" value="doSnippetBulkUpdate">
 <input type="hidden" name="view_id" value="{$view_id}">
 <input type="hidden" name="ids" value="{$ids}">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 
 <fieldset class="peek">
 	<legend>{'common.bulk_update.with'|devblocks_translate|capitalize}</legend>

programming_language: HTML
filename: paste_placeholders.tpl
change_type: ModificationType.MODIFY
diff: @@ -3,6 +3,7 @@
 <input type="hidden" name="a" value="snippetPlaceholdersPreview">
 <input type="hidden" name="id" value="{$snippet->id}">
 <input type="hidden" name="context_id" value="{$context_id}">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 
 <fieldset class="peek" style="margin-bottom:5px;">
 	<legend>Fill in the blanks:</legend>

programming_language: HTML
filename: peek.tpl
change_type: ModificationType.MODIFY
diff: @@ -4,6 +4,7 @@
 <input type="hidden" name="id" value="{$snippet->id}">
 <input type="hidden" name="view_id" value="{$view_id}">
 <input type="hidden" name="do_delete" value="0">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 
 <fieldset class="peek">
 	<legend>{'common.properties'|devblocks_translate|capitalize}</legend>

programming_language: HTML
filename: default.tpl
change_type: ModificationType.MODIFY
diff: @@ -29,6 +29,8 @@
 <input type="hidden" name="context_id" value="cerberusweb.contexts.snippet">
 <input type="hidden" name="c" value="tickets">
 <input type="hidden" name="a" value="">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
+
 <table cellpadding="5" cellspacing="0" border="0" width="100%" class="worklistBody">
 
 	{* Column Headers *}

programming_language: HTML
filename: banner.tpl
change_type: ModificationType.MODIFY
diff: @@ -11,6 +11,7 @@
 			<form action="{devblocks_url}{/devblocks_url}" method="post" name="tourForm">
 				<input type="hidden" name="c" value="internal">
 				<input type="hidden" name="a" value="doStopTour">
+				<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 				<a href="javascript:;" onclick="$('#tourDiv').fadeOut();genericAjaxGet('','c=internal&a=doStopTour');">hide this</a>
 				&nbsp;
 			</form>

programming_language: HTML
filename: peek.tpl
change_type: ModificationType.MODIFY
diff: @@ -6,6 +6,7 @@
 <input type="hidden" name="view_id" value="{$view_id}">
 {if !empty($model) && !empty($model->id)}<input type="hidden" name="id" value="{$model->id}">{/if}
 <input type="hidden" name="do_delete" value="0">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 
 <fieldset class="peek">
 	<legend>{'common.properties'|devblocks_translate}</legend>

programming_language: PHP
filename: view.tpl
change_type: ModificationType.MODIFY
diff: @@ -20,6 +20,8 @@
 <input type="hidden" name="context_id" value="cerberusweb.contexts.group">
 <input type="hidden" name="c" value="config">
 <input type="hidden" name="a" value="">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
+
 <table cellpadding="5" cellspacing="0" border="0" width="100%" class="worklistBody">
 
 	{* Column Headers *}

programming_language: HTML
filename: view.tpl
change_type: ModificationType.MODIFY
diff: @@ -33,6 +33,8 @@
 <input type="hidden" name="section" value="virtual_attendant">
 <input type="hidden" name="action" value="">
 <input type="hidden" name="explore_from" value="0">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
+
 <table cellpadding="1" cellspacing="0" border="0" width="100%" class="worklistBody">
 
 	{* Column Headers *}

programming_language: HTML
filename: copy.tpl
change_type: ModificationType.MODIFY
diff: @@ -1,5 +1,6 @@
 <form action="{devblocks_url}{/devblocks_url}" method="post" id="frmCopy{$view->id}" onsubmit="return false;">
 <input type="hidden" name="view_id" value="{$view_id}">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 
 <H2>Copy Worklist</H2>
 

programming_language: PHP
filename: search_and_view.tpl
change_type: ModificationType.MODIFY
diff: @@ -3,6 +3,7 @@
 <input type="hidden" name="c" value="internal">
 <input type="hidden" name="a" value="">
 <input type="hidden" name="id" value="{$view->id}">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 
 <div id="viewCustomFilters{$view->id}">
 {include file="devblocks:cerberusweb.core::internal/views/customize_view_criteria.tpl"}

programming_language: HTML
filename: view_export.tpl
change_type: ModificationType.MODIFY
diff: @@ -3,6 +3,7 @@
 <input type="hidden" name="a" value="viewDoExport">
 <input type="hidden" name="view_id" value="{$view_id}">
 <input type="hidden" name="cursor_key" value="">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 
 <div class="export-settings">
 

programming_language: PHP
filename: context_follow_peek.tpl
change_type: ModificationType.MODIFY
diff: @@ -13,6 +13,7 @@
 	<input type="hidden" name="context_id" value="{$context_id}">
 	<input type="hidden" name="group_id" value="{$group_id}">
 	<input type="hidden" name="bucket_id" value="{$bucket_id}">
+	<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 	
 	<div style="margin-bottom:10px;">
 	{include file="devblocks:cerberusweb.core::internal/workers/worker_picker_container.tpl" context=$context context_id=$context_id}

programming_language: PHP
filename: tab.tpl
change_type: ModificationType.MODIFY
diff: @@ -13,6 +13,8 @@
 {$guid = uniqid()}
 
 <form id="frm{$guid}" action="#" style="margin-bottom:5px;width:98%;">
+	<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
+	
 	<div style="float:left;">
 		<span style="font-weight:bold;font-size:150%;">{$calendar_properties.calendar_date|devblocks_date:'F Y'}</span>
 		<span style="margin-left:10px;">

programming_language: HTML
filename: tab.tpl
change_type: ModificationType.MODIFY
diff: @@ -1,5 +1,6 @@
 {if empty($worklists)}
 <form action="#" onsubmit="return false;">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 <div class="help-box" style="padding:5px;border:0;">
 	<h1 style="margin-bottom:5px;text-align:left;">Let's put this workspace to good use</h1>
 	

programming_language: PHP
filename: add.tpl
change_type: ModificationType.MODIFY
diff: @@ -11,6 +11,7 @@
 		<input type="hidden" name="section" value="dashboards">
 		<input type="hidden" name="action" value="addWidgetPopupJson">
 		<input type="hidden" name="workspace_tab_id" value="{$workspace_tab_id}">
+		<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 		
 		<b>Type:</b>
 		<select name="extension_id">
@@ -32,6 +33,7 @@
 		<input type="hidden" name="section" value="dashboards">
 		<input type="hidden" name="action" value="addWidgetImportJson">
 		<input type="hidden" name="workspace_tab_id" value="{$workspace_tab_id}">
+		<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 
 		<div class="import">
 			<b>Import:</b> (.json format)

programming_language: PHP
filename: calendar.tpl
change_type: ModificationType.MODIFY
diff: @@ -1,6 +1,8 @@
 {$guid = uniqid()}
 
 <form id="frm{$guid}" action="#" style="margin-bottom:5px;width:98%;">
+	<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
+	
 	<div style="float:left;">
 		<span style="font-weight:bold;font-size:150%;">{$calendar_properties.calendar_date|devblocks_date:'F Y'}</span>
 	</div>

programming_language: HTML
filename: export.tpl
change_type: ModificationType.MODIFY
diff: @@ -1,4 +1,5 @@
 <form action="javascript:;" method="post" id="frmWidgetExport" onsubmit="return false;">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 
 <b>Widget:</b>
 

programming_language: HTML
filename: export_data.tpl
change_type: ModificationType.MODIFY
diff: @@ -1,4 +1,5 @@
 <form action="javascript:;" method="post" id="frmWidgetExportData" onsubmit="return false;">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 
 <b>Widget:</b>
 

programming_language: HTML
filename: peek.tpl
change_type: ModificationType.MODIFY
diff: @@ -5,6 +5,7 @@
 <input type="hidden" name="action" value="saveWidgetPopup">
 {if !empty($widget) && !empty($widget->id)}<input type="hidden" name="id" value="{$widget->id}">{/if}
 <input type="hidden" name="do_delete" value="0">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 
 <table width="100%" cellpadding="0" cellspacing="2">
 	{if $extension instanceof Extension_WorkspaceWidget}

programming_language: HTML
filename: bulk.tpl
change_type: ModificationType.MODIFY
diff: @@ -5,6 +5,7 @@
 <input type="hidden" name="action" value="doDraftsBulkUpdate">
 <input type="hidden" name="view_id" value="{$view_id}">
 <input type="hidden" name="ids" value="{$ids}">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 
 <fieldset class="peek">
 	<legend>{'common.bulk_update.with'|devblocks_translate|capitalize}</legend>

programming_language: HTML
filename: peek.tpl
change_type: ModificationType.MODIFY
diff: @@ -6,6 +6,7 @@
 <input type="hidden" name="id" value="{$draft->id}">
 <input type="hidden" name="view_id" value="{$view_id}">
 <input type="hidden" name="do_delete" value="0">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 
 <table cellpadding="0" cellspacing="2" border="0" width="98%">
 	{if is_null($workers)}{$workers = DAO_Worker::getAll()}{/if}

programming_language: HTML
filename: view.tpl
change_type: ModificationType.MODIFY
diff: @@ -25,6 +25,8 @@
 <input type="hidden" name="section" value="drafts">
 <input type="hidden" name="action" value="">
 <input type="hidden" name="explore_from" value="0">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
+
 <table cellpadding="1" cellspacing="0" border="0" width="100%" class="worklistBody">
 
 	{* Column Headers *}

programming_language: HTML
filename: peek.tpl
change_type: ModificationType.MODIFY
diff: @@ -14,6 +14,7 @@
 <input type="hidden" name="link_context_id" value="{$draft->params.link_context_id}">
 {/if}
 <input type="hidden" name="format" value="{if ($draft && $draft->params.format == 'parsedown') || $mail_reply_html}parsedown{/if}">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 
 <fieldset class="peek">
 	<legend>{'common.message'|devblocks_translate|capitalize}</legend>

programming_language: HTML
filename: view.tpl
change_type: ModificationType.MODIFY
diff: @@ -26,6 +26,8 @@
 <input type="hidden" name="c" value="tickets">
 <input type="hidden" name="a" value="">
 <input type="hidden" name="explore_from" value="0">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
+
 <table cellpadding="1" cellspacing="0" border="0" width="100%" class="worklistBody">
 
 	{* Column Headers *}

programming_language: HTML
filename: add_tabs.tpl
change_type: ModificationType.MODIFY
diff: @@ -28,6 +28,8 @@
 <input type="hidden" name="a" value="doAddCustomTabJson">
 <input type="hidden" name="page_id" value="{$page->id}">
 <input type="hidden" name="len" value="99">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
+
 <fieldset class="peek">
 	<legend>Add a new tab:</legend>
 

programming_language: PHP
filename: edit_workspace_page.tpl
change_type: ModificationType.MODIFY
diff: @@ -6,6 +6,7 @@
 <input type="hidden" name="id" value="{$workspace_page->id|default:0}">
 <input type="hidden" name="view_id" value="{$view_id}">
 {if !empty($workspace_page)}<input type="hidden" name="do_delete" value="0">{/if}
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 
 <table cellpadding="2" cellspacing="0" border="0" width="100%" style="margin-bottom:5px;">
 	<tr>
@@ -118,6 +119,7 @@
 		<input type="hidden" name="c" value="pages">
 		<input type="hidden" name="a" value="importWorkspacePageJson">
 		<input type="hidden" name="view_id" value="{$view_id}">
+		<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 
 		<div class="import">
 			<b>Import:</b> (.json format)

programming_language: HTML
filename: edit_workspace_tab.tpl
change_type: ModificationType.MODIFY
diff: @@ -4,6 +4,7 @@
 <input type="hidden" name="id" value="{$workspace_tab->id}">
 <input type="hidden" name="workspace_page_id" value="{$workspace_tab->workspace_page_id}">
 {if !empty($workspace_tab)}<input type="hidden" name="do_delete" value="0">{/if}
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 
 <table cellpadding="2" cellspacing="0" border="0" width="100%" style="margin-bottom:5px;">
 	<tr>

programming_language: HTML
filename: page.tpl
change_type: ModificationType.MODIFY
diff: @@ -1,6 +1,7 @@
 <form action="{devblocks_url}{/devblocks_url}" id="frmWorkspacePage{$page->id}" method="POST" style="margin-top:5px;">
 	<input type="hidden" name="c" value="internal">
 	<input type="hidden" name="a" value="">
+	<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 
 	{$menu_json = DAO_WorkerPref::get($active_worker->id, 'menu_json', json_encode(array()))}
 	{$menu = json_decode($menu_json, true)}

programming_language: PHP
filename: view.tpl
change_type: ModificationType.MODIFY
diff: @@ -26,6 +26,8 @@
 <input type="hidden" name="context_id" value="">
 <input type="hidden" name="c" value="pages">
 <input type="hidden" name="a" value="">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
+
 <table cellpadding="1" cellspacing="0" border="0" width="100%" class="worklistBody">
 
 	{* Column Headers *}

programming_language: PHP
filename: wizard_popup.tpl
change_type: ModificationType.MODIFY
diff: @@ -2,6 +2,7 @@
 <input type="hidden" name="c" value="pages">
 <input type="hidden" name="a" value="savePageWizardPopup">
 <input type="hidden" name="view_id" value="{$view_id}">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 
 <fieldset class="peek">
 	<legend style="color:rgb(80,80,80);">What kind of page would you like to create?</legend>

programming_language: HTML
filename: general.tpl
change_type: ModificationType.MODIFY
diff: @@ -1,6 +1,7 @@
 <form action="{devblocks_url}{/devblocks_url}" method="post">
 <input type="hidden" name="c" value="preferences">
 <input type="hidden" name="a" value="saveDefaults">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 
 <fieldset class="peek">
 	<legend>{'preferences.account.settings'|devblocks_translate|capitalize}</legend>
@@ -148,4 +149,5 @@
 <input type="hidden" name="c" value="preferences">
 <input type="hidden" name="a" value="resendConfirmation">
 <input type="hidden" name="email" value="">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 </form>

programming_language: HTML
filename: security.tpl
change_type: ModificationType.MODIFY
diff: @@ -1,6 +1,7 @@
 <form action="{devblocks_url}{/devblocks_url}" method="POST" autocomplete="off">
 <input type="hidden" name="c" value="preferences">
 <input type="hidden" name="a" value="saveSecurityTab">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 
 <div class="help-box">
 	<h1>Set up your secret questions</h1>

programming_language: HTML
filename: bulk.tpl
change_type: ModificationType.MODIFY
diff: @@ -3,6 +3,7 @@
 <input type="hidden" name="a" value="doNotificationsBulkUpdate">
 <input type="hidden" name="view_id" value="{$view_id}">
 <input type="hidden" name="ids" value="{$ids}">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 
 <fieldset class="peek">
 	<legend>{'common.bulk_update.with'|devblocks_translate|capitalize}</legend>

programming_language: HTML
filename: view.tpl
change_type: ModificationType.MODIFY
diff: @@ -25,6 +25,8 @@
 <input type="hidden" name="c" value="preferences">
 <input type="hidden" name="a" value="">
 <input type="hidden" name="explore_from" value="0">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
+
 <table cellpadding="5" cellspacing="0" border="0" width="100%" class="worklistBody">
 
 	{* Column Headers *}

programming_language: HTML
filename: index.tpl
change_type: ModificationType.MODIFY
diff: @@ -1,6 +1,7 @@
 <form action="{devblocks_url}{/devblocks_url}" method="POST" id="frmWatcherPrefs">
 <input type="hidden" name="c" value="preferences">
 <input type="hidden" name="a" value="saveWatcherTab">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 
 <fieldset class="peek">
 <legend>If I'm watching something, send me a notification when these events happen:</legend>

programming_language: HTML
filename: quick_search.tpl
change_type: ModificationType.MODIFY
diff: @@ -6,6 +6,7 @@
 	<input type="hidden" name="c" value="search">
 	<input type="hidden" name="a" value="ajaxQuickSearch">
 	<input type="hidden" name="view_id" value="{$view->id}">
+	<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 
 	<div style="border:1px solid rgb(200,200,200);border-radius:10px;display:inline-block;">
 		<input type="text" name="query" class="input_search cerb-input-quicksearch" style="border:0;" size="50" value="{$quick_search_query}" autocomplete="off" spellcheck="false">

programming_language: PHP
filename: bulk.tpl
change_type: ModificationType.MODIFY
diff: @@ -3,6 +3,7 @@
 <input type="hidden" name="a" value="doTaskBulkUpdate">
 <input type="hidden" name="view_id" value="{$view_id}">
 <input type="hidden" name="ids" value="{$ids}">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 
 <fieldset class="peek">
 	<legend>{'common.bulk_update.with'|devblocks_translate|capitalize}</legend>

programming_language: HTML
filename: peek.tpl
change_type: ModificationType.MODIFY
diff: @@ -8,6 +8,7 @@
 <input type="hidden" name="link_context_id" value="{$link_context_id}">
 {/if}
 <input type="hidden" name="do_delete" value="0">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 
 <fieldset class="peek">
 	<legend>{'common.properties'|devblocks_translate}</legend>

programming_language: HTML
filename: view.tpl
change_type: ModificationType.MODIFY
diff: @@ -31,6 +31,8 @@
 <input type="hidden" name="c" value="tasks">
 <input type="hidden" name="a" value="">
 <input type="hidden" name="explore_from" value="0">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
+
 <table cellpadding="1" cellspacing="0" border="0" width="100%" class="worklistBody">
 
 	{* Column Headers *}

programming_language: HTML
filename: merge_confirm.tpl
change_type: ModificationType.MODIFY
diff: @@ -2,6 +2,7 @@
 <input type="hidden" name="c" value="tickets">
 <input type="hidden" name="a" value="viewMergeTickets">
 <input type="hidden" name="view_id" value="{$view_id}">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 
 <fieldset>
 	<legend>Are you sure you want to merge these tickets?</legend>

programming_language: PHP
filename: peek.tpl
change_type: ModificationType.MODIFY
diff: @@ -9,6 +9,7 @@
 <input type="hidden" name="link_context" value="{$link_context}">
 <input type="hidden" name="link_context_id" value="{$link_context_id}">
 {/if}
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 
 {if !$edit_mode && !empty($message)}
 <div id="ticketPeekMessage" style="margin-bottom:10px;">

programming_language: HTML
filename: bulk.tpl
change_type: ModificationType.MODIFY
diff: @@ -3,6 +3,7 @@
 <input type="hidden" name="a" value="doBulkUpdate">
 <input type="hidden" name="view_id" value="{$view_id}">
 <input type="hidden" name="ids" value="{$ids}">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 
 <fieldset class="peek">
 	<legend>{'common.bulk_update.with'|devblocks_translate|capitalize}</legend>

programming_language: HTML
filename: ticket_view_assist.tpl
change_type: ModificationType.MODIFY
diff: @@ -2,6 +2,7 @@
 <input type="hidden" name="c" value="tickets">
 <input type="hidden" name="a" value="viewAutoAssist">
 <input type="hidden" name="view_id" value="{$view_id}">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 
 Sort biggest piles by: 
 <label><input type="radio" name="mode" value="subjects" {if $mode!="subjects"}onclick="genericAjaxGet('{$view_id}_tips','c=tickets&a=showViewAutoAssist&view_id={$view_id}&mode=subjects');"{/if} {if $mode=="subjects"}checked{/if}>Subject Similarity</label>

programming_language: HTML
filename: ticket_view_assist_headers.tpl
change_type: ModificationType.MODIFY
diff: @@ -2,6 +2,7 @@
 <input type="hidden" name="c" value="tickets">
 <input type="hidden" name="a" value="viewAutoAssist">
 <input type="hidden" name="view_id" value="{$view_id}">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 
 Sort biggest piles by: 
 <label><input type="radio" name="mode" value="subjects" {if $mode!="subjects"}onclick="genericAjaxGet('{$view_id}_tips','c=tickets&a=showViewAutoAssist&view_id={$view_id}&mode=subjects');"{/if} {if $mode=="subjects"}checked{/if}>Subject Similarity</label>

programming_language: HTML
filename: view.tpl
change_type: ModificationType.MODIFY
diff: @@ -35,6 +35,8 @@
 <input type="hidden" name="a" value="">
 <input type="hidden" name="id" value="{$view->id}">
 <input type="hidden" name="explore_from" value="0">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
+
 <table cellpadding="1" cellspacing="0" border="0" width="100%" class="worklistBody">
 	{* Column Headers *}
 	<thead>

programming_language: HTML
filename: view.tpl
change_type: ModificationType.MODIFY
diff: @@ -32,6 +32,8 @@
 <input type="hidden" name="section" value="worker">
 <input type="hidden" name="action" value="">
 <input type="hidden" name="explore_from" value="0">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
+
 <table cellpadding="2" cellspacing="0" border="0" width="100%" class="worklistBody">
 
 	{* Column Headers *}

programming_language: HTML
filename: bulk.tpl
change_type: ModificationType.MODIFY
diff: @@ -3,6 +3,7 @@
 <input type="hidden" name="a" value="doOppBulkUpdate">
 <input type="hidden" name="view_id" value="{$view_id}">
 <input type="hidden" name="opp_ids" value="{$opp_ids}">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 
 <fieldset class="peek">
 	<legend>{'common.bulk_update.with'|devblocks_translate|capitalize}</legend>

programming_language: HTML
filename: peek.tpl
change_type: ModificationType.MODIFY
diff: @@ -8,6 +8,7 @@
 <input type="hidden" name="link_context_id" value="{$link_context_id}">
 {/if}
 <input type="hidden" name="do_delete" value="0">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 
 <fieldset class="peek">
 	<legend>{'common.properties'|devblocks_translate}</legend>

programming_language: HTML
filename: view.tpl
change_type: ModificationType.MODIFY
diff: @@ -32,6 +32,8 @@
 <input type="hidden" name="c" value="crm">
 <input type="hidden" name="a" value="">
 <input type="hidden" name="explore_from" value="0">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
+
 <table cellpadding="1" cellspacing="0" border="0" width="100%" class="worklistBody">
 
 	{* Column Headers *}

programming_language: HTML
filename: peek.tpl
change_type: ModificationType.MODIFY
diff: @@ -7,6 +7,7 @@
 <input type="hidden" name="link_context_id" value="{$link_context_id}">
 {/if}
 <input type="hidden" name="do_delete" value="0">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 
 <fieldset class="peek">
 	<legend>Properties</legend>

programming_language: HTML
filename: bulk.tpl
change_type: ModificationType.MODIFY
diff: @@ -3,6 +3,7 @@
 <input type="hidden" name="a" value="doBulkUpdate">
 <input type="hidden" name="view_id" value="{$view_id}">
 <input type="hidden" name="ids" value="{$ids}">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 
 <fieldset class="peek">
 	<legend>{'common.bulk_update.with'|devblocks_translate|capitalize}</legend>

programming_language: HTML
filename: view.tpl
change_type: ModificationType.MODIFY
diff: @@ -25,6 +25,7 @@
 <input type="hidden" name="view_id" value="{$view->id}">
 <input type="hidden" name="c" value="feedback">
 <input type="hidden" name="a" value="">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 
 <table cellpadding="1" cellspacing="0" border="0" width="100%" class="worklistBody">
 

programming_language: HTML
filename: category_edit_panel.tpl
change_type: ModificationType.MODIFY
diff: @@ -3,6 +3,7 @@
 <input type="hidden" name="a" value="saveKbCategoryEditPanelJson">
 <input type="hidden" name="id" value="{$category->id}">
 <input type="hidden" name="delete_box" value="0">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 
 <b>Name:</b><br>
 <input type="text" name="name" value="{$category->name}" style="width:99%;border:solid 1px rgb(180,180,180);"><br>

programming_language: HTML
filename: bulk.tpl
change_type: ModificationType.MODIFY
diff: @@ -3,6 +3,7 @@
 <input type="hidden" name="a" value="doArticlesBulkUpdate">
 <input type="hidden" name="view_id" value="{$view_id}">
 <input type="hidden" name="ids" value="{$ids}">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 
 <fieldset class="peek">
 	<legend>{'common.bulk_update.with'|devblocks_translate|capitalize}</legend>

programming_language: HTML
filename: peek_edit.tpl
change_type: ModificationType.MODIFY
diff: @@ -4,6 +4,7 @@
 <input type="hidden" name="id" value="{$article->id}">
 <input type="hidden" name="view_id" value="{$view_id}">
 <input type="hidden" name="do_delete" value="0">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 
 <div id="kbArticleTabs">
 	<ul>

programming_language: HTML
filename: peek_readonly.tpl
change_type: ModificationType.MODIFY
diff: @@ -1,4 +1,5 @@
 <form action="{devblocks_url}{/devblocks_url}" method="POST">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 
 <iframe src="{$smarty.const.DEVBLOCKS_WEBPATH}ajax.php?c=kb.ajax&a=getArticleContent&id={$article->id}" style="margin:5px 0px 5px 5px;height:400px;width:98%;border:1px solid rgb(200,200,200);" frameborder="0"></iframe>
 <br>

programming_language: HTML
filename: index.tpl
change_type: ModificationType.MODIFY
diff: @@ -3,6 +3,7 @@
 <form id="frmKbBrowseTab{$tab->id}" enctype="multipart/form-data" method="post" action="{devblocks_url}{/devblocks_url}">
 	<input type="hidden" name="c" value="kb.ajax">
 	<input type="hidden" name="a" value="">
+	<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 
 	{if $active_worker->hasPriv('core.kb.categories.modify')}
 		{$parent_id = 0}

programming_language: PHP
filename: view.tpl
change_type: ModificationType.MODIFY
diff: @@ -31,6 +31,8 @@
 <input type="hidden" name="a" value="">
 <input type="hidden" name="return" value="{$response_uri}">
 <input type="hidden" name="explore_from" value="0">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
+
 <table cellpadding="1" cellspacing="0" border="0" width="100%" class="worklistBody">
 
 	{* Column Headers *}

programming_language: HTML
filename: index.tpl
change_type: ModificationType.MODIFY
diff: @@ -2,6 +2,7 @@
 <legend>{'reports.ui.custom_fields.usage'|devblocks_translate}</legend>
 
 <form action="{devblocks_url}c=pages&page={$page->id}-{$page->name|devblocks_permalink}&report=report.custom_fields.usage{/devblocks_url}" method="POST" id="frmRange" name="frmRange">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 
 <b>Custom Field:</b>
 

programming_language: HTML
filename: index.tpl
change_type: ModificationType.MODIFY
diff: @@ -3,6 +3,7 @@
 
 <form action="{devblocks_url}c=pages&page={$page->id}-{$page->name|devblocks_permalink}&report=report.groups.group_replies{/devblocks_url}" method="POST" id="frmRange" name="frmRange">
 <input type="hidden" name="c" value="reports">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 <b>{'reports.ui.date_from'|devblocks_translate}</b> <input type="text" name="start" id="start" size="24" value="{$start}"><button type="button" onclick="devblocksAjaxDateChooser('#start','#divCal');"><span class="glyphicons glyphicons-calendar"></span></button>
 <b>{'reports.ui.date_to'|devblocks_translate}</b> <input type="text" name="end" id="end" size="24" value="{$end}"><button type="button" onclick="devblocksAjaxDateChooser('#end','#divCal');"><span class="glyphicons glyphicons-calendar"></span></button>
 <b>Grouping:</b> <select name="report_date_grouping">

programming_language: HTML
filename: index.tpl
change_type: ModificationType.MODIFY
diff: @@ -3,6 +3,7 @@
 
 <form action="{devblocks_url}c=pages&page={$page->id}-{$page->name|devblocks_permalink}&report=report.snippets.popularity{/devblocks_url}" method="POST" id="frmRange">
 <input type="hidden" name="c" value="reports">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 <b>{'reports.ui.date_from'|devblocks_translate}</b> <input type="text" name="start" id="start" size="24" value="{$start}"><button type="button" onclick="devblocksAjaxDateChooser('#start','#divCal');"><span class="glyphicons glyphicons-calendar"></span></button>
 <b>{'reports.ui.date_to'|devblocks_translate}</b> <input type="text" name="end" id="end" size="24" value="{$end}"><button type="button" onclick="devblocksAjaxDateChooser('#end','#divCal');"><span class="glyphicons glyphicons-calendar"></span></button>
 

programming_language: HTML
filename: index.tpl
change_type: ModificationType.MODIFY
diff: @@ -3,6 +3,7 @@
 
 <form action="{devblocks_url}c=pages&page={$page->id}-{$page->name|devblocks_permalink}&report=report.tickets.closed_tickets{/devblocks_url}" method="POST" id="frmRange" name="frmRange">
 <input type="hidden" name="c" value="reports">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 <b>{'reports.ui.date_from'|devblocks_translate}</b> <input type="text" name="start" id="start" size="24" value="{$start}"><button type="button" onclick="devblocksAjaxDateChooser('#start','#divCal');"><span class="glyphicons glyphicons-calendar"></span></button>
 <b>{'reports.ui.date_to'|devblocks_translate}</b> <input type="text" name="end" id="end" size="24" value="{$end}"><button type="button" onclick="devblocksAjaxDateChooser('#end','#divCal');"><span class="glyphicons glyphicons-calendar"></span></button>
 <b>Grouping:</b> <select name="report_date_grouping">

programming_language: HTML
filename: index.tpl
change_type: ModificationType.MODIFY
diff: @@ -3,6 +3,7 @@
 
 <form action="{devblocks_url}c=pages&page={$page->id}-{$page->name|devblocks_permalink}&report=report.tickets.new_tickets{/devblocks_url}" method="POST" id="frmRange">
 <input type="hidden" name="c" value="reports">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 <b>{'reports.ui.date_from'|devblocks_translate}</b> <input type="text" name="start" id="start" size="24" value="{$start}"><button type="button" onclick="devblocksAjaxDateChooser('#start','#divCal');"><span class="glyphicons glyphicons-calendar"></span></button>
 <b>{'reports.ui.date_to'|devblocks_translate}</b> <input type="text" name="end" id="end" size="24" value="{$end}"><button type="button" onclick="devblocksAjaxDateChooser('#end','#divCal');"><span class="glyphicons glyphicons-calendar"></span></button>
 <b>Grouping:</b> <select name="report_date_grouping">

programming_language: HTML
filename: index.tpl
change_type: ModificationType.MODIFY
diff: @@ -2,6 +2,7 @@
 <legend>{'reports.ui.ticket.top_contacts'|devblocks_translate}</legend>
 
 <form action="{devblocks_url}c=pages&page={$page->id}-{$page->name|devblocks_permalink}&report=report.tickets.top_contacts{/devblocks_url}" method="POST" id="frmRange" name="frmRange">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 {'reports.ui.date_from'|devblocks_translate} <input type="text" name="start" id="start" size="24" value="{$start}"><button type="button" onclick="devblocksAjaxDateChooser('#start','#divCal');"><span class="glyphicons glyphicons-calendar"></span></button>
 {'reports.ui.date_to'|devblocks_translate} <input type="text" name="end" id="end" size="24" value="{$end}"><button type="button" onclick="devblocksAjaxDateChooser('#end','#divCal');"><span class="glyphicons glyphicons-calendar"></span></button>
 <div id="divCal"></div>

programming_language: HTML
filename: index.tpl
change_type: ModificationType.MODIFY
diff: @@ -3,6 +3,7 @@
 
 <form action="{devblocks_url}c=pages&page={$page->id}-{$page->name|devblocks_permalink}&report=report.virtual_attendants.usage{/devblocks_url}" method="POST" id="frmRange">
 <input type="hidden" name="c" value="reports">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 <b>{'reports.ui.date_from'|devblocks_translate}</b> <input type="text" name="start" id="start" size="24" value="{$start}"><button type="button" onclick="devblocksAjaxDateChooser('#start','#divCal');"><span class="glyphicons glyphicons-calendar"></span></button>
 <b>{'reports.ui.date_to'|devblocks_translate}</b> <input type="text" name="end" id="end" size="24" value="{$end}"><button type="button" onclick="devblocksAjaxDateChooser('#end','#divCal');"><span class="glyphicons glyphicons-calendar"></span></button>
 

programming_language: HTML
filename: index.tpl
change_type: ModificationType.MODIFY
diff: @@ -5,6 +5,7 @@
 {if $invalidDate}<font color="red"><b>{'reports.ui.invalid_date'|devblocks_translate}</b></font>{/if}
 
 <form action="{devblocks_url}c=pages&page={$page->id}-{$page->name|devblocks_permalink}&report=report.workers.averageresponsetime{/devblocks_url}" method="POST" id="frmRange" name="frmRange">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 <input type="text" name="start" id="start" size="24" value="{$start}"><button type="button" onclick="devblocksAjaxDateChooser('#start','#divCal');"><span class="glyphicons glyphicons-calendar"></span></button>
 <input type="text" name="end" id="end" size="24" value="{$end}"><button type="button" onclick="devblocksAjaxDateChooser('#end','#divCal');"><span class="glyphicons glyphicons-calendar"></span></button>
 

programming_language: HTML
filename: index.tpl
change_type: ModificationType.MODIFY
diff: @@ -2,6 +2,7 @@
 <legend>{'reports.ui.worker.worker_history'|devblocks_translate}</legend>
 
 <form action="{devblocks_url}c=pages&page={$page->id}-{$page->name|devblocks_permalink}&report=report.workers.worker_history{/devblocks_url}" method="POST" id="frmRange" name="frmRange">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 <b>{'reports.ui.date_from'|devblocks_translate}</b> <input type="text" name="start" id="start" size="24" value="{$start}"><button type="button" onclick="devblocksAjaxDateChooser('#start','#divCal');"><span class="glyphicons glyphicons-calendar"></span></button>
 <b>{'reports.ui.date_to'|devblocks_translate}</b> <input type="text" name="end" id="end" size="24" value="{$end}"><button type="button" onclick="devblocksAjaxDateChooser('#end','#divCal');"><span class="glyphicons glyphicons-calendar"></span></button>
 <b>Grouping:</b> <select name="report_date_grouping">

programming_language: HTML
filename: peek.tpl
change_type: ModificationType.MODIFY
diff: @@ -5,6 +5,7 @@
 <input type="hidden" name="action" value="savePeekPopup">
 <input type="hidden" name="id" value="{$model->id|default:'0'}">
 <input type="hidden" name="do_delete" value="0">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 
 <fieldset class="peek">
 	<legend>{'common.properties'|devblocks_translate}</legend>

programming_language: HTML
filename: view.tpl
change_type: ModificationType.MODIFY
diff: @@ -26,6 +26,8 @@
 <input type="hidden" name="c" value="rest">
 <input type="hidden" name="a" value="">
 <input type="hidden" name="explore_from" value="0">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
+
 <table cellpadding="5" cellspacing="0" border="0" width="100%" class="worklistBody">
 
 	{* Column Headers *}

programming_language: HTML
filename: section.tpl
change_type: ModificationType.MODIFY
diff: @@ -8,6 +8,7 @@
 	<input type="hidden" name="a" value="handleSectionAction">
 	<input type="hidden" name="section" value="simulator">
 	<input type="hidden" name="action" value="generateTicketsJson">
+	<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 	
 	<table cellpadding="5" cellspacing="0" border="0">
 		<tr>
@@ -61,6 +62,7 @@
 	<input type="hidden" name="a" value="handleSectionAction">
 	<input type="hidden" name="section" value="simulator">
 	<input type="hidden" name="action" value="generateTasksJson">
+	<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 	
 	<table cellpadding="5" cellspacing="0" border="0">
 		<tr>
@@ -116,6 +118,7 @@
 	<input type="hidden" name="a" value="handleSectionAction">
 	<input type="hidden" name="section" value="simulator">
 	<input type="hidden" name="action" value="generateOrgsJson">
+	<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 	
 	<table cellpadding="5" cellspacing="0" border="0">
 		<tr>

programming_language: HTML
filename: edit_activity.tpl
change_type: ModificationType.MODIFY
diff: @@ -4,6 +4,7 @@
 <input type="hidden" name="action" value="save">
 <input type="hidden" name="id" value="{if !empty($activity->id)}{$activity->id}{else}0{/if}">
 <input type="hidden" name="do_delete" value="0">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 
 <fieldset>
 	<legend>

programming_language: HTML
filename: index.tpl
change_type: ModificationType.MODIFY
diff: @@ -26,6 +26,7 @@
 		
 		<td width="100%" valign="top">
 			<form action="{devblocks_url}{/devblocks_url}" method="post" id="configActivity">
+				<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 				{include file="devblocks:cerberusweb.timetracking::config/activities/edit_activity.tpl" activity=null}
 			</form>
 		</td>

programming_language: HTML
filename: index.tpl
change_type: ModificationType.MODIFY
diff: @@ -2,6 +2,7 @@
 <legend>{'timetracking.ui.reports.time_spent_activity'|devblocks_translate}</legend>
 
 <form action="{devblocks_url}c=pages&page={$page->id}-{$page->name|devblocks_permalink}&report=report.timetracking.timespentactivity{/devblocks_url}" method="POST" id="frmRange" name="frmRange">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 <b>{'timetracking.ui.reports.from'|devblocks_translate}</b> <input type="text" name="start" id="start" size="24" value="{$start}"><button type="button" onclick="devblocksAjaxDateChooser('#start','#divCal');"><span class="glyphicons glyphicons-calendar"></span></button>
 <b>{'timetracking.ui.reports.to'|devblocks_translate}</b> <input type="text" name="end" id="end" size="24" value="{$end}"><button type="button" onclick="devblocksAjaxDateChooser('#end','#divCal');"><span class="glyphicons glyphicons-calendar"></span></button>
 <b>Grouping:</b> <select name="report_date_grouping">

programming_language: HTML
filename: index.tpl
change_type: ModificationType.MODIFY
diff: @@ -2,6 +2,7 @@
 <legend>{'timetracking.ui.reports.time_spent_org'|devblocks_translate}</legend>
 
 <form action="{devblocks_url}c=pages&page={$page->id}-{$page->name|devblocks_permalink}&report=report.timetracking.timespentorg{/devblocks_url}" method="POST" id="frmRange" name="frmRange">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 <b>{'timetracking.ui.reports.from'|devblocks_translate}</b> <input type="text" name="start" id="start" size="24" value="{$start}"><button type="button" onclick="devblocksAjaxDateChooser('#start','#divCal');"><span class="glyphicons glyphicons-calendar"></span></button>
 <b>{'timetracking.ui.reports.to'|devblocks_translate}</b> <input type="text" name="end" id="end" size="24" value="{$end}"><button type="button" onclick="devblocksAjaxDateChooser('#end','#divCal');"><span class="glyphicons glyphicons-calendar"></span></button>
 <b>Grouping:</b> <select name="report_date_grouping">

programming_language: HTML
filename: index.tpl
change_type: ModificationType.MODIFY
diff: @@ -2,6 +2,7 @@
 <legend>{'timetracking.ui.reports.time_spent_worker'|devblocks_translate}</legend>
 
 <form action="{devblocks_url}c=pages&page={$page->id}-{$page->name|devblocks_permalink}&report=report.timetracking.timespentworker{/devblocks_url}" method="POST" id="frmRange" name="frmRange">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 <b>{'timetracking.ui.reports.from'|devblocks_translate}</b> <input type="text" name="start" id="start" size="24" value="{$start}"><button type="button" onclick="devblocksAjaxDateChooser('#start','#divCal');"><span class="glyphicons glyphicons-calendar"></span></button>
 <b>{'timetracking.ui.reports.to'|devblocks_translate}</b> <input type="text" name="end" id="end" size="24" value="{$end}"><button type="button" onclick="devblocksAjaxDateChooser('#end','#divCal');"><span class="glyphicons glyphicons-calendar"></span></button>
 <b>Grouping:</b> <select name="report_date_grouping">

programming_language: HTML
filename: add_language_panel.tpl
change_type: ModificationType.MODIFY
diff: @@ -3,6 +3,7 @@
 <input type="hidden" name="a" value="handleSectionAction">
 <input type="hidden" name="section" value="translations">
 <input type="hidden" name="action" value="saveAddLanguagePanel">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 
 {if is_array($codes) && count($codes) > 1}
 <table cellspacing="0" cellpadding="2" border="0">

programming_language: HTML
filename: find_strings_panel.tpl
change_type: ModificationType.MODIFY
diff: @@ -3,6 +3,7 @@
 <input type="hidden" name="a" value="handleSectionAction">
 <input type="hidden" name="section" value="translations">
 <input type="hidden" name="action" value="saveFindStringsPanel">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 
 This will find text defined in U.S. English and not yet translated to other languages.  
 Leaving new text blank allows you to easily find translation work with a search.

programming_language: HTML
filename: import_strings_panel.tpl
change_type: ModificationType.MODIFY
diff: @@ -3,6 +3,7 @@
 <input type="hidden" name="a" value="handleSectionAction">
 <input type="hidden" name="section" value="translations">
 <input type="hidden" name="action" value="saveImportStringsPanel">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 
 <b>Language File:</b> (.xml; TMX)<br>
 <input type="file" name="import_file" size="45"><br>

programming_language: HTML
filename: view.tpl
change_type: ModificationType.MODIFY
diff: @@ -23,6 +23,7 @@
 <input type="hidden" name="a" value="handleSectionAction">
 <input type="hidden" name="section" value="translations">
 <input type="hidden" name="action" value="">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 
 <table cellpadding="1" cellspacing="0" border="0" width="100%" class="worklistBody">
 

programming_language: HTML
filename: devblocks-dao.php
change_type: ModificationType.MODIFY
diff: @@ -1275,6 +1275,7 @@ class Context_<?php echo $class_name;?> extends Extension_DevblocksContext imple
 <input type="hidden" name="view_id" value="{$view_id}">
 {if !empty($model) && !empty($model->id)}<input type="hidden" name="id" value="{$model->id}">{/if}
 <input type="hidden" name="do_delete" value="0">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 
 <fieldset class="peek">
 	<legend>{'common.properties'|devblocks_translate}</legend>
@@ -1428,6 +1429,8 @@ $field_prefix = strtolower(substr($table_name,0,1));
 <input type="hidden" name="section" value="<?php echo $table_name; ?>">
 <input type="hidden" name="action" value="">
 <input type="hidden" name="explore_from" value="0">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
+
 <table cellpadding="1" cellspacing="0" border="0" width="100%" class="worklistBody">
 
 	{* Column Headers *}

programming_language: PHP
filename: bulk.tpl
change_type: ModificationType.MODIFY
diff: @@ -3,6 +3,7 @@
 <input type="hidden" name="a" value="saveBulkUpdatePopup">
 <input type="hidden" name="view_id" value="{$view_id}">
 <input type="hidden" name="ids" value="{$ids}">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 
 <fieldset>
 	<legend>{'common.bulk_update.with'|devblocks_translate|capitalize}</legend>

programming_language: HTML
filename: peek.tpl
change_type: ModificationType.MODIFY
diff: @@ -4,6 +4,7 @@
 <input type="hidden" name="id" value="{$model->id}">
 <input type="hidden" name="view_id" value="{$view_id}">
 <input type="hidden" name="do_delete" value="0">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 
 <fieldset class="peek">
 	<legend>{'common.properties'|devblocks_translate|capitalize}</legend>

programming_language: HTML
filename: view.tpl
change_type: ModificationType.MODIFY
diff: @@ -28,6 +28,8 @@
 <input type="hidden" name="c" value="example.objects">
 <input type="hidden" name="a" value="">
 <input type="hidden" name="explore_from" value="0">
+<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
+
 <table cellpadding="1" cellspacing="0" border="0" width="100%" class="worklistBody">
 
 	{* Column Headers *}

programming_language: HTML
filename: example.tpl
change_type: ModificationType.MODIFY
diff: @@ -2,6 +2,7 @@
 	<legend>{'example.report'|devblocks_translate|capitalize}</legend>
 
 	<form id="frmExampleReport" action="{devblocks_url}c=pages&page={$page->id}-{$page->name|devblocks_permalink}&report=example.report{/devblocks_url}" method="POST">
+		<input type="hidden" name="_csrf_token" value="{$session.csrf_token}">
 		&nbsp; 
 		Tickets created between: 
 		<input type="text" name="date_from" size="24" value="{$date_from}">

programming_language: HTML
filename: Engine.php
change_type: ModificationType.MODIFY
diff: @@ -574,7 +574,11 @@ abstract class DevblocksEngine {
 				break;
 		}
 
-		$request = new DevblocksHttpRequest($parts,$queryArgs);
+		$method = strtoupper(@$_SERVER['REQUEST_METHOD']);
+		
+		$request = new DevblocksHttpRequest($parts,$queryArgs,$method);
+		$request->csrf_token = isset($_SERVER['HTTP_X_CSRF_TOKEN']) ? $_SERVER['HTTP_X_CSRF_TOKEN'] : @$_REQUEST['_csrf_token'];
+		
 		DevblocksPlatform::setHttpRequest($request);
 
 		return $request;
@@ -588,6 +592,28 @@ abstract class DevblocksEngine {
 	 */
 	static function processRequest(DevblocksHttpRequest $request, $is_ajax=false) {
 		$path = $request->path;
+		
+		// Security: CSRF
+		
+		// If we are running a controller action...
+		if(isset($_REQUEST['c']) || isset($_REQUEST['a'])) {
+			
+			// ...and we're not in DEVELOPMENT_MODE
+			if(!DEVELOPMENT_MODE_ALLOW_CSRF) {
+			
+				// ...and the CSRF token is invalid for this session, freak out
+				if(!isset($_SESSION['csrf_token']) || $_SESSION['csrf_token'] != $request->csrf_token) {
+					header("Status: 403");
+					@$referer = $_SERVER['HTTP_REFERER'];
+					@$remote_addr = $_SERVER['REMOTE_ADDR'];
+					
+					error_log(sprintf("[Cerb/Security] Possible CSRF attack from IP %s using referrer %s", $remote_addr, $referer), E_USER_WARNING);
+					die("Access denied");
+				}
+			}
+		}
+
+		// Controllers
 
 		$controller_uri = array_shift($path);
 

programming_language: PHP
filename: Extension.php
change_type: ModificationType.MODIFY
diff: @@ -2034,11 +2034,15 @@ interface DevblocksHttpRequestHandler {
 };
 
 class DevblocksHttpRequest extends DevblocksHttpIO {
+	public $method = null;
+	public $csrf_token = null;
+	
 	/**
 	 * @param array $path
 	 */
-	function __construct($path, $query=array()) {
+	function __construct($path, $query=array(), $method=null) {
 		parent::__construct($path, $query);
+		$this->method = $method;
 	}
 };
 

programming_language: PHP
filename: template.php
change_type: ModificationType.MODIFY
diff: @@ -87,6 +87,11 @@ class _DevblocksTemplateManager {
 		
 		$contents = $url->write($content, !empty($params['full']) ? true : false);
 		
+		$is_ajax = substr($content, 0, 9) == 'ajax.php?';
+		
+		if($is_ajax)
+			$contents .= '&_csrf_token=' . $_SESSION['csrf_token'];
+		
 		if (!empty($params['assign'])) {
 			$smarty->assign($params['assign'], $contents);
 		} else {

programming_language: PHP
filename: framework.defaults.php
change_type: ModificationType.MODIFY
diff: @@ -68,6 +68,9 @@ if(!defined('DEVELOPMENT_MODE'))
 if(!defined('DEVELOPMENT_MODE_QUERIES'))
 	define('DEVELOPMENT_MODE_QUERIES', false);
 
+if(!defined('DEVELOPMENT_MODE_ALLOW_CSRF'))
+	define('DEVELOPMENT_MODE_ALLOW_CSRF', false);
+
 // ----
 
 @ini_set('session.gc_maxlifetime','86400');

programming_language: PHP
filename: devblocks.js
change_type: ModificationType.MODIFY
diff: @@ -240,9 +240,9 @@ function hideLoadingPanel() {
 }
 
 function genericAjaxPopupFind($sel) {
-	$devblocksPopups = $('#devblocksPopups');
-	$data = $devblocksPopups.data();
-	$element = $($sel).closest('DIV.devblocks-popup');
+	var $devblocksPopups = $('#devblocksPopups');
+	var $data = $devblocksPopups.data();
+	var $element = $($sel).closest('DIV.devblocks-popup');
 	for($key in $data) {
 		if($element.attr('id') == $data[$key].attr('id'))
 			return $data[$key];
@@ -256,7 +256,7 @@ function genericAjaxPopupFetch($layer) {
 }
 
 function genericAjaxPopupClose($layer, $event) {
-	$popup = genericAjaxPopupFetch($layer);
+	var $popup = genericAjaxPopupFetch($layer);
 	if(null != $popup) {
 		try {
 			if(null != $event)
@@ -273,7 +273,7 @@ function genericAjaxPopupClose($layer, $event) {
 }
 
 function genericAjaxPopupDestroy($layer) {
-	$popup = genericAjaxPopupFetch($layer);
+	var $popup = genericAjaxPopupFetch($layer);
 	if(null != $popup) {
 		genericAjaxPopupClose($layer);
 		try {
@@ -476,6 +476,11 @@ function genericAjaxGet(divRef,args,cb,options) {
 	options.cache = false;
 	options.success = cb;
 	
+	if(null == options.headers)
+		options.headers = {};
+		
+	options.headers['X-CSRF-Token'] = $('meta[name="_csrf_token"]').attr('content');
+	
 	$.ajax(options);
 }
 
@@ -523,6 +528,11 @@ function genericAjaxPost(formRef,divRef,args,cb,options) {
 	options.cache = false;
 	options.success = cb;
 	
+	if(null == options.headers)
+		options.headers = {};
+		
+	options.headers['X-CSRF-Token'] = $('meta[name="_csrf_token"]').attr('content');
+	
 	$.ajax(options);
 }
 

programming_language: JavaScript