function innerCreate() { global $db, $errorHandler; $cont = "\n" . '<div class="wide-container">'; $cont .= $this->menu->create(); $cont .= '<div class="wide-title">Certificate Authority</div>'; $cont .= '<div class="wide-box">'; $cont .= '<a href="#" onclick="effect_3 = Effect.SlideDown(\'help\',{duration:2}); return false;">help</a>'; $cont .= $this->help(); switch ($this->mode) { case 'expired': // Reissue expired: // Reissue expired: case 'imported': // Issue newly imported // Issue newly imported case 'added': // Issue added // Issue added case 'deleted': case 'default': if (!$this->real) { // show only $cont .= "<div><strong>PREVIEW ONLY</strong>. These commands would be recorded in the database if you perform the changes.</div>"; $cont .= '<div><a href="#" onclick="effect_2 = Effect.SlideDown(\'performer\',{duration:1.2}); return false;">perform-unlock</a></div>'; $cont .= '<div id="performer" style="display: none;"><a href="gencerts.php?mode=' . $this->mode . '&performUpdates=1' . (isset($_GET['days']) ? '&days=' . $_GET['days'] : '') . '">do it now</a></div>'; } else { $cont .= "<div>Paste these commands into the file 2006-mm-dd.caops and execute: ./performops 2006-mm-dd.caops</div>"; $cont .= "<div>UNDO SQL (import): UPDATE prefix_contact SET certState='none', certPassword='' WHERE certExpires='YYYY-MM-DD'</div>"; } if ($this->mode == 'imported') { $cont .= '<form action="gencerts.php" method="get">'; $cont .= '<input type="hidden" name="mode" value="imported" />'; $cont .= '<div><label for="days">Days since import</label></div>'; $cont .= '<div><input type="text" id="days" name="days" value="' . (isset($_GET['days']) ? $_GET['days'] : '') . '" /></div>'; $cont .= '<div><button type="submit">ok</button></div>'; $cont .= '</form>'; } case 'crl': case 'relist': if ($this->mode == 'relist') { $cont .= '<form action="gencerts.php" method="get">'; $cont .= '<input type="hidden" name="mode" value="relist" />'; $cont .= '<div><label for="date">Date of execution (yyyy-mm-dd)</label></div>'; $cont .= '<div><input type="text" id="date" name="date" value="' . (isset($_GET['date']) ? $_GET['date'] : '') . '" /></div>'; $cont .= '<div><button type="submit">ok</button></div>'; $cont .= '</form>'; } $cont .= '<pre>'; $cont .= $this->data; $cont .= '</pre>'; break; case 'pwlist': //make a passwordlist of a specific group $cont .= $this->createGroupSelector($_GET['groupname'], "pwlist.php"); $cont .= $this->passwordTable(); break; case 'stats': $db->query("SELECT certState, COUNT(certState) as n, grouplist.groupname as gn FROM " . TABLE_CONTACT . " AS contact, " . TABLE_GROUPS . " as groups , " . TABLE_GROUPLIST . " as grouplist \r\n WHERE contact.id=groups.id AND groups.groupid=grouplist.groupid GROUP BY groupname, certState ORDER BY groupname, certState"); $tGen = new TableGenerator('data', array('company' => 'Company', 'cstate' => 'Cert. State', 'n' => 'n')); $data = array(); while ($r = $db->next()) { $data[] = array('company' => $r['gn'], 'cstate' => $r['certState'], 'n' => $r['n']); } $cont .= '<table class="data">'; $cont .= '<caption>Statistics</caption>'; $cont .= $tGen->generateHead(array('cstate', 'n')); $cont .= $tGen->generateBody($data, array('cstate', 'n'), $className = '', $groupBy = 'company', $firstOnly = false); $cont .= '</table>'; break; case 'utrack': $cont .= '<form action="gencerts.php?mode=utrack" method="post">'; $cont .= '<div><label for="mails">E-mail addresses of used certificates, one in a line (copy from server-log). Do not run the same email twice on the same day, or UPDATE will return 0 rows updated.</label></div>'; $cont .= '<div><textarea name="mails" id="mails" cols="30" rows="10"></textarea></div>'; $cont .= '<div><button type="submit">ok</button></div>'; $cont .= '</form>'; break; } $cont .= '</div>'; $cont .= '</div>'; return $cont; }