Ejemplo n.º 1
0
function BuildRows($appli, $SockStatus, $internetkey, $noupgrade = false)
{
    $ini = new Bs_IniHandler();
    if ($GLOBALS["INDEXFF"] == null) {
        $GLOBALS["INDEXFF"] = @file_get_contents(dirname(__FILE__) . '/ressources/index.ini');
    }
    $ini->loadString($GLOBALS["INDEXFF"]);
    $tpl = new templates();
    $button_text = $tpl->_parse_body('{install_upgrade}');
    if (strlen($button_text) > 27) {
        $button_text = substr($button_text, 0, 24) . "...";
    }
    $bgcolor = "style='background-color:#DFFDD6'";
    $version = ParseAppli($SockStatus, $appli);
    $uninstall = ParseUninstall($SockStatus, $appli);
    if ($version == "0" or strlen($version) == 0) {
        $version = "{not_installed}";
        $bgcolor = null;
        $uninstall = null;
    }
    if (file_exists(dirname(__FILE__) . "/ressources/install/{$appli}.dbg")) {
        $dbg_exists = imgtootltip('22-logs.png', "{events}", "InstallLogs('{$appli}')");
        $styledbg = "background-color:yellow;border:1px solid black";
    } else {
        $dbg_exists = "<img src='img/fw_bold.gif'>";
    }
    $appli_text = $tpl->_ENGINE_parse_body("{{$appli}}");
    $appli_text = replace_accents($appli_text);
    if (strlen($appli_text) > 30) {
        $appli_text = texttooltip(substr($appli_text, 0, 27) . "...", $appli_text, null, null, 1);
    }
    $button_install = button($button_text, "ApplicationSetup('{$appli}')");
    if ($GLOBALS["ArticaMetaDisableSetupCenter"] == 1) {
        $button_install = null;
        $uninstall = null;
    }
    // UNINSTALL
    if ($uninstall != null) {
        $version = "<table><tr><td style='font-size:13px' valign='middle'>{$version}</td>\n\t\t\t<td valign='middle'>" . imgtootltip("ed_delete.gif", "{uninstall} {{$appli}}", "SetupCenterRemove('{$uninstall}','{$appli}')") . "</td></tr></table>";
    }
    if ($ini->_params["NEXT"]["{$internetkey}"] == null) {
        writelogs("Unable to stat NEXT/{$internetkey} \"{$ini->_params["NEXT"]["{$internetkey}"]}\"", __FUNCTION__, __FILE__, __LINE__);
        $ini->_params["NEXT"]["{$internetkey}"] = "<div style='color:#d32d2d'>{error_network}</div>";
        $button_install = null;
    }
    if ($internetkey == "openldap") {
        $sock = new sockets();
        if ($sock->GET_INFO("AllowUpgradeLdap") != 1) {
            $button_install = null;
        }
    }
    if ($noupgrade) {
        $button_install = null;
    }
    return "\n\t<tr {$bgcolor}>\n\t\t<td width=2% style=\"{$styledbg}\">{$dbg_exists}</td>\n\t\t<td style='font-size:13px' nowrap>{$appli_text}</td>\n\t\t<td style='font-size:13px'>{$version}</td>\n\t\t<td style='font-size:13px'>{$ini->_params["NEXT"]["{$internetkey}"]}</td>\n\t\t<td style='font-size:11px'>{$button_install}</td>\n\t\t<td style='font-size:13px'><div style='width:100px;height:22px;border:1px solid #CCCCCC' id='STATUS_{$appli}'>" . install_status($appli) . "</div></td>\n\t</tr>\n\t";
}
Ejemplo n.º 2
0
include_once 'ressources/class.ldap.inc';
include_once 'ressources/class.users.menus.inc';
include_once 'ressources/class.groups.inc';
include_once 'ressources/class.artica.inc';
include_once 'ressources/class.ini.inc';
include_once 'ressources/class.squid.inc';
include_once 'ressources/class.system.network.inc';
$user = new usersMenus();
if ($user->AsSquidAdministrator == false) {
    $tpl = new templates();
    echo "alert('" . $tpl->javascript_parse_text("{ERROR_NO_PRIVS}") . "');";
    die;
    exit;
}
if (isset($_GET["install-status"])) {
    install_status();
    exit;
}
if (isset($_GET["is31"])) {
    is31();
    exit;
}
if (isset($_GET["current"])) {
    page();
    exit;
}
if (isset($_GET["stables"])) {
    stables();
    exit;
}
tabs();
Ejemplo n.º 3
0
function install_apps()
{
    if (system_is_overloaded(basename(__FILE__))) {
        writelogs("Overloaded system, aborting...", __FUNCTION__, __FILE__, __LINE__);
        die;
    }
    $unix = new unix();
    $pidfile = "/etc/artica-postfix/pids/" . basename(__FILE__) . "." . md5(__FUNCTION__) . ".pid";
    $pid = $unix->get_pid_from_file($pidfile);
    $timefile = $unix->file_time_min($pidfile);
    if ($unix->process_exists($pid, basename(__FILE__))) {
        writelogs(basename(__FILE__) . ": Already executed pid {$pid} since {$timefile} minutes.. aborting the process", "MAIN", __FILE__, __LINE__);
        die;
    }
    if ($timefile < 1) {
        if ($GLOBALS["VERBOSE"]) {
            echo "At least 1mn...aborting";
            die;
        }
    }
    $q = new mysql();
    $sql = "SELECT CODE_NAME FROM setup_center WHERE `upgrade`=1 AND `progress`<10";
    $results = $q->QUERY_SQL($sql, "artica_backup");
    if (!$q->ok) {
        writelogs($q->mysql_error, __FUNCTION__, __FILE__, __LINE__);
    }
    if (mysql_num_rows($results) > 0) {
        while ($ligne = @mysql_fetch_array($results, MYSQL_ASSOC)) {
            $CODE_NAME = $ligne["CODE_NAME"];
            $q->QUERY_SQL("UPDATE setup_center SET `progress`=10 WHERE `CODE_NAME`='{$ligne["CODE_NAME"]}'", "artica_backup");
            install_single_app($CODE_NAME);
            if (system_is_overloaded(basename(__FILE__))) {
                writelogs("Overloaded system, aborting...", __FUNCTION__, __FILE__, __LINE__);
                die;
            }
        }
    }
    $sql = "SELECT CODE_NAME FROM setup_center WHERE `upgrade`=1 AND progress<10";
    $results = $q->QUERY_SQL($sql, "artica_backup");
    if (mysql_num_rows($results) == 0) {
        @unlink("/etc/cron.d/apps-upgrade");
        $q->QUERY_SQL("UPDATE setup_center SET `upgrade`=0 WHERE `upgrade`=1", "artica_backup");
        ParseProducts();
    }
    install_status();
}
Ejemplo n.º 4
0
<?php
include_once(dirname(__FILE__) . '/ressources/class.main_cf.inc');
include_once(dirname(__FILE__) . '/ressources/class.ldap.inc');
include_once(dirname(__FILE__) . "/ressources/class.sockets.inc");
include_once(dirname(__FILE__) . "/ressources/class.mysql.inc");


$tpl=new templates();
$page=CurrentPageName();
if(isset($_GET["install_status"])){install_status();exit;}
if(isset($_GET["installvdi"])){install_vdi();exit;}
if(posix_getuid()<>0){
	$user=new usersMenus();
	if($user->AsSystemAdministrator==false){

		echo $tpl->javascript_parse_text("alert('{ERROR_NO_PRIVS}');");
		die();exit();
	}
}

$button="<input type='button' style='padding:30px;padding-left:180px;padding-right:180px;font-size:16px' OnClick=\"javascript:VDIInstall();\" value='{install_upgrade}'>";
if(isset($_GET["debug"])){debug();exit;}
$installation_lauched=$tpl->javascript_parse_text("{installation_lauched}");
$users=new usersMenus();
if($users->LinuxDistriCode<>"DEBIAN"){
	if($users->LinuxDistriCode<>"UBUNTU"){
		$button="<H2>{THIS_DISTRIBUTION_IS_NOT_SUPPORTED}</H2>";
	}
}

Ejemplo n.º 5
0
function BuildRows($appli, $SockStatus, $internetkey, $noupgrade = false)
{
    $ini = new Bs_IniHandler();
    $ini->loadFile(dirname(__FILE__) . '/ressources/index.ini');
    $tpl = new templates();
    $button_text = $tpl->_parse_body('{install_upgrade}');
    if (strlen($button_text) > 27) {
        $button_text = substr($button_text, 0, 24) . "...";
    }
    $bgcolor = "style='background-color:#DFFDD6'";
    $version = ParseAppli($SockStatus, $appli);
    $uninstall = ParseUninstall($SockStatus, $appli);
    if ($version == "0" or strlen($version) == 0) {
        $version = "{not_installed}";
        $bgcolor = null;
        $uninstall = null;
    }
    if (file_exists(dirname(__FILE__) . "/ressources/install/{$appli}.dbg")) {
        $dbg_exists = imgtootltip('22-logs.png', "{events}", "InstallLogs('{$appli}')");
        $styledbg = "background-color:yellow;border:1px solid black";
    } else {
        $dbg_exists = "<img src='img/fw_bold.gif'>";
    }
    $appli_text = $tpl->javascript_parse_text("{{$appli}}");
    $appli_text = html_entity_decode($appli_text, ENT_QUOTES, "UTF-8");
    if (strlen($appli_text) > 30) {
        $appli_text = texttooltip(htmlentities(substr($appli_text, 0, 27)) . "...", htmlentities($appli_text), null, null, 1);
    }
    $button_install = button($button_text, "ApplicationSetup('{$appli}')");
    // UNINSTALL
    if ($uninstall != null) {
        $version = "<table><tr><td style='font-size:13px' valign='middle'>{$version}</td>\n\t\t\t<td valign='middle'>" . imgtootltip("ed_delete.gif", "{uninstall} {{$appli}}", "SetupCenterRemove('{$uninstall}','{$appli}')") . "</td></tr></table>";
    }
    if ($ini->_params["NEXT"]["{$internetkey}"] == null) {
        $ini->_params["NEXT"]["{$internetkey}"] = "<div style='color:red'>{error_network}</div>";
        $button_install = null;
    }
    if ($noupgrade) {
        $button_install = null;
    }
    return "\n\t<tr {$bgcolor}>\n\t\t<td width=2% style=\"{$styledbg}\">{$dbg_exists}</td>\n\t\t<td style='font-size:13px' nowrap>{$appli_text}</td>\n\t\t<td style='font-size:13px'>{$version}</td>\n\t\t<td style='font-size:13px'>{$ini->_params["NEXT"]["{$internetkey}"]}</td>\n\t\t<td style='font-size:11px'>{$button_install}</td>\n\t\t<td style='font-size:13px'><div style='width:100px;height:22px;border:1px solid #CCCCCC' id='STATUS_{$appli}'>" . install_status($appli) . "</div></td>\n\t</tr>\n\t";
}