Esempio n. 1
0
function DisplayUpdates()
{
    global $LNG;
    $Patchlevel = getVersion();
    $template = new template();
    $template->loadscript('update.js');
    $template->assign_vars(array('up_submit' => $LNG['up_submit'], 'up_version' => $LNG['up_version'], 'up_revision' => $LNG['up_revision'], 'up_add' => $LNG['up_add'], 'up_edit' => $LNG['up_edit'], 'up_del' => $LNG['up_del'], 'ml_from' => $LNG['ml_from'], 'up_aktuelle_updates' => $LNG['up_aktuelle_updates'], 'up_momentane_version' => $LNG['up_momentane_version'], 'up_alte_updates' => $LNG['up_alte_updates'], 'up_download' => $LNG['up_download_patch_files'], 'version' => implode('.', $Patchlevel), 'RevList' => json_encode(GetLogs(isset($_REQUEST['history']) ? 0 : $Patchlevel[2])), 'Rev' => $Patchlevel[2], 'canDownload' => function_exists('gzcompress')));
    $template->show('UpdatePage.tpl');
}
<?php
	include_once('ressources/class.templates.inc');
	include_once('ressources/class.ldap.inc');
	include_once('ressources/class.users.menus.inc');
	include_once("ressources/class.os.system.inc");
	include_once("ressources/class.lvm.org.inc");
	
	$user=new usersMenus();
	if(!$user->AsSystemAdministrator){echo "alert('no privileges');";die();}
	if(isset($_GET["popup"])){popup();exit;}
	if(isset($_POST["dev"])){perform();exit;}
	if(isset($_GET["GetLogs"])){GetLogs();exit;}
js();


function js(){
	$page=CurrentPageName();
	header("content-type: application/x-javascript");
	$dev=$_GET["dev"];
	$devenc=urlencode($dev);
	echo "YahooWinBrowse('700','$page?popup=yes&dev=$devenc','$dev',true)";
}


function popup(){
	$page=CurrentPageName();
	$tpl=new templates();	
	$sock=new sockets();
	$fsarray=unserialize(base64_decode($sock->getFrameWork("system.php?fsarray=yes")));
	$macro_build_bigpart_warning=$tpl->javascript_parse_text('{macro_build_bigpart_warning}');
	$devenc=urlencode($_GET["dev"]);
Esempio n. 3
0
<?php

include_once "../common.php";
include_once ROOT_PATH . "/mod/functs.php";
if (!$user->Check()) {
    exit;
}
if (!isset($_GET['log'])) {
    $smarty->display('view_logs.tpl');
    die;
} else {
    $type = $_GET['log'];
}
if (!strlen($type)) {
    die;
}
$logs = GetLogs($type[0]);
$RESULT = array();
if (count($logs)) {
    foreach ($logs as $v) {
        $RESULT[] = $v['logData'];
    }
    $smarty->assign('CONTARR', $RESULT);
}
$smarty->display('show_log.tpl');
include_once "ressources/class.lvm.org.inc";
$user = new usersMenus();
if (!$user->AsSystemAdministrator) {
    echo "alert('no privileges');";
    die;
}
if (isset($_GET["popup"])) {
    popup();
    exit;
}
if (isset($_POST["dev"])) {
    perform();
    exit;
}
if (isset($_GET["GetLogs"])) {
    GetLogs();
    exit;
}
js();
function js()
{
    $page = CurrentPageName();
    header("content-type: application/x-javascript");
    $dev = $_GET["dev"];
    $devenc = urlencode($dev);
    echo "YahooWinBrowse('700','{$page}?popup=yes&dev={$devenc}','{$dev}',true)";
}
function popup()
{
    $page = CurrentPageName();
    $tpl = new templates();
<?php

header("Pragma: no-cache");
header("Expires: 0");
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-cache, must-revalidate");
session_start();
include_once "ressources/class.templates.inc";
include_once "ressources/class.ldap.inc";
if (isset($_GET["post"])) {
    echo GetLogs();
    exit;
}
page();
function Page()
{
    $page = CurrentPageName();
    $html = "\n\t\n<script language=\"JavaScript\">  // une premiere fonction pour manipuler les valeurs \"dynamiques\"       \nfunction mettre(){                            \n   document.form1.source.focus();\n   document.form1.source.select();\n}\n\nvar timerID  = null;\nvar timerID1  = null;\nvar tant=0;\nvar reste=0;\n\nfunction demarre(){\n   tant = tant+1;\n   reste=10-tant;\n   document.getElementById('wait').innerHTML=\"- \" + reste + \" s\";\n        \n\n   if (tant < 10 ) {                           //exemple:caler a une minute (60*1000) \n      timerID = setTimeout(\"demarre()\",1000);\n                \n   } else {\n               tant = 0;\n               document.getElementById('wait').innerHTML='<img src=img/wait.gif>';\n               LoadAjax2('postlogs','{$page}?post=1');\n               demarre();                                //la boucle demarre !\n   }\n}\n\nfunction demar1(){\n   tant = tant+1;\n   \n        \n\n   if (tant < 2 ) {                             //delai court pour le premier affichage !\n      timerID = setTimeout(\"demar1()\",1000);\n                \n   } else {\n               tant = 0;                            //reinitialise le compteur\n               LoadAjax2('postlogs','{$page}?post=1');\n                   \n        demarre();                                 //on lance la fonction demarre qui relance le compteur\n   }\n}\n</script>\t\n\t\n\t<div id=wait style='margin:5px;font-weight:bold;font-size:12px;text-align:right'></div>\n\t<div id=postlogs></div>\n\t\n\t<script>LoadAjax2('postlogs','{$page}?post=1');</script>\n\t<script>demarre();</script>\n\t";
    $tplusr = new template_users('{mailman_events}', $html, 0, 0, 0, 0);
    echo $tplusr->web_page;
}
function GetLogs()
{
    $sock = new sockets();
    $datas = $sock->getfile('mailmanevents');
    writelogs(strlen($datas) . ' bytes', __FUNCTION__, __FILE__);
    $tbl = explode("\n", $datas);
    $tbl = array_reverse($tbl, TRUE);
    while (list($num, $val) = each($tbl)) {
        $html = $html . "<div style='color:white;margin-bottom:3px'><code>{$val}</code></div>";
    }