<?php

require_once('include/admin.inc.php');

auth_redirect(); // Require logged in user to access this page.

check_nonce('new-scratchpad');

$dbConnection->executeUpdate('INSERT INTO scratchpad (contributor, message) VALUES (?, ?)', array($currentuser->id, $_REQUEST['message']));

adminlog("User posted to scratchpad.", MTS_SCRATCH, MTA_INSERT);
_redirect( ADMIN_PATH . '/index.php' );

?>
