コード例 #1
0
ファイル: cpmanager.php プロジェクト: masterguru/cpmanager
        $email_template = $tpl->render($tpl->email_plain_text, $data_email);
        $to_save = array('query_string' => $query_string, 'result' => $result_action, 'time_creation' => time(), 'date_creation' => date("Y-m-d H:i:s"), 'server_info' => $_SERVER, 'request_info' => $_REQUEST, 'cookie_info' => $_COOKIE, 'env_info' => $_ENV, 'email_template' => $email_template);
        // get current log
        if (file_exists('createacct_log')) {
            $rawlog = file_get_contents('createacct_log');
        } else {
            file_put_contents('createacct_log', json_encode(array()));
            $rawlog = file_get_contents('createacct_log');
        }
        $records = json_decode($rawlog);
        $records[] = $to_save;
        $rawlog = json_encode($records);
        file_put_contents('createacct_log', $rawlog);
    }
}
if (file_exists('createacct_log')) {
    // read current log
    $rawlog = file_get_contents('createacct_log');
    $records = array_reverse(json_decode($rawlog), true);
    $history = new history();
    $data['history'] = $history->show_history($records);
} else {
    $data['history'] = '<div class="alert alert-info">Nothing recorded yet!.</div>';
}
$data['script_path'] = SCRIPT_PATH;
$data['select_servers'] = $core->get_select_servers($servers);
$data['serverid'] = $_REQUEST['serverid'];
$data['root_path'] = ROOT_PATH;
$data['html_navbar'] = $tpl->render($tpl->html_navbar, $data);
echo $tpl->render($tpl->html_header, $data) . $tpl->render($tpl->html_tpl_main, $data);
exit;