} } $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)); // Informação adicional $smarty->assign("TiposServidores", getAllTiposServidores()); // Todos os tipos de servidores disponiveis $smarty->assign("Servidores", getServidoresByIdUtilizador($User->getId())); // Todos os servidores do utilizador $smarty->assign("Lang", $linguagens[$User->getLinguagem()]); // Todas as palavras da lingua dele. $smarty->assign("LangKey", $User->getLinguagem());
$total = 0; $Servidores = getServidoresByIdUtilizador($User->getId()); if (count($Servidores)) { foreach ($Servidores as $Servidors) { $server = new Servidor($Servidors['Id'], $conn); $server->getFullStatus(); // Fazer update aos Status $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()));
die; } if ($UserVer == $User) { $UserVerIgual = true; } $total = 0; $Servidores = getServidoresByIdUtilizador($UserVer->getId()); foreach ($Servidores as $Servidor) { $server = new Servidor($Servidor['Id'], $conn); $server->getFullStatus(); // Fazer update aos Status $total += $server->getSlots(); } addInformacaoServidores($Servidores); $slotsOcupados = $total; $smarty->assign("UserVer", array("Nome" => utf8_encode($UserVer->getNome()), "Apelido" => utf8_encode($UserVer->getApelido()), "Email" => utf8_encode($UserVer->getEmail()), "Id" => $UserVer->getId(), "IdTema" => $UserVer->getIdTema(), "NomeTema" => $UserVer->getNomeTema(), "NumServidores" => count(getServidoresByIdUtilizador($UserVer->getId())), "MaxServidores" => $UserVer->getNumeroMaxServidores(), "IsAdmin" => $UserVer->isAdmin(), "SlotsUsados" => $slotsOcupados, "PercentUsado" => round(getPercentagem($UserVer->getNumeroServidores(), $UserVer->getNumeroMaxServidores())))); } } } $smarty->assign("passo1", $passo1); $smarty->assign("passo2", $passo2); $smarty->assign("passo3", $passo3); $smarty->assign("passo4", $passo4); $smarty->assign("Opcao", $opcao); $smarty->assign("UserVerIgual", $UserVerIgual); $smarty->display($User->getPastaTema() . '/admin.tpl'); ?> <style type="text/css"> #FullWidth { width: calc(100% - 12px); /* IE 9,10 , Chrome, Firefox */ width: -webkit-calc(100% - 12px); /*For safari 6.0*/
continue; } $mail = new PHPMailer(); $mail->isSMTP(); $mail->Host = $email_host; $mail->SMTPAuth = true; $mail->Username = $email_user; $mail->Password = $email_pass; $mail->SMTPSecure = $email_sec; $mail->Port = $email_port; $mail->setFrom('*****@*****.**', 'CyberPanel - Servers Info'); $mail->isHTML(true); $stmt = $conn->prepare(GETSERVIDORBYIDUTILIZADOR); $stmt->execute(array(":IdUtilizador" => $user->getId())); $servidoresV = $stmt->fetchAll(); $mail->addAddress($user->getEmail(), $user->getNome() . " " . $user->getApelido()); $mail->Subject = 'Cyber-Panel Servers Info'; foreach ($servidoresV as $servidor) { $sv = new Servidor($servidor['Id'], $conn); $mail->Body .= "<h2>" . $sv->getNomeServidor() . "</h2>"; $mail->Body .= "<p><b>" . $sv->getIp() . ":" . $sv->getPorta() . "</b></p>"; $Res = $sv->getFullStatus(); if ($Res) { $Mapa = $Res['Map']; $Slots = $Res['Players']; $MaxSlots = $Res['MaxPlayers']; $JLista = $Res['Playerlist']; $Plugins = $Res['Plugins']; $mail->Body .= "<h5><font color='green'>Online</font></h5>"; $mail->Body .= "<h6>Mapa: <b>" . $Mapa . "</b></h6>"; $mail->Body .= "<h6>Slots: <b>" . $Slots . "/" . $MaxSlots . "</b></h6>";