SproutCMS

This is the code documentation for the SproutCMS project

class Csrf

Protection against Cross Site Request Forgery (CSRF) attacks

Source code (96 results)

/sprout/Controllers/Admin/CategoryAdminController.php   Highlighted file source

Line 23: use Sprout\Helpers\Csrf;
Line 435: Csrf::checkOrDie();
Line 496: Csrf::checkOrDie();
Line 524: if (!Csrf::check()) die('Bad token');
Line 539: if (!Csrf::check()) die('Bad token');

/sprout/Controllers/Admin/CategoryAdminController.php   Highlighted file source

Line 23: use Sprout\Helpers\Csrf;
Line 435: Csrf::checkOrDie();
Line 496: Csrf::checkOrDie();
Line 524: if (!Csrf::check()) die('Bad token');
Line 539: if (!Csrf::check()) die('Bad token');

/sprout/Controllers/Admin/CronJobAdminController.php   Highlighted file source

Line 19: use Sprout\Helpers\Csrf;
Line 136: Csrf::checkOrDie();

/sprout/Controllers/Admin/CronJobAdminController.php   Highlighted file source

Line 19: use Sprout\Helpers\Csrf;
Line 136: Csrf::checkOrDie();

/sprout/Controllers/Admin/FileAdminController.php   Highlighted file source

Line 30: use Sprout\Helpers\Csrf;
Line 384: Csrf::checkOrDie();
Line 571: Csrf::checkOrDie();
Line 1194: Csrf::checkOrDie();
Line 1488: $out .= Csrf::token();
Line 1506: Csrf::checkOrDie();

/sprout/Controllers/Admin/FileAdminController.php   Highlighted file source

Line 30: use Sprout\Helpers\Csrf;
Line 384: Csrf::checkOrDie();
Line 571: Csrf::checkOrDie();
Line 1194: Csrf::checkOrDie();
Line 1488: $out .= Csrf::token();
Line 1506: Csrf::checkOrDie();

/sprout/Controllers/Admin/HasCategoriesAdminController.php   Highlighted file source

Line 25: use Sprout\Helpers\Csrf;
Line 876: Csrf::checkOrDie();

/sprout/Controllers/Admin/HasCategoriesAdminController.php   Highlighted file source

Line 25: use Sprout\Helpers\Csrf;
Line 876: Csrf::checkOrDie();

/sprout/Controllers/Admin/ListAdminController.php   Highlighted file source

Line 19: use Sprout\Helpers\Csrf;
Line 138: Csrf::checkOrDie();

/sprout/Controllers/Admin/ListAdminController.php   Highlighted file source

Line 19: use Sprout\Helpers\Csrf;
Line 138: Csrf::checkOrDie();

/sprout/Controllers/Admin/ManagedAdminController.php   Highlighted file source

Line 27: use Sprout\Helpers\Csrf;
Line 1813: Csrf::checkOrDie();
Line 1859: Csrf::checkOrDie();

/sprout/Controllers/Admin/ManagedAdminController.php   Highlighted file source

Line 27: use Sprout\Helpers\Csrf;
Line 1813: Csrf::checkOrDie();
Line 1859: Csrf::checkOrDie();

/sprout/Controllers/Admin/MySettingsAdminController.php   Highlighted file source

Line 19: use Sprout\Helpers\Csrf;
Line 81: Csrf::checkOrDie();

/sprout/Controllers/Admin/MySettingsAdminController.php   Highlighted file source

Line 19: use Sprout\Helpers\Csrf;
Line 81: Csrf::checkOrDie();

/sprout/Controllers/Admin/PageAdminController.php   Highlighted file source

Line 35: use Sprout\Helpers\Csrf;
Line 476: Csrf::checkOrDie();
Line 1836: Csrf::checkOrDie();
Line 2522: Csrf::checkOrDie();

/sprout/Controllers/Admin/PageAdminController.php   Highlighted file source

Line 35: use Sprout\Helpers\Csrf;
Line 476: Csrf::checkOrDie();
Line 1836: Csrf::checkOrDie();
Line 2522: Csrf::checkOrDie();

/sprout/Controllers/Admin/PerRecordPermissionAdminController.php   Highlighted file source

Line 22: use Sprout\Helpers\Csrf;
Line 130: Csrf::checkOrDie();
Line 201: $out .= Csrf::token();
Line 236: Csrf::checkOrDie();

/sprout/Controllers/Admin/PerRecordPermissionAdminController.php   Highlighted file source

Line 22: use Sprout\Helpers\Csrf;
Line 130: Csrf::checkOrDie();
Line 201: $out .= Csrf::token();
Line 236: Csrf::checkOrDie();

/sprout/Controllers/Admin/TreeAdminController.php   Highlighted file source

Line 20: use Sprout\Helpers\Csrf;
Line 305: Csrf::checkOrDie();
Line 376: Csrf::checkOrDie();

/sprout/Controllers/Admin/TreeAdminController.php   Highlighted file source

Line 20: use Sprout\Helpers\Csrf;
Line 305: Csrf::checkOrDie();
Line 376: Csrf::checkOrDie();

/sprout/Controllers/Admin/WorkerJobAdminController.php   Highlighted file source

Line 20: use Sprout\Helpers\Csrf;
Line 123: Csrf::checkOrDie();

/sprout/Controllers/Admin/WorkerJobAdminController.php   Highlighted file source

Line 20: use Sprout\Helpers\Csrf;
Line 123: Csrf::checkOrDie();

/sprout/Controllers/AdminAjaxController.php   Highlighted file source

Line 25: use Sprout\Helpers\Csrf;
Line 271: Csrf::checkOrDie();

/sprout/Controllers/AdminAjaxController.php   Highlighted file source

Line 25: use Sprout\Helpers\Csrf;
Line 271: Csrf::checkOrDie();

/sprout/Controllers/AdminController.php   Highlighted file source

Line 39: use Sprout\Helpers\Csrf;
Line 180: Csrf::checkOrDie();
Line 582: Csrf::checkOrDie();
Line 650: Csrf::checkOrDie();
Line 755: Csrf::checkOrDie();
Line 1089: echo Csrf::token();
Line 1110: $content .= Csrf::token();
Line 1177: Csrf::checkOrDie();
Line 1288: $content .= Csrf::token();
Line 1362: Csrf::checkOrDie();
Line 1453: $content .= Csrf::token();
Line 1492: Csrf::checkOrDie();
Line 1604: $content .= Csrf::token();
Line 1664: Csrf::checkOrDie();
Line 1767: $out .= Csrf::token();
Line 1821: Csrf::checkOrDie();
Line 1969: Csrf::checkOrDie();
Line 2080: 'edit_token' => Csrf::getTokenValue(),
Line 2090: 'edit_token' => Csrf::getTokenValue(),
Line 2117: if (!Csrf::check()) {
Line 2134: Csrf::checkOrDie();

/sprout/Controllers/AdminController.php   Highlighted file source

Line 39: use Sprout\Helpers\Csrf;
Line 180: Csrf::checkOrDie();
Line 582: Csrf::checkOrDie();
Line 650: Csrf::checkOrDie();
Line 755: Csrf::checkOrDie();
Line 1089: echo Csrf::token();
Line 1110: $content .= Csrf::token();
Line 1177: Csrf::checkOrDie();
Line 1288: $content .= Csrf::token();
Line 1362: Csrf::checkOrDie();
Line 1453: $content .= Csrf::token();
Line 1492: Csrf::checkOrDie();
Line 1604: $content .= Csrf::token();
Line 1664: Csrf::checkOrDie();
Line 1767: $out .= Csrf::token();
Line 1821: Csrf::checkOrDie();
Line 1969: Csrf::checkOrDie();
Line 2080: 'edit_token' => Csrf::getTokenValue(),
Line 2090: 'edit_token' => Csrf::getTokenValue(),
Line 2117: if (!Csrf::check()) {
Line 2134: Csrf::checkOrDie();

/sprout/Controllers/DbToolsController.php   Highlighted file source

Line 36: use Sprout\Helpers\Csrf;
Line 578: Csrf::checkOrDie();
Line 708: Csrf::checkOrDie();
Line 778: echo Csrf::token();
Line 790: Csrf::checkOrDie();
Line 844: echo Csrf::token();
Line 859: Csrf::checkOrDie();
Line 1074: echo Csrf::token();
Line 1166: Csrf::checkOrDie();
Line 1240: echo Csrf::token();
Line 1254: Csrf::checkOrDie();
Line 1386: echo Csrf::token();
Line 1399: Csrf::checkOrDie();
Line 2764: $out .= Csrf::token();
Line 2791: Csrf::checkOrDie();
Line 2885: Csrf::checkOrDie();

/sprout/Controllers/DbToolsController.php   Highlighted file source

Line 36: use Sprout\Helpers\Csrf;
Line 578: Csrf::checkOrDie();
Line 708: Csrf::checkOrDie();
Line 778: echo Csrf::token();
Line 790: Csrf::checkOrDie();
Line 844: echo Csrf::token();
Line 859: Csrf::checkOrDie();
Line 1074: echo Csrf::token();
Line 1166: Csrf::checkOrDie();
Line 1240: echo Csrf::token();
Line 1254: Csrf::checkOrDie();
Line 1386: echo Csrf::token();
Line 1399: Csrf::checkOrDie();
Line 2764: $out .= Csrf::token();
Line 2791: Csrf::checkOrDie();
Line 2885: Csrf::checkOrDie();

/sprout/Controllers/EmailShareController.php   Highlighted file source

Line 21: use Sprout\Helpers\Csrf;
Line 131: Csrf::checkOrDie();

/sprout/Controllers/EmailShareController.php   Highlighted file source

Line 21: use Sprout\Helpers\Csrf;
Line 131: Csrf::checkOrDie();

/sprout/Controllers/PageController.php   Highlighted file source

Line 24: use Sprout\Helpers\Csrf;
Line 491: Csrf::checkOrDie();

/sprout/Controllers/PageController.php   Highlighted file source

Line 24: use Sprout\Helpers\Csrf;
Line 491: Csrf::checkOrDie();

/sprout/Helpers/Csrf.php   Highlighted file source

Line 18: * Protection against Cross Site Request Forgery (CSRF) attacks
Line 20: class Csrf
Line 23: * Initialises the PHP session and, if not present, generates a CSRF secret for the session
Line 31: if (!isset($_SESSION['csrf_token'])) {
Line 32: $_SESSION['csrf_token'] = Security::randStr(32);
Line 37: * Generates a CSRF hidden form field
Line 45: return '<input type="hidden" name="edit_token" value="' . Enc::html($_SESSION['csrf_token']) . '">';
Line 50: * Gets the CSRF token in the postdata.
Line 59: if (empty($_POST['edit_token']) or empty($_SESSION['csrf_token'])) {
Line 63: if ($_POST['edit_token'] !== $_SESSION['csrf_token']) {
Line 72: * Checks the CSRF token
Line 87: * This is intended for use on JavaScript requests that require CSRF protection.
Line 91: * @return string The CSRF secret
Line 97: return $_SESSION['csrf_token'];

/sprout/Helpers/Csrf.php   Highlighted file source

Line 18: * Protection against Cross Site Request Forgery (CSRF) attacks
Line 20: class Csrf
Line 23: * Initialises the PHP session and, if not present, generates a CSRF secret for the session
Line 31: if (!isset($_SESSION['csrf_token'])) {
Line 32: $_SESSION['csrf_token'] = Security::randStr(32);
Line 37: * Generates a CSRF hidden form field
Line 45: return '<input type="hidden" name="edit_token" value="' . Enc::html($_SESSION['csrf_token']) . '">';
Line 50: * Gets the CSRF token in the postdata.
Line 59: if (empty($_POST['edit_token']) or empty($_SESSION['csrf_token'])) {
Line 63: if ($_POST['edit_token'] !== $_SESSION['csrf_token']) {
Line 72: * Checks the CSRF token
Line 87: * This is intended for use on JavaScript requests that require CSRF protection.
Line 91: * @return string The CSRF secret
Line 97: return $_SESSION['csrf_token'];

/sprout/views/admin/action_log_edit.php   Highlighted file source

Line 17: use Sprout\Helpers\Csrf;
Line 79: <?php echo Csrf::token(); ?>

/sprout/views/admin/action_log_edit.php   Highlighted file source

Line 17: use Sprout\Helpers\Csrf;
Line 79: <?php echo Csrf::token(); ?>

/sprout/views/admin/categories_itemlist_outer.php   Highlighted file source

Line 16: use Sprout\Helpers\Csrf;
Line 27: <?= Csrf::token(); ?>

/sprout/views/admin/categories_itemlist_outer.php   Highlighted file source

Line 16: use Sprout\Helpers\Csrf;
Line 27: <?= Csrf::token(); ?>

/sprout/views/admin/categories_multi_categorise.php   Highlighted file source

Line 17: use Sprout\Helpers\Csrf;
Line 31: <?= Csrf::token(); ?>

/sprout/views/admin/categories_multi_categorise.php   Highlighted file source

Line 17: use Sprout\Helpers\Csrf;
Line 31: <?= Csrf::token(); ?>

/sprout/views/admin/categories_multi_delete.php   Highlighted file source

Line 16: use Sprout\Helpers\Csrf;
Line 20: <?= Csrf::token(); ?>

/sprout/views/admin/categories_multi_delete.php   Highlighted file source

Line 16: use Sprout\Helpers\Csrf;
Line 20: <?= Csrf::token(); ?>

/sprout/views/admin/categories_reorder.php   Highlighted file source

Line 18: use Sprout\Helpers\Csrf;
Line 40: <?= Csrf::token(); ?>

/sprout/views/admin/categories_reorder.php   Highlighted file source

Line 18: use Sprout\Helpers\Csrf;
Line 40: <?= Csrf::token(); ?>

/sprout/views/admin/cron_job_manual_run.php   Highlighted file source

Line 2: use Sprout\Helpers\Csrf;
Line 14: <?= Csrf::token(); ?>

/sprout/views/admin/cron_job_manual_run.php   Highlighted file source

Line 2: use Sprout\Helpers\Csrf;
Line 14: <?= Csrf::token(); ?>

/sprout/views/admin/file_add_dragdrop_form.php   Highlighted file source

Line 16: use Sprout\Helpers\Csrf;
Line 47: <?= Csrf::token(); ?>

/sprout/views/admin/file_add_dragdrop_form.php   Highlighted file source

Line 16: use Sprout\Helpers\Csrf;
Line 47: <?= Csrf::token(); ?>

/sprout/views/admin/file_cleanup_invalid.php   Highlighted file source

Line 17: use Sprout\Helpers\Csrf;
Line 30: <?php echo Csrf::token(); ?>

/sprout/views/admin/file_cleanup_invalid.php   Highlighted file source

Line 17: use Sprout\Helpers\Csrf;
Line 30: <?php echo Csrf::token(); ?>

/sprout/views/admin/file_contents_thumbs.php   Highlighted file source

Line 16: use Sprout\Helpers\Csrf;
Line 30: <?= Csrf::token(); ?>

/sprout/views/admin/file_contents_thumbs.php   Highlighted file source

Line 16: use Sprout\Helpers\Csrf;
Line 30: <?= Csrf::token(); ?>

/sprout/views/admin/file_selector_popup.php   Highlighted file source

Line 16: use Sprout\Helpers\Csrf;
Line 87: <?= Csrf::token(); ?>

/sprout/views/admin/file_selector_popup.php   Highlighted file source

Line 16: use Sprout\Helpers\Csrf;
Line 87: <?= Csrf::token(); ?>

/sprout/views/admin/generic_export.php   Highlighted file source

Line 16: use Sprout\Helpers\Csrf;
Line 32: <?php echo Csrf::token(); ?>

/sprout/views/admin/generic_export.php   Highlighted file source

Line 16: use Sprout\Helpers\Csrf;
Line 32: <?php echo Csrf::token(); ?>

/sprout/views/admin/generic_import.php   Highlighted file source

Line 17: use Sprout\Helpers\Csrf;
Line 28: <?php echo Csrf::token(); ?>

/sprout/views/admin/generic_import.php   Highlighted file source

Line 17: use Sprout\Helpers\Csrf;
Line 28: <?php echo Csrf::token(); ?>

/sprout/views/admin/generic_itemlist_outer.php   Highlighted file source

Line 17: use Sprout\Helpers\Csrf;
Line 27: <?= Csrf::token(); ?>

/sprout/views/admin/generic_itemlist_outer.php   Highlighted file source

Line 17: use Sprout\Helpers\Csrf;
Line 27: <?= Csrf::token(); ?>

/sprout/views/admin/import_upload.php   Highlighted file source

Line 16: use Sprout\Helpers\Csrf;
Line 28: <?php echo Csrf::token(); ?>

/sprout/views/admin/import_upload.php   Highlighted file source

Line 16: use Sprout\Helpers\Csrf;
Line 28: <?php echo Csrf::token(); ?>

/sprout/views/admin/link_checker.php   Highlighted file source

Line 16: use Sprout\Helpers\Csrf;
Line 36: <?= Csrf::token(); ?>

/sprout/views/admin/link_checker.php   Highlighted file source

Line 16: use Sprout\Helpers\Csrf;
Line 36: <?= Csrf::token(); ?>

/sprout/views/admin/login_form.php   Highlighted file source

Line 17: use Sprout\Helpers\Csrf;
Line 30: <?= Csrf::token(); ?>

/sprout/views/admin/login_form.php   Highlighted file source

Line 17: use Sprout\Helpers\Csrf;
Line 30: <?= Csrf::token(); ?>

/sprout/views/admin/main_layout.php   Highlighted file source

Line 19: use Sprout\Helpers\Csrf;
Line 63: // Allow AJAX to use the CSRF token
Line 64: echo '<script>var csrfToken = "', Csrf::getTokenValue(), '";</script>', "\n";

/sprout/views/admin/main_layout.php   Highlighted file source

Line 19: use Sprout\Helpers\Csrf;
Line 63: // Allow AJAX to use the CSRF token
Line 64: echo '<script>var csrfToken = "', Csrf::getTokenValue(), '";</script>', "\n";

/sprout/views/admin/my_settings/details.php   Highlighted file source

Line 18: use Sprout\Helpers\Csrf;
Line 23: <?= Csrf::token(); ?>

/sprout/views/admin/my_settings/details.php   Highlighted file source

Line 18: use Sprout\Helpers\Csrf;
Line 23: <?= Csrf::token(); ?>

/sprout/views/admin/page_import_options.php   Highlighted file source

Line 16: use Sprout\Helpers\Csrf;
Line 31: <?php echo Csrf::token(); ?>

/sprout/views/admin/page_import_options.php   Highlighted file source

Line 16: use Sprout\Helpers\Csrf;
Line 31: <?php echo Csrf::token(); ?>

/sprout/views/admin/page_import_upload.php   Highlighted file source

Line 13: use Sprout\Helpers\Csrf;
Line 19: <?php echo Csrf::token(); ?>

/sprout/views/admin/page_import_upload.php   Highlighted file source

Line 13: use Sprout\Helpers\Csrf;
Line 19: <?php echo Csrf::token(); ?>

/sprout/views/admin/page_menu_groups.php   Highlighted file source

Line 17: use Sprout\Helpers\Csrf;
Line 38: <?= Csrf::token(); ?>

/sprout/views/admin/page_menu_groups.php   Highlighted file source

Line 17: use Sprout\Helpers\Csrf;
Line 38: <?= Csrf::token(); ?>

/sprout/views/admin/per_record_perms.php   Highlighted file source

Line 16: use Sprout\Helpers\Csrf;
Line 24: <?php echo Csrf::token(); ?>

/sprout/views/admin/per_record_perms.php   Highlighted file source

Line 16: use Sprout\Helpers\Csrf;
Line 24: <?php echo Csrf::token(); ?>

/sprout/views/admin/tree_organise.php   Highlighted file source

Line 14: use Sprout\Helpers\Csrf;
Line 26: <?php echo Csrf::token(); ?>

/sprout/views/admin/tree_organise.php   Highlighted file source

Line 14: use Sprout\Helpers\Csrf;
Line 26: <?php echo Csrf::token(); ?>

/sprout/views/admin/worker_job_manual_run.php   Highlighted file source

Line 2: use Sprout\Helpers\Csrf;
Line 14: <?= Csrf::token(); ?>

/sprout/views/admin/worker_job_manual_run.php   Highlighted file source

Line 2: use Sprout\Helpers\Csrf;
Line 14: <?= Csrf::token(); ?>

/sprout/views/dbtools/import_xml.php   Highlighted file source

Line 2: use Sprout\Helpers\Csrf;
Line 10: <?php echo Csrf::token(); ?>

/sprout/views/dbtools/import_xml.php   Highlighted file source

Line 2: use Sprout\Helpers\Csrf;
Line 10: <?php echo Csrf::token(); ?>

/sprout/views/dbtools/sql.php   Highlighted file source

Line 2: use Sprout\Helpers\Csrf;
Line 8: <?= Csrf::token(); ?>

/sprout/views/dbtools/sql.php   Highlighted file source

Line 2: use Sprout\Helpers\Csrf;
Line 8: <?= Csrf::token(); ?>

/sprout/views/dbtools/sql_result.php   Highlighted file source

Line 2: use Sprout\Helpers\Csrf;
Line 29: <?= Csrf::token(); ?>

/sprout/views/dbtools/sql_result.php   Highlighted file source

Line 2: use Sprout\Helpers\Csrf;
Line 29: <?= Csrf::token(); ?>

/sprout/views/email_share_form.php   Highlighted file source

Line 18: use Sprout\Helpers\Csrf;
Line 29: <?= Csrf::token(); ?>

/sprout/views/email_share_form.php   Highlighted file source

Line 18: use Sprout\Helpers\Csrf;
Line 29: <?= Csrf::token(); ?>

/sprout/views/page_approval_form.php   Highlighted file source

Line 16: use Sprout\Helpers\Csrf;
Line 41: <?php echo Csrf::token(); ?>

/sprout/views/page_approval_form.php   Highlighted file source

Line 16: use Sprout\Helpers\Csrf;
Line 41: <?php echo Csrf::token(); ?>

/sprout/views/tinymce4/upload.php   Highlighted file source

Line 17: use Sprout\Helpers\Csrf;
Line 32: <?= Csrf::token(); ?>

/sprout/views/tinymce4/upload.php   Highlighted file source

Line 17: use Sprout\Helpers\Csrf;
Line 32: <?= Csrf::token(); ?>

A total of 308 lines in 96 files were found