Beispiel #1
0
            } else {
                $Erros[] = $linguagens[$User->getLinguagem()]['erro_editarPerfil'];
            }
        } elseif ($Action == "toggleCron") {
            $User->setCron(!$User->hasCron());
            $User->atualizaInfo();
        } else {
        }
    }
}
$smarty->debugging = false;
$smarty->caching = false;
$smarty->cache_lifetime = 10;
$smarty->assign("NomeTema", $User->getNomeTema(), true);
// Nome do Tema
$smarty->assign("PastaTema", $User->getPastaTema(), true);
// Pasta do Tema
$smarty->assign("Titulo", "Cyber-Panel", true);
// Titulo do HTML
$smarty->assign("Zona", $linguagens[$User->getLinguagem()]['zona_perfil'], true);
// Zona em que se encontra
$PercentagemServidores = round(getPercentagem($User->getNumeroServidores(), $User->getNumeroMaxServidores()));
if ($OldUser) {
    $Uti = array("Nome" => utf8_encode($User->getNome()), "Apelido" => utf8_encode($User->getApelido()), "Email" => utf8_encode($User->getEmail()), "Id" => $User->getId(), "IdTema" => $User->getIdTema(), "NomeTema" => $User->getNomeTema(), "IsAdmin" => $User->isAdmin(), "NumServidores" => count(getServidoresByIdUtilizador($User->getId())), "MaxServidores" => $User->getNumeroMaxServidores(), "PercentUsado" => round($PercentagemServidores), "Cron" => $User->hasCron(), "OldUser" => $OldUser, "OldId" => $OldUserC->getId(), "OldNome" => utf8_encode($OldUserC->getNome()), "OldApelido" => utf8_encode($OldUserC->getApelido()), "OldEmail" => utf8_encode($OldUserC->getEmail()));
} else {
    $Uti = array("Nome" => utf8_encode($User->getNome()), "Apelido" => utf8_encode($User->getApelido()), "Email" => utf8_encode($User->getEmail()), "Id" => $User->getId(), "IdTema" => $User->getIdTema(), "NomeTema" => $User->getNomeTema(), "NumServidores" => count(getServidoresByIdUtilizador($User->getId())), "MaxServidores" => $User->getNumeroMaxServidores(), "IsAdmin" => $User->isAdmin(), "PercentUsado" => round($PercentagemServidores), "Cron" => $User->hasCron(), "OldUser" => $OldUser);
}
// Passar Dados para Sistema Smarty.
$smarty->assign("Utilizador", $Uti);
// Informação sobre o utilizador
$smarty->assign("Infos", array("NumServidores" => count(getServidoresByIdUtilizador($User->getId())), "NumServidoresOnline" => count(getServidoresByIdUtilizadorAndStatus($User->getId(), 1)), "NumServidoresOffline" => count(getServidoresByIdUtilizadorAndStatus($User->getId(), 0)), "NumSlotsOcupados" => $slotsOcupados));
Beispiel #2
0
        $total += $server->getSlots();
    }
    $slotsOcupados = $total;
} else {
    $slotsOcupados = 0;
}
$smarty = new Smarty();
if ($OldUser) {
    $Uti = array("Nome" => utf8_encode($User->getNome()), "Apelido" => utf8_encode($User->getApelido()), "Email" => utf8_encode($User->getEmail()), "Id" => $User->getId(), "IdTema" => $User->getIdTema(), "NomeTema" => $User->getNomeTema(), "IsAdmin" => $User->isAdmin(), "OldUser" => $OldUser, "OldId" => $OldUserC->getId(), "OldNome" => utf8_encode($OldUserC->getNome()), "OldApelido" => utf8_encode($OldUserC->getApelido()), "OldEmail" => utf8_encode($OldUserC->getEmail()));
} else {
    $Uti = array("Nome" => utf8_encode($User->getNome()), "Apelido" => utf8_encode($User->getApelido()), "Email" => utf8_encode($User->getEmail()), "Id" => $User->getId(), "IdTema" => $User->getIdTema(), "NomeTema" => $User->getNomeTema(), "IsAdmin" => $User->isAdmin(), "OldUser" => $OldUser);
}
$smarty->debugging = false;
$smarty->caching = false;
$smarty->cache_lifetime = 10;
$smarty->assign("NomeTema", utf8_encode($User->getPastaTema()), true);
$smarty->assign("PastaTema", utf8_encode($User->getPastaTema()), true);
$smarty->assign("Titulo", "Cyber-Panel", true);
$smarty->assign("Zona", utf8_encode($linguagens[$User->getLinguagem()]['zona_servidor'] . " :: " . $Servidor->getNomeServidor()), true);
$smarty->assign("Utilizador", $Uti);
$smarty->assign("Infos", array("NumServidores" => count(getServidoresByIdUtilizador($User->getId())), "NumServidoresOnline" => count(getServidoresByIdUtilizadorAndStatus($User->getId(), 1)), "NumServidoresOffline" => count(getServidoresByIdUtilizadorAndStatus($User->getId(), 0)), "NumSlotsOcupados" => $slotsOcupados));
$smarty->assign("TiposServidores", getAllTiposServidores());
$smarty->assign("Servidores", getServidoresByIdUtilizador($User->getId()));
$smarty->assign("Servidor", array("Id" => $Servidor->getId(), "IdUtilizador" => $Servidor->getIdUtilizador(), "TipoServidor" => $Servidor->getTipoServidor(), "NomeTipoServidor" => $Servidor->getNomeTipoServidor(), "NomeServidor" => $Servidor->getNomeServidor(), "Ip" => $Servidor->getIp(), "Porta" => $Servidor->getPorta(), "PortaQuery" => $Servidor->getPortaQuery(), "Mapa" => $Servidor->getMapaAtual(), "MapaDb" => $Servidor->getMapaInicial(), "Motd" => $Servidor->getMotd(), "MaxSlots" => $Servidor->getMaxSlots(), "MaxSlotsDb" => $Servidor->getMaxSlotsDb(), "Slots" => $Servidor->getSlots(), "Jogadores" => $Servidor->getJogadores(), "Instalado" => $Servidor->isInstalado(), "OnlineMode" => $Servidor->getOnlineMode(), "FTP_User" => $Servidor->getFTPUser(), "FTP_Password" => $Servidor->getFTPPassword(), "Status" => $Servidor->getStatus()));
$smarty->assign("Lang", $linguagens[$User->getLinguagem()]);
$smarty->display($User->getPastaTema() . '/servidor.tpl');
#$smarty->display('Metromega/index.tpl');
?>
	<script type="text/javascript">
	function Redirect (url) {
	    var ua        = navigator.userAgent.toLowerCase(),
Beispiel #3
0
            $User->getInfo();
            echo json_encode(array("Status" => true, "ID" => $User->getLinguagem(), "Result" => $linguagens[$User->getLinguagem()]['alerta_okMudarLinguagem']));
            die;
        } else {
            echo json_encode(array("Status" => false, "Result" => $linguagens[$User->getLinguagem()]['alerta_erroMudarLinguagem']));
            die;
        }
        echo json_encode(array("Status" => false, "Result" => $linguagens[$User->getLinguagem()]['alerta_erroMudarLinguagem']));
        die;
    }
}
$smarty->debugging = false;
$smarty->caching = false;
$smarty->cache_lifetime = 10;
$smarty->assign("NomeTema", $User->getNomeTema(), true);
$smarty->assign("PastaTema", $User->getPastaTema(), true);
$smarty->assign("Titulo", "Cyber-Panel", true);
$smarty->assign("Zona", $linguagens[$User->getLinguagem()]['zona_definicoes'], true);
$PercentagemServidores = round(getPercentagem($User->getNumeroServidores(), $User->getNumeroMaxServidores()));
if ($OldUser) {
    $Uti = array("Nome" => utf8_encode($User->getNome()), "Apelido" => utf8_encode($User->getApelido()), "Email" => utf8_encode($User->getEmail()), "Id" => $User->getId(), "IdTema" => $User->getIdTema(), "NomeTema" => $User->getNomeTema(), "NumServidores" => count(getServidoresByIdUtilizador($User->getId())), "MaxServidores" => $User->getNumeroMaxServidores(), "IsAdmin" => $User->isAdmin(), "PercentUsado" => round($PercentagemServidores), "OldUser" => $OldUser, "OldId" => $OldUserC->getId(), "OldNome" => utf8_encode($OldUserC->getNome()), "OldApelido" => utf8_encode($OldUserC->getApelido()), "OldEmail" => utf8_encode($OldUserC->getEmail()));
} else {
    $Uti = array("Nome" => utf8_encode($User->getNome()), "Apelido" => utf8_encode($User->getApelido()), "Email" => utf8_encode($User->getEmail()), "Id" => $User->getId(), "IdTema" => $User->getIdTema(), "NomeTema" => $User->getNomeTema(), "NumServidores" => count(getServidoresByIdUtilizador($User->getId())), "MaxServidores" => $User->getNumeroMaxServidores(), "IsAdmin" => $User->isAdmin(), "PercentUsado" => round($PercentagemServidores), "OldUser" => $OldUser);
}
$smarty->assign("Utilizador", $Uti);
$smarty->assign("Infos", array("NumServidores" => count(getServidoresByIdUtilizador($User->getId())), "NumServidoresOnline" => count(getServidoresByIdUtilizadorAndStatus($User->getId(), 1)), "NumServidoresOffline" => count(getServidoresByIdUtilizadorAndStatus($User->getId(), 0)), "NumSlotsOcupados" => $slotsOcupados));
$smarty->assign("TiposServidores", getAllTiposServidores());
$smarty->assign("Servidores", getServidoresByIdUtilizador($User->getId()));
$smarty->assign("Lang", $linguagens[$User->getLinguagem()]);
$smarty->assign("LangKey", $User->getLinguagem());
$smarty->assign("Langs", getLangKeys());
} else {
    header("Location: index.php");
    die;
}
$ServidoresTipo = getServidorByTipoServidorAndIdUtilizador($Tipo, $User->getId());
foreach ($ServidoresTipo as $Servidor) {
    $server = new Servidor($Servidor['Id'], $conn);
    $server->getFullStatus();
    // Fazer update aos Status
}
addInformacaoServidores($ServidoresTipo);
$smarty->debugging = false;
$smarty->caching = false;
$smarty->cache_lifetime = 10;
$smarty->assign("NomeTema", $User->getNomeTema(), true);
$smarty->assign("PastaTema", $User->getPastaTema(), true);
$smarty->assign("Titulo", "Cyber-Panel", true);
$smarty->assign("Zona", $linguagens[$User->getLinguagem()]['zona_criarServidor'], true);
$PercentagemServidores = round(getPercentagem($User->getNumeroServidores(), $User->getNumeroMaxServidores()));
if ($OldUser) {
    $Uti = array("Nome" => utf8_encode($User->getNome()), "Apelido" => utf8_encode($User->getApelido()), "Email" => utf8_encode($User->getEmail()), "Id" => $User->getId(), "IdTema" => $User->getIdTema(), "NomeTema" => $User->getNomeTema(), "NumServidores" => count(getServidoresByIdUtilizador($User->getId())), "MaxServidores" => $User->getNumeroMaxServidores(), "IsAdmin" => $User->isAdmin(), "PercentUsado" => round($PercentagemServidores), "OldUser" => $OldUser, "OldId" => $OldUserC->getId(), "OldNome" => utf8_encode($OldUserC->getNome()), "OldApelido" => utf8_encode($OldUserC->getApelido()), "OldEmail" => utf8_encode($OldUserC->getEmail()));
} else {
    $Uti = array("Nome" => utf8_encode($User->getNome()), "Apelido" => utf8_encode($User->getApelido()), "Email" => utf8_encode($User->getEmail()), "Id" => $User->getId(), "IdTema" => $User->getIdTema(), "NomeTema" => $User->getNomeTema(), "NumServidores" => count(getServidoresByIdUtilizador($User->getId())), "MaxServidores" => $User->getNumeroMaxServidores(), "IsAdmin" => $User->isAdmin(), "PercentUsado" => round($PercentagemServidores), "OldUser" => $OldUser);
}
$smarty->assign("Utilizador", $Uti);
$smarty->assign("Infos", array("NumServidores" => count(getServidoresByIdUtilizador($User->getId())), "NumServidoresOnline" => count(getServidoresByIdUtilizadorAndStatus($User->getId(), 1)), "NumServidoresOffline" => count(getServidoresByIdUtilizadorAndStatus($User->getId(), 0)), "NumSlotsOcupados" => $slotsOcupados));
$smarty->assign("TiposServidores", getAllTiposServidores());
$smarty->assign("NumTiposServidores", count(getAllTiposServidores()));
$smarty->assign("Servidores", getServidoresByIdUtilizador($User->getId()));
$smarty->assign("TipoServidor", getTipoServidorById($Tipo)['Nome']);
$smarty->assign("NumServidoresTipo", count($ServidoresTipo));