exit(1);
    }
}
$timestart = microtime(true);
echo "Debut du script " . date("H:i:s", $timestart) . "\n";
for ($i = 600; $i > 100; $i--) {
    $username = '******' . $i;
    editUser(dummy_User($username), $client);
    generateCert($username, $client);
}
$createdUsers = microtime(true);
echo "500 certificats crees à  " . date("H:i:s", $createdUsers) . "\n";
echo "temps de creation de 500 certificats  " . number_format($createdUsers - $timestart, 3) . "secondes\n";
echo "moyenne de temps de creation d'un certificat " . number_format(($createdUsers - $timestart) / 500, 3) . "secondes\n";
for ($i = 600; $i > 100; $i--) {
    $username = '******' . $i;
    revoke($username, $client);
}
$revokedUsers = microtime(true);
echo "500 certificats revoques à  " . date("H:i:s", $revokedUsers) . "\n";
echo "temps de revocation de 500 certificats  " . number_format($revokedUsers - $createdUsers, 3) . "secondes\n";
echo "moyenne de temps de revocation d'un certificat " . number_format(($revokedUsers - $createdUsers) / 500, 3) . "secondes\n";
/* echo "Maintenat je calcule le nombre maximal de creations en une heure! CELA PRENDRA UNE HEURE!"; */
/* $total=0; */
/* for($endTime=$revokedUsers+(60*60); microtime(true) < $endTime; $total++) { */
/*     $username="******" . ($total + 100); */
/*     editUser(dummy_User($username), $client); */
/*     generateCert($username, $client); */
/* } */
/* echo "nombre de certificats crées en une heure". $total. "\n"; */
/* echo "moyenne de temps de creation d'un certificat " . (60*60)/$total . "secondes\n"; */
Ejemplo n.º 2
0
        } else {
            $verifyStatus = '<td style="padding:5px 0px 0px 0px;"><a class="btn btn-sm btn-success">已验证</a></td>';
            $setUser = "******" . SYSTEM_URL . "index.php?mod=admin:setplug&plug=white_vmail&action=revoke&email=" . $row['email'] . "&uid=" . $row['id'] . "' class='btn btn-sm btn-warning'" . $Ban . ">设为未验证</a></td>";
            $Ban = ' disabled';
        }
        if ($row['white_vmail_send'] == 0) {
            $sendStatus = '<td style="padding:5px 0px 0px 0px;"><a class="btn btn-sm btn-danger">未发送</a></td>';
        } else {
            $sendStatus = '<td style="padding:5px 0px 0px 0px;"><a class="btn btn-sm btn-success">已发送</a></td>';
        }
        $sendMail = "<td style='padding:5px 0px 0px 0px;'><a href='" . SYSTEM_URL . "index.php?mod=admin:setplug&plug=white_vmail&action=send&email=" . $row['email'] . "&uid=" . $row['id'] . "' class='btn btn-sm btn-primary'" . $Ban . ">发送邮件</a></td>";
        $delUser = "******" . SYSTEM_URL . "index.php?mod=admin:setplug&plug=white_vmail&action=del&email=" . $row['email'] . "&uid=" . $row['id'] . "&name=" . $row['name'] . "' class='btn btn-sm btn-primary' onclick='return confirm(\"确认删除?\");'>删除用户</a></td>";
        $Ban = '';
        echo "<tbody><tr><tr><td>" . $row['id'] . "</td><td>" . $row['name'] . "</td><td>" . $row['email'] . "</td>" . $sendStatus . $verifyStatus . $sendMail . $delUser . $setUser . "</tr>";
    }
    echo '</tbody></table></div></div>';
}
showUsers();
if (isset($_GET['action']) && $_GET['action'] == 'send' && isset($_GET['email']) && isset($_GET['uid'])) {
    sendMail($_GET['email'], $_GET['uid']);
}
if (isset($_GET['action']) && $_GET['action'] == 'del' && isset($_GET['email']) && isset($_GET['uid']) && isset($_GET['name'])) {
    del($_GET['uid'], $_GET['name']);
}
if (isset($_GET['action']) && $_GET['action'] == 'set' && isset($_GET['email']) && isset($_GET['uid'])) {
    set($_GET['uid'], $_GET['email']);
}
if (isset($_GET['action']) && $_GET['action'] == 'revoke' && isset($_GET['email']) && isset($_GET['uid'])) {
    revoke($_GET['uid'], $_GET['email']);
}
echo '<link rel="stylesheet" href="css/main.css" type="text/css" />';