function controller_revisions($args)
{
    page_canonical($args[0][0]);
    $page = $args[0][0];
    if (!page_exists($page)) {
        hotglue_error(404);
    }
    // get all revisions of page and determine the current revision's index
    load_modules('glue');
    $a = expl('.', $page);
    $revs = revisions_info(array('pagename' => $a[0], 'sort' => 'time'));
    $revs = $revs['#data'];
    $cur_rev = false;
    for ($i = 0; $i < count($revs); $i++) {
        if ($revs[$i]['revision'] == $a[1]) {
            $cur_rev = $i;
            break;
        }
    }
    if ($cur_rev === false) {
        // we didn't find the current revision
        hotglue_error(500);
    }
    default_html(true);
    html_add_css(base_url() . 'modules/revisions_browser/revisions_browser.css');
    if (USE_MIN_FILES) {
        html_add_js(base_url() . 'modules/revisions_browser/revisions_browser.min.js');
    } else {
        html_add_js(base_url() . 'modules/revisions_browser/revisions_browser.js');
    }
    html_add_js_var('$.glue.page', $page);
    $bdy =& body();
    elem_attr($bdy, 'id', 'revisions');
    render_page(array('page' => $page, 'edit' => false));
    body_append('<div id="revisions_browser_ctrl">');
    body_append('<div id="revisions_browser_prev">');
    if ($cur_rev + 1 < count($revs)) {
        body_append('<a href="' . base_url() . '?' . htmlspecialchars(urlencode($revs[$cur_rev + 1]['page']), ENT_COMPAT, 'UTF-8') . '/revisions">prev</a>');
    }
    body_append('</div><div id="revisions_browser_cur">');
    if (substr($revs[$cur_rev]['revision'], 0, 5) == 'auto-') {
        body_append(date('d M y H:i', $revs[$cur_rev]['time']));
    } else {
        body_append(htmlspecialchars($revs[$cur_rev]['revision'], ENT_NOQUOTES, 'UTF-8'));
    }
    body_append('<br>');
    if ($a[1] == 'head') {
        body_append('<a href="' . base_url() . '?' . htmlspecialchars(urlencode($page), ENT_COMPAT, 'UTF-8') . '/edit">back to editing mode</a>');
    } else {
        body_append('<a id="revisions_browser_revert_btn" href="#">revert</a>');
    }
    body_append('</div><div id="revisions_browser_next">');
    if (0 < $cur_rev) {
        body_append('<a href="' . base_url() . '?' . htmlspecialchars(urlencode($revs[$cur_rev - 1]['page']), ENT_COMPAT, 'UTF-8') . '/revisions">next</a>');
    }
    body_append('</div>');
    body_append('</div>');
    echo html_finalize();
}
Exemple #2
0
 function render($args)
 {
     include_once $this->driver;
     if (!function_exists('render_page')) {
         rcube::raise_error(array('code' => 600, 'type' => 'php', 'file' => __FILE__, 'line' => __LINE__, 'message' => "ThreeCol plugin: Broken driver: {$this->driver}"), true, false);
     }
     $args = render_page($args);
     return $args;
 }
function switch_main()
{
    switch ($_GET["main"]) {
        case "init":
            $content = main_page();
            break;
        case "enable_kasper":
            main_kaspersky();
            exit;
            break;
        case "kasper_level":
            main_kaspersky_level();
            exit;
            break;
        case "kasper_action":
            main_kaspersky_action();
            exit;
            break;
        case "kasper_save":
            main_kaspersky_save();
            exit;
            break;
        case "fetchmail":
            main_fetchmail();
            exit;
            break;
        case "main_fetchmail_1":
            main_fetchmail_1();
            exit;
            break;
        case "main_fetchmail_2":
            main_fetchmail_2();
            exit;
            break;
        case "main_fetchmail_3":
            main_fetchmail_3();
            exit;
            break;
        case "main_fetchmail_build":
            main_fetchmail_build();
            exit;
            break;
        case "postmaster":
            main_postmaster();
            exit;
            break;
        default:
            $content = main_page();
    }
    $tpl = new templates();
    echo $tpl->_ENGINE_parse_body(render_page($content));
}
Exemple #4
0
 function render($args)
 {
     $this->include_script($this->local_skin_path() . '/threecol.js');
     $this->include_stylesheet($this->local_skin_path() . '/threecol.css');
     if (is_readable($this->driver)) {
         include_once $this->driver;
         if (!function_exists('render_page')) {
             rcube::raise_error(array('code' => 600, 'type' => 'php', 'file' => __FILE__, 'line' => __LINE__, 'message' => "ThreeCol plugin: Broken driver: {$this->driver}"), true, false);
         }
         $args = render_page($args);
     }
     return $args;
 }
Exemple #5
0
function controler_send_mail()
{
    if ($_SERVER["REQUEST_METHOD"] != "POST") {
        render_error("attend un formulaire envoyé en POST!");
        exit;
    }
    $message = $_REQUEST['message'];
    if (empty($message)) {
        render_error("Le paramètre 'message' non vide est attendu");
        exit;
    }
    $resp = service_send_sms($message, 'nico');
    if ($resp == false) {
        render_error("problème lors de l'envoie du sms.");
        exit;
    }
    render_page($resp);
}
Exemple #6
0
<?php

error_reporting(NULL);
$TAB = 'USER';
// Main include
include $_SERVER['DOCUMENT_ROOT'] . "/inc/main.php";
// Data
if ($user == 'admin') {
    exec(VESTA_CMD . "v-list-users json", $output, $return_var);
} else {
    exec(VESTA_CMD . "v-list-user " . $user . " json", $output, $return_var);
}
$data = json_decode(implode('', $output), true);
$data = array_reverse($data, true);
// Render page
render_page($user, $TAB, 'list_user');
// Back uri
$_SESSION['back'] = $_SERVER['REQUEST_URI'];
Exemple #7
0
    // Flush field values on success
    if (empty($_SESSION['error_msg'])) {
        $_SESSION['ok_msg'] = __('DATABASE_CREATED_OK', htmlentities($user) . "_" . htmlentities($_POST['v_database']), htmlentities($user) . "_" . htmlentities($_POST['v_database']));
        $_SESSION['ok_msg'] .= " / <a href=" . $db_admin_link . " target='_blank'>" . __('open %s', $db_admin) . "</a>";
        unset($v_database);
        unset($v_dbuser);
        unset($v_password);
        unset($v_type);
        unset($v_charset);
    }
}
// Get user email
$v_db_email = $panel[$user]['CONTACT'];
// List avaiable database types
$db_types = explode(',', $_SESSION['DB_SYSTEM']);
// List available database servers
exec(VESTA_CMD . "v-list-database-hosts json", $output, $return_var);
$db_hosts_tmp1 = json_decode(implode('', $output), true);
$db_hosts_tmp2 = array_map(function ($host) {
    return $host['HOST'];
}, $db_hosts_tmp1);
$db_hosts = array_values(array_unique($db_hosts_tmp2));
unset($output);
unset($db_hosts_tmp1);
unset($db_hosts_tmp2);
render_page($user, $TAB, 'add_db');
// Flush session messages
unset($_SESSION['error_msg']);
unset($_SESSION['ok_msg']);
// Footer
include $_SERVER['DOCUMENT_ROOT'] . '/templates/footer.html';
Exemple #8
0
<?php

require "common.php";
$template = "links";
render_page($template);
Exemple #9
0
    $v_db_tmp = rtrim($v_db_tmp, ",");
    $v_db_tmp = "DB=" . escapeshellarg($v_db_tmp);
    $v_cron = $_POST['v_cron'];
    $v_cron_tmp = str_replace("\r\n", ",", $_POST['v_cron']);
    $v_cron_tmp = rtrim($v_cron_tmp, ",");
    $v_cron_tmp = "CRON=" . escapeshellarg($v_cron_tmp);
    $v_userdir = $_POST['v_userdir'];
    $v_userdir_tmp = str_replace("\r\n", ",", $_POST['v_userdir']);
    $v_userdir_tmp = rtrim($v_userdir_tmp, ",");
    $v_userdir_tmp = "USER="******"\n" . $v_dns_tmp . "\n" . $v_mail_tmp . "\n" . $v_db_tmp . "\n" . $v_userdir_tmp . "\n");
    fclose($fp);
    unset($mktemp_output);
    // Save changes
    exec(VESTA_CMD . "v-update-user-backup-exclusions " . $user . " " . $tmp, $output, $return_var);
    check_return_code($return_var, $output);
    unset($output);
    // Set success message
    if (empty($_SESSION['error_msg'])) {
        $_SESSION['ok_msg'] = __("Changes has been saved.");
    }
}
// Render page
render_page($user, $TAB, 'edit_backup_exclusions');
// Flush session messages
unset($_SESSION['error_msg']);
unset($_SESSION['ok_msg']);
<?php

include_once 'header.php';
include_once 'menubar.php';
?>
<div id="content">
<?php 
try {
    render_page();
} catch (Exception $exception) {
    log_al_error($exception->getMessage());
    send_error_email($exception->getMessage());
    ?>
<p>An error was encountered processing your request.  Technical support has been notified and we hope
to correct the problem soon.  We apologize for this inconvenience.</p>
<?php 
}
?>
</div>
<?php 
include_once 'footer.php';
Exemple #11
0
        $v_autoreply = 'no';
        $v_autoreply_message = '';
    }
    // Add autoreply
    if (!empty($_POST['v_autoreply']) && empty($_SESSION['error_msg'])) {
        if ($v_autoreply_message != str_replace("\r\n", "\n", $_POST['v_autoreply_message'])) {
            $v_autoreply_message = str_replace("\r\n", "\n", $_POST['v_autoreply_message']);
            $v_autoreply_message = escapeshellarg($v_autoreply_message);
            exec(VESTA_CMD . "v-add-mail-account-autoreply " . $v_username . " " . $v_domain . " " . $v_account . " " . $v_autoreply_message, $output, $return_var);
            check_return_code($return_var, $output);
            unset($output);
            $v_autoreply = 'yes';
            $v_autoreply_message = $_POST['v_autoreply_message'];
        }
    }
    // Set success message
    if (empty($_SESSION['error_msg'])) {
        $_SESSION['ok_msg'] = __('Changes has been saved.');
    }
}
// Render page
if (empty($_GET['account'])) {
    // Display body for mail domain
    render_page($user, $TAB, 'edit_mail');
} else {
    // Display body for mail account
    render_page($user, $TAB, 'edit_mail_acc');
}
// Flush session messages
unset($_SESSION['error_msg']);
unset($_SESSION['ok_msg']);
Exemple #12
0
<?php

//
// Pipecode - distributed social network
// Copyright (C) 2014 Bryan Beicker <*****@*****.**>
//
// This file is part of Pipecode.
//
// Pipecode is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Pipecode is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Pipecode.  If not, see <http://www.gnu.org/licenses/>.
//
include "render.php";
header("Content-Type: text/plain");
$qid = (int) $s2;
$can_moderate = true;
render_page(0, 0, $qid, true);
Exemple #13
0
<?php

error_reporting(NULL);
$TAB = 'UPDATES';
// Main include
include $_SERVER['DOCUMENT_ROOT'] . "/inc/main.php";
// Check user
if ($_SESSION['user'] != 'admin') {
    header('Location: /list/user');
    exit;
}
// Data
exec(VESTA_CMD . "v-list-sys-vesta-updates json", $output, $return_var);
$data = json_decode(implode('', $output), true);
unset($output);
exec(VESTA_CMD . "v-list-sys-vesta-autoupdate plain", $output, $return_var);
$autoupdate = $output['0'];
unset($output);
// Render page
render_page($user, $TAB, 'list_updates');
// Back uri
$_SESSION['back'] = $_SERVER['REQUEST_URI'];
Exemple #14
0
<?php

error_reporting(NULL);
$TAB = 'PACKAGE';
// Main include
include $_SERVER['DOCUMENT_ROOT'] . "/inc/main.php";
// Check user
if ($_SESSION['user'] != 'admin') {
    header("Location: /list/user");
    exit;
}
// Data
exec(VESTA_CMD . "v-list-user-packages json", $output, $return_var);
$data = json_decode(implode('', $output), true);
unset($output);
// Render page
render_page($user, $TAB, 'list_packages');
// Back uri
$_SESSION['back'] = $_SERVER['REQUEST_URI'];
Exemple #15
0
// Read config
$v_config = shell_exec(VESTA_CMD . "v-open-fs-config " . $v_config_path);
if (!empty($v_config_path1)) {
    $v_config1 = shell_exec(VESTA_CMD . "v-open-fs-config " . $v_config_path1);
}
if (!empty($v_config_path2)) {
    $v_config2 = shell_exec(VESTA_CMD . "v-open-fs-config " . $v_config_path2);
}
if (!empty($v_config_path3)) {
    $v_config3 = shell_exec(VESTA_CMD . "v-open-fs-config " . $v_config_path3);
}
if (!empty($v_config_path4)) {
    $v_config4 = shell_exec(VESTA_CMD . "v-open-fs-config " . $v_config_path4);
}
if (!empty($v_config_path5)) {
    $v_config5 = shell_exec(VESTA_CMD . "v-open-fs-config " . $v_config_path5);
}
if (!empty($v_config_path6)) {
    $v_config6 = shell_exec(VESTA_CMD . "v-open-fs-config " . $v_config_path6);
}
if (!empty($v_config_path7)) {
    $v_config7 = shell_exec(VESTA_CMD . "v-open-fs-config " . $v_config_path7);
}
if (!empty($v_config_path8)) {
    $v_config8 = shell_exec(VESTA_CMD . "v-open-fs-config " . $v_config_path8);
}
// Render page
render_page($user, $TAB, 'edit_server_dovecot');
// Flush session messages
unset($_SESSION['error_msg']);
unset($_SESSION['ok_msg']);
}
$SimplePie->__destruct();
unset($SimplePie);
$_GLOBAL['aStories'] = $aStories;
// #2: Get the weather
$sWeatherFeed = 'http://www.wunderground.com/auto/rss_full/CA/Palo_Alto.xml';
$SimplePie = new SimplePie();
$SimplePie->enable_cache(false);
$SimplePie->set_feed_url($sWeatherFeed);
$SimplePie->init();
$SimplePie->handle_content_type();
if ($SimplePie->error()) {
    // TODO: Delete that feed??
    $SimplePie->__destruct();
    continue;
}
$aWeather = $SimplePie->get_items();
foreach ($aWeather as $oItem) {
    $sTitle = $oItem->get_title();
    if (stristr($sTitle, 'Current Condition')) {
        $GLOBALS['sWeather'] = mb_substr($sTitle, 21);
        break;
    }
    /*if (preg_match('/^Current Conditions : (-?[0-9]{1,3}[.][0-9])/', $sTitle, $aMatches)) {
          $GLOBALS['sCurrentTemp'] = $aMatches[1]; break;
      }*/
}
$SimplePie->__destruct();
unset($SimplePie);
render_page('Headlines', 'stories/view.feed.php');
Exemple #17
0
function render_dynamic_page($page, $params)
{
    require 'pages/' . $page . '.php';
    render_page($params);
}
Exemple #18
0
<?php

error_reporting(NULL);
$TAB = 'LOG';
// Main include
include $_SERVER['DOCUMENT_ROOT'] . "/inc/main.php";
// Data
exec(VESTA_CMD . "v-list-user-log {$user} json", $output, $return_var);
check_error($return_var);
$data = json_decode(implode('', $output), true);
$data = array_reverse($data);
unset($output);
// Render page
render_page($user, $TAB, 'list_log');
Exemple #19
0
    if (empty($_SESSION['error_msg'])) {
        $_SESSION['ok_msg'] = __('Changes has been saved.');
    }
}
$v_ftp_users_raw = explode(':', $v_ftp_user);
$v_ftp_users_paths_raw = explode(':', $data[$v_domain]['FTP_PATH']);
$v_ftp_users = array();
foreach ($v_ftp_users_raw as $v_ftp_user_index => $v_ftp_user_val) {
    if (empty($v_ftp_user_val)) {
        continue;
    }
    $v_ftp_users[] = array('is_new' => 0, 'v_ftp_user' => $v_ftp_user_val, 'v_ftp_password' => $v_ftp_password, 'v_ftp_path' => isset($v_ftp_users_paths_raw[$v_ftp_user_index]) ? $v_ftp_users_paths_raw[$v_ftp_user_index] : '', 'v_ftp_email' => $v_ftp_email, 'v_ftp_pre_path' => $v_ftp_user_prepath);
}
if (empty($v_ftp_users)) {
    $v_ftp_user = null;
    $v_ftp_users[] = array('is_new' => 1, 'v_ftp_user' => '', 'v_ftp_password' => '', 'v_ftp_path' => isset($v_ftp_users_paths_raw[$v_ftp_user_index]) ? $v_ftp_users_paths_raw[$v_ftp_user_index] : '', 'v_ftp_email' => '', 'v_ftp_pre_path' => $v_ftp_user_prepath);
}
// set default pre path for newly created users
$v_ftp_pre_path_new_user = $v_ftp_user_prepath;
if (isset($v_ftp_users_updated)) {
    $v_ftp_users = $v_ftp_users_updated;
    if (empty($v_ftp_users_updated)) {
        $v_ftp_user = null;
        $v_ftp_users[] = array('is_new' => 1, 'v_ftp_user' => '', 'v_ftp_password' => '', 'v_ftp_path' => isset($v_ftp_users_paths_raw[$v_ftp_user_index]) ? $v_ftp_users_paths_raw[$v_ftp_user_index] : '', 'v_ftp_email' => '', 'v_ftp_pre_path' => $v_ftp_user_prepath);
    }
}
// Render page
render_page($user, $TAB, 'edit_web');
// Flush session messages
unset($_SESSION['error_msg']);
unset($_SESSION['ok_msg']);
Exemple #20
0
    // Set restart flag
    $v_restart = 'yes';
    if (empty($_POST['v_restart'])) {
        $v_restart = 'no';
    }
    // Update config
    if (!empty($_POST['v_config'])) {
        exec('mktemp', $mktemp_output, $return_var);
        $new_conf = $mktemp_output[0];
        $fp = fopen($new_conf, 'w');
        fwrite($fp, str_replace("\r\n", "\n", $_POST['v_config']));
        fclose($new_conf);
        exec(VESTA_CMD . "v-change-sys-service-config " . $new_conf . " clamd " . $v_restart, $output, $return_var);
        check_return_code($return_var, $output);
        unset($output);
        unlink($new_conf);
    }
    // Set success message
    if (empty($_SESSION['error_msg'])) {
        $_SESSION['ok_msg'] = __('Changes has been saved.');
    }
}
$v_config_path = shell_exec(VESTA_CMD . 'v-list-sys-clamd-config plain');
$v_service_name = strtoupper('clamav');
// Read config
$v_config = shell_exec(VESTA_CMD . "v-open-fs-config " . $v_config_path);
// Render page
render_page($user, $TAB, 'edit_server_service');
// Flush session messages
unset($_SESSION['error_msg']);
unset($_SESSION['ok_msg']);
Exemple #21
0
<?php

error_reporting(NULL);
$TAB = 'RRD';
// Main include
include $_SERVER['DOCUMENT_ROOT'] . "/inc/main.php";
// Check user
if ($_SESSION['user'] != 'admin') {
    header('Location: /list/user');
    exit;
}
// Data
exec(VESTA_CMD . "v-list-sys-rrd json", $output, $return_var);
$data = json_decode(implode('', $output), true);
unset($output);
// Render page
render_page($user, $TAB, 'list_rrd');
// Back uri
$_SESSION['back'] = $_SERVER['REQUEST_URI'];
Exemple #22
0
+--------------------------------------------------------+
| This program is released as free software under the
| Affero GPL license. You can redistribute it and/or
| modify it under the terms of this license which you
| can read by viewing the included agpl.txt or online
| at www.gnu.org/licenses/agpl.html. Removal of this
| copyright header is strictly prohibited without
| written permission from the original author(s).
+--------------------------------------------------------*/
if (!defined("IN_FUSION")) {
    die("Access Denied");
}
require_once INCLUDES . "footer_includes.php";
define("CONTENT", ob_get_contents());
ob_end_clean();
render_page(false);
echo "</body>\n</html>\n";
?>
<!-- Woopra Code Start -->
<script type="text/javascript" src="//static.woopra.com/js/woopra.v2.js"></script>
<script type="text/javascript">
woopraTracker.track();
</script>
<!-- Woopra Code End -->
<?php 
if (iADMIN) {
    $result = dbquery("DELETE FROM " . DB_FLOOD_CONTROL . " WHERE flood_timestamp < '" . (time() - 360) . "'");
    $result = dbquery("DELETE FROM " . DB_THREAD_NOTIFY . " WHERE notify_datestamp < '" . (time() - 1209600) . "'");
    $result = dbquery("DELETE FROM " . DB_CAPTCHA . " WHERE captcha_datestamp < '" . (time() - 360) . "'");
    $result = dbquery("DELETE FROM " . DB_NEW_USERS . " WHERE user_datestamp < '" . (time() - 86400) . "'");
}
Exemple #23
0
        $fp = fopen($new_conf, 'w');
        fwrite($fp, str_replace("\r\n", "\n", $_POST['v_config']));
        fclose($new_conf);
        exec(VESTA_CMD . "v-change-sys-service-config " . $new_conf . " mariadb " . $v_restart, $output, $return_var);
        check_return_code($return_var, $output);
        unset($output);
        unlink($new_conf);
    }
    // Set success message
    if (empty($_SESSION['error_msg'])) {
        $_SESSION['ok_msg'] = __('Changes has been saved.');
    }
}
// List config
exec(VESTA_CMD . "v-list-sys-mysql-config json", $output, $return_var);
$data = json_decode(implode('', $output), true);
unset($output);
$v_max_user_connections = $data['CONFIG']['max_user_connections'];
$v_max_connections = $data['CONFIG']['max_connections'];
$v_wait_timeout = $data['CONFIG']['wait_timeout'];
$v_interactive_timeout = $data['CONFIG']['interactive_timeout'];
$v_max_allowed_packet = $data['CONFIG']['max_allowed_packet'];
$v_config_path = $data['CONFIG']['config_path'];
$v_service_name = strtoupper('mariadb');
# Read config
$v_config = shell_exec(VESTA_CMD . "v-open-fs-config " . $v_config_path);
// Render page
render_page($user, $TAB, 'edit_server_mysql');
// Flush session messages
unset($_SESSION['error_msg']);
unset($_SESSION['ok_msg']);
Exemple #24
0
    $hide_value = -1;
    $expand_value = 0;
}
print_header("Poll");
writeln('<table class="fill">');
writeln('<tr>');
writeln('<td class="left_col">');
print_left_bar("main", "poll");
writeln('</td>');
writeln('<td class="fill">');
vote_box($qid, true, false);
if ($javascript_enabled) {
    render_sliders(0, 0, $qid);
    print_noscript();
} else {
    render_page(0, 0, $qid, false);
}
writeln('		</td>');
writeln('	</tr>');
writeln('</table>');
if ($javascript_enabled) {
    writeln('<script>');
    writeln();
    writeln('var hide_value = ' . $hide_value . ';');
    writeln('var expand_value = ' . $expand_value . ';');
    writeln('var auth_zid = "' . $auth_zid . '";');
    writeln();
    writeln('get_comments(0, 0, ' . $qid . ');');
    writeln('render_page();');
    writeln();
    writeln('</script>');
Exemple #25
0
        check_return_code($return_var, $output);
        unset($output);
        $restart_dns = 'yes';
    }
    // Restart dns server
    if (!empty($restart_dns) && empty($_SESSION['error_msg'])) {
        exec(VESTA_CMD . "v-restart-dns", $output, $return_var);
        check_return_code($return_var, $output);
        unset($output);
    }
    // Set success message
    if (empty($_SESSION['error_msg'])) {
        $_SESSION['ok_msg'] = __('Changes has been saved.');
    }
    // Change url if record id was changed
    if (empty($_SESSION['error_msg']) && $_GET['record_id'] != $_POST['v_record_id']) {
        header("Location: /edit/dns/?domain=" . $_GET['domain'] . "&record_id=" . $_POST['v_record_id']);
        exit;
    }
}
// Render page
if (empty($_GET['record_id'])) {
    // Display body for dns domain
    render_page($user, $TAB, 'edit_dns');
} else {
    // Display body for dns record
    render_page($user, $TAB, 'edit_dns_rec');
}
// Flush session messages
unset($_SESSION['error_msg']);
unset($_SESSION['ok_msg']);
Exemple #26
0
  +--------------------------------------------------------+
  | This program is released as free software under the
  | Affero GPL license. You can redistribute it and/or
  | modify it under the terms of this license which you
  | can read by viewing the included agpl.txt or online
  | at www.gnu.org/licenses/agpl.html. Removal of this
  | copyright header is strictly prohibited without
  | written permission from the original author(s).
  +--------------------------------------------------------*/
if (!defined("IN_FUSION")) {
    die("Access Denied");
}
require_once INCLUDES . "footer_includes.php";
define("CONTENT", ob_get_contents());
ob_end_clean();
render_page(FALSE);
echo push_jquery();
// output here all jquery.
// Cron Job (6 MIN)
if ($settings['cronjob_hour'] < time() - 360) {
    $result = dbquery("DELETE FROM " . DB_FLOOD_CONTROL . " WHERE flood_timestamp < '" . (time() - 360) . "'");
    $result = dbquery("DELETE FROM " . DB_CAPTCHA . " WHERE captcha_datestamp < '" . (time() - 360) . "'");
    $result = dbquery("DELETE FROM " . DB_USERS . " WHERE user_joined='0' AND user_ip='0.0.0.0' and user_level='103'");
    $result = dbquery("UPDATE " . DB_SETTINGS . " SET settings_value='" . time() . "' WHERE settings_name='cronjob_hour'");
}
// Cron Job (24 HOUR)
if ($settings['cronjob_day'] < time() - 86400) {
    $new_time = time();
    $result = dbquery("DELETE FROM " . DB_THREAD_NOTIFY . " WHERE notify_datestamp < '" . (time() - 1209600) . "'");
    $result = dbquery("DELETE FROM " . DB_NEW_USERS . " WHERE user_datestamp < '" . (time() - 86400) . "'");
    $result = dbquery("DELETE FROM " . DB_EMAIL_VERIFY . " WHERE user_datestamp < '" . (time() - 86400) . "'");
Exemple #27
0
        if (!empty($_POST['v_ns6'])) {
            $ns_cmd = $ns_cmd . " " . $v_ns6;
        }
        if (!empty($_POST['v_ns7'])) {
            $ns_cmd = $ns_cmd . " " . $v_ns7;
        }
        if (!empty($_POST['v_ns8'])) {
            $ns_cmd = $ns_cmd . " " . $v_ns8;
        }
        exec($ns_cmd, $output, $return_var);
        check_return_code($return_var, $output);
        unset($output);
        $v_ns1 = str_replace("'", "", $v_ns1);
        $v_ns2 = str_replace("'", "", $v_ns2);
        $v_ns3 = str_replace("'", "", $v_ns3);
        $v_ns4 = str_replace("'", "", $v_ns4);
        $v_ns5 = str_replace("'", "", $v_ns5);
        $v_ns6 = str_replace("'", "", $v_ns6);
        $v_ns7 = str_replace("'", "", $v_ns7);
        $v_ns8 = str_replace("'", "", $v_ns8);
    }
    // Set success message
    if (empty($_SESSION['error_msg'])) {
        $_SESSION['ok_msg'] = __('Changes has been saved.');
    }
}
// Render page
render_page($user, $TAB, 'edit_user');
// Flush session messages
unset($_SESSION['error_msg']);
unset($_SESSION['ok_msg']);
Exemple #28
0
<?php

error_reporting(NULL);
$TAB = 'DNS';
// Main include
include $_SERVER['DOCUMENT_ROOT'] . "/inc/main.php";
// Data & Render page
if (empty($_GET['domain'])) {
    exec(VESTA_CMD . "v-list-dns-domains {$user} json", $output, $return_var);
    $data = json_decode(implode('', $output), true);
    $data = array_reverse($data, true);
    unset($output);
    render_page($user, $TAB, 'list_dns');
} else {
    exec(VESTA_CMD . "v-list-dns-records '" . $user . "' '" . escapeshellarg($_GET['domain']) . "' 'json'", $output, $return_var);
    $data = json_decode(implode('', $output), true);
    $data = array_reverse($data, true);
    unset($output);
    render_page($user, $TAB, 'list_dns_rec');
}
// Back uri
$_SESSION['back'] = $_SERVER['REQUEST_URI'];
Exemple #29
0
error_reporting(NULL);
$TAB = 'STATS';
// Main include
include $_SERVER['DOCUMENT_ROOT'] . "/inc/main.php";
// Data
if ($user == 'admin') {
    if (empty($_GET['user'])) {
        exec(VESTA_CMD . "v-list-users-stats json", $output, $return_var);
        $data = json_decode(implode('', $output), true);
        $data = array_reverse($data, true);
        unset($output);
    } else {
        $v_user = escapeshellarg($_GET['user']);
        exec(VESTA_CMD . "v-list-user-stats {$v_user} json", $output, $return_var);
        $data = json_decode(implode('', $output), true);
        $data = array_reverse($data, true);
        unset($output);
    }
    exec(VESTA_CMD . "v-list-sys-users 'json'", $output, $return_var);
    $users = json_decode(implode('', $output), true);
    unset($output);
} else {
    exec(VESTA_CMD . "v-list-user-stats {$user} json", $output, $return_var);
    $data = json_decode(implode('', $output), true);
    $data = array_reverse($data, true);
    unset($output);
}
// Render page
render_page($user, $TAB, 'list_stats');
// Back uri
$_SESSION['back'] = $_SERVER['REQUEST_URI'];
Exemple #30
0
<?php

error_reporting(NULL);
$TAB = 'FIREWALL';
// Main include
include $_SERVER['DOCUMENT_ROOT'] . "/inc/main.php";
// Check user
if ($_SESSION['user'] != 'admin') {
    header("Location: /list/user");
    exit;
}
// Data
exec(VESTA_CMD . "v-list-firewall-ban json", $output, $return_var);
$data = json_decode(implode('', $output), true);
$data = array_reverse($data, true);
unset($output);
// Render page
render_page($user, $TAB, 'list_firewall_banlist');
// Back uri
$_SESSION['back'] = $_SERVER['REQUEST_URI'];