<?php require_once "pages.php"; $act = "prefs"; $ref = pageLinkAct(); pageHeader(); // defaults update if (isset($_POST['update'])) { // update user settings if (userUpd($auth['name'], null, null, $_POST['email'])) { $auth['email'] = $_POST['email']; infoMessage(T_("Settings update"), T_("Settings successfully updated.")); } } ?> <form action="<?php echo $ref; ?> " method="post" onsubmit="validate(event);"> <ul> <h3><?php echo T_("Defaults"); ?> </h3> <li> <?php $error = isset($_POST["update"]) && empty($_POST["email"]); $class = "description required" . ($error ? " error" : ""); ?> <label class="<?php
foreach ($db->query($sql) as $DATA) { if (isGrantExpired($DATA)) { continue; } $our = $DATA["user_id"] == $auth["id"]; $class = "file expanded " . $DATA['id']; if ($our) { $class .= " our"; } echo "<tr class=\"{$class}\">"; // selection echo "<td><input class=\"element checkbox\" type=\"checkbox\" name=\"sel[]\" value=\"" . $DATA['id'] . "\"/></td>"; // upload echo '<td><a href="' . grantUrl($DATA) . '">' . '<img title="' . T_("Upload") . "\" src=\"{$style}/static/upload.png\"/></a></td>"; // delete echo "<td><a href=\"" . pageLinkAct(array('purge' => null, 'sel' => $DATA['id'])) . "\">" . "<img title=\"" . T_("Purge") . "\" src=\"{$style}/static/cross.png\"/></a></td>"; // name echo '<td class="ticketid">' . htmlEntUTF8($DATA['id']) . '</td>'; // user echo "<td>" . htmlEntUTF8($DATA["user"]) . "</td>"; // date echo '<td data-sort-value="' . $DATA["time"] . '">' . date($dateFmtShort, $DATA["time"]) . '</td>'; // expire $expStr = grantExpiration($DATA, $expVal); echo "<td data-sort-value=\"{$expVal}\">{$expStr}</td>"; echo "</tr>"; } ?> </tbody> </table>
<?php $act = "tedit"; $ref = pageLinkAct(array('id' => $id, 'src' => $src)); $title = sprintf(T_("Editing ticket %s"), "<span class=\"ticketid\">{$id}</span>"); pageHeader(array('title' => $title)); // form values $name = anyOf(@$_POST['name'], $DATA['name']); $comment = anyOf(@$_POST['comment'], $DATA['cmt']); $hasPass = hasPassHash($DATA); $pass = anyOf(@$_POST['pass'], ""); $clear = anyOf(@$_POST['clear'], ""); $permanent = anyOf(@$_POST['ticket_permanent'], !($DATA['expire'] || $DATA["last_time"] || $DATA["expire_dln"])); $notify = anyOf(@$_POST['notify'], join(", ", getEMailAddrs($DATA['notify_email']))); // current expiration values if (isset($_POST['ticket_totaldays'])) { $totalDays = $_POST['ticket_totaldays']; } elseif ($DATA["expire"]) { $totalDays = ceil(($DATA["expire"] - time()) / (3600 * 24)); } elseif ($permanent) { $totalDays = $defaults['ticket']['total'] / (3600 * 24); } else { $totalDays = 0; } if (isset($_POST['ticket_lastdldays'])) { $lastDlDays = $_POST['ticket_lastdldays']; } elseif ($DATA["last_time"]) { $lastDlDays = ceil($DATA["last_time"] / (3600 * 24)); } elseif ($permanent) { $lastDlDays = $defaults['ticket']['lastdl'] / (3600 * 24); } else {