Skip to content
This repository has been archived by the owner on Feb 1, 2024. It is now read-only.

Commit

Permalink
Add support for CiC.
Browse files Browse the repository at this point in the history
  • Loading branch information
kmccurley committed Sep 19, 2023
1 parent c771d2a commit 763eb88
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 6 deletions.
4 changes: 2 additions & 2 deletions iacr/downloadaccepted.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function dedup_strings($arr) {
$sql = "SELECT paperId,title,authorInformation,abstract FROM Paper WHERE outcome > 0 AND timeWithdrawn = 0";
$stmt = $db->query($sql);
$papers = $stmt->fetchAll(PDO::FETCH_ASSOC);
if ($Opt['iacrType'] == 'tches' || $Opt['iacrType'] == 'tosc') {
if ($Opt['iacrType'] == 'tches' || $Opt['iacrType'] == 'tosc' || $Opt['iacrType'] == 'cic') {
foreach($finalData as &$paper) {
$paper['paperId'] = $dbname . '_' . $paper;
}
Expand All @@ -29,7 +29,7 @@ function dedup_strings($arr) {
$finalPapers = array();
// Create finalPapers version of $finalData, keyed by paperId for easy lookup.
foreach($finalData as &$paper) {
if ($Opt['iacrType'] == 'tches' || $Opt['iacrType'] == 'tosc') {
if ($Opt['iacrType'] == 'tches' || $Opt['iacrType'] == 'tosc' || $Opt['iacrType'] == 'cic') {
$paper['paperId'] = $dbname . '_' . $paper;
}
$finalPapers[$paper['paperId']] = $paper;
Expand Down
6 changes: 4 additions & 2 deletions iacr/includes/leftnav.inc
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
$withLNCS = array('pkc', 'tcc', 'crypto', 'eurocrypt', 'asiacrypt');
if (in_array($Opt['iacrType'], $withLNCS)) {
echo '<div><a id="menucopyright" class="navitem" href="copyright.php">Copyright forms</a></div>';
} elseif ($Opt['iacrType'] === 'tches' or $Opt['iacrType'] === 'tosc') {
} elseif ($Opt['iacrType'] === 'tches' || $Opt['iacrType'] === 'tosc' || $Opt['iacrType'] === 'cic') {
echo '<div><a id="menucopyright" class="navitem" href="copyright.php">Copyright forms</a></div>';
}
?>
Expand All @@ -23,8 +23,10 @@
if (in_array($Opt['iacrType'], $withLNCS)) {
echo '<div><a id="menulncs" class="navitem" href="lncs.php">LNCS table of contents</a></div>';
}
if ($Opt['iacrType'] != 'cic') {
echo '<div><a id="menuprogram" class="navitem" href="program.php">Program</a></div>';
}
?>
<div><a id="menuprogram" class="navitem" href="program.php">Program</a></div>
<div class="navheader font-weight-bold">IACR Documents</div>
<div><a class="navitem" href="https://www.iacr.org/docs/progchair.pdf" target="_blank">Program chair guidelines</a></div>
<div><a class="navitem" href="https://www.iacr.org/docs/genchair.pdf" target="_blank">General chair guidelines</a></div>
Expand Down
40 changes: 39 additions & 1 deletion iacr/includes/papertable.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,45 @@ function echo_iacr_button(PaperOption $opt, Conf $conf, $paperId) {
$msg = 'IACR copyright form';
break;
case IACRSetting::FINAL_PAPER:
$url = 'https://iacr.org/submit/upload/paper.php?' . http_build_query($querydata);
if ($conf->opt['iacrType'] == 'cic') {
try {
$db = new PDO("mysql:host=localhost;dbname=$dbname;charset=utf8",
$conf->opt['dbUser'],
$conf->opt['dbPassword']);
$sql = "SELECT timeSubmitted FROM Paper WHERE paperId=:paperId";
$stmt = $db->prepare($sql);
$stmt->bindParam(':paperId', $paperId);
$stmt->execute();
$timeSubmitted = $stmt->fetch(PDO::FETCH_ASSOC)['timeSubmitted'];
$submitted = date('Y-m-d H:m:s', $timeSubmitted);
// This is an approximation to acceptance timestamp. The actual acceptance date is apparently
// only stored in the ActionLog as an ill-defined action. We simply look for the last acceptance decision
// on ANY paper.
$stmt = $db->prepare('SELECT max(timestamp) AS accepted FROM ActionLog WHERE action LIKE "Set decision:%" AND action LIKE "%ccept%"');
$stmt->execute();
$timeAccepted = $stmt->fetch(PDO::FETCH_ASSOC)['accepted'];
$accepted = date('Y-m-d H:m:s', $timeAccepted);
$stmt = null;
$db = null;
} catch (PDOException $e) {
$submitted = 'error';
$accepted = 'error';
error_log('unable to fetch accepted and submitted: ' . $e->message());
}
$paperid = 'cic' . strval($conf->opt['volume']) . '_' . strval($conf->opt['issue']) . '_' . strval($paperId);
$authmsg = $paperid . 'candidate' . $submitted . $accepted;
$auth = hash_hmac('sha256', $authmsg, $conf->opt['hotcrp_shared_key']);
$querydata = array('paperid' => $paperid,
'auth' => $auth,
'version' => 'candidate',
'submitted' => $submitted,
'accepted' => $accepted,
'email' => $email,
'journal' => 'cic');
$url = 'https://publish.iacr.org/submit?' . http_build_query($querydata);
} else {
$url = 'https://iacr.org/submit/upload/paper.php?' . http_build_query($querydata);
}
$msg = 'Upload final paper';
break;
case IACRSetting::SLIDES:
Expand Down
2 changes: 1 addition & 1 deletion lib/mailer.php
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ function kw_passwordlink($args, $isbool, $uf) {
} else {
$capinfo->set_user($this->recipient)->set_token_pattern("hcpw0[20]");
}
$capinfo->set_expires_after(259200);
$capinfo->set_expires_after(900000);
$token = $capinfo->create();
$this->preparation->reset_capability = $token;
}
Expand Down

0 comments on commit 763eb88

Please sign in to comment.