function msgGrantUse($GRANT, $DATA, &$subject, &$body) { $subject = sprintf(T_("[dl] download link for grant %s"), grantStr($GRANT)); $body = sprintf(T_("Your grant %s has been used by %s." . " The uploaded file (%s) is now available to be downloaded at:\n\n"), grantStr($GRANT), $_SERVER["REMOTE_ADDR"], $DATA['name']); if (!isset($DATA['pass'])) { $body .= ticketUrl($DATA); } else { $body .= T_("URL:") . " " . ticketUrl($DATA) . "\n" . T_("Password:"******" " . $DATA['pass'] . "\n"; } }
$sel =& $_REQUEST["sel"]; if (!is_array($sel)) { $sel = array($sel); } // purge immediately foreach ($sel as $id) { if (!isGrantId($id)) { continue; } $sql = "SELECT * FROM \"grant\" WHERE id = " . $db->quote($id); $DATA = $db->query($sql)->fetch(); if ($DATA === false) { continue; } // actually purge the grant $list[] = htmlEntUTF8(grantStr($DATA)); grantPurge($DATA, false); } if (count($list)) { infoMessage(T_("Purged"), $list); } } // list active grants $sql = 'SELECT g.*, u.name AS "user" FROM "grant" g' . ' LEFT JOIN "user" u ON u.id = g.user_id' . ' ORDER BY time DESC'; ?> <form action="<?php echo $ref; ?> " method="post"> <table class="sortable" id="allgrants"> <thead>
function logGrantEvent($DATA, $logLine, $logType = LOG_INFO) { logEvent('g/' . grantStr($DATA) . ": {$logLine}", $logType); }
<?php require_once "pages.php"; $act = false; pageHeader(array('title' => T_("Grant result"))); // final url msgGrantCreate($DATA, $subject, $body); $url = grantUrl($DATA); $mailto = "mailto:?subject=" . rawurlencode($subject) . "&body=" . rawurlencode($body); ?> <div> <label class="description"> <?php printf(T_("Your grant %s"), htmlEntUTF8(grantStr($DATA))); ?> </label> <p><span class="ticketid"><?php echo htmlentities($url); ?> </span></p> <?php if ($DATA['pass']) { echo "<p>" . T_("The required password is:") . " <tt>" . htmlEntUTF8($DATA['pass']) . "</tt></p>"; } if ($DATA['sent_email']) { echo "<p>" . T_("A grant link has been sent to:") . " "; $addrs = getEMailAddrs($DATA['sent_email']); foreach ($addrs as &$addr) { $addr = '<a href="mailto:' . urlencode($addr) . '">' . htmlentities($addr) . '</a>'; }