コード例 #1
0
ファイル: report.php プロジェクト: erixemaan/webjohn
<?php

include 'bgProcess.class.php';
if (empty($_REQUEST['sessID'])) {
    die('No session ID');
}
$john = new johnSession($_REQUEST['sessID']);
$policy_len = 8;
$policy_Upp = 1;
$policy_Low = 1;
$policy_Num = 1;
$policy_Spe = 1;
$policy_outOf = 3;
if (isset($_POST['action']) && $_POST['action'] == 'update_policy') {
    $filter_res = filter_input_array(INPUT_POST, array('policy_len' => FILTER_VALIDATE_INT, 'policy_Upp' => FILTER_VALIDATE_INT, 'policy_Low' => FILTER_VALIDATE_INT, 'policy_Num' => FILTER_VALIDATE_INT, 'policy_Spe' => FILTER_VALIDATE_INT, 'policy_outOf' => FILTER_VALIDATE_INT));
    //~ var_dump($filter_res);
    $filter_pass = true;
    foreach ($filter_res as $key => $value) {
        $filter_pass = $filter_pass && $value !== false;
    }
    //~ var_dump($filter_pass);
    if ($filter_pass) {
        $passpolicy = array('len' => $filter_res['policy_len'], 'nbUp' => $filter_res['policy_Upp'], 'nbLow' => $filter_res['policy_Low'], 'nbNum' => $filter_res['policy_Num'], 'nbSpe' => $filter_res['policy_Spe'], 'minOutOf' => $filter_res['policy_outOf']);
        $john->updateJohnConf(array('passpolicy' => $passpolicy));
        $john->getStats(true);
    }
} elseif (isset($_POST['action']) && $_POST['action'] == 'buildCache') {
    $john->buildCache();
}
if (isset($john->config['johnSession']['passpolicy'])) {
    $policy_len = $john->config['johnSession']['passpolicy']['len'];
コード例 #2
0
ファイル: index.php プロジェクト: erixemaan/webjohn
function list_formats()
{
    return johnSession::getFormats();
}
コード例 #3
0
			  <li><a href="controlpannel.php">Control Pannel</a></li>
			</ul>
		</div>
	</div>
	<div class="container">
		<table class="table">
			<thead>
				<th>Session</th>
				<th>Status</th>
				<th>Actions</th>
			</thead>
			<tbody>
<?php 
foreach (list_sessions() as $sessid) {
    //~ var_dump($sessid);
    $john = new johnSession($sessid);
    //~ var_dump($john);
    print '<tr>';
    print '<td>' . $john->session_name . '</td>';
    print '<td id="status_' . $sessid . '">';
    print securedString($john->status());
    print '</td>';
    print '<td id=buttons_' . $sessid . '>';
    if ($john->isRunning()) {
        print '&nbsp;<button id="stop_' . $sessid . '" type="button" class="btn btn-danger btn-small" data-loading-text="..."><i class="icon-stop icon-white"></i> Stop</button>';
    } elseif (!$john->isFinished()) {
        print '&nbsp;<button id="start_' . $sessid . '" type="button" class="btn btn-success btn-small" data-loading-text="..."><i class="icon-play icon-white"></i> Resume</button>';
    }
    print '&nbsp;<button id="update_' . $sessid . '" type="button" class="btn btn-small" data-loading-text="..."';
    if (!$john->isRunning()) {
        print ' style="display: none"';