예제 #1
0
"/>
  </td>
  <td></td>
</tr>
</table>
</form>
&nbsp<br/>

<?php 
$digest_username = null;
$auth = java_bean("resin-admin-authenticator");
if (!$auth || !$auth->isComplete()) {
    include "digest.php";
}
if (!empty($digest)) {
    admin_init();
    $conf = $g_resin->getConfigFile();
    $conf_dir = $g_resin->getConfigDirectory();
    $root_dir = $g_resin->getRootDirectory();
    // generate temporary config file
    try {
        $old_reporting_level = error_reporting(0);
        $password_file = realpath("{$conf_dir}/admin-users.xml.generated");
        $file = fopen($password_file, "w");
        if (!$file) {
            $password_file = realpath("{$root_dir}/admin-users.xml.generated");
            $file = fopen($password_file, "w");
        }
        error_reporting($old_reporting_level);
        if ($file) {
            fwrite($file, <<<EOF
<?php

require_once "WEB-INF/php/inc.php";
admin_init("", false, true);
$r_host = $_GET['host'];
if ($r_host === '') {
    $r_host = 'default';
}
$manager_suffix = $_GET['manager-suffix'];
$r_webapp = $_GET['webapp'];
if ($r_webapp === "") {
    $r_webapp = "/";
}
$query = "resin:type=WebApp,Host=" . $r_host . ",name=" . $r_webapp;
$beans = $g_mbean_server->query($query);
$webapp = $beans[0];
$session_manager = $webapp->SessionManager;
if ($session_manager->SessionActiveCount == 0) {
    echo "No Active Sessions";
    return;
}
$sessions_json = $session_manager->sessionsAsJsonString();
//[{"AccessTime":1335326457442,"CreationTime":1335326237342,"IdleIsSet":false,"IdleTimeout":1800000,"LastSaveLength":112,"LastUseTime":1335326459502,"New":false,"SessionId":"aaacRWFwH0LzGcuiiiGBt","UseCount":1.0,"Valid":true}]
$session_table_id = "session-table-" . $manager_suffix;
$properties = array("SessionId", "CreationTime", "AccessTime", "LastUseTime", "IdleTimeout", "IdleIsSet", "New", "Valid", "UseCount", "LastSaveLength");
$properties_text = array("Session Id", "Creation Time", "Access Time", "Last UseTime", "Idle Timeout", "IdleIsSet", "New", "Valid", "Use Count", "Last Save Length");
$properties_format = array("CreationTime" => "date", "AccessTime" => "date", "LastUseTime" => "date", "LastSaveLength" => "memory", "IdleTimeout" => "timeout");
$properties_header = array();
echo "<table id='{$session_table_id}' class='data-detail'>\n";
echo " <tr>\n";
foreach ($properties_text as $property) {
예제 #3
0
$site_data = array('name' => '', 'description' => '');
$user_data = array('username' => '', 'secretphrase' => '');
$success_msg = '';
if (isset($_POST['confignow'])) {
    unset($_POST['confignow']);
    //Separate the data
    //User Data
    $user_data['id'] = '1';
    $user_data['username'] = $_POST['username'];
    $user_data['secretphrase'] = create_hash($_POST['secretphrase']);
    //Unset user data from $_POST;
    foreach ($user_data as $key => $value) {
        unset($_POST[$key]);
    }
    //Create all the needed files and server configurations
    if (config_init($_POST) && rss_init($_POST) && admin_init($user_data)) {
        unset($user_data['secretphrase']);
        foreach ($_POST as $key => $value) {
            $site_data[$key] = $value;
        }
        $success_msg = '<div class="over-top-msg"><p>Please wait, Your blog is being configured.</p></div>';
        header('refresh:3;url=' . dirname($_SERVER['PHP_SELF']));
    }
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
	<title>iGuana Blog | Initial Setup</title>
</head>
<body>