first commit
This commit is contained in:
@@ -0,0 +1,125 @@
|
||||
<?php
|
||||
|
||||
// +----------------------------------------------------------------------+
|
||||
// | OpenConf |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Copyright (c) 2002-2020 Zakon Group LLC. All Rights Reserved. |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | This source file is subject to the OpenConf License, available on |
|
||||
// | the OpenConf web site: www.OpenConf.com |
|
||||
// +----------------------------------------------------------------------+
|
||||
|
||||
require_once "../include.php";
|
||||
|
||||
printHeader(oc_('Email Chair'), 3);
|
||||
|
||||
if (isset($_POST['ocaction']) && ($_POST['ocaction'] == "Send Email")) {
|
||||
$err = '';
|
||||
$message = '';
|
||||
$hdr = $OC_configAR['OC_mailHeaders']; // keep before validate hook
|
||||
if (isset($_POST['email']) && !empty($_POST['email'])) {
|
||||
$err .= '<li>' . oc_('Fields not correctly filled out') . '</li>';
|
||||
}
|
||||
if (!isset($_POST['name']) || !preg_match("/\p{L}/u", $_POST['name']) || preg_match("/[\r\n]/", $_POST['name'])) {
|
||||
$err .= '<li>' . sprintf(oc_('%s field empty or invalid'), oc_('Name')) . '</li>';
|
||||
}
|
||||
if (!isset($_POST['liame']) || !validEmail(($_POST['liame'] = trim($_POST['liame']))) || preg_match("/[\r\n]/", $_POST['liame'])) {
|
||||
$err .= '<li>' . sprintf(oc_('%s field empty or invalid'), oc_('Email')) . '</li>';
|
||||
}
|
||||
if (($OC_configAR['OC_privacy_display'] > 0) && (!isset($_POST['consent']) || ($_POST['consent'] != '1'))) {
|
||||
$err .= '<li>' . sprintf(oc_('%s field is required'), oc_('Consent')) . '</li>';
|
||||
}
|
||||
if (!isset($_POST['subject']) || !preg_match("/\p{L}/u", $_POST['subject']) || preg_match("/[\r\n]/", $_POST['subject'])) {
|
||||
$err .= '<li>' . sprintf(oc_('%s field empty or invalid'), oc_('Subject')) . '</li>';
|
||||
}
|
||||
if (!isset($_POST['message']) || !preg_match("/\p{L}/u", $_POST['message'])) {
|
||||
$err .= '<li>' . sprintf(oc_('%s field empty or invalid'), oc_('Message')) . '</li>';
|
||||
} else {
|
||||
$message = $_POST['message'];
|
||||
}
|
||||
|
||||
if (oc_hookSet('author-contact-validate')) {
|
||||
foreach ($GLOBALS['OC_hooksAR']['author-contact-validate'] as $hook) {
|
||||
require_once $hook;
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($err)) {
|
||||
// add who it's from to body of message in case of an issue with reply headers
|
||||
$message .= "\n\nFrom: " . $_POST['name'] . ' <' . $_POST['liame'] . ">\n";
|
||||
|
||||
// setup Reply-To
|
||||
if (empty($hdr)) {
|
||||
$hdr = 'From: "' . preg_replace('/"/', '', $_POST['name']) . '" <' . $GLOBALS['OC_configAR']['OC_pcemail'] . '>' . "\r\n" . // pcemail used to avoid email validation issues
|
||||
'Reply-To: ' . $_POST['liame'] . "\r\n";
|
||||
} else {
|
||||
if (preg_match("/^(.*Reply-To:\s?)\S+(.*)$/s", $hdr, $matches)) {
|
||||
$hdr = $matches[1] . $_POST['liame'] . $matches[2];
|
||||
} elseif (preg_match("/[\r\n]$/s", $hdr)) {
|
||||
$hdr .= 'Reply-To: ' . $_POST['liame'] . "\r\n";
|
||||
} else {
|
||||
$hdr .= "\r\n" . 'Reply-To: ' . $_POST['liame'] . "\r\n";
|
||||
}
|
||||
}
|
||||
if (! oc_mail($OC_configAR['OC_pcemail'], $_POST['subject'], $message, $hdr)) {
|
||||
err(oc_('An error occurred sending out the email.'));
|
||||
} else {
|
||||
print '<div class="note2">' . oc_('Your message has been sent.') . '</div>';
|
||||
printFooter();
|
||||
exit;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
print '
|
||||
<style type="text/css">
|
||||
<!--
|
||||
#recaptcha_response_field { background-color: #eee; }
|
||||
-->
|
||||
</style>
|
||||
<form method="post" action="' . $_SERVER['PHP_SELF'] . '">
|
||||
<input type="hidden" name="ocaction" value="Send Email" />
|
||||
<input type="hidden" name="email" value="" />
|
||||
<table border="0" style="width: 500px; margin: 0 auto" cellspacing="4">
|
||||
';
|
||||
|
||||
if (!empty($err)) {
|
||||
print '<tr><td> </td><td class="warn">' . oc_('Please correct the following:') . '<ul>' . $err . '</ul></br>';
|
||||
}
|
||||
|
||||
print '
|
||||
<tr><td><strong><label for="name">' . oc_('Name') . ':</label></strong></td><td><input size="60" name="name" id="name" class="ocinput" style="width: 400px" value="' . safeHTMLstr(varValue('name', $_POST)) . '"></td></tr>
|
||||
<tr><td><strong><label for="liame">' .
|
||||
//T: Email Address
|
||||
oc_('Email') . ':</label></strong></td><td><input size="60" name="liame" id="liame" class="ocinput" style="width: 400px" value="' . safeHTMLstr(varValue('liame', $_POST)) . '"></td></tr>
|
||||
';
|
||||
|
||||
if ($OC_configAR['OC_privacy_display'] > 0) {
|
||||
print '<tr><td> </td><td><label><input name="consent" id="consent" type="checkbox" value="1" ' . ((isset($_POST['consent']) && ($_POST['consent'] == '1')) ? 'checked ' : '') . '/> ' . oc_('I consent to the collection of my personal information and to receive emails about the message below.') . ' (<a href="../privacy_policy.php" target="_blank">' . oc_('Privacy Policy') . '</a>)</label></td></tr>';
|
||||
}
|
||||
|
||||
print '
|
||||
<tr><td><strong><label for="subject">' . oc_('Subject') . ':</label></strong></td><td><input size="60" name="subject" id="subject" class="ocinput" style="width: 400px" value="' .
|
||||
//T: Email Subject Line
|
||||
safeHTMLstr(varValue('subject', $_POST)) . '"></td></tr>
|
||||
<tr><td valign="top"><strong><label for="message">' . oc_('Message') . ':</label></strong></td><td><textarea rows="5" cols="60" class="ocinput" style="width: 400px" name="message" id="message">' .
|
||||
//T: Email Message
|
||||
safeHTMLstr(varValue('message', $_POST)) . '</textarea></td></tr>
|
||||
';
|
||||
|
||||
if (oc_hookSet('author-contact-fields')) {
|
||||
foreach ($GLOBALS['OC_hooksAR']['author-contact-fields'] as $hook) {
|
||||
require_once $hook;
|
||||
}
|
||||
}
|
||||
|
||||
print '
|
||||
<tr><th align="center" colspan=2><br><input type="submit" name="submit" class="submit" value="' . oc_('Send Email') . '"></th></tr>
|
||||
</table>
|
||||
</form>
|
||||
<p>
|
||||
';
|
||||
|
||||
printFooter();
|
||||
|
||||
?>
|
||||
+407
@@ -0,0 +1,407 @@
|
||||
<?php
|
||||
|
||||
// +----------------------------------------------------------------------+
|
||||
// | OpenConf |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Copyright (c) 2002-2020 Zakon Group LLC. All Rights Reserved. |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | This source file is subject to the OpenConf License, available on |
|
||||
// | the OpenConf web site: www.OpenConf.com |
|
||||
// +----------------------------------------------------------------------+
|
||||
|
||||
$OC_subEdit = true; // flag for designating submission editing
|
||||
|
||||
require_once "../include.php";
|
||||
|
||||
oc_sendNoCacheHeaders();
|
||||
|
||||
$editTimeout = 2; // hours
|
||||
|
||||
// Cancel edit
|
||||
if (isset($_GET['ocaction']) && ($_GET['ocaction'] == 'cancel')
|
||||
&& isset($_GET['pid']) && ctype_digit($_GET['pid'])
|
||||
&& isset($_GET['edittoken']) && preg_match("/^\w+$/", $_GET['edittoken'])
|
||||
) {
|
||||
ocsql_query("UPDATE `" . OCC_TABLE_PAPER . "` SET `edittoken`=NULL, `edittime`=NULL WHERE `paperid`=" . (int) $_GET['pid'] . " AND `edittoken`='" . safeSQLstr($_GET['edittoken']) . "' LIMIT 1");
|
||||
header("Location: ../");
|
||||
exit;
|
||||
}
|
||||
|
||||
if (OCC_CHAIR_PWD_TRUMPS && isset($_REQUEST['c']) && ($_REQUEST['c'] == 1)) {
|
||||
$hdrfn = 1;
|
||||
beginChairSession();
|
||||
$chair = true;
|
||||
} else {
|
||||
$hdrfn = 3;
|
||||
$chair = false;
|
||||
}
|
||||
|
||||
$hdr = oc_('Edit Submission');
|
||||
|
||||
$showPaper = false; // View (vs Edit) Submission if true
|
||||
|
||||
// Edit still allowed?
|
||||
if (! $chair && ! $OC_statusAR['OC_edit_open']) {
|
||||
if ($OC_configAR['OC_authorViewSubIfEditClosed']) {
|
||||
$showPaper = true;
|
||||
$hdr = oc_('View Submission'); // also used for auth form button
|
||||
} else {
|
||||
warn(oc_('Submission edits are no longer available.'), $hdr, $hdrfn);
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
printHeader($hdr, $hdrfn);
|
||||
|
||||
// Is this a post?
|
||||
if (isset($_POST['ocaction'])) {
|
||||
if (! isset($_POST['pid']) || ! preg_match("/^\d+$/", $_POST['pid'])) {
|
||||
warn(oc_('Submission ID is invalid'));
|
||||
}
|
||||
|
||||
if ($_POST['ocaction'] == 'Edit Submission') {
|
||||
// Check password
|
||||
if (! $chair && (! isset($_POST['passwordfld']) || empty($_POST['passwordfld']))) {
|
||||
warn(oc_('Submission ID or password entered is incorrect'));
|
||||
exit;
|
||||
}
|
||||
|
||||
// verify login and acceptance status if not chair
|
||||
if (! $chair) {
|
||||
$pq = "SELECT `" . OCC_TABLE_PAPER . "`.`password`, `" . OCC_TABLE_ACCEPTANCE . "`.`accepted` FROM `" . OCC_TABLE_PAPER . "` LEFT JOIN `" . OCC_TABLE_ACCEPTANCE . "` ON (`" . OCC_TABLE_PAPER . "`.`accepted`=`" . OCC_TABLE_ACCEPTANCE . "`.`value`) WHERE `" . OCC_TABLE_PAPER . "`.`paperid`='" . safeSQLstr($_POST['pid']) . "'";
|
||||
$pr = ocsql_query($pq) or err(oc_('Unable to retrieve submission'));
|
||||
if (ocsql_num_rows($pr) != 1) {
|
||||
warn(oc_('Submission ID or password entered is incorrect'));
|
||||
exit;
|
||||
}
|
||||
$pl = ocsql_fetch_assoc($pr);
|
||||
if (!oc_password_verify($_POST['passwordfld'], $pl['password'])) {
|
||||
warn(oc_('Submission ID or password entered is incorrect'));
|
||||
exit;
|
||||
}
|
||||
unset($_POST['passwordfld']);
|
||||
|
||||
if ( ! $showPaper ) {
|
||||
// Edit limited to accepted subs only?
|
||||
if (($OC_configAR['OC_editAcceptedOnly'] == 1) && ($pl['accepted'] != 1)) {
|
||||
if ($OC_configAR['OC_authorViewSubIfEditClosed']) {
|
||||
$showPaper = true;
|
||||
print '<p class="warn" style="text-align: center;">' . oc_('Submission edits are no longer available.') . '</p>';
|
||||
} else {
|
||||
warn(oc_('Submission edits are no longer available.'));
|
||||
exit;
|
||||
}
|
||||
} else {
|
||||
// set token
|
||||
$token = oc_idGen();
|
||||
$pr = ocsql_query("UPDATE `" . OCC_TABLE_PAPER . "` SET `edittoken`='" . safeSQLstr($token) . "', `edittime`='" . safeSQLstr(time()) . "' WHERE `paperid`=" . (int) $_POST['pid'] . " LIMIT 1") or err(oc_('Unable to edit submission') . ' (token)');
|
||||
}
|
||||
}
|
||||
|
||||
if ($showPaper) {
|
||||
$pid = $_POST['pid'];
|
||||
require_once 'view.inc';
|
||||
printFooter();
|
||||
exit;
|
||||
}
|
||||
|
||||
}
|
||||
} elseif ($_POST['ocaction'] != 'Submit Changes') {
|
||||
warn(oc_('Invalid request'));
|
||||
exit;
|
||||
}
|
||||
|
||||
if ($chair) { // display back links
|
||||
print '<p style="text-align: center"><a href="../chair/show_paper.php?pid=' . urlencode($_POST['pid']) . '">View This Submission</a> | <a href="../chair/list_papers.php">View All Submissions</a></p>';
|
||||
} elseif ($_POST['ocaction'] == 'Submit Changes') { // check token
|
||||
$pq = "SELECT `edittoken`, `edittime` FROM `" . OCC_TABLE_PAPER . "` WHERE `paperid`='" . safeSQLstr($_POST['pid']) . "'";
|
||||
$pr = ocsql_query($pq) or err(oc_('Unable to retrieve submission') . ' (tokeninfo)');
|
||||
if (ocsql_num_rows($pr) != 1) { err(oc_('Submission ID or password entered is incorrect')); }
|
||||
$pl = ocsql_fetch_assoc($pr);
|
||||
if (!isset($_POST['edittoken'])
|
||||
|| ($_POST['edittoken'] != $pl['edittoken'])
|
||||
|| ((time() - $pl['edittime']) > (60 * 60 * $editTimeout))
|
||||
) {
|
||||
warn(sprintf(oc_('There is a %1$d hour timeout for editing the submission. Please <a href="%2$s">edit submission</a> once again'), $editTimeout, $_SERVER['PHP_SELF']));
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
// Set number of author fields to display if Submit Changes, else populate $_POST with database fields
|
||||
if (isset($_POST['authornum']) && ctype_digit($_POST['authornum'])) {
|
||||
$oc_authorNum = $_POST['authornum'];
|
||||
} else {
|
||||
// get sub
|
||||
$anr = ocsql_query("SELECT * FROM `" . OCC_TABLE_PAPER . "` WHERE `paperid`=" . (int) $_POST['pid']) or err("Unable to retrieve submission information");
|
||||
if (ocsql_num_rows($anr) != 1) {
|
||||
err(oc_('Submission ID or password entered is incorrect'));
|
||||
}
|
||||
$_POST = array_merge((array)$_POST, ocsql_fetch_assoc($anr));
|
||||
|
||||
// get authors
|
||||
$authorCount = 0;
|
||||
$anr = ocsql_query("SELECT * FROM `" . OCC_TABLE_AUTHOR . "` WHERE `paperid`=" . (int) $_POST['pid'] . " ORDER BY `position`") or err(oc_('Unable to retrieve author(s) information'));
|
||||
while ($anl = ocsql_fetch_assoc($anr)) {
|
||||
foreach ($anl as $anli => $anlv) {
|
||||
if (($anli == 'paperid') || ($anli == 'position')) { continue; }
|
||||
$_POST[$anli . $anl['position']] = $anlv;
|
||||
}
|
||||
$authorCount = $anl['position']; // track highest position
|
||||
}
|
||||
|
||||
// get topics
|
||||
$anr = ocsql_query("SELECT `topicid` FROM `" . OCC_TABLE_PAPERTOPIC . "` WHERE `paperid`=" . (int) $_POST['pid']) or err(oc_('Unable to retrieve topic(s) information'));
|
||||
$_POST['topics'] = array();
|
||||
while ($anl = ocsql_fetch_assoc($anr)) {
|
||||
$_POST['topics'][] = $anl['topicid'];
|
||||
}
|
||||
|
||||
// set author num to either use min display or actual author count, whichever is greater
|
||||
$oc_authorNum = (($authorCount > $OC_configAR['OC_authorsMinDisplay']) ? $authorCount : $OC_configAR['OC_authorsMinDisplay']);
|
||||
|
||||
// set token
|
||||
if (! $chair) {
|
||||
$_POST['edittoken'] = $token;
|
||||
}
|
||||
}
|
||||
|
||||
if (oc_hookSet('author-edit-preprocess')) {
|
||||
foreach ($GLOBALS['OC_hooksAR']['author-edit-preprocess'] as $hook) {
|
||||
require_once $hook;
|
||||
}
|
||||
}
|
||||
|
||||
require_once OCC_FORM_INC_FILE;
|
||||
require_once OCC_SUBMISSION_INC_FILE;
|
||||
|
||||
// Set non-editable fields to disabled if submissions closed (and it's not Chair)
|
||||
if (! $chair && ! $OC_statusAR['OC_submissions_open']) {
|
||||
foreach ($OC_submissionFieldAR as $fid => $far) {
|
||||
if (isset($far['closeedit']) && ! $far['closeedit']) {
|
||||
$OC_submissionFieldAR[$fid]['enabled'] = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// remove consent field if already given
|
||||
if (isset($OC_submissionFieldAR['consent'])) {
|
||||
$cr = ocsql_query("SELECT `consent` FROM `" . OCC_TABLE_PAPER . "` WHERE `paperid`='" . safeSQLstr($_POST['pid']) . "'") or err('Unable to query consent status');
|
||||
$cl = ocsql_fetch_assoc($cr);
|
||||
if (!empty($cl['consent'])) {
|
||||
unset($OC_submissionFieldAR['consent']);
|
||||
foreach ($OC_submissionFieldSetAR as $fsid => $fsar) { // remove from fieldset
|
||||
if (in_array('consent', $fsar['fields'])) {
|
||||
$OC_submissionFieldSetAR[$fsid]['fields'] = array_diff($OC_submissionFieldSetAR[$fsid]['fields'], array('consent'));
|
||||
continue; // field should only be in one fieldset
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Update topic field?
|
||||
if ( isset($OC_submissionFieldAR['topics']['type']) && ($OC_submissionFieldAR['topics']['type'] == 'radio') && isset($_POST['topics']) && is_array($_POST['topics']) && isset($_POST['topics'][0]) ) {
|
||||
$_POST['topics'] = $_POST['topics'][0]; // change from array to single value
|
||||
}
|
||||
|
||||
// Update password fieldset
|
||||
$OC_submissionFieldSetAR['fs_passwords']['fieldset'] = oc_('Change Password');
|
||||
$OC_submissionFieldSetAR['fs_passwords']['note'] = oc_('Leave these fields blank if you do not want to change the password');
|
||||
$OC_submissionFieldAR['password1']['name'] = oc_('New Password');
|
||||
|
||||
// Check whether we're submitting changes
|
||||
if ($_POST['ocaction'] == "Submit Changes") {
|
||||
if ($chair && !validToken('chair')) {
|
||||
warn(oc_('Invalid submission'));
|
||||
}
|
||||
|
||||
$err = '';
|
||||
$errInc = '';
|
||||
$qfields = array(); // fields to insert into submission table
|
||||
$afields = array(); // fields to insert into authors table
|
||||
$tfields = array(); // fields to insert into topics table
|
||||
$fileUploaded = false;
|
||||
|
||||
require_once 'submission-validate.inc';
|
||||
|
||||
// process if no errors
|
||||
if (!empty($err)) {
|
||||
print '<p><span class="err">' . oc_('Please check the following:') . '<ul>' . $err . $errInc . '</ul></span><br /><hr /><br />';
|
||||
} else {
|
||||
$q = "UPDATE `" . OCC_TABLE_PAPER . "` SET `lastupdate`='" . safeSQLstr(date("Y-m-d")) . "', `edittoken`=NULL, `edittime`=NULL";
|
||||
foreach ($qfields as $qid => $qval) {
|
||||
$q .= ", `" . $qid . "`=" . $qval;
|
||||
}
|
||||
$q .= " WHERE `paperid`=" . (int) $_POST['pid'];
|
||||
$r = ocsql_query($q) or err(oc_('Unable to update submission'));
|
||||
|
||||
$q = "DELETE FROM `" . OCC_TABLE_AUTHOR . "` WHERE `paperid`=" . (int) $_POST['pid'];
|
||||
$r = ocsql_query($q) or err(oc_('Unable to update authors or topics (2)'));
|
||||
foreach ($afields as $qid => $qar) {
|
||||
$q = "INSERT INTO `" . OCC_TABLE_AUTHOR . "` SET `paperid`=" . (int) $_POST['pid'] . ", `position`=" . (int) $qid;
|
||||
foreach ($qar as $qqid => $qqval) {
|
||||
$q .= ", `" . $qqid . "`=" . $qqval;
|
||||
}
|
||||
$r = ocsql_query($q) or err(oc_('Unable to add one or more authors or topics.'));
|
||||
}
|
||||
|
||||
if (!empty($tfields)) {
|
||||
$q = "DELETE FROM `" . OCC_TABLE_PAPERTOPIC . "` WHERE `paperid`='" . safeSQLstr($_POST['pid']) . "'";
|
||||
$r = ocsql_query($q) or err(oc_('Unable to update topics'));
|
||||
$q = "INSERT INTO `" . OCC_TABLE_PAPERTOPIC . "` (`paperid`,`topicid`) VALUES";
|
||||
foreach ($tfields as $t) {
|
||||
$q .= " (" . safeSQLstr($_POST['pid']) . ",$t),";
|
||||
}
|
||||
$r = ocsql_query(rtrim($q, ',')) or err(oc_('Unable to add topics'));
|
||||
}
|
||||
|
||||
// Get and update notification template
|
||||
// ocIgnore included so poEdit picks up (DB) template translation
|
||||
//T: [:sid:] is the numeric submission ID
|
||||
$ocIgnoreSubject = oc_('Submission Update ID [:sid:]');
|
||||
$ocIgnoreBody = '[:fields:]'; // don't bother with translation
|
||||
$fields = oc_genFieldMessage($OC_submissionFieldSetAR, $OC_submissionFieldAR, $_POST);
|
||||
list($mailsubject, $mailbody) = oc_getTemplate('author-edit');
|
||||
$templateExtraAR = array(
|
||||
'sid' => $_POST['pid'],
|
||||
'fields' => (oc_('Submission ID') . ': ' . $_POST['pid'] . "\n\n" . $fields)
|
||||
);
|
||||
$mailsubject = oc_replaceVariables($mailsubject, $templateExtraAR);
|
||||
$mailbody = oc_replaceVariables($mailbody, $templateExtraAR);
|
||||
|
||||
// Set up confirmation
|
||||
$confirmmsg = '<p><strong>' . safeHTMLstr(oc_('The submission has been updated. Below is the information submitted.')) . '</strong></p><pre>' . safeHTMLstr($fields) . '</pre>';
|
||||
if (! $chair) {
|
||||
$confirmmsg .= '<p><strong>' . sprintf(oc_('A copy has also been emailed to the contact author. If you notice any problems or do <em>not</em> receive the email within 24 hours, please contact the <a href="mailto:%1$s?subject=submission edit problem - %2$s">Chair</a>.'), urlencode($OC_configAR['OC_pcemail']), urlencode($_POST['pid'])) . '</strong></p>';
|
||||
}
|
||||
|
||||
if (oc_hookSet('author-edit-save')) {
|
||||
foreach ($GLOBALS['OC_hooksAR']['author-edit-save'] as $hook) {
|
||||
require_once $hook;
|
||||
}
|
||||
}
|
||||
|
||||
//confirm it
|
||||
print $confirmmsg;
|
||||
if (! $chair) {
|
||||
if (($OC_configAR['OC_emailAuthorRecipients'] == 1) && !empty($allemails)) {
|
||||
$mailto = $allemails;
|
||||
} else {
|
||||
$mailto = $contactemail;
|
||||
}
|
||||
sendEmail($mailto, $mailsubject, $mailbody, $OC_configAR['OC_notifyAuthorEdit']);
|
||||
}
|
||||
|
||||
printFooter();
|
||||
|
||||
// log
|
||||
oc_logit('submission', 'Submission ID ' . $_POST['pid'] . ' edited' . ($chair ? ' by Chair' : '') . '. Title: ' . $_POST['title']);
|
||||
|
||||
exit;
|
||||
} // else no $err
|
||||
} // if Submit Changes
|
||||
|
||||
|
||||
// Display form
|
||||
print '
|
||||
<form method="post" id="editsub" enctype="multipart/form-data" action="' . $_SERVER['PHP_SELF'] . '" class="ocform">
|
||||
<input type="hidden" name="ocaction" value="Submit Changes" />
|
||||
<input type="hidden" name="pid" value="' . safeHTMLstr($_POST['pid']) . '">
|
||||
<input type="hidden" name="authornum" id="authornum" value="' . $oc_authorNum . '" />
|
||||
';
|
||||
|
||||
if ($chair) {
|
||||
print '
|
||||
<input type="hidden" name="c" value="1">
|
||||
<input type="hidden" name="token" value="' . $_SESSION[OCC_SESSION_VAR_NAME]['chairtoken'] . '" />
|
||||
';
|
||||
} else {
|
||||
print '
|
||||
<input type="hidden" name="edittoken" value="' . safeHTMLstr($_POST['edittoken']) . '" />
|
||||
';
|
||||
}
|
||||
|
||||
oc_displayFieldSet($OC_submissionFieldSetAR, $OC_submissionFieldAR, $_POST);
|
||||
|
||||
if (oc_hookSet('author-edit-fields')) {
|
||||
foreach ($GLOBALS['OC_hooksAR']['author-edit-fields'] as $hook) {
|
||||
require_once $hook;
|
||||
}
|
||||
}
|
||||
|
||||
if (! $chair) {
|
||||
print '
|
||||
<div id="oc_submit_emailConfirmOuter">
|
||||
<div id="oc_submit_emailConfirmInner" aria-live="polite">
|
||||
<p class="note">' . oc_('Emails will be sent to:') . '</p>
|
||||
<p id="oc_submit_emailConfirm"></p>
|
||||
</div>
|
||||
</div>
|
||||
';
|
||||
}
|
||||
|
||||
print '<p><input type="submit" id="submit" name="submit" value="' . oc_('Submit Changes') . '" class="submit" />';
|
||||
|
||||
if (! $chair) {
|
||||
print '
|
||||
|
||||
<a href="' . $_SERVER['PHP_SELF'] . '?ocaction=cancel&pid=' . urlencode($_POST['pid']) . '&edittoken=' . urlencode(varValue('edittoken', $_POST)) . '&c=' . ($chair ? 1 : 0) . '">' . oc_('Cancel Changes') . '</a>
|
||||
';
|
||||
}
|
||||
|
||||
print '</p>
|
||||
<span id="processing" style="position: relative; visibility: hidden;">' . oc_('Processing...') . '</span>
|
||||
</form>
|
||||
<script type="text/javascript">
|
||||
oc_setupProcessingForm("editsub");
|
||||
';
|
||||
|
||||
if (! $chair) {
|
||||
print '
|
||||
document.getElementById("editsub").addEventListener("change", function (evt) { oc_updateSubmitEmailAddresses(evt, true, ' . $OC_configAR['OC_emailAuthorRecipients'] . '); });
|
||||
oc_updateSubmitEmailAddresses(null, true, ' . $OC_configAR['OC_emailAuthorRecipients'] . ');
|
||||
';
|
||||
}
|
||||
|
||||
print '</script>';
|
||||
|
||||
printFooter();
|
||||
|
||||
exit;
|
||||
|
||||
} // if Submission
|
||||
|
||||
// display login form by default
|
||||
print '
|
||||
<form method="post" action="' . $_SERVER['PHP_SELF'] . '" id="editform">
|
||||
<input type="hidden" name="ocaction" value="Edit Submission" />
|
||||
<table border=0 cellspacing=0 cellpadding=5>
|
||||
<tr><td><strong><label for="pid">' . oc_('Submission ID') . '</label>:</strong></td><td><input name="pid" id="pid" size="10" tabindex="1"> ( <a href="email_papers.php" tabindex="4">' . oc_('forgot ID?') . '</a> )</td></tr>
|
||||
<tr><td><strong><label for="passwordfld">' . oc_('Password') . '</label>:</strong></td><td><input name="passwordfld" id="passwordfld" type="password" tabindex="2" size="20" maxlength="255"> ( <a href="reset.php" tabindex="5">' . oc_('forgot password?') . '</a> )</td></tr>
|
||||
</table>
|
||||
<p><input type="submit" name="submit" class="submit" value="' . $hdr . '" tabindex="3" /></p>
|
||||
</form>
|
||||
' .
|
||||
(
|
||||
$showPaper ?
|
||||
''
|
||||
:
|
||||
'<p class="note">' . sprintf(oc_('There is a %d hour limit to complete updates'), $editTimeout) . '</p>'
|
||||
) . '
|
||||
<script language="javascript">
|
||||
<!--
|
||||
document.forms[0].elements[0].focus();
|
||||
// -->
|
||||
</script>
|
||||
';
|
||||
|
||||
if (oc_hookSet('author-edit-bottom')) {
|
||||
foreach ($GLOBALS['OC_hooksAR']['author-edit-bottom'] as $hook) {
|
||||
require_once $hook;
|
||||
}
|
||||
}
|
||||
|
||||
printFooter();
|
||||
|
||||
exit;
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,67 @@
|
||||
<?php
|
||||
|
||||
// +----------------------------------------------------------------------+
|
||||
// | OpenConf |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Copyright (c) 2002-2020 Zakon Group LLC. All Rights Reserved. |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | This source file is subject to the OpenConf License, available on |
|
||||
// | the OpenConf web site: www.OpenConf.com |
|
||||
// +----------------------------------------------------------------------+
|
||||
|
||||
require_once "../include.php";
|
||||
|
||||
printHeader(oc_('Email Submissions'), 3);
|
||||
|
||||
if (isset($_POST['ocaction']) && ($_POST['ocaction'] == "Email Submissions") && (!empty($_POST['email']))) {
|
||||
// check for valid email
|
||||
if (!validEmail($_POST['email'])) {
|
||||
print '<p style="text-align: center" class="warn">' . oc_('Email address entered is invalid') . '</p>';
|
||||
printFooter();
|
||||
exit;
|
||||
}
|
||||
$q = "SELECT `" . OCC_TABLE_PAPER . "`.`paperid`, `" . OCC_TABLE_PAPER . "`.`title` FROM `" . OCC_TABLE_PAPER . "`, `" . OCC_TABLE_AUTHOR . "` WHERE `" . OCC_TABLE_AUTHOR . "`.`email`='" . safeSQLstr(oc_strtolower($_POST['email'])) . "' AND `" . OCC_TABLE_AUTHOR . "`.`paperid`=`" . OCC_TABLE_PAPER . "`.`paperid` AND `" . OCC_TABLE_AUTHOR . "`.`position`=`" . OCC_TABLE_PAPER . "`.`contactid` ORDER BY `" . OCC_TABLE_PAPER . "`.`paperid`";
|
||||
$r = ocsql_query($q) or err(oc_('Error checking for submissions'));
|
||||
if (($rnum=ocsql_num_rows($r)) == 0) {
|
||||
print '<p style="text-align: center" class="warn">' . sprintf(oc_("We did not find any submissions where the contact author's email is %s"), safeHTMLstr($_POST['email'])) . '.</p>';
|
||||
printFooter();
|
||||
exit;
|
||||
}
|
||||
else {
|
||||
$msg = "\n" . sprintf(oc_('Per your request, here is a list of submissions made to the %s OpenConf system with you listed as the contact:'), $OC_configAR['OC_confName']) . "\n";
|
||||
|
||||
while ($e = ocsql_fetch_array($r)) {
|
||||
$msg .= '
|
||||
ID: ' . $e['paperid'] . '
|
||||
Title: ' . $e['title'] . '
|
||||
';
|
||||
}
|
||||
sendEmail($_POST['email'], oc_('List of submissions made'), $msg, $OC_configAR['OC_notifyAuthorEmailPapers']);
|
||||
print oc_('We have emailed the list of submissions for which you are the contact author.');
|
||||
printFooter();
|
||||
exit;
|
||||
}
|
||||
}
|
||||
else {
|
||||
print '<p style="text-align: center; font-weight: bold">' . oc_('Please enter your email address below and click on <em>Email Submissions</em>. We will then email you a list of submissions for which you are the contact author.') . "</p>\n";
|
||||
}
|
||||
|
||||
print '
|
||||
<form method="post" action="' . $_SERVER['PHP_SELF'] . '" id="email_papersform">
|
||||
<input type="hidden" name="ocaction" value="Email Submissions" />
|
||||
<table border="0" style="margin: 0 auto">
|
||||
<tr><td><strong>' . oc_('Email') . ':</strong></td><td><input size="20" name="email" id="email" value="' . safeHTMLstr(varValue('email', $_POST)) . '"></td></tr>
|
||||
<tr><th align="center" colspan=2><br><input type="submit" name="submit" class="submit" value="' . oc_('Email Submissions') . '"></th></tr>
|
||||
</table>
|
||||
</form>
|
||||
';
|
||||
|
||||
if (oc_hookSet('author-email_papers-bottom')) {
|
||||
foreach ($GLOBALS['OC_hooksAR']['author-email_papers-bottom'] as $hook) {
|
||||
require_once $hook;
|
||||
}
|
||||
}
|
||||
|
||||
printFooter();
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,93 @@
|
||||
<?php
|
||||
|
||||
// +----------------------------------------------------------------------+
|
||||
// | OpenConf |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Copyright (c) 2002-2020 Zakon Group LLC. All Rights Reserved. |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | This source file is subject to the OpenConf License, available on |
|
||||
// | the OpenConf web site: www.OpenConf.com |
|
||||
// +----------------------------------------------------------------------+
|
||||
|
||||
require_once "../include.php";
|
||||
|
||||
$hdr = oc_('View File');
|
||||
$hdrfn = 3;
|
||||
|
||||
$formatDBFldName = 'format';
|
||||
$fileDir = $OC_configAR['OC_paperDir'];
|
||||
$uploadOpen = $OC_statusAR['OC_view_file_open'];
|
||||
|
||||
if (oc_hookSet('author-viewfile-preprocess')) {
|
||||
foreach ($GLOBALS['OC_hooksAR']['author-viewfile-preprocess'] as $hook) {
|
||||
require_once $hook;
|
||||
}
|
||||
}
|
||||
|
||||
// Check that we're still open
|
||||
if (! $uploadOpen) {
|
||||
warn(oc_('Files may no longer be viewed'), $hdr, $hdrfn);
|
||||
}
|
||||
|
||||
// Check whether this is a submission
|
||||
if (isset($_POST['ocaction']) && ($_POST['ocaction'] == "View File")) {
|
||||
// Check inputs
|
||||
if (!preg_match("/^\d+$/",$_POST['pid']) || empty($_POST['pwd'])) {
|
||||
warn(oc_('Submission ID or password entered is incorrect'), $hdr, $hdrfn);
|
||||
}
|
||||
|
||||
if (oc_hookSet('author-viewfile-validate')) {
|
||||
foreach ($GLOBALS['OC_hooksAR']['author-viewfile-validate'] as $hook) {
|
||||
require_once $hook;
|
||||
}
|
||||
}
|
||||
|
||||
// Valid pid/pwd?
|
||||
$pq = "SELECT `" . $formatDBFldName . "` AS `format`, `password` FROM `" . OCC_TABLE_PAPER . "` WHERE `paperid`='" . safeSQLstr($_POST['pid']) . "'";
|
||||
$pr = ocsql_query($pq) or err(oc_('Unable to view file'), $hdr, $hdrfn);
|
||||
if (ocsql_num_rows($pr) != 1) {
|
||||
warn(sprintf(oc_('Submission ID or password entered is incorrect'), safeHTMLstr($_POST['pid'])), $hdr, $hdrfn);
|
||||
}
|
||||
$pl = ocsql_fetch_array($pr);
|
||||
if (!oc_password_verify($_POST['pwd'], $pl['password'])) {
|
||||
warn(sprintf(oc_('Submission ID or password entered is incorrect'), safeHTMLstr($_POST['pid'])), $hdr, $hdrfn);
|
||||
}
|
||||
|
||||
$filename = $_POST['pid'] . '.' . $pl['format'];
|
||||
|
||||
if (! oc_displayFile($fileDir . $filename, $pl['format'])) {
|
||||
warn(oc_('File does not exist'), $hdr, $hdrfn);
|
||||
}
|
||||
}
|
||||
|
||||
printHeader($hdr, $hdrfn);
|
||||
|
||||
print '
|
||||
<form method="POST" enctype="multipart/form-data" action="' . $_SERVER['PHP_SELF'] . '" id="paperform">
|
||||
<input type="hidden" name="ocaction" value="View File" />
|
||||
<table border=0 cellspacing=0 cellpadding=5>
|
||||
';
|
||||
|
||||
if (oc_hookSet('author-viewfile-formtop')) {
|
||||
foreach ($GLOBALS['OC_hooksAR']['author-viewfile-formtop'] as $hook) {
|
||||
require_once $hook;
|
||||
}
|
||||
}
|
||||
|
||||
print '
|
||||
<tr><td><strong><label for="pid">' . oc_('Submission ID') . ':</label></strong></td><td><input name="pid" id="pid" size="10" tabindex="2"> ( <a href="email_papers.php" tabindex="5">' . oc_('forgot ID?') . '</a> )</td></tr>
|
||||
<tr><td><strong><label for="pwd">' . oc_('Password') . ':</label></strong></td><td><input name="pwd" id="pwd" type="password" size="20" maxlength="255" tabindex="3"> ( <a href="reset.php" tabindex="6">' . oc_('forgot password?') . '</a> )</td></tr>
|
||||
</table>
|
||||
<p><input type="submit" name="submit" value="' . oc_('View File') . '" class="submit" tabindex="4" /></p>
|
||||
</form>
|
||||
';
|
||||
|
||||
if (oc_hookSet('author-paper-bottom')) {
|
||||
foreach ($GLOBALS['OC_hooksAR']['author-paper-bottom'] as $hook) {
|
||||
require_once $hook;
|
||||
}
|
||||
}
|
||||
|
||||
printFooter();
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,64 @@
|
||||
<?php
|
||||
|
||||
// +----------------------------------------------------------------------+
|
||||
// | OpenConf |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Copyright (c) 2002-2020 Zakon Group LLC. All Rights Reserved. |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | This source file is subject to the OpenConf License, available on |
|
||||
// | the OpenConf web site: www.OpenConf.com |
|
||||
// +----------------------------------------------------------------------+
|
||||
|
||||
require_once "../include.php";
|
||||
|
||||
printHeader(oc_('Reset Password'), 3);
|
||||
|
||||
if (isset($_POST['ocaction']) && ($_POST['ocaction'] == "Reset Password") && preg_match("/^\d+$/",$_POST['pid']) && !empty($_POST['email'])) {
|
||||
// check for valid email
|
||||
if (!validEmail($_POST['email'])) {
|
||||
print '<p style="text-align: center" class="warn">' . oc_('Email address entered is invalid') . '</p>';
|
||||
printFooter();
|
||||
exit;
|
||||
}
|
||||
$q = "SELECT `" . OCC_TABLE_AUTHOR . "`.`email` FROM `" . OCC_TABLE_PAPER . "`, `" . OCC_TABLE_AUTHOR . "` WHERE `" . OCC_TABLE_PAPER . "`.`paperid`='" . safeSQLstr($_POST['pid']) . "' AND `" . OCC_TABLE_AUTHOR . "`.`paperid`=`" . OCC_TABLE_PAPER . "`.`paperid` AND `" . OCC_TABLE_AUTHOR . "`.`position`=`" . OCC_TABLE_PAPER . "`.`contactid` AND `" . OCC_TABLE_AUTHOR . "`.`email`='" . safeSQLstr(oc_strtolower($_POST['email'])) . "'";
|
||||
$r = ocsql_query($q) or err(oc_('Error checking submission ID'));
|
||||
if (ocsql_num_rows($r) != 1) {
|
||||
print '<p style="text-align: center" class="warn">' . oc_("Submission ID or contact author's email invalid.") . ' ' . sprintf(oc_('Please contact the <a href="mailto:%1$s?subject=%2$s">Chair</a>.'), $OC_configAR['OC_pcemail'], 'Unable to Reset Password') . '</p>';
|
||||
printFooter();
|
||||
exit;
|
||||
}
|
||||
else {
|
||||
$newpwd = oc_password_generate();
|
||||
$q2 = "UPDATE `" . OCC_TABLE_PAPER . "` SET `password`='" . safeSQLstr(oc_password_hash($newpwd)) . "' WHERE `paperid`='" . safeSQLstr($_POST['pid']) . "'";
|
||||
$r2 = ocsql_query($q2) or err(oc_('Unable to update password'));
|
||||
$msg = "\n" . sprintf(oc_('Per your request, we have issued you a new password for accessing the %s OpenConf system. The new password is:'), $OC_configAR['OC_confName']) . "\n " . $newpwd . "\n\n" . oc_('You may change this password by signing in to the OpenConf system and editing your submission.');
|
||||
sendEmail($_POST['email'], oc_('Author Password Reset'), $msg, $OC_configAR['OC_notifyAuthorReset']);
|
||||
print oc_('We have emailed you a new password.');
|
||||
printFooter();
|
||||
exit;
|
||||
}
|
||||
}
|
||||
else {
|
||||
print '<p style="text-align: center;">' . oc_('Please enter your submission id and the contact author\'s email below') . "</p>\n";
|
||||
}
|
||||
|
||||
print '
|
||||
<form method="post" action="' . $_SERVER['PHP_SELF'] . '" id="resetform">
|
||||
<input type="hidden" name="ocaction" value="Reset Password" />
|
||||
<table border="0" style="margin: 0 auto">
|
||||
<tr><td><strong>' . oc_('Submission ID') . ':</strong></td><td><input size="20" name="pid" value="' . safeHTMLstr(varValue('pid', $_POST)) . '"></td></tr>
|
||||
<tr><td><strong>' . oc_('Email') . ':</strong></td><td><input size="20" name="email" value="' . safeHTMLstr(varValue('email', $_POST)) . '"></td></tr>
|
||||
<tr><th align="center" colspan=2><br><input type="submit" name="submit" class="submit" value="' . oc_('Reset Password') . '"></th></tr>
|
||||
</table>
|
||||
';
|
||||
|
||||
if (oc_hookSet('author-reset-bottom')) {
|
||||
foreach ($GLOBALS['OC_hooksAR']['author-reset-bottom'] as $hook) {
|
||||
require_once $hook;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
printFooter();
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,140 @@
|
||||
<?php
|
||||
|
||||
// +----------------------------------------------------------------------+
|
||||
// | OpenConf |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Copyright (c) 2002-2020 Zakon Group LLC. All Rights Reserved. |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | This source file is subject to the OpenConf License, available on |
|
||||
// | the OpenConf web site: www.OpenConf.com |
|
||||
// +----------------------------------------------------------------------+
|
||||
|
||||
require_once "../include.php";
|
||||
require_once OCC_FORM_INC_FILE;
|
||||
require_once OCC_REVIEW_INC_FILE;
|
||||
|
||||
$hdr = oc_('Check Status');
|
||||
$hdrfn = 3;
|
||||
|
||||
require_once "../include-submissions.inc";
|
||||
|
||||
// Check status allowed?
|
||||
if (! $OC_statusAR['OC_status_open']) {
|
||||
warn(oc_('Check Status is not available.'), $hdr, $hdrfn);
|
||||
}
|
||||
|
||||
// Is this a post?
|
||||
if (isset($_POST['ocaction']) && ($_POST['ocaction'] == 'Check Status')) {
|
||||
// Check token
|
||||
if (!isset($_POST['token']) || !isset($_SESSION['atoken']) || ($_POST['token'] != $_SESSION['atoken'])) {
|
||||
warn(oc_('Invalid submission'), $hdr, $hdrfn);
|
||||
}
|
||||
unset($_SESSION['atoken']);
|
||||
session_write_close();
|
||||
|
||||
// Check for paper ID & password
|
||||
if (! isset($_POST['pid']) ||
|
||||
! preg_match("/^\d+$/", $_POST['pid']) ||
|
||||
! isset($_POST['pwd']) ||
|
||||
empty($_POST['pwd'])
|
||||
) {
|
||||
warn(oc_('Submission ID or password entered is incorrect'), $hdr, $hdrfn);
|
||||
}
|
||||
|
||||
// retrieve sub
|
||||
$q = "SELECT `title`, `password`, `accepted` FROM `" . OCC_TABLE_PAPER . "` WHERE `paperid`='" . safeSQLstr($_POST['pid']) . "'";
|
||||
$r = ocsql_query($q) or err(oc_('Submission ID or password entered is incorrect'), $hdr, $hdrfn);
|
||||
if (ocsql_num_rows($r) == 1) {
|
||||
$l = ocsql_fetch_assoc($r);
|
||||
// check pwd
|
||||
if (oc_password_verify($_POST['pwd'], $l['password'])) {
|
||||
// display info & status
|
||||
printHeader($hdr, $hdrfn);
|
||||
print '
|
||||
<p><strong>' . oc_('Submission ID') . ':</strong> ' . safeHTMLstr($_POST['pid']) . '</p>
|
||||
<p><strong>' .
|
||||
//T: Submission Title
|
||||
oc_('Title') . ':</strong> ' . safeHTMLstr($l['title']) . '</p>
|
||||
<p><strong>' .
|
||||
//T: Submission Status
|
||||
oc_('Status') . ':</strong> ' . (empty($l['accepted']) ? oc_('Pending') : safeHTMLstr(oc_($l['accepted']))) . '</p>
|
||||
';
|
||||
|
||||
if (oc_hookSet('author-status')) {
|
||||
foreach ($GLOBALS['OC_hooksAR']['author-status'] as $v) {
|
||||
require_once $v;
|
||||
}
|
||||
}
|
||||
|
||||
// display review comments to author
|
||||
if ($OC_configAR['OC_authorSeePendingSubReviews'] || !empty($l['accepted'])) {
|
||||
$q2 = "SELECT * FROM `" . OCC_TABLE_PAPERREVIEWER . "` WHERE `paperid`='" . safeSQLstr($_POST['pid']) . "' ORDER BY `reviewerid`";
|
||||
$r2 = ocsql_query($q2) or err('Unable to retrieve review data');
|
||||
if (ocsql_num_rows($r2) > 0) {
|
||||
// Fields to display
|
||||
$displayFieldAR = array();
|
||||
foreach ($OC_reviewQuestionsAR as $fid => $far) {
|
||||
if (isset($far['showauthor']) && $far['showauthor']) {
|
||||
$displayFieldAR[] = $fid;
|
||||
}
|
||||
}
|
||||
if (count($displayFieldAR) > 0) {
|
||||
$rcount = 1;
|
||||
while ($l2 = ocsql_fetch_assoc($r2)) {
|
||||
$reviewInfo = '';
|
||||
foreach ($displayFieldAR as $fid) {
|
||||
if (!empty($l2[$fid])) {
|
||||
$reviewInfo .= '<p><span style="font-weight: bold; font-style: italic; color: #555;">' . safeHTMLstr(oc_($OC_reviewQuestionsAR[$fid]['short'])) . ':</span> ' . nl2br(safeHTMLstr(oc_getFieldValue($OC_reviewQuestionsAR, $l2, $fid))) . "</p>\n";
|
||||
}
|
||||
}
|
||||
if (!empty($reviewInfo)) {
|
||||
print '<p><strong>' . safeHTMLstr(sprintf(oc_('Reviewer %s'), $rcount++)) . ':</strong></p><div style="margin-left: 20px;">' . $reviewInfo . '</div>';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
printFooter();
|
||||
} else {
|
||||
warn(oc_('Submission ID or password entered is incorrect'), $hdr, $hdrfn);
|
||||
}
|
||||
} else {
|
||||
warn(oc_('Submission ID or password entered is incorrect'), $hdr, $hdrfn);
|
||||
}
|
||||
}
|
||||
else { // not a submission -- display sub id/password form
|
||||
// set author token
|
||||
$_SESSION['atoken'] = oc_idGen();
|
||||
session_write_close();
|
||||
|
||||
printHeader($hdr, $hdrfn);
|
||||
|
||||
print '
|
||||
<form method="post" action="' . $_SERVER['PHP_SELF'] . '" id="statusform">
|
||||
<input type="hidden" name="ocaction" value="Check Status" />
|
||||
<input type="hidden" name="token" value="' . safeHTMLstr($_SESSION['atoken']) . '" />
|
||||
<table border=0 cellspacing=0 cellpadding=5>
|
||||
<tr><td><strong><label for="pid">' . oc_('Submission ID') . '</label>:</strong></td><td><input name="pid" id="pid" size="10" tabindex="1"> ( <a href="email_papers.php" tabindex="4">' . oc_('forgot ID?') . '</a> )</td></tr>
|
||||
<tr><td><strong><label for="password">' . oc_('Password') . '</label>:</strong></td><td><input name="pwd" id="password" type="password" tabindex="2" size="20" maxlength="255"> ( <a href="reset.php" tabindex="5">' . oc_('forgot password?') . '</a> )</td></tr>
|
||||
</table>
|
||||
<p><input type="submit" name="submit" value="' . oc_('Check Status') . '" class="submit" tabindex="3" /></p>
|
||||
</form>
|
||||
<script language="javascript">
|
||||
<!--
|
||||
document.forms[0].elements[0].focus();
|
||||
// -->
|
||||
</script>
|
||||
';
|
||||
printFooter();
|
||||
|
||||
if (oc_hookSet('author-status-bottom')) {
|
||||
foreach ($GLOBALS['OC_hooksAR']['author-status-bottom'] as $hook) {
|
||||
require_once $hook;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
exit;
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,152 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------+
|
||||
// | OpenConf |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Copyright (c) 2002-2020 Zakon Group LLC. All Rights Reserved. |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | This source file is subject to the OpenConf License, available on |
|
||||
// | the OpenConf web site: www.OpenConf.com |
|
||||
// +----------------------------------------------------------------------+
|
||||
|
||||
$firstBlankAuthor = 0;
|
||||
$lastAuthor = 0;
|
||||
|
||||
// Force contact author = 1
|
||||
if ($author1contact) {
|
||||
$_POST['contactid'] = 1;
|
||||
}
|
||||
|
||||
// validate fields
|
||||
$allemails = '';
|
||||
foreach ($GLOBALS['OC_submissionFieldSetAR'] as $fsid => $fs) {
|
||||
if ($fsid != 'fs_authors') { // non-author field
|
||||
foreach ($fs['fields'] as $fid) {
|
||||
if (!preg_match("/^(?:file|password\d)$/", $fid)) { // skip validation of special fields
|
||||
oc_validateField($fid, $GLOBALS['OC_submissionFieldAR'], $qfields, $err);
|
||||
}
|
||||
}
|
||||
} else { // author field
|
||||
for ($a=1; $a<=$OC_configAR['OC_authorsMax']; $a++) {
|
||||
if (!isset($_POST['name_last' . $a]) || empty($_POST['name_last' . $a])) {
|
||||
if ($firstBlankAuthor == 0) {
|
||||
$firstBlankAuthor = $a;
|
||||
}
|
||||
if ((isset($_POST['name_first' . $a]) && !empty($_POST['name_first' . $a]))
|
||||
|| (isset($_POST['organization' . $a]) && !empty($_POST['organization' . $a]))
|
||||
|| (isset($_POST['email' . $a]) && !empty($_POST['email' . $a]))
|
||||
) {
|
||||
$err .= '<li>' . sprintf(oc_('Author %d missing last name'), $a) . '</li>';
|
||||
}
|
||||
} else {
|
||||
$afields[$a] = array('name_last' => "'" . safeSQLstr(varValue('name_last' . $a, $_POST)) . "'");
|
||||
foreach ($fs['fields'] as $fid) {
|
||||
if ($fid == 'name_last') { continue; }
|
||||
// override required field attribute?
|
||||
$requiredOverride = false;
|
||||
if ($OC_configAR['OC_authorsRequiredData'] > 0) {
|
||||
if (($OC_configAR['OC_authorsRequiredData'] == 1) && ($a != 1)) { // first author
|
||||
$requiredOverride = true;
|
||||
} elseif (($OC_configAR['OC_authorsRequiredData'] == 2) && ($a != $_POST['contactid'])) { // contact author
|
||||
$requiredOverride = true;
|
||||
}
|
||||
}
|
||||
// validate
|
||||
oc_validateField($fid, $GLOBALS['OC_submissionFieldAR'], $afields[$a], $err, $a, $requiredOverride);
|
||||
}
|
||||
$lastAuthor = $a;
|
||||
if (isset($_POST['email'.$a]) && !empty($_POST['email'.$a])) {
|
||||
$allemails .= $_POST['email'.$a] . ',';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
$allemails = rtrim($allemails, ',');
|
||||
|
||||
// Additional author checks
|
||||
if ($lastAuthor == 0) { // no author info
|
||||
$err .= '<li>' . oc_('Authors information missing.') . '</li>';
|
||||
} elseif (($firstBlankAuthor > 0) && ($firstBlankAuthor < $lastAuthor)) { // blank author - can't skip otherwise ordering will be messed up
|
||||
$err .= '<li>' . oc_('One or more author\'s data skipped. Please enter authors sequentially.') . '</li>';
|
||||
} elseif (!preg_match("/^\d+$/", $_POST['contactid']) || ($_POST['contactid'] < 1) || ($_POST['contactid'] > $OC_configAR['OC_authorsMax'])) { // Check that we have a valid contact author & email
|
||||
$err .= '<li>' . oc_('Contact author invalid') . '</li>';
|
||||
} else {
|
||||
$contactemail = $_POST['email' . $_POST['contactid']];
|
||||
if (!validEmail($contactemail)) {
|
||||
$err .= '<li>' . oc_('Contact author email does not seem valid') . '</li>';
|
||||
}
|
||||
}
|
||||
|
||||
// Update topics
|
||||
if (isset($qfields['topics'])) {
|
||||
if ($qfields['topics'] != 'NULL') {
|
||||
if (!preg_match("/^'[\d\,]*'$/", $qfields['topics'])) {
|
||||
$err .= '<li>' . sprintf(oc_('%s field does not appear to be valid'), oc_('Topic')) . '</li>'; // should only trigger if validateField above fails
|
||||
} else {
|
||||
$tfields = explode(',', trim($qfields['topics'], "'"));
|
||||
}
|
||||
}
|
||||
unset($qfields['topics']);
|
||||
}
|
||||
|
||||
// Check file
|
||||
if (isset($OC_submissionFieldAR['file'])) {
|
||||
if ( isset($_FILES['file']['error']) // good upload
|
||||
&& ($_FILES['file']['error'] == UPLOAD_ERR_OK) // no error
|
||||
&& is_uploaded_file($_FILES['file']['tmp_name']) // legitimate upload
|
||||
&& ($_FILES['file']['size'] > 0) // file not empty
|
||||
&& (empty($OC_configAR['OC_fileLimit']) || ($_FILES['file']['size'] <= ($OC_configAR['OC_fileLimit'] * 1024 * 1024))) // file size <= limit
|
||||
) { // file uploaded ok
|
||||
if ( ! isset($_POST['format']) || ! in_array($_POST['format'], $extAR) ) { // invalid format
|
||||
$err .= '<li>' . oc_('File format invalid') . '</li>';
|
||||
} else { // upload good
|
||||
$fileUploaded = true;
|
||||
$errInc .= '<br /><li>' . oc_('Also, re-select the file') . '</li>'; // let user know file must be re-selected if there was another error
|
||||
if (oc_hookSet('author-file-validate')) {
|
||||
foreach ($GLOBALS['OC_hooksAR']['author-file-validate'] as $hook) {
|
||||
require_once $hook;
|
||||
}
|
||||
}
|
||||
}
|
||||
} elseif ( isset($_FILES['file']['error']) ) { // notify of error
|
||||
switch($_FILES['file']['error']) {
|
||||
case UPLOAD_ERR_INI_SIZE:
|
||||
case UPLOAD_ERR_FORM_SIZE:
|
||||
$err .= '<li>' . oc_('File size too large') . '</li>';
|
||||
break;
|
||||
case UPLOAD_ERR_NO_FILE:
|
||||
if (isset($OC_submissionFieldAR['file']['required']) && $OC_submissionFieldAR['file']['required']) { // file required? if not, no error
|
||||
$err .= '<li>' . oc_('File missing') . '</li>';
|
||||
}
|
||||
break;
|
||||
default:
|
||||
$err .= '<li>' . oc_('File did not upload properly') . '</li>';
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Check password if either field is not empty or it's an original submission
|
||||
if ( (isset($_POST['password1']) && !empty($_POST['password1']))
|
||||
|| (isset($_POST['password2']) && !empty($_POST['password2']))
|
||||
|| ( ! isset($_POST['pid']) )
|
||||
) {
|
||||
if (!isset($_POST['password1']) || !isset($_POST['password2']) || empty($_POST['password1'])) {
|
||||
$err .= '<li>' . oc_('Password must be entered twice') . '</li>';
|
||||
} elseif ($_POST['password1'] != $_POST['password2']) {
|
||||
$err .= '<li>' . oc_('Passwords entered do not match') . '</li>';
|
||||
} else {
|
||||
$qfields['password'] = "'" . oc_password_hash($_POST['password1']) . "'";
|
||||
}
|
||||
}
|
||||
|
||||
// Add datetime to consent and strip tags
|
||||
if (isset($qfields['consent']) && preg_match("/^\'.*\'$/", $qfields['consent'])) {
|
||||
$qfields['consent'] = rtrim(strip_tags($qfields['consent']), "'") . safeSQLstr(" (" . gmdate('Y-m-d H:i:s') . " UTC)") . "'";
|
||||
}
|
||||
|
||||
if (oc_hookSet('author-submission-validate')) {
|
||||
foreach ($GLOBALS['OC_hooksAR']['author-submission-validate'] as $hook) {
|
||||
require_once $hook;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,632 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------+
|
||||
// | OpenConf |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Copyright (c) 2002-2020 Zakon Group LLC. All Rights Reserved. |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | This source file is subject to the OpenConf License, available on |
|
||||
// | the OpenConf web site: www.OpenConf.com |
|
||||
// +----------------------------------------------------------------------+
|
||||
|
||||
if (!isset($oc_authorNum)) {
|
||||
$oc_authorNum = 1;
|
||||
}
|
||||
|
||||
// Force author 1 as contact
|
||||
if (
|
||||
( ($GLOBALS['OC_configAR']['OC_authorsMinDisplay'] == 1) && ($GLOBALS['OC_configAR']['OC_authorsMax'] == 1) )
|
||||
||
|
||||
($GLOBALS['OC_configAR']['OC_authorOneContact'] == 1)
|
||||
) {
|
||||
$author1contact = true;
|
||||
} else {
|
||||
$author1contact = false;
|
||||
}
|
||||
|
||||
// Get topics
|
||||
$topq = "SELECT * FROM `" . OCC_TABLE_TOPIC . "`";
|
||||
if ($OC_configAR['OC_topicDisplayAlpha']) {
|
||||
$topq .= " ORDER BY `topicname`";
|
||||
}
|
||||
$topr = ocsql_query($topq) or err('unable to retrieve topics');
|
||||
if (($tnum = ocsql_num_rows($topr)) < 1) {
|
||||
warn(oc_('We are still waiting for the list of topics to be finalized before opening up for submissions. Please check back later.'));
|
||||
} else {
|
||||
$topicAR = array();
|
||||
while ($topl = ocsql_fetch_assoc($topr)) {
|
||||
if ($topl['topicname'] == 'N/A') { continue; }
|
||||
$topicAR[$topl['topicid']] = $topl['topicname'];
|
||||
}
|
||||
}
|
||||
|
||||
// Get authors
|
||||
$sfAuthorAR = array();
|
||||
for ($i=1; $i<=$GLOBALS['oc_authorNum']; $i++) {
|
||||
$sfAuthorAR[$i] = oc_('Author') . ' ' . $i; // oc_() only around Author because of JS in include-forms
|
||||
}
|
||||
|
||||
// See include-forms.inc for syntax format
|
||||
|
||||
$OC_submissionFieldAR = array();
|
||||
$OC_submissionFieldSetAR = array();
|
||||
|
||||
// Hooks
|
||||
if (oc_hookSet('author-submission-preinc')) {
|
||||
foreach ($GLOBALS['OC_hooksAR']['author-submission-preinc'] as $v) {
|
||||
require_once $v;
|
||||
}
|
||||
}
|
||||
|
||||
if (!isset($mod_oc_customforms_customSubForm) || (!$mod_oc_customforms_customSubForm)) { // skip if we have a custom form
|
||||
|
||||
// Consent
|
||||
if (
|
||||
(OCC_LICENSE != 'Public')
|
||||
||
|
||||
((OCC_LICENSE == 'Public') && ($OC_configAR['OC_privacy_display'] > 0))
|
||||
) {
|
||||
$OC_submissionFieldAR['consent'] = array(
|
||||
'name' => oc_('Consent'),
|
||||
'short' => oc_('Consent'),
|
||||
'note' => '',
|
||||
'type' => 'checkbox',
|
||||
'reviewer' => false,
|
||||
'advocate' => false,
|
||||
'usekey' => false,
|
||||
'required' => true,
|
||||
'delimiter' => '',
|
||||
'values' => array(oc_('I consent to the collection and use of my personal information, including receiving emails, consistent with the Privacy Policy linked above.') . ' ' . oc_('I have also obtained the consent of all other individuals whose information I provide.'))
|
||||
);
|
||||
|
||||
$OC_submissionFieldSetAR['fs_consent'] = array(
|
||||
'fieldset' => oc_('Consent'),
|
||||
'note' => '',
|
||||
'fields' => array('consent')
|
||||
);
|
||||
}
|
||||
|
||||
// General Info
|
||||
$OC_submissionFieldAR['title'] = array(
|
||||
'name' => oc_('Submission Title'),
|
||||
'short' => oc_('Title'),
|
||||
'note' => '',
|
||||
'type' => 'text',
|
||||
'reviewer' => true,
|
||||
'advocate' => true,
|
||||
'width' => 80,
|
||||
'required' => true // always required
|
||||
);
|
||||
|
||||
$OC_submissionFieldAR['type'] = array(
|
||||
'name' => oc_('Submission Type'),
|
||||
'short' => oc_('Submission Type'),
|
||||
'note' => '',
|
||||
'type' => 'radio',
|
||||
'reviewer' => true,
|
||||
'advocate' => true,
|
||||
'closeedit' => false,
|
||||
'usekey' => false,
|
||||
'required' => true,
|
||||
'display' => 'sameline',
|
||||
'valuetype' => 'custom',
|
||||
'values' => array()
|
||||
);
|
||||
if (isset($OC_configAR['OC_subtypes']) && !empty($OC_configAR['OC_subtypes'])) {
|
||||
$OC_submissionFieldAR['type']['values'] = explode(',', $OC_configAR['OC_subtypes']);
|
||||
}
|
||||
|
||||
$OC_submissionFieldAR['student'] = array(
|
||||
'name' => oc_('Student'),
|
||||
'short' => oc_('Student'),
|
||||
'note' => '',
|
||||
'type' => 'radio',
|
||||
'reviewer' => true,
|
||||
'advocate' => true,
|
||||
'closeedit' => false,
|
||||
'usekey' => true,
|
||||
'required' => true,
|
||||
'delimiter' => ' ',
|
||||
'values' => array('T' => oc_('Yes'), 'F' => oc_('No'))
|
||||
);
|
||||
|
||||
$OC_submissionFieldSetAR['fs_general'] = array(
|
||||
'fieldset' => oc_('General Information'),
|
||||
'note' => '',
|
||||
'fields' => array('title', 'type', 'student')
|
||||
);
|
||||
|
||||
// Authors
|
||||
$OC_submissionFieldAR['orcid'] = array(
|
||||
'name' => oc_('ORCID'),
|
||||
'short' => oc_('ORCID'),
|
||||
'note' => '',
|
||||
'type' => 'text',
|
||||
'width' => 30,
|
||||
'maxchars' => 30,
|
||||
'required' => false
|
||||
);
|
||||
|
||||
$OC_submissionFieldAR['honorific'] = array(
|
||||
'name' => oc_('Honorific'),
|
||||
'short' => oc_('Honorific'),
|
||||
'note' => '',
|
||||
'type' => 'text',
|
||||
'reviewer' => true,
|
||||
'advocate' => true,
|
||||
'required' => false
|
||||
);
|
||||
|
||||
$OC_submissionFieldAR['name_first'] = array(
|
||||
'name' => oc_('First/Given Name'),
|
||||
'short' => oc_('First Name'),
|
||||
'note' => '',
|
||||
'type' => 'text',
|
||||
'maxchars' => 60,
|
||||
'reviewer' => true,
|
||||
'advocate' => true,
|
||||
'required' => false
|
||||
);
|
||||
|
||||
$OC_submissionFieldAR['name_last'] = array(
|
||||
'name' => oc_('Last/Family Name'),
|
||||
'short' => oc_('Last Name'),
|
||||
'note' => '',
|
||||
'type' => 'text',
|
||||
'maxchars' => 40,
|
||||
'reviewer' => true,
|
||||
'advocate' => true,
|
||||
'required' => true // always required
|
||||
);
|
||||
|
||||
$OC_submissionFieldAR['suffix'] = array(
|
||||
'name' => oc_('Suffix'),
|
||||
'short' => oc_('Suffix'),
|
||||
'note' => '',
|
||||
'type' => 'text',
|
||||
'maxchars' => 60,
|
||||
'reviewer' => true,
|
||||
'advocate' => true,
|
||||
'required' => false
|
||||
);
|
||||
|
||||
$OC_submissionFieldAR['position_title'] = array(
|
||||
'name' => oc_('Position/Title'),
|
||||
'short' => oc_('Position'),
|
||||
'note' => '',
|
||||
'type' => 'text',
|
||||
'required' => false
|
||||
);
|
||||
|
||||
$OC_submissionFieldAR['organization'] = array(
|
||||
'name' => oc_('Organization'),
|
||||
'short' => oc_('Organization'),
|
||||
'note' => '',
|
||||
'type' => 'text',
|
||||
'maxchars' => 150, // limitation as a result of utf8mb4 keys
|
||||
'reviewer' => true,
|
||||
'advocate' => true,
|
||||
'required' => false
|
||||
);
|
||||
|
||||
$OC_submissionFieldAR['department'] = array(
|
||||
'name' => oc_('Department/Division'),
|
||||
'short' => oc_('Department/Division'),
|
||||
'note' => '',
|
||||
'type' => 'text',
|
||||
'required' => false
|
||||
);
|
||||
|
||||
$OC_submissionFieldAR['address'] = array(
|
||||
'name' => oc_('Address'),
|
||||
'short' => oc_('Address'),
|
||||
'note' => '',
|
||||
'type' => 'text',
|
||||
'required' => false
|
||||
);
|
||||
|
||||
$OC_submissionFieldAR['address2'] = array(
|
||||
'name' => oc_('Address 2'),
|
||||
'short' => oc_('Address 2'),
|
||||
'note' => '',
|
||||
'type' => 'text',
|
||||
'required' => false
|
||||
);
|
||||
|
||||
$OC_submissionFieldAR['city'] = array(
|
||||
'name' => oc_('City'),
|
||||
'short' => oc_('City'),
|
||||
'note' => '',
|
||||
'type' => 'text',
|
||||
'required' => false
|
||||
);
|
||||
|
||||
$OC_submissionFieldAR['spc'] = array(
|
||||
'name' => oc_('State/Province'),
|
||||
'short' => oc_('State/Province'),
|
||||
'note' => '',
|
||||
'type' => 'text',
|
||||
'required' => false
|
||||
);
|
||||
|
||||
$OC_submissionFieldAR['postcode'] = array(
|
||||
'name' => oc_('Postcode/Zip'),
|
||||
'short' => oc_('Postcode/Zip'),
|
||||
'note' => '',
|
||||
'type' => 'text',
|
||||
'required' => false
|
||||
);
|
||||
|
||||
$OC_submissionFieldAR['country'] = array(
|
||||
'name' => oc_('Country'),
|
||||
'short' => oc_('Country'),
|
||||
'note' => '',
|
||||
'type' => 'dropdown',
|
||||
'blank' => true,
|
||||
'required' => false,
|
||||
'usekey' => true,
|
||||
'reviewer' => true,
|
||||
'advocate' => true,
|
||||
'valuetype' => 'country'
|
||||
);
|
||||
|
||||
$OC_submissionFieldAR['email'] = array(
|
||||
'name' => oc_('Email'),
|
||||
'short' => oc_('Email'),
|
||||
'note' => '',
|
||||
'type' => 'email',
|
||||
'required' => false // required for contact author automatically
|
||||
|
||||
);
|
||||
|
||||
$OC_submissionFieldAR['phone'] = array(
|
||||
'name' => oc_('Telephone'),
|
||||
'short' => oc_('Telephone'),
|
||||
'note' => '',
|
||||
'type' => 'text',
|
||||
'required' => false
|
||||
);
|
||||
|
||||
$OC_submissionFieldAR['url'] = array(
|
||||
'name' => oc_('Web Site'),
|
||||
'short' => oc_('Web Site'),
|
||||
'note' => '',
|
||||
'type' => 'text',
|
||||
'required' => false,
|
||||
'placeholder' => 'https://'
|
||||
);
|
||||
|
||||
$OC_submissionFieldAR['facebook'] = array(
|
||||
'name' => oc_('Facebook Page'),
|
||||
'short' => oc_('Facebook'),
|
||||
'note' => '',
|
||||
'type' => 'text',
|
||||
'required' => false,
|
||||
'placeholder' => 'https://'
|
||||
);
|
||||
|
||||
$OC_submissionFieldAR['twitter'] = array(
|
||||
'name' => oc_('Twitter Page'),
|
||||
'short' => oc_('Twitter'),
|
||||
'note' => '',
|
||||
'type' => 'text',
|
||||
'required' => false,
|
||||
'placeholder' => 'https://'
|
||||
);
|
||||
|
||||
$OC_submissionFieldAR['linkedin'] = array(
|
||||
'name' => oc_('LinkedIn Page'),
|
||||
'short' => oc_('LinkedIn'),
|
||||
'note' => '',
|
||||
'type' => 'text',
|
||||
'required' => false,
|
||||
'placeholder' => 'https://'
|
||||
);
|
||||
|
||||
$OC_submissionFieldAR['photo'] = array(
|
||||
'name' => oc_('Photo Link'),
|
||||
'short' => oc_('Photo'),
|
||||
'note' => '',
|
||||
'type' => 'text',
|
||||
'required' => false,
|
||||
'placeholder' => 'https://'
|
||||
);
|
||||
|
||||
$OC_submissionFieldAR['presenter'] = array(
|
||||
'name' => oc_('Presenter'),
|
||||
'short' => oc_('Presenter'),
|
||||
'note' => '',
|
||||
'type' => 'radio',
|
||||
'usekey' => true,
|
||||
'required' => false,
|
||||
'display' => 'sameline',
|
||||
'values' => array('T' => oc_('Yes'), 'F' => oc_('No'))
|
||||
);
|
||||
|
||||
$OC_submissionFieldAR['biography'] = array(
|
||||
'name' => oc_('Biography'),
|
||||
'short' => oc_('Biography'),
|
||||
'note' => '',
|
||||
'type' => 'textarea',
|
||||
'required' => false
|
||||
);
|
||||
|
||||
$OC_submissionFieldAR['role'] = array(
|
||||
'name' => oc_('Contributor Role'),
|
||||
'short' => oc_('Contributor Role'),
|
||||
'note' => '',
|
||||
'type' => 'picklist',
|
||||
'usekey' => true,
|
||||
'required' => false,
|
||||
'values' => array(
|
||||
1 => oc_('Conceptualization'),
|
||||
2 => oc_('Data curation'),
|
||||
3 => oc_('Formal Analysis'),
|
||||
4 => oc_('Funding acquisition'),
|
||||
5 => oc_('Investigation'),
|
||||
6 => oc_('Methodology'),
|
||||
7 => oc_('Project administration'),
|
||||
8 => oc_('Resources'),
|
||||
9 => oc_('Software'),
|
||||
10 => oc_('Supervision'),
|
||||
11 => oc_('Validation'),
|
||||
12 => oc_('Visualization'),
|
||||
13 => oc_('Writing - original draft'),
|
||||
14 => oc_('Writing - review & editing')
|
||||
)
|
||||
);
|
||||
|
||||
$OC_submissionFieldSetAR['fs_authors'] = array(
|
||||
'fieldset' => oc_('Author(s)'),
|
||||
'note' => '',
|
||||
'fields' => array('orcid', 'honorific', 'name_first', 'name_last', 'suffix', 'position_title', 'organization', 'department', 'address', 'address2', 'city', 'spc', 'postcode', 'country', 'email', 'phone', 'url', 'facebook', 'twitter', 'linkedin', 'photo', 'presenter', 'biography', 'role')
|
||||
);
|
||||
|
||||
// Contact Author
|
||||
$OC_submissionFieldAR['contactid'] = array(
|
||||
'name' => oc_('Contact Author'),
|
||||
'short' => oc_('Contact Author'),
|
||||
'note' => oc_('Author who will serve as the point of contact for correspondence about the submission.'),
|
||||
'type' => 'dropdown',
|
||||
'required' => true, // always required
|
||||
'usekey' => true,
|
||||
'valuetype' => 'author'
|
||||
);
|
||||
|
||||
$OC_submissionFieldAR['altcontact'] = array(
|
||||
'name' => oc_('Alternate Contact'),
|
||||
'short' => oc_('Alternate Contact'),
|
||||
'note' => oc_('Alternate contact information, such as personal email address or telephone number; used only if unable to contact using above email address.'),
|
||||
'type' => 'text',
|
||||
'required' => false
|
||||
);
|
||||
|
||||
$OC_submissionFieldSetAR['fs_contactauthor'] = array(
|
||||
'fieldset' => oc_('Contact Author'),
|
||||
'note' => '',
|
||||
'fields' => array('contactid', 'altcontact')
|
||||
);
|
||||
|
||||
// Topics
|
||||
$OC_submissionFieldAR['topics'] = array(
|
||||
'name' => oc_('Topic Areas'),
|
||||
'short' => oc_('Topic(s)'),
|
||||
'note' => '',
|
||||
'type' => 'checkbox',
|
||||
'usekey' => true,
|
||||
'display' => 'newline',
|
||||
'required' => true, // always required
|
||||
'valuetype' => 'topic'
|
||||
);
|
||||
if ($OC_configAR['OC_multipleSubmissionTopics'] != 1) { // (!1 = limited to 1)
|
||||
$OC_submissionFieldAR['topics']['maxselections'] = 1;
|
||||
}
|
||||
|
||||
$OC_submissionFieldSetAR['fs_topics'] = array(
|
||||
'fieldset' => oc_('Topic Areas'),
|
||||
'note' => oc_('To help match submissions to reviewers and sessions, please select the area(s) most applicable to your submission'),
|
||||
'fields' => array('topics')
|
||||
);
|
||||
|
||||
// Content
|
||||
$OC_submissionFieldAR['keywords'] = array(
|
||||
'name' => oc_('Keywords'),
|
||||
'short' => oc_('Keywords'),
|
||||
'note' => '',
|
||||
'type' => 'text',
|
||||
'required' => false
|
||||
);
|
||||
|
||||
$OC_submissionFieldAR['abstract'] = array(
|
||||
'name' => oc_('Abstract'),
|
||||
'short' => oc_('Abstract'),
|
||||
'note' => '',
|
||||
'reviewer' => true,
|
||||
'advocate' => true,
|
||||
'type' => 'textarea',
|
||||
'height' => 10,
|
||||
'required' => false
|
||||
);
|
||||
|
||||
$OC_submissionFieldSetAR['fs_content'] = array(
|
||||
'fieldset' => oc_('Content'),
|
||||
'note' => '',
|
||||
'fields' => array('keywords', 'abstract')
|
||||
);
|
||||
|
||||
if ( preg_match("/submit/", $_SERVER['PHP_SELF']) || (isset($mod_oc_customforms_edit) && $mod_oc_customforms_edit) || (isset($mod_oc_formfields_edit) && $mod_oc_formfields_edit) ) { // only display file field if submission (or forms editing via module)
|
||||
$OC_submissionFieldAR['file'] = array(
|
||||
'name' => oc_('File'),
|
||||
'short' => oc_('File'),
|
||||
'note' => (empty($GLOBALS['fileNotice']) ? '' : $GLOBALS['fileNotice'] . '<br />') . (empty($OC_configAR['OC_fileLimit']) ? sprintf(oc_('File size limit is %s.'), $GLOBALS['OC_maxFileSize']) : ''),
|
||||
'type' => 'file',
|
||||
'closeedit' => false,
|
||||
'required' => true
|
||||
);
|
||||
$OC_submissionFieldSetAR['fs_content']['fields'][] = 'file';
|
||||
}
|
||||
|
||||
// Password
|
||||
$OC_submissionFieldAR['password1'] = array(
|
||||
'name' => oc_('Password'),
|
||||
'short' => oc_('Password'),
|
||||
'note' => '',
|
||||
'type' => 'password',
|
||||
'required' => true // always required
|
||||
);
|
||||
|
||||
$OC_submissionFieldAR['password2'] = array(
|
||||
'name' => oc_('Re-enter Password'),
|
||||
'short' => oc_('Confirm'),
|
||||
'note' => '',
|
||||
'type' => 'password',
|
||||
'required' => true // always required
|
||||
);
|
||||
|
||||
$OC_submissionFieldSetAR['fs_passwords'] = array(
|
||||
'fieldset' => oc_('Password'),
|
||||
'note' => oc_('Please enter a password you will remember. The submission ID, which you will receive via email upon submission of this form, along with this password will allow you to make future changes to this submission.'),
|
||||
'fields' => array('password1', 'password2')
|
||||
);
|
||||
|
||||
// Comments
|
||||
$OC_submissionFieldAR['comments'] = array(
|
||||
'name' => oc_('Optional Comments'),
|
||||
'short' => oc_('Comments'),
|
||||
'note' => '',
|
||||
'type' => 'textarea',
|
||||
'required' => false
|
||||
);
|
||||
|
||||
$OC_submissionFieldSetAR['fs_comments'] = array(
|
||||
'fieldset' => oc_('Comments'),
|
||||
'note' => '',
|
||||
'fields' => array('comments')
|
||||
);
|
||||
|
||||
// Unset fields that should not be displayed on form
|
||||
if (!empty($GLOBALS['OC_configAR']['OC_hideSubFields'])) {
|
||||
$hSF = explode(',', $GLOBALS['OC_configAR']['OC_hideSubFields']);
|
||||
foreach ($hSF as $hs_f) {
|
||||
list($a_fs, $a_f) = explode(':', $hs_f);
|
||||
unset($OC_submissionFieldAR[$a_f]);
|
||||
if (in_array($a_f, $OC_submissionFieldSetAR[$a_fs]['fields'])) {
|
||||
$OC_submissionFieldSetAR[$a_fs]['fields'] = array_values(array_diff($OC_submissionFieldSetAR[$a_fs]['fields'], array($a_f)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} // if ! custom form
|
||||
|
||||
// Hooks
|
||||
if (oc_hookSet('author-submission-inc')) {
|
||||
foreach ($GLOBALS['OC_hooksAR']['author-submission-inc'] as $v) {
|
||||
require_once $v;
|
||||
}
|
||||
}
|
||||
|
||||
// Make updates if form not being edited by module
|
||||
if (
|
||||
(! isset($mod_oc_customforms_edit) || ! $mod_oc_customforms_edit)
|
||||
&&
|
||||
(! isset($mod_oc_formfields_edit) || ! $mod_oc_formfields_edit)
|
||||
){
|
||||
$GLOBALS['updateAuthorFieldsAR'] = array();
|
||||
foreach ($OC_submissionFieldAR as $sfk => $sf) {
|
||||
// remove field if either:
|
||||
// - designated for new submissions only if sub being edited,
|
||||
// - designated for Chair only and author viewing/editing
|
||||
if (
|
||||
(isset($sf['newsubonly']) && $sf['newsubonly'] && isset($GLOBALS['OC_subEdit']) && $GLOBALS['OC_subEdit'])
|
||||
||
|
||||
(
|
||||
(isset($sf['chair']) && $sf['chair'])
|
||||
&&
|
||||
(
|
||||
(isset($OC_subNew) && $OC_subNew)
|
||||
||
|
||||
(isset($OC_subEdit) && $OC_subEdit && (!isset($chair) || !$chair))
|
||||
||
|
||||
(isset($OC_subShow) && $OC_subShow)
|
||||
)
|
||||
)
|
||||
) {
|
||||
unset($OC_submissionFieldAR[$sfk]);
|
||||
foreach ($OC_submissionFieldSetAR as $fsid => $fsar) {
|
||||
if (in_array($sfk, $fsar['fields'])) {
|
||||
$OC_submissionFieldSetAR[$fsid]['fields'] = array_diff($OC_submissionFieldSetAR[$fsid]['fields'], array($sfk));
|
||||
continue; // field should only be in one fieldset
|
||||
}
|
||||
}
|
||||
} else { // update values & valuetypes
|
||||
if (isset($sf['valuetype']) && !empty($sf['valuetype']) && ($sf['valuetype'] != 'custom')) {
|
||||
switch($sf['valuetype']) {
|
||||
case 'author':
|
||||
$OC_submissionFieldAR[$sfk]['values'] = $sfAuthorAR;
|
||||
$GLOBALS['updateAuthorFieldsAR'][] = $sfk;
|
||||
break;
|
||||
|
||||
case 'country':
|
||||
require_once OCC_COUNTRY_FILE;
|
||||
$OC_submissionFieldAR[$sfk]['values'] = $GLOBALS['OC_countryAR'];
|
||||
break;
|
||||
|
||||
case 'topic':
|
||||
$OC_submissionFieldAR[$sfk]['values'] = $topicAR;
|
||||
break;
|
||||
|
||||
default: // lib file
|
||||
require_once OCC_LIB_DIR . $sf['valuetype'] . '.inc';
|
||||
$OC_submissionFieldAR[$sfk]['values'] = $GLOBALS['OC_' . $sf['valuetype'] . 'AR'];
|
||||
break;
|
||||
}
|
||||
} elseif (
|
||||
isset($sf['values'])
|
||||
&& is_array($sf['values'])
|
||||
&& ( !isset($mod_oc_customforms_customSubForm) || ! $mod_oc_customforms_customSubForm )
|
||||
) {
|
||||
// Translate values
|
||||
if (!isset($sf['usekey']) || $sf['usekey']) {
|
||||
foreach ($sf['values'] as $vk => $vv) {
|
||||
$OC_submissionFieldAR[$sfk]['values'][$vk] = oc_($vv);
|
||||
}
|
||||
} else { // change to usekey in support of field values translation (e.g., consent, sub type)
|
||||
$OC_submissionFieldAR[$sfk]['usekey'] = true;
|
||||
$valuesAR = array();
|
||||
foreach ($sf['values'] as $vv) {
|
||||
$valuesAR[$vv] = oc_($vv);
|
||||
}
|
||||
$OC_submissionFieldAR[$sfk]['values'] = $valuesAR;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Update Topics to radio if required and max selections = 1
|
||||
if (isset($OC_submissionFieldAR['topics']['required']) && $OC_submissionFieldAR['topics']['required'] && isset($OC_submissionFieldAR['topics']['maxselections']) && ($OC_submissionFieldAR['topics']['maxselections'] == 1) && ($OC_submissionFieldAR['topics']['type'] == 'checkbox')){
|
||||
$OC_submissionFieldAR['topics']['type'] = 'radio';
|
||||
}
|
||||
|
||||
// Remove file field if present and not making new submission
|
||||
if (isset($OC_submissionFieldAR['file']) && !preg_match("/submit/", $_SERVER['PHP_SELF']) && !preg_match("/preview/", $_SERVER['QUERY_STRING'])) {
|
||||
unset($OC_submissionFieldAR['file']);
|
||||
foreach ($OC_submissionFieldSetAR as $fsid => $fsar) {
|
||||
if (in_array('file', $fsar['fields'])) {
|
||||
if (count($fsar['fields']) == 1) {
|
||||
unset($OC_submissionFieldSetAR[$fsid]);
|
||||
} else {
|
||||
$OC_submissionFieldSetAR[$fsid]['fields'] = array_diff($OC_submissionFieldSetAR[$fsid]['fields'], array('file'));
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Set contact author field to 1 and hide it if (minDisplayAuthors=1 && maxAuthors=1) || (OC_authorOneContact=1)
|
||||
if ( isset($OC_submissionFieldAR['contactid']) && $author1contact ) {
|
||||
$OC_submissionFieldAR['contactid']['type'] = 'hidden';
|
||||
$_POST['contactid'] = 1;
|
||||
$GLOBALS['updateAuthorFieldsAR'] = array_diff($GLOBALS['updateAuthorFieldsAR'], array('contactid')); // remove contactid field from list of fields to be updated via Add Author
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,244 @@
|
||||
<?php
|
||||
|
||||
// +----------------------------------------------------------------------+
|
||||
// | OpenConf |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Copyright (c) 2002-2020 Zakon Group LLC. All Rights Reserved. |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | This source file is subject to the OpenConf License, available on |
|
||||
// | the OpenConf web site: www.OpenConf.com |
|
||||
// +----------------------------------------------------------------------+
|
||||
|
||||
$OC_subNew = true; // flag for designating new submission
|
||||
|
||||
require_once "../include.php";
|
||||
|
||||
oc_sendNoCacheHeaders();
|
||||
|
||||
// Set number of author fields to display
|
||||
if (isset($_POST['authornum']) && ctype_digit($_POST['authornum'])) {
|
||||
$oc_authorNum = $_POST['authornum'];
|
||||
} else {
|
||||
$oc_authorNum = $OC_configAR['OC_authorsMinDisplay'];
|
||||
}
|
||||
|
||||
printHeader(oc_('Submission'), 3);
|
||||
|
||||
// Check whether cfp still open
|
||||
if (! $OC_statusAR['OC_submissions_open'] || ((defined('OCC_LICENSE_EXPIRES')) && (strtotime(OCC_LICENSE_EXPIRES) < time()))) {
|
||||
print '<p class="warn">' . oc_('Submissions are closed.') . '</p>';
|
||||
printFooter();
|
||||
exit;
|
||||
}
|
||||
|
||||
// File upload settings
|
||||
$uploadDir = $OC_configAR['OC_paperDir'];
|
||||
$extAR = $OC_configAR['OC_extar'];
|
||||
$fileNotice = ( isset($OC_configAR['OC_paperFldNote']) ? oc_($OC_configAR['OC_paperFldNote']) : '' );
|
||||
$formatDBFldName = 'format';
|
||||
$fileFldName = 'File';
|
||||
|
||||
if (oc_hookSet('author-submit-preprocess')) {
|
||||
foreach ($GLOBALS['OC_hooksAR']['author-submit-preprocess'] as $hook) {
|
||||
require_once $hook;
|
||||
}
|
||||
}
|
||||
|
||||
require_once OCC_FORM_INC_FILE;
|
||||
require_once OCC_SUBMISSION_INC_FILE;
|
||||
|
||||
// Check whether this is a submission
|
||||
if (isset($_POST['submit'])) {
|
||||
$err = '';
|
||||
$errInc = '';
|
||||
$qfields = array(); // fields to insert into submission table
|
||||
$afields = array(); // fields to insert into authors table
|
||||
$tfields = array(); // fields to insert into topics table
|
||||
$fileUploaded = false;
|
||||
|
||||
require_once 'submission-validate.inc';
|
||||
|
||||
// errors?
|
||||
if (!empty($err)) {
|
||||
print '<p><span class="err">' . oc_('Please check the following:') . '<ul>' . $err . $errInc . '</ul></span><br /><hr /><br />';
|
||||
// remove uploaded file?
|
||||
if (isset($_FILES['file']['tmp_name']) && is_file($_FILES['file']['tmp_name'])) {
|
||||
unlink($_FILES['file']['tmp_name']);
|
||||
}
|
||||
} else {
|
||||
// Check that paper hasn't been submitted yet; if it has notify author and bail
|
||||
$q = "SELECT `" . OCC_TABLE_PAPER . "`.`paperid` FROM `" . OCC_TABLE_PAPER . "`, `" . OCC_TABLE_AUTHOR . "` WHERE `" . OCC_TABLE_PAPER . "`.`title`='" . safeSQLstr($_POST['title']) . "' AND `" . OCC_TABLE_AUTHOR . "`.`paperid`=`" . OCC_TABLE_PAPER . "`.`paperid` AND `" . OCC_TABLE_AUTHOR . "`.`position`=`" . OCC_TABLE_PAPER . "`.`contactid` AND `" . OCC_TABLE_AUTHOR . "`.`name_last`='" . safeSQLstr($_POST['name_last'.$_POST['contactid']]) . "'";
|
||||
$r = ocsql_query($q) or err(oc_('Unable to verify whether submission has already been made'));
|
||||
if (ocsql_num_rows($r) > 0) {
|
||||
print '<p><span class="err">' . oc_('This submission appears to already have been made; please check your email for a confirmation. ');
|
||||
if ($OC_statusAR['OC_edit_open']) {
|
||||
print sprintf(oc_('You may review or edit the submission <a href="%s">here</a>.'), 'edit.php') . ' ';
|
||||
}
|
||||
print oc_('Please contact the Chair with any questions.') . '</span></p>';
|
||||
printFooter();
|
||||
exit;
|
||||
}
|
||||
|
||||
$backupMsg = '';
|
||||
|
||||
// add paper
|
||||
$q = "INSERT INTO `" . OCC_TABLE_PAPER . "` SET `submissiondate`='" . safeSQLstr(date("Y-m-d")) . "', `lastupdate`='" . safeSQLstr(date("Y-m-d")) . "'";
|
||||
foreach ($qfields as $qid => $qval) {
|
||||
$q .= ", `" . $qid . "`=" . $qval;
|
||||
}
|
||||
$r = ocsql_query($q) or err(oc_('unable to process submission'));
|
||||
|
||||
$backupMsg .= "$q\n\n";
|
||||
|
||||
// get paper ID
|
||||
$pid = ocsql_insert_id() or err(oc_('unable to get submission ID'));
|
||||
|
||||
// add authors
|
||||
foreach ($afields as $qid => $qar) {
|
||||
$q = "INSERT INTO `" . OCC_TABLE_AUTHOR . "` SET `paperid`=" . (int) $pid . ", `position`=" . (int) $qid;
|
||||
foreach ($qar as $qqid => $qqval) {
|
||||
$q .= ", `" . $qqid . "`=" . $qqval;
|
||||
}
|
||||
$r = ocsql_query($q) or err(oc_('unable to add one or more authors, but submission added. Please edit submission.'));
|
||||
$backupMsg .= "$q\n\n";
|
||||
}
|
||||
|
||||
// add topic(s)
|
||||
if (!empty($tfields)) {
|
||||
$q = "INSERT INTO `" . OCC_TABLE_PAPERTOPIC . "` (`paperid`,`topicid`) VALUES";
|
||||
foreach ($tfields as $t) {
|
||||
$q .= " ($pid,$t),";
|
||||
}
|
||||
$r = ocsql_query(rtrim($q, ',')) or err(oc_('unable to add submission topic, but submission and authors added'));
|
||||
$backupMsg .= "$q\n\n";
|
||||
}
|
||||
|
||||
if (!empty($OC_configAR['OC_subBackupEmail'])) {
|
||||
sendEmail($OC_configAR['OC_subBackupEmail'], "Submission ID $pid SQL", $backupMsg);
|
||||
}
|
||||
|
||||
$formFields = oc_('Submission ID') . ": " . $pid . "\n\n" . oc_genFieldMessage($OC_submissionFieldSetAR, $OC_submissionFieldAR, $_POST);
|
||||
|
||||
// confirm it
|
||||
$confirmmsg = '';
|
||||
|
||||
// File Uploaded?
|
||||
if ($fileUploaded) {
|
||||
$fileName = $uploadDir . $pid . '.' . $_POST['format'];
|
||||
if (oc_saveFile($_FILES['file']['tmp_name'], $fileName, $_POST['format'])) {
|
||||
$formFields .= "\n\n" . oc_('File') . ': ' . oc_('uploaded') . "\n"; // confirm to user
|
||||
// update format
|
||||
$fq = "UPDATE `" . OCC_TABLE_PAPER . "` SET `" . $formatDBFldName . "`='" . safeSQLstr($_POST['format']) . "' WHERE `paperid`='" . $pid . "' LIMIT 1";
|
||||
ocsql_query($fq); // note no error check
|
||||
} else {
|
||||
$formFields .= "\n\n" . oc_('File') . ':' . oc_('NOT uploaded') . "\n"; // confirm to user
|
||||
$confirmmsg .= '<p class="warn">' . sprintf(oc_('Your file failed to load properly. Please try <a href="%s">uploading just the file</a> or contact the Chair.'), 'upload.php') . '</p>';
|
||||
}
|
||||
}
|
||||
|
||||
if (isset($OC_configAR['OC_subConfirmNotice'])) {
|
||||
if (preg_match("/\<(?:p|br) ?\/?\>/", $OC_configAR['OC_subConfirmNotice'])) { // HTML?
|
||||
$confirmmsg .= oc_($OC_configAR['OC_subConfirmNotice']);
|
||||
} else {
|
||||
$confirmmsg .= nl2br(oc_($OC_configAR['OC_subConfirmNotice']));
|
||||
}
|
||||
} else {
|
||||
//T: [:code:] should be left untranslated
|
||||
$confirmmsg .= oc_('<p><strong>Thank you for your submission. Your submission ID number is [:sid:]. Please write this number down and include it in any communications with us.</strong></p>
|
||||
|
||||
<p><strong>Below is the information submitted. We have also emailed a copy to the submission contact. If you notice any problems or do <em>not</em> receive the email within 24 hours, please contact us.</strong></p>
|
||||
|
||||
<p>[:formfields:]</p>');
|
||||
}
|
||||
|
||||
// Get and update notification template
|
||||
// ocIgnore included so poEdit picks up (DB) template translation
|
||||
//T: [:sid:] is the numeric submission ID
|
||||
$ocIgnoreSubject = oc_('Submission ID [:sid:]');
|
||||
//T: [:OC_confName:] is the event name
|
||||
$ocIgnoreBody = oc_('Thank you for your submission to [:OC_confName:]. Below is a copy of the information submitted for your records.
|
||||
|
||||
[:fields:]');
|
||||
list($mailsubject, $mailbody) = oc_getTemplate('author-submit');
|
||||
$templateExtraAR = array(
|
||||
'sid' => $pid,
|
||||
'fields' => $formFields
|
||||
);
|
||||
$mailsubject = oc_replaceVariables($mailsubject, $templateExtraAR);
|
||||
$mailbody = oc_replaceVariables($mailbody, $templateExtraAR);
|
||||
|
||||
if (oc_hookSet('author-submit-save')) {
|
||||
foreach ($GLOBALS['OC_hooksAR']['author-submit-save'] as $hook) {
|
||||
require_once $hook;
|
||||
}
|
||||
}
|
||||
|
||||
// Set up confirmation
|
||||
$confirmmsg = preg_replace("/\[:sid:\]/", $pid, $confirmmsg);
|
||||
$confirmmsg = preg_replace("/\[:formfields:\]/", '<br />' . nl2br(safeHTMLstr($formFields)), $confirmmsg);
|
||||
|
||||
print $confirmmsg;
|
||||
|
||||
if (($OC_configAR['OC_emailAuthorRecipients'] == 1) && !empty($allemails)) {
|
||||
$mailto = $allemails;
|
||||
} else {
|
||||
$mailto = $contactemail;
|
||||
}
|
||||
|
||||
sendEmail($mailto, $mailsubject, $mailbody, $OC_configAR['OC_notifyAuthorSubmit']);
|
||||
|
||||
printFooter();
|
||||
|
||||
// log
|
||||
oc_logit('submission', 'Submission ID ' . $pid . ' made. Title: ' . $_POST['title']);
|
||||
|
||||
if (oc_hookSet('author-submit-postsave')) {
|
||||
foreach ($GLOBALS['OC_hooksAR']['author-submit-postsave'] as $hook) {
|
||||
require_once $hook;
|
||||
}
|
||||
}
|
||||
|
||||
exit;
|
||||
} // else no errors
|
||||
}
|
||||
|
||||
if (isset($OC_configAR['OC_paperSubNote']) && !empty($OC_configAR['OC_paperSubNote'])) {
|
||||
print '<div>' . (preg_match("/\<(?:p|br) ?\/?\>/", oc_($OC_configAR['OC_paperSubNote'])) ? oc_($OC_configAR['OC_paperSubNote']) : nl2br(oc_($OC_configAR['OC_paperSubNote']))) . '</div><p><hr /></p>';
|
||||
}
|
||||
|
||||
print '
|
||||
<form method="post" enctype="multipart/form-data" action="' . $_SERVER['PHP_SELF'] . '" class="ocform" id="makesub">
|
||||
<input type="hidden" name="authornum" id="authornum" value="' . $oc_authorNum . '" />
|
||||
';
|
||||
|
||||
oc_displayFieldSet($OC_submissionFieldSetAR, $OC_submissionFieldAR, $_POST);
|
||||
|
||||
if (oc_hookSet('author-submit-fields')) {
|
||||
foreach ($GLOBALS['OC_hooksAR']['author-submit-fields'] as $hook) {
|
||||
require_once $hook;
|
||||
}
|
||||
}
|
||||
|
||||
print '
|
||||
<p class="note">' . oc_('Please check over your entries, making sure everything is filled out. When ready, click on the Make Submission button below once.') . '</p>
|
||||
<div id="oc_submit_emailConfirmOuter">
|
||||
<div id="oc_submit_emailConfirmInner" aria-live="polite">
|
||||
<p class="note">' . oc_('The confirmation email will be sent to:') . '</p>
|
||||
<p id="oc_submit_emailConfirm"></p>
|
||||
</div>
|
||||
</div>
|
||||
<p><input type="submit" name="submit" id="submit" value="' . oc_('Make Submission') . '" class="submit" /></p>
|
||||
<span id="processing" style="position: relative; visibility: hidden;">' . oc_('Processing...') . '</span>
|
||||
</fieldset>
|
||||
</form>
|
||||
<script type="text/javascript">
|
||||
oc_setupProcessingForm("makesub");
|
||||
document.getElementById("makesub").addEventListener("change", function (evt) { oc_updateSubmitEmailAddresses(evt, true, ' . $OC_configAR['OC_emailAuthorRecipients'] . '); });
|
||||
oc_updateSubmitEmailAddresses(null, true, ' . $OC_configAR['OC_emailAuthorRecipients'] . ');
|
||||
</script>
|
||||
';
|
||||
|
||||
|
||||
printFooter();
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,260 @@
|
||||
<?php
|
||||
|
||||
// +----------------------------------------------------------------------+
|
||||
// | OpenConf |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Copyright (c) 2002-2020 Zakon Group LLC. All Rights Reserved. |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | This source file is subject to the OpenConf License, available on |
|
||||
// | the OpenConf web site: www.OpenConf.com |
|
||||
// +----------------------------------------------------------------------+
|
||||
|
||||
require_once "../include.php";
|
||||
|
||||
$uploadDir = $OC_configAR['OC_paperDir'];
|
||||
$uploadOpen = $OC_statusAR['OC_upload_open'];
|
||||
$extAR = $OC_configAR['OC_extar'];
|
||||
$fileNotice = ( isset($OC_configAR['OC_paperFldNote']) ? $OC_configAR['OC_paperFldNote'] : '' );
|
||||
$formatDBFldName = 'format';
|
||||
|
||||
if (OCC_CHAIR_PWD_TRUMPS && isset($_REQUEST['c']) && ($_REQUEST['c'] == 1)) {
|
||||
$hdrfn = 1;
|
||||
beginChairSession();
|
||||
$chair = TRUE;
|
||||
} else {
|
||||
$hdrfn = 3;
|
||||
$chair = FALSE;
|
||||
}
|
||||
|
||||
// Print appropriate header
|
||||
printHeader(oc_('Upload File'), $hdrfn);
|
||||
|
||||
if (oc_hookSet('author-upload-preprocess')) {
|
||||
foreach ($GLOBALS['OC_hooksAR']['author-upload-preprocess'] as $hook) {
|
||||
require_once $hook;
|
||||
}
|
||||
}
|
||||
|
||||
if ($chair) { // display back links
|
||||
print '<p style="text-align: center"><a href="../chair/show_paper.php?pid=' . safeHTMLstr($_REQUEST['pid']) . '">View This Submission</a> | <a href="../chair/list_papers.php">View All Submissions</a></p><br />';
|
||||
} elseif (! $uploadOpen) { // Check that we're still open
|
||||
warn(oc_('File upload is not available'));
|
||||
}
|
||||
|
||||
// Check whether this is a submission
|
||||
if (isset($_POST['ocaction']) && ($_POST['ocaction'] == "Upload File")) {
|
||||
if ($chair && !validToken('chair')) {
|
||||
warn(oc_('Invalid submission'));
|
||||
}
|
||||
|
||||
// Check inputs
|
||||
if (! isset($_POST['pid']) || ! preg_match("/^\d+$/", $_POST['pid'])) {
|
||||
warn(oc_('Submission ID is invalid') . '. <a href="upload.php">' . oc_('Try again') . '</a>');
|
||||
} elseif (
|
||||
(! $chair && (!isset($_POST['pwd']) || empty($_POST['pwd'])))
|
||||
|| (!isset($_FILES['file']['name']) || empty($_FILES['file']['name']))
|
||||
|| (!isset($_POST['format']) || !in_array($_POST['format'], $extAR))
|
||||
) {
|
||||
warn('<form method="post" action="upload.php">' . oc_('Please fill in all fields.') . ' <input type="hidden" name="c" value="' . ($chair ? 1 : 0) . '" /><input type="hidden" name="pid" value="' . safeHTMLstr(varValue('pid', $_POST)) . '" /><input type="submit" value="' . oc_('Try again') . '" /></form>');
|
||||
}
|
||||
|
||||
// Set PID to intval in case of leading 0's
|
||||
$usepid = intval($_POST['pid']);
|
||||
|
||||
// Retrieve pwd, format, & contact author email
|
||||
$pq = "SELECT `" . OCC_TABLE_PAPER . "`.`" . $formatDBFldName . "`, `" . OCC_TABLE_PAPER . "`.`accepted`, `" . OCC_TABLE_PAPER . "`.`password`, `" . OCC_TABLE_AUTHOR . "`.`email` FROM `" . OCC_TABLE_PAPER . "` LEFT JOIN `" . OCC_TABLE_AUTHOR . "` ON (`" . OCC_TABLE_PAPER . "`.`paperid`=`" . OCC_TABLE_AUTHOR . "`.`paperid` AND `" . OCC_TABLE_PAPER . "`.`contactid`=`" . OCC_TABLE_AUTHOR . "`.`position`) WHERE `" . OCC_TABLE_PAPER . "`.`paperid`='" . $usepid . "'";
|
||||
$pr = ocsql_query($pq) or err("Unable to upload file");
|
||||
if (ocsql_num_rows($pr) != 1) {
|
||||
warn(oc_('Submission ID or password entered is incorrect'));
|
||||
}
|
||||
$pl = ocsql_fetch_array($pr);
|
||||
|
||||
// Valid pid/pwd?; check for chair pwd first to save db call
|
||||
if (! $chair
|
||||
&& !oc_password_verify($_POST['pwd'], $pl['password'])
|
||||
) {
|
||||
warn(oc_('Submission ID or password entered is incorrect'));
|
||||
}
|
||||
|
||||
// Was a file successfully loaded
|
||||
if (!isset($_FILES['file']['error']) // bad upload
|
||||
|| $_FILES['file']['error'] // error
|
||||
|| ! is_uploaded_file($_FILES['file']['tmp_name']) // fake upload
|
||||
|| ($_FILES['file']['size'] <= 0) // empty file
|
||||
|| (!empty($OC_configAR['OC_fileLimit']) && ($_FILES['file']['size'] > ($OC_configAR['OC_fileLimit'] * 1024 * 1024))) // file size > limit
|
||||
) {
|
||||
warn(sprintf(oc_('The file failed to load. Please <a href="%1$s">try again</a>. If the problem persists, contact the <a href="mailto:%2$s?subject=File Upload failed">Chair</a>'), $_SERVER['PHP_SELF'], $OC_configAR['OC_pcemail']));
|
||||
}
|
||||
|
||||
if (oc_hookSet('author-upload-validate')) {
|
||||
foreach ($GLOBALS['OC_hooksAR']['author-upload-validate'] as $hook) {
|
||||
require_once $hook;
|
||||
}
|
||||
}
|
||||
|
||||
// Delete old file?
|
||||
$oldFileName = $uploadDir . $usepid . '.' . $pl[$formatDBFldName];
|
||||
oc_deleteFile($oldFileName);
|
||||
|
||||
// Move new file
|
||||
$err = 0;
|
||||
$newFileName = $uploadDir . $usepid . '.' . $_POST['format'];
|
||||
|
||||
// Check whether file uploaded
|
||||
if (is_uploaded_file($_FILES['file']['tmp_name'])
|
||||
&& oc_saveFile($_FILES['file']['tmp_name'], $newFileName, $_POST['format'])
|
||||
) {
|
||||
//T: %s = submission ID (number)
|
||||
$confirmmsg = sprintf(oc_('Submission ID %s has been uploaded.'), $usepid);
|
||||
|
||||
// Get and update notification template
|
||||
// ocIgnore included so poEdit picks up (DB) template translation
|
||||
//T: [:sid:] is the numeric submission ID
|
||||
$ocIgnoreSubject = oc_('Submission ID [:sid:] file uploaded');
|
||||
//T: [:sid:] is the numeric submission ID
|
||||
$ocIgnoreBody = oc_('Submission ID [:sid:] has been uploaded.
|
||||
|
||||
[:error:]');
|
||||
list($mailsubject, $mailbody) = oc_getTemplate('author-upload');
|
||||
$templateExtraAR = array(
|
||||
'sid' => $usepid,
|
||||
'error' => ''
|
||||
);
|
||||
|
||||
// Set lastupdate date, and format if needed
|
||||
$eq = "UPDATE `" . OCC_TABLE_PAPER . "` SET `lastupdate`='" . safeSQLstr(date("Y-m-d")) . "'";
|
||||
// also update format if changed
|
||||
if ($_POST['format'] != $pl[$formatDBFldName]) {
|
||||
$eq .= ", `" . $formatDBFldName . "`='" . safeSQLstr($_POST['format']) . "'";
|
||||
}
|
||||
$eq .= " WHERE `paperid`='" . $usepid . "'";
|
||||
if ( ! ocsql_query($eq)) {
|
||||
$templateExtraAR['error'] = oc_('However, we were unable to update the format.');
|
||||
$confirmmsg .= "\n\n" . oc_('However, we were unable to update the format.');
|
||||
$err = 1;
|
||||
}
|
||||
|
||||
$mailsubject = oc_replaceVariables($mailsubject, $templateExtraAR);
|
||||
$mailbody = oc_replaceVariables($mailbody, $templateExtraAR);
|
||||
|
||||
if (oc_hookSet('author-upload-preconfirm')) {
|
||||
foreach ($GLOBALS['OC_hooksAR']['author-upload-preconfirm'] as $hook) {
|
||||
require_once $hook;
|
||||
}
|
||||
}
|
||||
|
||||
// Send email confirmation
|
||||
$mailto = '';
|
||||
if ( $OC_configAR['OC_emailAuthorOnUpload'] && ! $chair) {
|
||||
if ($OC_configAR['OC_emailAuthorRecipients'] == 1) {
|
||||
$ar = ocsql_query("SELECT `email` FROM `" . OCC_TABLE_AUTHOR . "` WHERE `paperid`='" . safeSQLstr($_POST['pid']) . "'") or err('Unable to retrieve author email addresses');
|
||||
while ($al = ocsql_fetch_assoc($ar)) {
|
||||
$mailto .= $al['email'] . ',';
|
||||
}
|
||||
$mailto = rtrim($mailto, ',');
|
||||
}
|
||||
if (empty($mailto)) {
|
||||
$mailto = $pl['email'];
|
||||
}
|
||||
}
|
||||
|
||||
sendEmail($mailto, $mailsubject, $mailbody, $OC_configAR['OC_notifyAuthorUpload']);
|
||||
|
||||
if (!$err) {
|
||||
print $confirmmsg;
|
||||
} else {
|
||||
err($confirmmsg);
|
||||
}
|
||||
|
||||
// log
|
||||
oc_logit('submission', 'Submission ID ' . $usepid . ' file upload' . (isset($_POST['oc_multifile_type']) ? (' (MultiFile Type: ' . $_POST['oc_multifile_type'] . ')') : ''));
|
||||
|
||||
} else { // file failed to upload or move properly
|
||||
print '<span class="err">' . sprintf(oc_('The file failed to load properly. Please email it directly to the <a href="mailto:%1$s?subject=%2$s File failed - submission ID %3$s">Chair</a>'), $OC_configAR['OC_pcemail'], $OC_configAR['OC_confName'], $usepid) . '</span>';
|
||||
}
|
||||
|
||||
printFooter();
|
||||
exit;
|
||||
}
|
||||
|
||||
print '
|
||||
<form method="POST" enctype="multipart/form-data" action="upload.php" id="uploadform">
|
||||
<input type="hidden" name="ocaction" value="Upload File" />
|
||||
';
|
||||
|
||||
if ($chair) {
|
||||
print '
|
||||
<input type="hidden" name="c" value="1">
|
||||
<input type="hidden" name="token" value="' . safeHTMLstr($_SESSION[OCC_SESSION_VAR_NAME]['chairtoken']) . '" />
|
||||
<input type="hidden" name="pid" value="' . safeHTMLstr($_REQUEST['pid']) . '" />
|
||||
';
|
||||
}
|
||||
|
||||
print '<table border="0" cellspacing="0" cellpadding="5" aria-live="polite">';
|
||||
|
||||
if (oc_hookSet('author-upload-formtop')) {
|
||||
foreach ($GLOBALS['OC_hooksAR']['author-upload-formtop'] as $hook) {
|
||||
require_once $hook;
|
||||
}
|
||||
}
|
||||
|
||||
if (! $chair) {
|
||||
print '
|
||||
<tr id="subid"><td style="font-weight: bold; white-space: nowrap;"><label for="pid">' . oc_('Submission ID') . ':</label></td><td><input name="pid" id="pid" size="10" tabindex="2" value="' . ((isset($_GET['id']) && ctype_digit($_GET['id'])) ? safeHTMLstr($_GET['id']) : '') . '"> ( <a href="email_papers.php" tabindex="7">' . oc_('forgot ID?') . '</a> )</td></tr>
|
||||
<tr id="pwd"><td><strong><label for="pwdfld">' . oc_('Password') . ':</label></strong></td><td><input name="pwd" id="pwdfld" type="password" size="20" maxlength="255" tabindex="3"> ( <a href="reset.php" tabindex="8">' . oc_('forgot password?') . '</a> )</td></tr>
|
||||
';
|
||||
} else {
|
||||
print '
|
||||
<div style="display: none;"><div id="subid"></div><div id="pwd"></div></div>
|
||||
';
|
||||
}
|
||||
|
||||
print '
|
||||
<tr id="filerow"><td valign="top"><strong><label for="file">' . oc_('File') . ':</label></strong></td><td><input type="file" name="file" id="file" size="30" tabindex="4" /> <strong><label for="format">' .
|
||||
//T: File format
|
||||
oc_('Format') . ':</label></strong>
|
||||
';
|
||||
|
||||
print '<select name="format" id="format" tabindex="5">';
|
||||
$formatoptions = "";
|
||||
foreach ($extAR as $fval) {
|
||||
$formatoptions .= '<option value="' . $fval . '"> ' . $OC_formatAR[$fval] . '</option>';
|
||||
}
|
||||
print $formatoptions;
|
||||
print "</select><br /><br />\n";
|
||||
|
||||
print '
|
||||
<div class="note2" id="fldnote">' . nl2br($fileNotice) . '</div>
|
||||
';
|
||||
|
||||
if (empty($OC_configAR['OC_fileLimit'])) {
|
||||
print '<p class="note">' . sprintf(oc_('File size limit is %s.'), $OC_maxFileSize) . '</p>';
|
||||
}
|
||||
|
||||
print '
|
||||
</td></tr>
|
||||
';
|
||||
|
||||
if (oc_hookSet('author-upload-formbottom')) {
|
||||
foreach ($GLOBALS['OC_hooksAR']['author-upload-formbottom'] as $hook) {
|
||||
require_once $hook;
|
||||
}
|
||||
}
|
||||
|
||||
print '
|
||||
</table>
|
||||
<p>
|
||||
<div id="sub"><input type="submit" name="subaction" class="submit" value="' . oc_('Upload File') . '" tabindex="6"></div>
|
||||
</form>
|
||||
<p>
|
||||
';
|
||||
|
||||
if (oc_hookSet('author-upload-bottom')) {
|
||||
foreach ($GLOBALS['OC_hooksAR']['author-upload-bottom'] as $hook) {
|
||||
require_once $hook;
|
||||
}
|
||||
}
|
||||
|
||||
printFooter();
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,63 @@
|
||||
<?php
|
||||
|
||||
// +----------------------------------------------------------------------+
|
||||
// | OpenConf |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Copyright (c) 2002-2020 Zakon Group LLC. All Rights Reserved. |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | This source file is subject to the OpenConf License, available on |
|
||||
// | the OpenConf web site: www.OpenConf.com |
|
||||
// +----------------------------------------------------------------------+
|
||||
|
||||
// included from edit.php
|
||||
|
||||
$spq = "SELECT * FROM `" . OCC_TABLE_PAPER . "` WHERE `paperid`='" . safeSQLstr($pid) . "'";
|
||||
$spr = ocsql_query($spq) or err(oc_('Unable to retrieve submission'));
|
||||
if (ocsql_num_rows($spr) != 1) {
|
||||
warn(oc_('Submission ID is invalid'));
|
||||
exit;
|
||||
}
|
||||
$spl = ocsql_fetch_assoc($spr);
|
||||
|
||||
ocsql_query("UPDATE `" . OCC_TABLE_PAPER . "` SET `edittoken`=NULL, `edittime`=NULL WHERE `paperid`='" . safeSQLstr($pid) . "' LIMIT 1");
|
||||
|
||||
// Get authors
|
||||
$oc_authorNum = 0;
|
||||
$qa = "SELECT * FROM `" . OCC_TABLE_AUTHOR . "` WHERE `paperid`='" . safeSQLstr($pid) . "' ORDER BY `position`";
|
||||
$ra = ocsql_query($qa) or err(oc_('Unable to retrieve author(s) information'));
|
||||
while ($a = ocsql_fetch_array($ra)) {
|
||||
$apos = $a['position'];
|
||||
foreach ($a as $akey => $aval) {
|
||||
if (preg_match("/^(?:paperid|position)$/", $akey)) { continue; }
|
||||
$spl[$akey . $apos] = $aval;
|
||||
}
|
||||
}
|
||||
$oc_authorNum = $apos;
|
||||
|
||||
// Get topics
|
||||
$qt = "SELECT `topicid` FROM `" . OCC_TABLE_PAPERTOPIC . "` WHERE `paperid`='" . safeSQLstr($pid) . "'";
|
||||
$rt = ocsql_query($qt) or err(oc_('Unable to retrieve topic(s) information'));
|
||||
$spl['topics'] = array();
|
||||
while ($t = ocsql_fetch_array($rt)) {
|
||||
$spl['topics'][] = $t['topicid'];
|
||||
}
|
||||
|
||||
require_once OCC_FORM_INC_FILE;
|
||||
require_once OCC_SUBMISSION_INC_FILE;
|
||||
|
||||
print '
|
||||
<table class="ocfields">
|
||||
<tr><th>' . safeHTMLstr(oc_('Submission ID')) . ':</th><td>' . safeHTMLstr($pid) . '</td></tr>
|
||||
';
|
||||
|
||||
oc_showFieldSet($OC_submissionFieldSetAR, $OC_submissionFieldAR, $spl);
|
||||
|
||||
if (oc_hookSet('author-show_paper')) {
|
||||
foreach ($GLOBALS['OC_hooksAR']['author-show_paper'] as $hook) {
|
||||
require_once $hook;
|
||||
}
|
||||
}
|
||||
|
||||
print '</table>';
|
||||
|
||||
?>
|
||||
@@ -0,0 +1,119 @@
|
||||
<?php
|
||||
|
||||
// +----------------------------------------------------------------------+
|
||||
// | OpenConf |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | Copyright (c) 2002-2020 Zakon Group LLC. All Rights Reserved. |
|
||||
// +----------------------------------------------------------------------+
|
||||
// | This source file is subject to the OpenConf License, available on |
|
||||
// | the OpenConf web site: www.OpenConf.com |
|
||||
// +----------------------------------------------------------------------+
|
||||
|
||||
require_once "../include.php";
|
||||
require_once "../include-submissions.inc";
|
||||
|
||||
printHeader(oc_('Withdraw Submission'), 3);
|
||||
|
||||
// Withdraw allowed?
|
||||
if (! $OC_statusAR['OC_withdraw_open']) {
|
||||
print '<strong>' . oc_('Submission withdraw is not available.') . '</strong><p>';
|
||||
printFooter();
|
||||
exit;
|
||||
}
|
||||
|
||||
// Is this a post?
|
||||
if (isset($_POST['ocaction']) && ($_POST['ocaction'] == 'Withdraw Submission')) {
|
||||
// Check for paper ID & password
|
||||
if (! isset($_POST['pid']) ||
|
||||
! preg_match("/^\d+$/", $_POST['pid']) ||
|
||||
! isset($_POST['pwd']) ||
|
||||
empty($_POST['pwd'])
|
||||
) {
|
||||
warn(oc_('Submission ID or password entered is incorrect'));
|
||||
printFooter();
|
||||
exit;
|
||||
}
|
||||
|
||||
$pq = "SELECT `" . OCC_TABLE_PAPER . "`.`title`, `" . OCC_TABLE_PAPER . "`.`password`, `" . OCC_TABLE_AUTHOR . "`.`email` FROM `" . OCC_TABLE_PAPER . "`, `" . OCC_TABLE_AUTHOR . "` WHERE `" . OCC_TABLE_PAPER . "`.`paperid`='" . safeSQLstr($_POST['pid']) . "' AND `" . OCC_TABLE_PAPER . "`.`paperid`=`" . OCC_TABLE_AUTHOR . "`.`paperid` AND `" . OCC_TABLE_PAPER . "`.`contactid`=`" . OCC_TABLE_AUTHOR . "`.`position`";
|
||||
$pr = ocsql_query($pq) or err("Unable to retrieve submission");
|
||||
if (ocsql_num_rows($pr) != 1) {
|
||||
warn(oc_('Submission ID or password entered is incorrect'));
|
||||
printFooter();
|
||||
exit;
|
||||
}
|
||||
$pl = ocsql_fetch_array($pr);
|
||||
if (!oc_password_verify($_POST['pwd'], $pl['password'])) {
|
||||
warn(oc_('Submission ID or password entered is incorrect'));
|
||||
printFooter();
|
||||
exit;
|
||||
}
|
||||
|
||||
// Withdraw submission
|
||||
if (withdrawPaper($_POST['pid'], OCC_WORD_AUTHOR)) {
|
||||
$mailto = '';
|
||||
if ($OC_configAR['OC_emailAuthorRecipients'] == 1) {
|
||||
$ar = ocsql_query("SELECT `email` FROM `" . OCC_TABLE_AUTHOR . "` WHERE `paperid`='" . safeSQLstr($_POST['pid']) . "'") or err('Unable to retrieve author email addresses');
|
||||
while ($al = ocsql_fetch_assoc($ar)) {
|
||||
$mailto .= $al['email'] . ',';
|
||||
}
|
||||
$mailto = rtrim($mailto, ',');
|
||||
}
|
||||
|
||||
deletePaper($_POST['pid'], false);
|
||||
print '<p>' . oc_('Your submission has been withdrawn. If this is not what you intended to do, please contact the Chair.') . '</p>';
|
||||
// Notify via email
|
||||
// ocIgnore included so poEdit picks up (DB) template translation
|
||||
//T: [:sid:] is the numeric submission ID
|
||||
$ocIgnoreSubject = oc_('Submission Withdraw - ID [:sid:]');
|
||||
$ocIgnoreBody = oc_('The submission below has been withdrawn at the author\'s request. If you did not intend to withdraw the submission, please reply back.
|
||||
|
||||
[:submission:]');
|
||||
list($mailsubject, $mailbody) = oc_getTemplate('author-withdraw');
|
||||
$templateExtraAR = array(
|
||||
'sid' => $_POST['pid'],
|
||||
'submission' => oc_('Submission ID') . ': ' . $_POST['pid'] . "\n" . oc_('Title') . ': ' . $pl['title']
|
||||
);
|
||||
$mailsubject = oc_replaceVariables($mailsubject, $templateExtraAR);
|
||||
$mailbody = oc_replaceVariables($mailbody, $templateExtraAR);
|
||||
|
||||
if (empty($mailto)) {
|
||||
$mailto = $pl['email'];
|
||||
}
|
||||
sendEmail($mailto, $mailsubject, $mailbody, $OC_configAR['OC_notifyAuthorWithdraw']);
|
||||
} else {
|
||||
print '<p>' . oc_('We encountered a problem withdrawing your submission. Please contact the Chair.') . '</p>';
|
||||
}
|
||||
|
||||
printFooter();
|
||||
exit;
|
||||
} // if submit
|
||||
|
||||
// display sub id/password form
|
||||
print '
|
||||
<form method="post" action="' . $_SERVER['PHP_SELF'] . '" id="withdrawform">
|
||||
<input type="hidden" name="ocaction" value="Withdraw Submission" />
|
||||
<table border=0 cellspacing=0 cellpadding=5>
|
||||
<tr><td><strong><label for="pid">' . oc_('Submission ID') . '</label>:</strong></td><td><input name="pid" id="pid" size="10" tabindex="1"> ( <a href="email_papers.php" tabindex="4">' . oc_('forgot ID?') . '</a> )</td></tr>
|
||||
<tr><td><strong><label for="password">' . oc_('Password') . '</label>:</strong></td><td><input name="pwd" id="password" type="password" tabindex="2" size="20" maxlength="255"> ( <a href="reset.php" tabindex="5">' . oc_('forgot password?') . '</a> )</td></tr>
|
||||
</table>
|
||||
<p class="warn">' . oc_('Clicking the button below will result in your submission being withdrawn.') . '</p>
|
||||
<p><input type="submit" name="submit" value="' . oc_('Withdraw Submission') . '" tabindex="3" class="submit" onclick="return(confirm(\'' . oc_('Proceed with withdrawing submission?') . '\'))" /></p>
|
||||
</form>
|
||||
<script language="javascript">
|
||||
<!--
|
||||
document.forms[0].elements[0].focus();
|
||||
// -->
|
||||
</script>
|
||||
';
|
||||
|
||||
if (oc_hookSet('author-withdraw-bottom')) {
|
||||
foreach ($GLOBALS['OC_hooksAR']['author-withdraw-bottom'] as $hook) {
|
||||
require_once $hook;
|
||||
}
|
||||
}
|
||||
|
||||
printFooter();
|
||||
|
||||
exit;
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user