Commit to Version 24-11

Commit to Version 24-11
This commit is contained in:
Fgagod
2024-11-02 18:14:52 +01:00
parent f38f6e7f58
commit 85004884e7
45 changed files with 920 additions and 850 deletions
-2
View File
@@ -1,2 +0,0 @@
# Auto detect text files and perform LF normalization
* text=auto
+154 -11
View File
@@ -1,14 +1,157 @@
# OSMW
Install OSMW
=============================
- http://domain.com/OSMW/install.php
Créateur de OpenSim Manager Web - OSMW
More configuration
=============================
- inc/config.php
Loutil de gestion de tous vos simulateurs Opensim au travers de votre navigateur web.
Il vous simplifie la gestion quotidienne de vos simulateurs, vous supervisez vos régions dun coup d’œil.
Un outil simple à lutiliser, intégrer à vos hébergement et personnalisable si possible.
Admin Login for new install
=============================
firstname = Super
lastname = Admin
password = password
Pour Opensimulator:
- Gestion de vos régions
- Gestion de vos terrains
- Gestion des visiteurs sur vos terrains
- Gestion de vos sauvegardes
- ...
For Linux !!! REQUIREMENTS !!!!
=============================
- tmux
apt install tmux
- lib php ssh2
apt install php-ssh2
Writing permission /inc/config.php just for Installation after remove permission
Writing permission writing for install.php and delete after installation
Writing permission for folder files /Regions of Opensimulator (writing Regions.ini)
Enjoy!
******************************************
********* REQUIREMENTS **********
******************************************
configuration required for OpenSimulator Manager Web (OSMW):
-- LINUX : Apache / MySQL / TMUX / PHP8 / LibSSH2
-- WINDOWS : WAMP (exemple : Laragon)
Fonctionnement : Traduire
Correction
-- OSMW envoie des commandes au simulateur via Remote Admin, sauf pour le START (Démarrage en console TMUX pour LINUX et Terminal pour WINDOWS)
-- Certains fichiers et/ou dossiers doivent avoir les droits d'écriture pour pouvoir être modifiés par OSMW (LINUX)
-- ATTENTION aux droits d'accès aux fichiers et au format des données saisies dans vos fichiers INI
--> Régions.ini (droits d'écriture) / OpensimDefaults.ini, etc., qui doivent être accessibles
--> Préférer l'utilisation de fichier de config dans addon-modules/NameGrid/config/NameGrid.ini
Gestion des Utilisateurs:
=> 4 Niveaux d'accès sont autorisés
-- Administrateurs
-- Gestionnaires de sauvegardes
-- Invités / Compte privé par moteur
-- 1 compte root
******************************************
********* Suivi de versions **********
******************************************
-------------------------------------------------------
*** V 24.11 (Novembre 2024) ***
/* NEWS 2024 by Nino85 Whitman (creator)*/
-- OSMW compatible WINDOWS et LINUX
-- Cleanup page
-- Optimize size of project
-- Fix bugs
-- Add more actions, options, infos, ...
And more ...
-------------------------------------------------------
*** V 21.6 (Juin 2021) ***
/* NEWS 2021 by Nino85 Whitman (creator)*/
-- Cleanup page
-- Optimize size of project
-- Fix bugs
-- Add more actions, options, infos, ...
And more ...
-------------------------------------------------------
*** V 20.8 (Aout 2020) ***
/* NEWS 2020 by Nino85 Whitman (creator)*/
-- add TMUX command for simulator
-- Fix bugs
-- Add more actions, options, infos, ...
And more ...
-------------------------------------------------------
*** V 9.0 *** 2019
/* NEWS 2019 by Nino85 Whitman (creator)*/
-- compatible PHP 7
-- bdd mysql format PDO
-- Cleanup Code
-- Fix bugs
-- Add more actions, options, infos, ...
And more ...
-------------------------------------------------------
*** V 7 ***
/* NEWS 2017 by Nino85 Whitman (creator)*/
-- Cleanup Code
-- Fix bugs
-- Add more actions, options, infos, ...
And more ...
-------------------------------------------------------
*** V 5.5 ***
/* NEWS 2015 by Nino85 Whitman (creator)*/
-- Cleanup Code
-- Fix bugs
-------------------------------------------------------
*** V 5.0 ***
/* NEWS 2015 by djphil and modified by Nino85 Whitman (creator)*/
-- Cleanup Code
-- Fix bugs
-- Add Themes
-- Add bootstrap
-- Add Multilanguage
-- Add Google Recaptcha v2.0
-- Add Navbar
-- Add more actions, options, infos, ...
And more ...
-------------------------------------------------------
*** V 4 Beta *** 2014
-- Mise à jours des SESSION
-- Systeme d'installation intégrés **
-- ...
-------------------------------------------------------
*** V 3.2 Final *** 2013
-- Gestion des sauvegardes de la config des moteurs Opensim et pour chaque sim
-- Transfert des fichiers de sauvagardes vers un serveur FTP exterieur
-- Detection des fichiers de config moteurs
-------------------------------------------------------
*** V 3.0 *** MISE A JOUR MAJEUR *** 2013
-- OSMW à sa propre base de donnée *** Nouveauté
-- Les Fichiers de config , conf moteurs et users sont en BDD ( prb de sécurité !)
-- Compte Utilisateur filtré au niveau des moteurs (choix du moteur) *** Nouveauté
-- Verifier/ Modifier/ configurer vos INIs, opensim, grid, ... *** Nouveauté
-- Connectivité AdmOSMW (Referencement sur le site Fgagod.net)
-------------------------------------------------------
*** V 2.0 *** 2012
-- Optimisations du code
-------------------------------------------------------
*** V 1.1 *** 2011
-- Refonte complete de l'interface
-- Système d'installation simplifié
-- Gestion des moteurs OpenSim, des utilisateurs et de la config en .INI
-- ...
--------------------------------------------------------
*** V 1.0 *** 2010
-- Ajout de la gestion multi-Utilisateurs dans OSMW
--------------------------------------------------------
*** V0.9.11 *** 2019
-- Authentification multi-users via fichier texte (pas encore intégrer à OSMW)
--------------------------------------------------------
*** V0.7.11 *** 2077
-- Ajouts de Fonctionnaltées;
-- Cartographie ajouté
-- TOUS demarrer et arreter d'une seule fois
-- Une serie de tests pour voir si tous fonctionne bien
-- Ce fichier LOL
-- Optimisations du code
--------------------------------------------------------
*** V0.6.11 *** 2006
-- Premiere version de OSWebManager
+281
View File
@@ -0,0 +1,281 @@
<?php
/*
foreach($_POST as $key => $val) echo '$_POST["'.$key.'"]='.$val.'<br />';
foreach($_GET as $key => $val) echo '$_GET["'.$key.'"]='.$val.'<br />';
*/
/*
// Return Ok else NOK
//http://YOUR_OSMW_WEBSERVER/api/?api_key=API_KEY_CONFIG&opensim_select=NAME_OPENSIMULATOR&cmd=COMMANDE
// COMMANDE FOR SIMULATOR:
Start
Stop
GenerateMap
WindlightEnable
WindlightDisable
WindlightLoad
StartLogin
StopLogin
StatusLogin
kick_user&avatar_name=AVATAR_NAME
Estate_NameSet&estate_name=ESTATE
Estate_OwnerSet&estate_owner=AVATAR_NAME
//http://YOUR_OSMW_WEBSERVER/api/?api_key=API_KEY_CONFIG&opensim_select=NAME_OPENSIMULATOR&cmd_tmux=COMMANDE
// COMMANDE FOR TMUX:
tmux_load
tmux_kill
//http://YOUR_OSMW_WEBSERVER/api/?api_key=API_KEY_CONFIG&cmd_tmux=COMMANDE
// COMMANDE FOR TMUX:
tmux_load_all
tmux_kill_all
//http://YOUR_OSMW_WEBSERVER/api/?api_key=API_KEY_CONFIG&opensim_select=NAME_OPENSIMULATOR&cmd_gest=COMMANDE
// COMMANDE DE GESTION
list_simulateurs
list_regions
*/
include ('../inc/config/config.php');
include ('../inc/config/fonctions.php');
include ('../inc/config/radmin.php');
if (isset($_GET['api_key']) || isset($_POST['api_key']))
{
if ($_GET['api_key'] == $api_key || $_POST['api_key'] == $api_key)
{
$_SESSION['authentification_api'] = "autorized";
$opensim_select ="";
$messageInfo ="";
if(isset($_GET['msg_alert'])){ if($_GET['msg_alert']){$msg_alert = $_GET['msg_alert'];} }
if(isset($_GET['avatar_name'])){ if($_GET['avatar_name']){$avatar_name = $_GET['avatar_name'];} }
if(isset($_GET['estate_name'])){ if($_GET['estate_name']){$estate_name = $_GET['estate_name'];} }
if(isset($_GET['estate_owner'])){ if($_GET['estate_owner']){$estate_owner = $_GET['estate_owner'];} }
}
else{echo "ERROR API KEY";exit;}
}
else{echo "ERROR API KEY";exit;}
//############################################################################################################
if (isset($_SESSION['authentification_api']))
{
//#################################################################################################################
if ( isset($_GET['cmd']))
{
try{$bdd = new PDO('mysql:host='.$hostnameBDD.';dbname='.$database.';charset=utf8', $userBDD, $passBDD);}
catch (Exception $e){ die('Erreur : ' . $e->getMessage()); }
if(isset($_GET['opensim_select']))
{
$req_sql = "SELECT * FROM moteurs WHERE id_os ='".$_GET['opensim_select']."'";
$reponse = $bdd->query($req_sql);
$data = $reponse->fetch();
$FichierConfINIPrivate = $data['address']. $data['DB_OS'];
$reponse->closeCursor();
$tableauIniSimu = parse_ini_file($FichierConfINIPrivate, true);
$RemotePort = $tableauIniSimu['RemoteAdmin']['port'] ;
$access_password2 = $tableauIniSimu['RemoteAdmin']['access_password'] ;
}
else
{
}
if(isset($_GET['cmd'])) {$CMD = $_GET['cmd'];} else {$CMD = 'NOK';}
//echo $CMD ;
if($CMD == 'get'){$messageInfo = "OK";}
if($CMD == 'info'){$messageInfo = $_SERVER['SERVER_NAME'];}
if($CMD == 'Start')
{
if(PHP_OS == "Linux")
{
$cmd = 'tmux send-keys -t '.$data['name'].' "cd '.$data['address'].';./opensim.sh" Enter';
CommandeSSH($hostname,$usernameSSH,$passwordSSH,$cmd);
}
if(PHP_OS == "WINNT")
{
$new_chemin = str_replace("/", "\\",$data['address'] );
$cmd ="start /D ".$new_chemin." OpenSim.exe";
exec( $cmd);
}
}
if($CMD == 'Stop')
{
$parameters = array('command' => 'quit');
if(PHP_OS == "Linux")
{
$cmd = "rm ".$data['address']."OpenSim.log";
CommandeSSH($hostname,$usernameSSH,$passwordSSH,$cmd);
}
if(PHP_OS == "WINNT")
{
$new_chemin = str_replace("/", "\\",$data['address']);
$cmd ="del ".$new_chemin."\OpenSim.log";
exec($cmd);
}
}
if($CMD == 'GenerateMap') {$parameters = array('command' => 'generate map');}
if($CMD == 'WindlightEnable') {$parameters = array('command' => 'windlight enable');}
if($CMD == 'WindlightDisable') {$parameters = array('command' => 'windlight disable');}
if($CMD == 'WindlightLoad') {$parameters = array('command' => 'windlight load');}
if($CMD == 'StartLogin') {$parameters = array('command' => 'login enable');}
if($CMD == 'StopLogin') {$parameters = array('command' => 'login disable');}
if($CMD == 'StatusLogin') {$parameters = array('command' => 'login status');}
if($CMD == 'Alerte') {$parameters = array('command' => 'alert '.$msg_alert);}
if($CMD == 'kick_user') {$kick = 'kick user '.$avatar_name.' ejected by administrator.' ; $parameters = array('command' => $kick );}
if($CMD == 'Estate_NameSet') {$estate_cmd = 'estate set name 101 "'.$estate_name.'"' ; $parameters = array('command' => $estate_cmd );}
if($CMD == 'Estate_OwnerSet') {$estate_cmd = 'estate set owner 101 '.$estate_owner ; $parameters = array('command' => $estate_cmd );}
if($CMD=='ReloadEstate')
{
$myRemoteAdmin = new RemoteAdmin(trim($hostname), trim($RemotePort), trim($access_password2));
$myRemoteAdmin->SendCommand('admin_estate_reload', array());
}
//********************************************************************************************************
if ($CMD!= '' AND $CMD!= 'get' AND $CMD!= 'info' AND $CMD!= 'Start')
{
$myRemoteAdmin = new RemoteAdmin(trim($hostname), trim($RemotePort), trim($access_password2));
$retour_radmin = $myRemoteAdmin->SendCommand('admin_console_command', $parameters);
$messageInfo = "OK";
}
}
//#################################################################################################################
if (isset($_GET['cmd_tmux'])) // Pour Config Linux
{
$osmw_simu =$_GET['opensim_select'];
// on se connecte a MySQL
try{$bdd = new PDO('mysql:host='.$hostnameBDD.';dbname='.$database.';charset=utf8', $userBDD, $passBDD);}
catch (Exception $e){ die('Erreur : ' . $e->getMessage()); }
if($_GET['cmd_tmux'] == 'tmux_load')
{
$cmd = 'tmux new -d -s '.$_GET['opensim_select'];
CommandeSSH($hostname,$usernameSSH,$passwordSSH,$cmd);
$messageInfo = "OK";
}
if($_GET['cmd_tmux'] == 'tmux_kill')
{
$cmd = 'tmux kill-session -t '.$_GET['opensim_select'];
CommandeSSH($hostname,$usernameSSH,$passwordSSH,$cmd);
$messageInfo = "OK";
}
if($_GET['cmd_tmux'] == 'tmux_kill_all')
{
// on se connecte a MySQL
try{$bdd = new PDO('mysql:host='.$hostnameBDD.';dbname='.$database.';charset=utf8', $userBDD, $passBDD);}
catch (Exception $e){ die('Erreur : ' . $e->getMessage()); }
$reponse = $bdd->query('SELECT * FROM moteurs');
// On affiche chaque entrée une à une
while ($data = $reponse->fetch())
{
$cmd = 'tmux kill-session -t '.$data['name'];
CommandeSSH($hostname,$usernameSSH,$passwordSSH,$cmd);
}
$messageInfo = "OK";
}
if($_GET['cmd_tmux'] == 'tmux_load_all')
{
// on se connecte a MySQL
try{$bdd = new PDO('mysql:host='.$hostnameBDD.';dbname='.$database.';charset=utf8', $userBDD, $passBDD);}
catch (Exception $e){ die('Erreur : ' . $e->getMessage()); }
$reponse = $bdd->query('SELECT * FROM moteurs');
// On affiche chaque entrée une à une
while ($data = $reponse->fetch())
{
$cmd = 'tmux new -d -s '.$data['name'];
CommandeSSH($hostname,$usernameSSH,$passwordSSH,$cmd);
}
$messageInfo = "OK";
}
}
//#################################################################################################################
if (isset($_GET['cmd_gest']))
{
$list ="";
if($_GET['cmd_gest'] == 'list_simulateurs')
{
// on se connecte a MySQL
try{$bdd = new PDO('mysql:host='.$hostnameBDD.';dbname='.$database.';charset=utf8', $userBDD, $passBDD);}
catch (Exception $e){ die('Erreur : ' . $e->getMessage()); }
$reponse = $bdd->query('SELECT * FROM moteurs');
$list ='';
// On affiche chaque entrée une à une
while ($data = $reponse->fetch())
{
$list .= $data['id_os'].";";
}
$messageInfo = "OK;" . $list;
}
//****************************************************************************************
if($_GET['cmd_gest'] == 'list_regions')
{
try{$bdd = new PDO('mysql:host='.$hostnameBDD.';dbname='.$database.';charset=utf8', $userBDD, $passBDD);}
catch (Exception $e){ die('Erreur : ' . $e->getMessage()); }
$req_sql = "SELECT * FROM moteurs WHERE id_os ='".$_GET['opensim_select']."'";
$reponse = $bdd->query($req_sql);
$data = $reponse->fetch();
$FichierConfINIPrivate = $data['address']. $data['DB_OS'];
$reponse->closeCursor();
$tableauIniSimu = parse_ini_file($FichierConfINIPrivate, true);
$RemotePort = $tableauIniSimu['RemoteAdmin']['port'] ;
$access_password2 = $tableauIniSimu['RemoteAdmin']['access_password'] ;
$filename2 = $data['address']."Regions/Regions.ini";
if (file_exists($filename2)) {$filename = $filename2;}
$tableauIni = parse_ini_file($filename, true);
if ($tableauIni == FALSE) {$messageInfo = "OK;";}
// *** Recuperation du port Http du Simulateur
$FichierConfINIPrivate = $data['address']. $data['DB_OS'];
$tableauIniSimu = parse_ini_file($FichierConfINIPrivate, true);
$srvOS = $tableauIniSimu['Network']['http_listener_port'];
$tableauIni = parse_ini_file($filename, true);
//print_r($tableauIni);
$list ="";
foreach ($tableauIni as $key => $val)
{
$UUID_image = str_replace("-","",$tableauIni[$key]['RegionUUID']);
$ImgMapHttp = "http://".$hostname.":".trim($srvOS)."/index.php?method=regionImage".$UUID_image;
$list = $list.$key."#".$ImgMapHttp.";";
}
$messageInfo = "OK;" . $list;
}
}
//#################################################################################################################
echo $messageInfo;
$_SESSION = array();
}
else {echo "NO API KEY";}
?>
Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.9 KiB

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 665 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 599 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 545 B

-1
View File
@@ -1 +0,0 @@
No direct access ...
BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 665 KiB

After

Width:  |  Height:  |  Size: 414 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 376 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 398 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 347 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 351 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 356 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 418 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 382 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 386 KiB

BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 394 KiB

-173
View File
@@ -1,173 +0,0 @@
<?php
if (isset($_SESSION['authentification']))
{
//echo Affichage_Entete($_SESSION['opensim_select']);
$moteursOK = Securite_Simulateur();
/* ************************************ */
//SECURITE MOTEUR
$btnN1 = "disabled";$btnN2 = "disabled";$btnN3 = "disabled";
if ($_SESSION['privilege'] == 4) {$btnN1 = ""; $btnN2 = ""; $btnN3 = "";} // Niv 4
if ($_SESSION['privilege'] == 3) {$btnN1 = ""; $btnN2 = ""; $btnN3 = "";} // Niv 3
if ($_SESSION['privilege'] == 2) {$btnN1 = ""; $btnN2 = "";} // Niv 2
if ($moteursOK == "OK" )
{
if($_SESSION['privilege'] == 1)
{$btnN1 = "";$btnN2 = "";$btnN3 = "";}
}
//SECURITE MOTEUR
/* ************************************ */
echo '<h1>'.$osmw_index_22.'</h1>';
echo '<div class="clearfix"></div>';
// *******************************************************
// Initialisation des variables ET du tableau
// *******************************************************
// Offset
$ox = -10;
$oy = 0;
// Limite de 50x50
$max = 15;
for ($x = -$max; $x < ($max - 1); $x++)
{
// echo "<hr>X:".$x.'<hr>';
// Limite de 50x50
for($y = -$max; $y < ($max - 1); $y++)
{
// echo "<hr>Y:".$y.'<hr>';
$Matrice[$x][$y]['name'] = "";
$Matrice[$x][$y]['img'] = "";
$Matrice[$x][$y]['ip'] = "";
$Matrice[$x][$y]['port'] = "";
$Matrice[$x][$y]['uuid'] = "";
}
}
//*******************************************************
// *******************************************************
// Lecture des regions.ini et enregistrement dans Matrice
// *******************************************************
// on se connecte a MySQL
try{$bdd = new PDO('mysql:host='.$hostnameBDD.';dbname='.$database.';charset=utf8', $userBDD, $passBDD);}
catch (Exception $e){ die('Erreur : ' . $e->getMessage()); }
$reponse = $bdd->query('SELECT * FROM moteurs');
// On affiche chaque entrée une à une
while ($data = $reponse->fetch())
{
// Pour chaque serveur
$tableauIni = parse_ini_file($data['address']."Regions/Regions.ini", true);
if ($tableauIni == FALSE)
{
echo 'Probleme Lecture Fichier .ini '.$data['address']."Regions/Regions.ini".'<br>';
}
while (list($keyi) = each($tableauIni))
{
// *** Recuperation du port Http du Simulateur
$FichierConfINIPrivate = INI_Conf_Moteur($_SESSION['opensim_select'], "address").INI_Conf_Moteur($_SESSION['opensim_select'], "DB_OS");
$tableauIniSimu = parse_ini_file($FichierConfINIPrivate, true);
$srvOS = $tableauIniSimu['Network']['http_listener_port'];
// Recuperation des valeurs ET enregistrement des valeurs dans le tableau
// echo $key.$tableauIni[$key]['RegionUUID'].$tableauIni[$key]['Location'].$tableauIni[$key]['InternalPort'].'<br>';
$location = explode(",", $tableauIni[$keyi]['Location']);
$coordX = $location[0] - $px - $ox;
$coordY = $location[1] - $py - $oy;
$Matrice[$coordX][$coordY]['name'] = $keyi;
$uuid = str_replace("-", "", $tableauIni[$keyi]['RegionUUID']);
// $ImgMap = "http://".$tableauIni[$keyi]['ExternalHostName'].":".trim($srvOS)."/index.php?method=regionImage".$uuid;
$ImgMap = "vps1.fgagod.fr".":".trim($srvOS)."/index.php?method=regionImage".$uuid;
$Matrice[$coordX][$coordY]['img'] = $ImgMap;
$Matrice[$coordX][$coordY]['ip'] = $tableauIni[$keyi]['ExternalHostName'];
$Matrice[$coordX][$coordY]['port'] = $tableauIni[$keyi]['InternalPort'];
$Matrice[$coordX][$coordY]['uuid'] = $key.$tableauIni[$keyi]['RegionUUID'];
$Matrice[$coordX][$coordY]['hypergrid'] = $data[hypergrid];
}
}
$reponse->closeCursor();
// ****************************
// *** Map en construction ****
// ****************************
// echo $_POST['zooming'];
if (isset($_POST['zooming']))
{
$widthMap = $_POST['zooming'];
$heightMap = $_POST['zooming'];
// $select = "";
$_SESSION['zooming_select'] = trim($_POST['zooming']);
if ($_SESSION['zooming_select'] == 30) {$select1 = "selected";}
if ($_SESSION['zooming_select'] == 40) {$select2 = "selected";}
if ($_SESSION['zooming_select'] == 50) {$select3 = "selected";}
if ($_SESSION['zooming_select'] == 60) {$select4 = "selected";}
if ($_SESSION['zooming_select'] == 70) {$select5 = "selected";}
}
else
{
if ($_SESSION['zooming_select'] == 30) {$select1 = "selected";}
if ($_SESSION['zooming_select'] == 40) {$select2 = "selected";}
if ($_SESSION['zooming_select'] == 50) {$select3 = "selected";}
if ($_SESSION['zooming_select'] == 60) {$select4 = "selected";}
if ($_SESSION['zooming_select'] == 70) {$select5 = "selected";}
$widthMap = $_SESSION['zooming_select'];
$heightMap = $_SESSION['zooming_select'];
}
echo '<form class="form-group" method=post action="">';
echo '<div class="form-inline">';
echo '<select class="form-control" name="zooming">';
echo '<option value="30" name="zooming" '.$select1.'>Zoom 1</option>';
echo '<option value="40" name="zooming" '.$select2.'>Zoom 2</option>';
echo '<option value="50" name="zooming" '.$select3.'>Zoom 3</option>';
echo '<option value="60" name="zooming" '.$select4.'>Zoom 4</option>';
echo '<option value="70" name="zooming" '.$select5.'>Zoom 5</option>';
echo '</select>';
echo ' <button type="submit" class="btn btn-success" name="goto">';
echo '<i class="glyphicon glyphicon-ok"></i> '.$osmw_btn_map_zoom;
echo '</button>';
echo '</div>';
echo '<br />';
echo '<center>';
echo '<table>';
for ($y = $max; $y > (-$max - 1); $y--) // Limite Y
//for ($x = -$max; $x < ($max + 1); $x++) // Limite X
{
echo '<tr>';
for ($x = -$max; $x < $max+1; $x++) // Limite X
//for($y = -$max; $y < ($max + 1); $y++) // Limite Y
{
echo '<td>';
if ($Matrice[$x][$y]['img'])
{
$textemap = $Matrice[$x][$y]['name'];
$locX = $Matrice[$x][$y]['locX'];
$locY = $Matrice[$x][$y]['locY'];
echo '<img class="img-responsive" src="'.$Matrice[$x][$y]['img'].'" width="'.$widthMap.'" height="'.$heightMap.'" alt="'.$textemap.'" title="'.$textemap.' '.$locX.' '.$locY.'" data-toggle="tooltip" data-placement="top">';
}
else
{
$textemap = "Water (Free)";
echo '<img class="img-responsive" src="./img/water.jpg" width="'.$widthMap.'" height="'.$heightMap.'" alt="'.$textemap.'" title="'.$textemap.' '.$locX.' '.$locY.'" data-toggle="tooltip" data-placement="top">';
}
echo '</td>';
}
echo '</tr>';
}
echo '</table>';
echo '</center>';
}
else {header('Location: index.php');}
?>
+37 -13
View File
@@ -18,9 +18,6 @@ if (isset($_SESSION['authentification']))
//SECURITE MOTEUR
/* ************************************ */
echo '<h1>'.$osmw_index_2.'</h1>';
echo '<div class="clearfix"></div>';
//******************************************************
// Affichage page principale
//******************************************************
@@ -57,11 +54,38 @@ if (isset($_SESSION['authentification']))
echo '<th>Action</th>';
echo '</tr>';
while (list($key, $val) = each($tableauIni))
foreach ($tableauIni as $key => $val)
{
$uuid = str_replace("-", "", $tableauIni[$key]['RegionUUID']);
$ImgMap = "http://".$hostname.":".trim($srvOS)."/index.php?method=regionImage".$uuid;
if (Test_Url($ImgMap) == false) {$ImgMap = "img/offline.jpg";}
//$ImgMap = "http://".$hostname.":".trim($srvOS)."/index.php?method=regionImage".str_replace("-","",$tableauIni[$key]['RegionUUID']);
//if (Test_Url($ImgMap) == false){$ImgMap = "img/offline.jpg";}
$ImgMapHttp = "http://".$hostname.":".trim($srvOS)."/index.php?method=regionImage".str_replace("-","",$tableauIni[$key]['RegionUUID']);
$ImgMapLocal = './img/'.str_replace("-","",$tableauIni[$key]['RegionUUID']).'.jpg';
if (Test_Url($ImgMapHttp) == false)
{
$ImgMap = "./img/offline.jpg";
unlink($ImgMapLocal );
}
else
{
if(file_exists($ImgMapLocal))
{
if (file_exists($ImgMapLocal))
{
//echo "$ImgMapLocal was last modified: " . date ("F d Y H:i:s.", filemtime($ImgMapLocal));
}
}
else
{
copy($ImgMapHttp, $ImgMapLocal);
}
$ImgMap = $ImgMapLocal;
}
echo '<tr>';
echo '<td><h5>'.$key.'</h5></td>';
echo '<td><img style="height: 90px;" class="img-thumbnail" alt="" src="'.$ImgMap.'"></td>';
@@ -173,7 +197,7 @@ if (isset($_SESSION['authentification']))
{
$parameters = array(
'region_name' => $_POST['name_sim'],
'filename' => 'BackupOAR_'.$_POST['name_sim'].'_'.date(d_m_Y_H_i).'.oar'
'filename' => 'BackupOAR_'.$_POST['name_sim'].'_'.date('d_m_Y_H_i').'.oar'
);
$myRemoteAdmin->SendCommand('admin_save_oar', $parameters);
echo $messageInfo ;
@@ -182,7 +206,7 @@ if (isset($_SESSION['authentification']))
{
$parameters = array(
'region_name' => $_POST['name_sim'],
'filename' => 'BackupXML_'.$_POST['name_sim'].'_'.date(d_m_Y_H_i).'.xml2');
'filename' => 'BackupXML_'.$_POST['name_sim'].'_'.date('d_m_Y_H_i').'.xml2');
$myRemoteAdmin->SendCommand('admin_save_xml', $parameters);
echo $messageInfo ;
}
@@ -196,7 +220,7 @@ if (isset($_SESSION['authentification']))
{
$parameters = array(
'region_name' => $_POST['name_sim'],
'filename' => 'BackupMAP_'.$_POST['name_sim'].'_'.date(d_m_Y_h).'.jpg'
'filename' => 'BackupMAP_'.$_POST['name_sim'].'_'.date('d_m_Y_h').'.jpg'
);
$myRemoteAdmin->SendCommand('admin_save_heightmap', $parameters);
echo $messageInfo ;
@@ -205,7 +229,7 @@ if (isset($_SESSION['authentification']))
{
$parameters = array(
'region_name' => $_POST['name_sim'],
'filename' => 'BackupMAP_'.$_POST['name_sim'].'_'.date(d_m_Y_h).'.raw'
'filename' => 'BackupMAP_'.$_POST['name_sim'].'_'.date('d_m_Y_h').'.raw'
);
$myRemoteAdmin->SendCommand('admin_save_heightmap', $parameters);
echo $messageInfo ;
@@ -222,8 +246,8 @@ if (isset($_SESSION['authentification']))
if ($_POST['cmd'] == "delete")
{
$file_delete = INI_Conf_Moteur($_SESSION['opensim_select'],"address").$_POST['name_file'];
$cmd = 'rm "'.$file_delete.'"';
CommandeSSH($hostname,$usernameSSH,$passwordSSH,$cmd);
unlink($file_delete);
echo '<div class="alert alert-success alert-anim" role="alert">Fichier '.$chemin.$_POST['name_file'].' '.$osmw_delete_user_ok.'<strong> OpenSim.log</strong</div>';
echo $messageInfo ;
}
@@ -236,7 +260,7 @@ if (isset($_SESSION['authentification']))
if($_POST["choix"]=="section")
{
$parameters = array('command' => 'save iar '.$fullname.' /OSMWExport '.$_POST['pass'].' BackupIAR_'.$_POST['first'].'_'.$_POST['last'].'_'.date(d_m_Y_h).'.iar');
$parameters = array('command' => 'save iar '.$fullname.' /OSMWExport '.$_POST['pass'].' BackupIAR_'.$_POST['first'].'_'.$_POST['last'].'_'.date('d_m_Y_h').'.iar');
}
if($_POST["choix"]=="all")
{
+85 -47
View File
@@ -1,6 +1,7 @@
<?php
if (isset($_SESSION['authentification']))
{
echo Affichage_Entete($_SESSION['opensim_select']);
$moteursOK = Securite_Simulateur();
/* ************************************ */
@@ -17,9 +18,6 @@ if (isset($_SESSION['authentification']))
//SECURITE MOTEUR
/* ************************************ */
echo '<h1>'.$osmw_index_1.'</h1>';
echo '<div class="clearfix"></div>';
//******************************************************
/* Selon ACTION bouton => Envoi Commande via Remote Admin sauf START */
//******************************************************
@@ -36,15 +34,18 @@ if (isset($_SESSION['authentification']))
//**************************
// EXECUTION COMMANDE SYSTEME
//**************************
if($_POST['cmdStart'])
if(isset($_POST['cmdStart']))
{
//echo PHP_OS;
// WINDOWS ***********************
//Exemple: "start /D C:\OpenSimulator\opensim_FestAvi2015_0821 OpenSim.exe"
//$new_chemin = str_replace("/", "\\",INI_Conf_Moteur($_SESSION['opensim_select'], "address") );
//$cmd ="start /D ".$new_chemin." OpenSim.exe";
if(PHP_OS == "WINNT")
{
// WINDOWS ***********************
//Exemple: "start /D C:\OpenSimulator\opensim_FestAvi2015_0821 OpenSim.exe"
$new_chemin = str_replace("/", "\\",INI_Conf_Moteur($_SESSION['opensim_select'], "address") );
$cmd ="start /D ".$new_chemin." OpenSim.exe";
exec( $cmd);
}
// LINUX ***********************
if(PHP_OS == "Linux")
{
@@ -56,7 +57,7 @@ if (isset($_SESSION['authentification']))
//**************************
// COMMANDE PAR REMOTE ADMIN (specifique)
//**************************
if($_POST['cmdEstate'])
if(isset($_POST['cmdEstate']))
{
$myRemoteAdmin = new RemoteAdmin(trim($hostname), trim($RemotePort), trim($access_password2));
$myRemoteAdmin->SendCommand('admin_estate_reload', array());
@@ -64,39 +65,54 @@ if (isset($_SESSION['authentification']))
//**************************
// COMMANDE PAR REMOTE ADMIN (admin_console_command)
//**************************
if($_POST['cmd'] == 'Alerte General') {$parameters = array('command' => 'alert '.$_POST["msg_alert"]);}
if($_POST['cmd'] == 'Stop') {$parameters = array('command' => 'quit');
if(isset($_POST['cmd'])){$COMMAND = $_POST['cmd']; }else{$COMMAND ="";}
if($COMMAND == 'Stop')
{
$parameters = array('command' => 'quit');
// LINUX ***********************
if(PHP_OS == "Linux")
{
$cmd = "rm ".INI_Conf_Moteur($_SESSION['opensim_select'], "address")."OpenSim.log";
CommandeSSH($hostname,$usernameSSH,$passwordSSH,$cmd);}
if($_POST['cmd'] == 'Restart') {$parameters = array('command' => 'restart');}
if($_POST['cmd'] == 'Region Root') {$parameters = array('command' => 'change region root');}
if($_POST['cmd'] == 'Update Client') {$parameters = array('command' => 'force update');}
if($_POST['cmd'] == 'FCache Assets') {$parameters = array('command' => 'fcache assets');}
if($_POST['cmd'] == 'FCache ClearF') {$parameters = array('command' => 'fcache clear file');}
if($_POST['cmd'] == 'Generate Map') {$parameters = array('command' => 'generate map');}
if($_POST['cmd'] == 'Windlight enable') {$parameters = array('command' => 'windlight enable');}
if($_POST['cmd'] == 'Windlight disable'){$parameters = array('command' => 'windlight disable');}
if($_POST['cmd'] == 'Windlight load') {$parameters = array('command' => 'windlight load');}
if($_POST['cmd'] == 'Elevate') {$parameters = array('command' => 'terrain elevate 1');}
if($_POST['cmd'] == 'Lower') {$parameters = array('command' => 'terrain lower 1');}
CommandeSSH($hostname,$usernameSSH,$passwordSSH,$cmd);
}
if(PHP_OS == "WINNT")
{
$new_chemin = str_replace("/", "\\",INI_Conf_Moteur($_SESSION['opensim_select'], "address") );
$cmd ="del ".$new_chemin."\OpenSim.log";
exec($cmd);
}
}
if($COMMAND == 'Alerte General') {$parameters = array('command' => 'alert '.$_POST["msg_alert"]);}
if($COMMAND == 'Restart') {$parameters = array('command' => 'restart');}
if($COMMAND == 'Region Root') {$parameters = array('command' => 'change region root');}
if($COMMAND == 'Update Client') {$parameters = array('command' => 'force update');}
if($COMMAND == 'FCache Assets') {$parameters = array('command' => 'fcache assets');}
if($COMMAND == 'FCache ClearF') {$parameters = array('command' => 'fcache clear file');}
if($COMMAND == 'Generate Map') {$parameters = array('command' => 'generate map');}
if($COMMAND == 'Windlight enable') {$parameters = array('command' => 'windlight enable');}
if($COMMAND == 'Windlight disable'){$parameters = array('command' => 'windlight disable');}
if($COMMAND == 'Windlight load') {$parameters = array('command' => 'windlight load');}
if($COMMAND == 'Elevate') {$parameters = array('command' => 'terrain elevate 1');}
if($COMMAND == 'Lower') {$parameters = array('command' => 'terrain lower 1');}
if($_POST['cmd'] == 'StartLogin') {$parameters = array('command' => 'login enable');}
if($_POST['cmd'] == 'StopLogin') {$parameters = array('command' => 'login disable');}
if($_POST['cmd'] == 'StatusLogin') {$parameters = array('command' => 'login status');}
if($COMMAND == 'StartLogin') {$parameters = array('command' => 'login enable');}
if($COMMAND == 'StopLogin') {$parameters = array('command' => 'login disable');}
if($COMMAND == 'StatusLogin') {$parameters = array('command' => 'login status');}
if($_POST['cmd'] == 'kick_user') { $kick = 'kick user '.$_POST["avatar_name"].' ejected by administrator.' ;$parameters = array('command' => $kick );}
if($_POST['cmd'] == 'appearance_user') { $appearance = 'appearance show '.$_POST["avatar_name"] ;$parameters = array('command' => $appearance );}
if($COMMAND == 'kick_user') { $kick = 'kick user '.$_POST["avatar_name"].' ejected by administrator.' ;$parameters = array('command' => $kick );}
if($COMMAND == 'appearance_user') { $appearance = 'appearance show '.$_POST["avatar_name"] ;$parameters = array('command' => $appearance );}
if($_POST['cmd'] == 'estate_name') {$estate_name = 'estate set name 101 "'.$_POST["estate_name"].'"' ;$parameters = array('command' => $estate_name );}
if($_POST['cmd'] == 'estate_owner') {echo $estate_owner = 'estate set owner 101 '.$_POST["estate_owner"] ;$parameters = array('command' => $estate_owner );}
if($COMMAND == 'estate_name') {$estate_name = 'estate set name 101 "'.$_POST["estate_name"].'"' ;$parameters = array('command' => $estate_name );}
if($COMMAND == 'estate_owner') {echo $estate_owner = 'estate set owner 101 '.$_POST["estate_owner"] ;$parameters = array('command' => $estate_owner );}
if($_POST['cmd']<>"")
if($COMMAND<>"")
{
$myRemoteAdmin = new RemoteAdmin(trim($hostname), trim($RemotePort), trim($access_password2));
$retour_radmin = $myRemoteAdmin->SendCommand('admin_console_command', $parameters);
}
if($_POST['cmd'])
if($COMMAND)
{
//debug($retour_radmin);
echo $messageInfo;
@@ -133,14 +149,18 @@ if (isset($_SESSION['authentification']))
//################################################
if (isset($_POST['section1'])=="section1")
{
$cmd = 'tmux ls | grep '.INI_Conf_Moteur($_SESSION['opensim_select'], "name");
$retour = CommandeSSH($hostname,$usernameSSH,$passwordSSH,$cmd);
$name_tmux = explode(":",$retour);
// LINUX ***********************
if(PHP_OS == "Linux")
{
$cmd = 'tmux ls | grep '.INI_Conf_Moteur($_SESSION['opensim_select'], "name");
$retour = CommandeSSH($hostname,$usernameSSH,$passwordSSH,$cmd);
$name_tmux = explode(":",$retour);
if ($name_tmux[0] == INI_Conf_Moteur($_SESSION['opensim_select'], "name"))
{$check_tmux ='<a href="index.php?a=AdminSims"><p class="btn btn-success">Tmux check <i class="glyphicon glyphicon-ok-sign"></i></p></a>';}
else{$check_tmux ='<a href="index.php?a=AdminSims"><p class="btn btn-danger">Tmux check <i class="glyphicon glyphicon-remove-sign"></i></p></a>';}
}else{$check_tmux = "";}
if ($name_tmux[0] == INI_Conf_Moteur($_SESSION['opensim_select'], "name"))
{$check_tmux ='<a href="index.php?a=AdminSims"><p class="btn btn-success">Tmux check <i class="glyphicon glyphicon-ok-sign"></i></p></a>';}
else{$check_tmux ='<a href="index.php?a=AdminSims"><p class="btn btn-danger">Tmux check <i class="glyphicon glyphicon-remove-sign"></i></p></a>';}
echo '<form class="form-inline" method="post" action="">';
echo '<table class="table table-hover"><tr><td align=left >';
@@ -305,7 +325,6 @@ if (isset($_SESSION['authentification']))
$tableauIni = parse_ini_file($filename, true);
echo '<table class="table table-hover">';
//echo '<tr class="default"><td colspan=7><p><strong>'.$osmw_label_total_sim.'<span class="badge">'.count($tableauIni).'</span></strong></td><tr>';
echo '<tr class="info">';
echo '<th>Name</th>';
echo '<th>Image</th>';
@@ -314,11 +333,30 @@ if (isset($_SESSION['authentification']))
echo '<th>Port</th>';
echo '</tr>';
while (list($key, $val) = each($tableauIni))
foreach ($tableauIni as $key => $val)
{
$ImgMap = "http://".$hostname.":".trim($srvOS)."/index.php?method=regionImage".str_replace("-","",$tableauIni[$key]['RegionUUID']);
$ImgMapHttp = "http://".$hostname.":".trim($srvOS)."/index.php?method=regionImage".str_replace("-","",$tableauIni[$key]['RegionUUID']);
$ImgMapLocal = './img/'.str_replace("-","",$tableauIni[$key]['RegionUUID']).'.jpg';
if (Test_Url($ImgMapHttp) == false)
{
$ImgMap = "./img/offline.jpg";
unlink($ImgMapLocal );
}
else
{
if(!file_exists($ImgMapLocal))
{
copy($ImgMapHttp, $ImgMapLocal);
}
$ImgMap = $ImgMapLocal;
}
if (Test_Url($ImgMap) == false){$ImgMap = "img/offline.jpg";}
echo '<tr>';
echo '<td><h5>'.$key.'</h5></td>';
@@ -383,7 +421,7 @@ if (isset($_SESSION['authentification']))
echo "File exist: <strong>" .$fichierLog.'</strong>';
echo '</div>';
}
else if ($_POST['cmd'])
else if ($COMMAND)
{
echo '<div class="alert alert-danger alert-anim" role="alert">';
echo "File not exist: <strong>" .$fichierLog.'</strong>';
+8 -16
View File
@@ -17,9 +17,7 @@ if (isset($_SESSION['authentification']))
//SECURITE MOTEUR
/* ************************************ */
echo '<h1>'.$osmw_index_8.'</h1>';
echo '<div class="clearfix"></div>';
//******************************************************
//******************************************************
// Affichage page principale
//******************************************************
// on se connecte a MySQL
@@ -72,21 +70,15 @@ if (isset($_SESSION['authentification']))
echo '<form class="form-group" method="post" action="">';
echo '<input type="hidden" value="'.$data['id'].'" name="id_user">';
echo '<table class="table table-hover">';
echo '<tr class="info">';
echo '<td>Firstname:</td>';
echo '<td><input class="form-control" type="text" value="'.$data['firstname'].'" name="firstname" ></td>';
echo '</tr><tr class="info">';
echo '<td>Lastname:</td>';
echo '<td><input class="form-control" type="text" value="'.$data['lastname'].'" name="lastname" ></td>';
echo '</tr><tr class="warning">';
echo '<td>Password:</td>';
echo '<td><input class="form-control" type="text" value="'.$data['password'].'" name="password" ></td>';
echo '</tr><tr>';
echo '</form>';
echo '<tr class="info"><td>Firstname:</td><td><input class="form-control" type="text" value="'.$data['firstname'].'" name="firstname" ></td></tr>';
echo '<tr class="info"><td>Lastname:</td><td><input class="form-control" type="text" value="'.$data['lastname'].'" name="lastname" ></td></tr>';
echo '<tr class="warning"><td>Password:</td><td><input class="form-control" type="text" value="'.$data['password'].'" name="password" ></td></tr>';
echo '</table>';
echo' <button type="submit" class="btn btn-success" name="cmd" value="Enregistrer">';
echo '<i class="glyphicon glyphicon-ok"></i> '.$osmw_btn_enregistrer.'</button>';
echo '<button type="submit" class="btn btn-success" name="cmd" value="Enregistrer"><i class="glyphicon glyphicon-ok"></i> '.$osmw_btn_enregistrer.'</button>';
echo '</form>';
$reponse->closeCursor();
}
+8
View File
@@ -0,0 +1,8 @@
<?php
if (isset($_SESSION['authentification']) )
{
echo'HELP';
}
else {header('Location: index.php');}
?>
+26 -26
View File
@@ -17,9 +17,7 @@ if (isset($_SESSION['authentification']) && $_SESSION['privilege']>= 3)
//SECURITE MOTEUR
/* ************************************ */
echo '<h1>'.$osmw_index_15.'</h1>';
echo '<div class="clearfix"></div>';
//******************************************************
//******************************************************
// Affichage page principale
//******************************************************
// on se connecte a MySQL
@@ -190,10 +188,13 @@ if (isset($_SESSION['authentification']) && $_SESSION['privilege']>= 3)
while ($data = $reponse->fetch())
{
if ($_POST[$data['id_os']] != '')
{
$clesprivilege = $clesprivilege.'|'.$_POST[$data['id_os']];
}
if (isset($_POST[$data['id_os']]))
{
if ($_POST[$data['id_os']] != '')
{
$clesprivilege = $clesprivilege.'|'.$_POST[$data['id_os']];
}
}
}
$sqlUp = "
@@ -211,28 +212,27 @@ if (isset($_SESSION['authentification']) && $_SESSION['privilege']>= 3)
echo "<i class='glyphicon glyphicon-ok'></i>";
echo " User <strong>".$_POST['NewFirstName']." ".$_POST['NewLastName']."</strong> ".$osmw_edit_user_ok."</p>";
}
}
// ******************************************************
// ******************************************************
if ($_POST['cmd'] == 'Supprimer')
{
$sqlDel = "
DELETE FROM users
WHERE `firstname` = '".$_POST['oldFirstName']."'
AND `lastname` = '".$_POST['oldLastName']."'
";
$reponse = $bdd->query($sqlDel);
if ($_POST['cmd'] == 'Supprimer')
{
$sqlDel = "
DELETE FROM users
WHERE `firstname` = '".$_POST['oldFirstName']."'
AND `lastname` = '".$_POST['oldLastName']."'
";
$reponse = $bdd->query($sqlDel);
echo "<p class='alert alert-success alert-anim'>";
echo "<i class='glyphicon glyphicon-ok'></i>";
echo " User <strong>".$_POST['NewFirstName']." ".$_POST['NewLastName']."</strong> ".$osmw_delete_user_ok."</p>";
echo "<p class='alert alert-success alert-anim'>";
echo "<i class='glyphicon glyphicon-ok'></i>";
echo " User <strong>".$_POST['NewFirstName']." ".$_POST['NewLastName']."</strong> ".$osmw_delete_user_ok."</p>";
}
}
// ******************************************************
// ************** LISTE DES UTILISATEURS ****************
// ******************************************************
if ($_POST['cmd'] != 'Ajouter')
{
echo '<form class="form-group pull-right" method="post" action="">';
echo '<input type="hidden" value="Ajouter" name="cmd" '.$btnN3.'>';
echo '<button class="btn btn-success" type="submit" '.$btnN3.'>';
@@ -243,8 +243,8 @@ if (isset($_SESSION['authentification']) && $_SESSION['privilege']>= 3)
$sql = 'SELECT * FROM users ORDER BY id ASC';
$reponse = $bdd->query($sql);
while ($data = $reponse->fetch()) {$n++;}
$n = $reponse->fetchColumn();
echo '<p>'.$osmw_label_total_user.' <span class="badge">'.$n.'</span></p>';
@@ -375,7 +375,7 @@ if (isset($_SESSION['authentification']) && $_SESSION['privilege']>= 3)
$privilegetxt4 = "";
$block = "";
}
}
echo '</table>';
$reponse->closeCursor();
+3 -6
View File
@@ -16,11 +16,8 @@ if (isset($_SESSION['authentification']) && $_SESSION['privilege']>= 3)
}
//SECURITE MOTEUR
/* ************************************ */
echo '<h1>'.$osmw_index_18.'</h1>';
echo '<div class="clearfix"></div>';
// on se connecte a MySQL
// on se connecte a MySQL
try{$bdd = new PDO('mysql:host='.$hostnameBDD.';dbname='.$database.';charset=utf8', $userBDD, $passBDD);}
catch (Exception $e){ die('Erreur : ' . $e->getMessage()); }
@@ -44,7 +41,7 @@ if (isset($_SESSION['authentification']) && $_SESSION['privilege']>= 3)
$reponse = $bdd->query($sqlIns);
echo "<p class='alert alert-success alert-anim'>";
echo "<i class='glyphicon glyphicon-ok'></i>";
echo " Configuration <strong>".$_POST['NewName']."</strong> ".$osmw_save_user_ok."</p>";
echo " Configuration ".$osmw_save_user_ok."</p>";
}
}
// ******************************************************
@@ -61,7 +58,7 @@ if (isset($_SESSION['authentification']) && $_SESSION['privilege']>= 3)
echo '<form class="form-group" method="post" action="">';
echo '<table class="table table-hover">';
echo '<tr>';
echo '<td>Path (ex: /manager/):</td>';
echo '<td>Path (ex: /OSMW/):</td>';
echo '<td><input class="form-control" type="text" value="'.$data['cheminAppli'].'" name="cheminAppli" '.$btnN3.'></td>';
echo '</tr>';
echo '<tr>';
-187
View File
@@ -1,187 +0,0 @@
<?php
if (isset($_SESSION['authentification']) && $_SESSION['privilege']>= 4)
{
echo Affichage_Entete($_SESSION['opensim_select']);
$moteursOK = Securite_Simulateur();
/* ************************************ */
//SECURITE MOTEUR
$btnN1 = "disabled";$btnN2 = "disabled";$btnN3 = "disabled";
if ($_SESSION['privilege'] == 4) {$btnN1 = ""; $btnN2 = ""; $btnN3 = "";} // Niv 4
if ($_SESSION['privilege'] == 3) {$btnN1 = ""; $btnN2 = ""; $btnN3 = "";} // Niv 3
if ($_SESSION['privilege'] == 2) {$btnN1 = ""; $btnN2 = "";} // Niv 2
if ($moteursOK == "OK" )
{
if($_SESSION['privilege'] == 1)
{$btnN1 = "";$btnN2 = "";$btnN3 = "";}
}
//SECURITE MOTEUR
/* ************************************ */
echo '<h1>'.$osmw_index_5.'</h1>';
echo '<div class="clearfix"></div>';
//******************************************************
// Affichage page principale
//******************************************************
// *** Test des Fichiers suivants ***
$FichierConfINIPrivate = INI_Conf_Moteur($_SESSION['opensim_select'], "address").INI_Conf_Moteur($_SESSION['opensim_select'], "DB_OS");
$filename1 = INI_Conf_Moteur($_SESSION['opensim_select'],"address")."OpenSim.ini";
$filename1b = INI_Conf_Moteur($_SESSION['opensim_select'],"address")."OpenSimDefaults.ini";
$filename2 = $FichierConfINIPrivate;
$filename3 = INI_Conf_Moteur($_SESSION['opensim_select'],"address")."config-include/FlotsamCache.ini";
$filename4 = INI_Conf_Moteur($_SESSION['opensim_select'],"address")."config-include/GridCommon.ini";
$filename5 = INI_Conf_Moteur($_SESSION['opensim_select'],"address")."OpenSim.log";
$filename6 = INI_Conf_Moteur($_SESSION['opensim_select'],"address")."OpenSim.32BitLaunch.log";
$filename7 = INI_Conf_Moteur($_SESSION['opensim_select'],"address")."startuplogo.txt";
$filename8 = INI_Conf_Moteur($_SESSION['opensim_select'],"address")."startup_commands.txt";
$filename9 = INI_Conf_Moteur($_SESSION['opensim_select'],"address")."shutdown_commands.txt";
//******************************************************
$dispo = "";
if (file_exists($filename1))
{
$dispo = $dispo.'<p><input class="btn btn-default btn-block" type="submit" name="affichage" value="OpenSim.ini"></p>';
}
else if (!$_POST['affichage'])
{
echo '<div class="alert alert-danger alert-anim" role="alert"> <strong>OpenSim.ini</strong> '.$osmw_erreur_file_exist.'</div>';
}
if (file_exists($filename1b))
{
$dispo = $dispo.'<p><input class="btn btn-default btn-block" type="submit" name="affichage" value="OpenSimDefaults.ini"></p>';
}
else if (!$_POST['affichage'])
{
echo '<div class="alert alert-danger alert-anim" role="alert"> <strong>OpenSimDefaults.ini</strong> '.$osmw_erreur_file_exist.'</div>';
}
if (file_exists($filename2))
{
$dispo = $dispo.'<p><input class="btn btn-default btn-block" type="submit" name="affichage" value="'.$FichierConfINIPrivate.'"></p>';
}
else if (!$_POST['affichage'])
{
echo '<div class="alert alert-danger alert-anim" role="alert"> <strong>".FichierConfINIPrivate."</strong> '.$osmw_erreur_file_exist.'</div>';
}
if (file_exists($filename3))
{
$dispo = $dispo.'<p><input class="btn btn-default btn-block" type="submit" name="affichage" value="FlotsamCache.ini"></p>';
}
else if (!$_POST['affichage'])
{
echo '<div class="alert alert-danger alert-anim" role="alert"> <strong>FlotsamCache.ini</strong> '.$osmw_erreur_file_exist.'</div>';
}
if (file_exists($filename4))
{
$dispo = $dispo.'<p><input class="btn btn-default btn-block" type="submit" name="affichage" value="GridCommon.ini"></p>';
}
else if (!$_POST['affichage'])
{
echo '<div class="alert alert-danger alert-anim" role="alert"> <strong>GridCommon.ini</strong> '.$osmw_erreur_file_exist.'</div>';
}
if (file_exists($filename5))
{
$dispo = $dispo.'<p><input class="btn btn-default btn-block" type="submit" name="affichage" value="OpenSim.log"></p>';
}
else if (!$_POST['affichage'])
{
echo '<div class="alert alert-danger alert-anim" role="alert"> <strong>OpenSim.log</strong> '.$osmw_erreur_file_exist.'</div>';
}
if (file_exists($filename6))
{
$dispo = $dispo.'<p><input class="btn btn-default btn-block" type="submit" name="affichage" value="OpenSim.32BitLaunch.log"></p>';
}
else if (!$_POST['affichage'])
{
echo '<div class="alert alert-danger alert-anim" role="alert"> <strong>OpenSim.32BitLaunch.log</strong> '.$osmw_erreur_file_exist.'</div>';
}
if (file_exists($filename7))
{
$dispo = $dispo.'<p><input class="btn btn-default btn-block" type="submit" name="affichage" value="startuplogo.txt"></p>';
}
else if (!$_POST['affichage'])
{
echo '<div class="alert alert-danger alert-anim" role="alert"> <strong>startuplogo.txt</strong> '.$osmw_erreur_file_exist.'</div>';
}
if (file_exists($filename8))
{
$dispo = $dispo.'<p><input class="btn btn-default btn-block" type="submit" name="affichage" value="startup_commands.txt"></p>';
}
else if (!$_POST['affichage'])
{
echo '<div class="alert alert-danger alert-anim" role="alert"> <strong>startup_commands.txt</strong> '.$osmw_erreur_file_exist.'</div>';
}
if (file_exists($filename9))
{
$dispo = $dispo.'<p><input class="btn btn-default btn-block" type="submit" name="affichage" value="shutdown_commands.txt"></p>';
}
else if (!$_POST['affichage'])
{
echo '<div class="alert alert-danger alert-anim" role="alert"> <strong>shutdown_commands.txt</strong> '.$osmw_erreur_file_exist.'</div>';
}
echo '<h4>'.$osmw_menu_choix_change.'</h4>';
echo '<form class="form-group" method="post" action="">';
echo $dispo;
echo '</form>';
if ($_POST['affichage'] == "OpenSim.ini"){$fichier = $filename1;}
if ($_POST['affichage'] == "OpenSimDefaults.ini"){$fichier = $filename1b;}
if ($_POST['affichage'] == $FichierConfINIPrivate){$fichier = $filename2;}
if ($_POST['affichage'] == "FlotsamCache.ini"){$fichier = $filename3;}
if ($_POST['affichage'] == "GridCommon.ini"){$fichier = $filename4;}
if ($_POST['affichage'] == "OpenSim.log"){$fichier = $filename5;}
if ($_POST['affichage'] == "OpenSim.32BitLaunch.log"){$fichier = $filename6;}
if ($_POST['affichage'] == "startuplogo.txt"){$fichier = $filename7;}
if ($_POST['affichage'] == "startup_commands.txt"){$fichier = $filename8;}
if ($_POST['affichage'] == "shutdown_commands.txt"){$fichier = $filename9;}
// Enregistre le fichier
if (isset($_POST['button']))
{
unlink($fichier);
$ouverture = fopen("$fichier", "a+");
fwrite($ouverture, "$_POST[modif]");
fclose($ouverture);
echo '<div class="alert alert-success alert-anim" role="alert">';
echo '<strong>'.$_POST['affichage'].'</strong> '.$osmw_edit_user_ok.'</div>';
}
if (isset($_POST['affichage'])) // Affiche le fichier
{
echo '<div class="alert alert-warning" role="alert">';
echo '<p>'.$osmw_file_change.' :<strong>'.$_POST['affichage'].'</strong>';
echo '</div>';
echo '<form class="form-group" method="post" action="">';
echo '<input type="hidden" name="affichage" value="'.$_POST['affichage'].'">';
echo '<input type="hidden" name="button" value="Modifier" '.$btnN3.'>';
echo '<textarea class="form-control preformat" name="modif" rows="10">';
echo file_get_contents($fichier);
echo '</textarea>';
echo '<p></p>';
echo '<button class="btn btn-success" type="submit" name="button" '.$btnN3.'>';
echo '<i class="glyphicon glyphicon-ok"></i> '.$osmw_btn_modifier.'</button>';
echo '</form>';
}
}
else {header('Location: index.php');}
?>
+32 -15
View File
@@ -2,11 +2,21 @@
if (isset($_SESSION['authentification']) && $_SESSION['privilege']>= 3)
{
echo Affichage_Entete($_SESSION['opensim_select']);
$moteursOK = Securite_Simulateur();
/* ************************************ */
//SECURITE MOTEUR
$btnN1 = "disabled";$btnN2 = "disabled";$btnN3 = "disabled";
if ($_SESSION['privilege'] == 4) {$btnN1 = ""; $btnN2 = ""; $btnN3 = "";} // Niv 4
if ($_SESSION['privilege'] == 3) {$btnN1 = ""; $btnN2 = ""; $btnN3 = "";} // Niv 3
if ($_SESSION['privilege'] == 2) {$btnN1 = ""; $btnN2 = "";} // Niv 2
if ($moteursOK == "OK" )
{
if($_SESSION['privilege'] == 1)
{$btnN1 = "";$btnN2 = "";$btnN3 = "";}
}
//SECURITE MOTEUR
/* ************************************ */
echo '<h1>'.$osmw_index_6.'</h1>';
echo '<div class="clearfix"></div>';
//******************************************************
// Affichage page principale
//******************************************************
@@ -71,7 +81,7 @@ if (isset($_SESSION['authentification']) && $_SESSION['privilege']>= 3)
// Enregistrement du nouveau fichier
$fp = fopen (INI_Conf_Moteur($_SESSION['opensim_select'], "address")."Regions/RegionTemp.ini", "w");
while (list($key, $val) = each($tableauIni))
foreach ($tableauIni as $key => $val)
{
fputs($fp, "[".$key."]\r\n");
fputs($fp, "RegionUUID = ".$tableauIni[$key]['RegionUUID']."\r\n");
@@ -134,7 +144,8 @@ if (isset($_SESSION['authentification']) && $_SESSION['privilege']>= 3)
// Enregistrement du nouveau fichier
$fp = fopen (INI_Conf_Moteur($_SESSION['opensim_select'], "address")."Regions/RegionTemp.ini", "w");
while (list($key, $val) = each($tableauIni))
foreach ($tableauIni as $key => $val)
{
fputs($fp, "[".$key."]\r\n");
fputs($fp, "RegionUUID = ".$tableauIni[$key]['RegionUUID']."\r\n");
@@ -174,7 +185,7 @@ if (isset($_SESSION['authentification']) && $_SESSION['privilege']>= 3)
// Enregistrement du nouveau fichier
$fp = fopen (INI_Conf_Moteur($_SESSION['opensim_select'], "address")."Regions/RegionTemp.ini", "w");
while (list($key, $val) = each($tableauIni))
foreach ($tableauIni as $key => $val)
{
fputs($fp, "[".$key."]\r\n");
fputs($fp, "RegionUUID = ".$tableauIni[$key]['RegionUUID']."\r\n");
@@ -201,6 +212,9 @@ if (isset($_SESSION['authentification']) && $_SESSION['privilege']>= 3)
// Affichage page principale
// ******************************************************
// ******************************************************
$fonctionalites ='<b>Options: </b><br> NonPhysicalPrimMax = 256 | PhysicalPrimMax = 64 | ClampPrimSize = False | MaxPrims = 15000 | MaxAgents = 100 | MaxPrimsPerUser = -1';
// *** Lecture Fichier Regions.ini ***
$filename2 = INI_Conf_Moteur($_SESSION['opensim_select'], "address")."Regions/Regions.ini";
@@ -224,23 +238,22 @@ if (isset($_SESSION['authentification']) && $_SESSION['privilege']>= 3)
// Autorisation d'ajout de region
$btn = 'disabled';
if (INI_Conf("Parametre_OSMW","Autorized") == '1')
{
$RegionMax = INI_Conf("NbAutorized", "NbAutorized");
echo '<p>'.$osmw_label_nb_max_sim .' <span class="badge">'.$RegionMax.'</span></p>';
echo '<p>'.$osmw_label_total_sim.' <span class="badge">'.count($tableauIni).'</span></p>';
echo '<p>'.$osmw_label_nb_max_sim .' <span class="badge">'.count($tableauIni).' / '.$RegionMax.'</span></p>';
if (count($tableauIni) == $RegionMax ){$btn = 'disabled';}
else {$btn = $btnN3;}
echo '<form class="form-group" method="post" action="">';
echo '<input type="hidden" name="cmd" value="Ajouter">';
echo '<button class="btn btn-success" type="submit" '.$btn.'><i class="glyphicon glyphicon-ok"></i> '.$osmw_btn_ajout_user.'</button>';
echo '</form>';
}
echo '<p>'.$fonctionalites.'</p>';
echo '<table class="table table-hover">';
echo '<tr class="info">';
@@ -255,8 +268,12 @@ if (isset($_SESSION['authentification']) && $_SESSION['privilege']>= 3)
echo '<th>Delete</th>';
echo '</tr>';
while (list($key, $val) = each($tableauIni))
foreach ($tableauIni as $key => $val)
{
if(isset($tableauIni[$key]['SizeX']) ) { $SizeX = $tableauIni[$key]['SizeX']; }else{$SizeX = "";}
if(isset($tableauIni[$key]['SizeY'])) { $SizeY = $tableauIni[$key]['SizeY']; }else{$SizeY = "";}
echo '<tr>';
echo '<form class="form-group" method="post" action="">';
echo '<input type="hidden" name="name_sim" value="'.$key.'" >';
@@ -266,8 +283,8 @@ if (isset($_SESSION['authentification']) && $_SESSION['privilege']>= 3)
echo '<td><input class="form-control" type="text" name="InternalPort" value="'.$tableauIni[$key]['InternalPort'].'" '.$btnN3.'></td>';
echo '<td><input class="form-control" type="text" name="ExternalHostName" value="'.$tableauIni[$key]['ExternalHostName'].'" '.$btnN3.'></td>';
echo '<td><input class="form-control" type="text" name="RegionUUID" value="'.$tableauIni[$key]['RegionUUID'].'" '.$btnN3.'></td>';
echo '<td><input class="form-control" type="text" name="sizeX" value="'.$tableauIni[$key]['SizeX'].'" '.$btnN3.'></td>';
echo '<td><input class="form-control" type="text" name="sizeY" value="'.$tableauIni[$key]['SizeY'].'" '.$btnN3.'></td>';
echo '<td><input class="form-control" type="text" name="SizeX" value="'.$SizeX.'" '.$btnN3.'></td>';
echo '<td><input class="form-control" type="text" name="SizeY" value="'.$SizeY.'" '.$btnN3.'></td>';
echo '<td><button class="btn btn-success" type="submit" value="Modifier" name="cmd" '.$btnN3.'><i class="glyphicon glyphicon-edit"></i> '.$osmw_btn_modifier.'</button></td>';
echo '<td><button class="btn btn-danger" type="submit" value="Supprimer" name="cmd" '.$btnN3.'><i class="glyphicon glyphicon-trash"></i> '.$osmw_btn_supprimer.'</button></td>';
echo '</tr>';
+38 -25
View File
@@ -17,23 +17,13 @@ if (isset($_SESSION['authentification']) && $_SESSION['privilege']>= 3)
}
//SECURITE MOTEUR
/* ************************************ */
echo '<h1>'.$osmw_index_17.'</h1>';
echo '<div class="clearfix"></div>';
echo '<form class="form-group" method="post" action="">';
echo '<input type="hidden" name="cmd" value="Ajouter" '.$btnN3.'>';
echo '<button class="btn btn-success" type="submit" value="Ajouter un Simulateur" '.$btnN3.'><i class="glyphicon glyphicon-plus"></i></button> ';
echo '<button class="btn btn-warning" type="submit" name="cmd" value="tmux_load_all" '.$btnN3.'><i class="glyphicon glyphicon-play"></i> ALL Tmux</button> ' ;
echo '<button class="btn btn-danger" type="submit" name="cmd" value="tmux_kill_all" '.$btnN3.'><i class="glyphicon glyphicon-stop"></i> ALL Tmux</button> ';
echo '</form>';
//******************************************************
// CONSTRUCTION de la commande pour ENVOI sur la console via SSH
//******************************************************
if (isset($_POST['cmd']))
{
$osmw_simu =$_POST['name'];
if (isset($_POST['name'])){$osmw_simu =$_POST['name'];}
// on se connecte a MySQL
try{$bdd = new PDO('mysql:host='.$hostnameBDD.';dbname='.$database.';charset=utf8', $userBDD, $passBDD);}
catch (Exception $e){ die('Erreur : ' . $e->getMessage()); }
@@ -138,7 +128,7 @@ if (isset($_SESSION['authentification']) && $_SESSION['privilege']>= 3)
echo "<p class='alert alert-success alert-anim'>";
echo "<i class='glyphicon glyphicon-ok'></i>";
echo " ".$osmw_simu." <strong>".$_POST['NewName']."</strong> ".$osmw_edit_user_ok."</p>";
echo " ".$osmw_simu." ".$osmw_edit_user_ok."</p>";
}
if($_POST['cmd'] == 'Supprimer')
@@ -147,32 +137,47 @@ if (isset($_SESSION['authentification']) && $_SESSION['privilege']>= 3)
echo "<p class='alert alert-success alert-anim'>";
echo "<i class='glyphicon glyphicon-ok'></i>";
echo " ".$osmw_simu." <strong>".$_POST['NewName']."</strong> ".$osmw_delete_user_ok."</p>";
echo " ".$osmw_simu." ".$osmw_delete_user_ok."</p>";
}
// Exécution de la requete
if($sqlIns){$bdd->query($sqlIns);}
if(isset($sqlIns)){if($sqlIns){$bdd->query($sqlIns);}}
}
//******************************************************
// Affichage page principale
//******************************************************
echo '<form class="form-group" method="post" action="">';
echo '<input type="hidden" name="cmd" value="Ajouter" '.$btnN3.'>';
echo '<button class="btn btn-dark" type="submit" value="Ajouter un Simulateur" '.$btnN3.'><i class="glyphicon glyphicon-plus"></i></button> ';
// LINUX ***********************
if(PHP_OS == "Linux")
{
echo '<button class="btn btn-warning" type="submit" name="cmd" value="tmux_load_all" '.$btnN3.'><i class="glyphicon glyphicon-play"></i> ALL Tmux</button> ' ;
echo '<button class="btn btn-danger" type="submit" name="cmd" value="tmux_kill_all" '.$btnN3.'><i class="glyphicon glyphicon-stop"></i> ALL Tmux</button> ';
}
echo '</form>';
echo '<p>'.$osmw_label_totl_simulator.' <span class="badge">'.NbOpensim().'</span></p>';
echo '<table class="table table-hover">';
echo '<tr class="info">';
echo '<th>Name Tmux</th>';
echo '<th>Name</th>';
echo '<th>Version</th>';
echo '<th>Path BIN</th>';
echo '<th>HG url</th>';
echo '<th>Path INI private</th>';
echo '<th>Save</th>';
echo '<th>Delete</th>';
echo '<th>Load Tmux</th>';
echo '<th>Kill Tmux</th>';
echo '<th>State Tmux</th>';
// LINUX ***********************
if(PHP_OS == "Linux")
{
echo '<th>Load Tmux</th>';
echo '<th>Kill Tmux</th>';
echo '<th>State Tmux</th>';
}
echo '</tr>';
// on se connecte a MySQL
// on se connecte a MySQL
try{$bdd = new PDO('mysql:host='.$hostnameBDD.';dbname='.$database.';charset=utf8', $userBDD, $passBDD);}
catch (Exception $e){ die('Erreur : ' . $e->getMessage()); }
@@ -181,13 +186,17 @@ if (isset($_SESSION['authentification']) && $_SESSION['privilege']>= 3)
// On affiche chaque entrée une à une
while ($data = $reponse->fetch())
{
// LINUX ***********************
if(PHP_OS == "Linux")
{
$cmd = 'tmux ls | grep '.$data['name'];
$retour = CommandeSSH($hostname,$usernameSSH,$passwordSSH,$cmd);
//$retour = CommandeSSH($hostname,$usernameSSH,$passwordSSH,$cmd);
$name_tmux = explode(":",$retour);
if ($name_tmux[0] == $data['name'])
{$check_tmux ='<p class="btn btn-success"><i class="glyphicon glyphicon-ok-sign"></i></p>';}
else{$check_tmux ='<p class="btn btn-danger"><i class="glyphicon glyphicon-remove-sign"></i></p>';}
}
echo '<tr>';
echo '<form method=post action="">';
@@ -201,9 +210,13 @@ if (isset($_SESSION['authentification']) && $_SESSION['privilege']>= 3)
echo '<td><input class="form-control" type="text" name="DB_OS" value="'.$data['DB_OS'].'" '.$btnN3.'></td>';
echo '<td><button class="btn btn-success" type="submit" name="cmd" value="Update" '.$btnN3.'><i class="glyphicon glyphicon-edit"></i></button></td>';
echo '<td><button class="btn btn-danger" type="submit" name="cmd" value="Supprimer" '.$btnN3.'><i class="glyphicon glyphicon-trash"></i></button></td>';
echo '<td><button class="btn btn-warning" type="submit" name="cmd" value="tmux_load" '.$btnN3.'><i class="glyphicon glyphicon-play"></i></button></td>';
echo '<td><button class="btn btn-danger" type="submit" name="cmd" value="tmux_kill" '.$btnN3.'><i class="glyphicon glyphicon-stop"></i></button></td>';
echo '<td>'.$check_tmux.'</td>';
// LINUX ***********************
if(PHP_OS == "Linux")
{
echo '<td><button class="btn btn-warning" type="submit" name="cmd" value="tmux_load" '.$btnN3.'><i class="glyphicon glyphicon-play"></i></button></td>';
echo '<td><button class="btn btn-danger" type="submit" name="cmd" value="tmux_kill" '.$btnN3.'><i class="glyphicon glyphicon-stop"></i></button></td>';
echo '<td>'.$check_tmux.'</td>';
}
echo '</tr>';
echo '</form>';
echo '</tr>';
@@ -16,11 +16,8 @@ if (isset($_SESSION['authentification']) && $_SESSION['privilege']>= 3)
}
//SECURITE MOTEUR
/* ************************************ */
echo '<h1>'.$osmw_index_18.'</h1>';
echo '<div class="clearfix"></div>';
// on se connecte a MySQL
// on se connecte a MySQL
try{$bdd = new PDO('mysql:host='.$hostnameBDD.';dbname='.$database.';charset=utf8', $userBDD, $passBDD);}
catch (Exception $e){ die('Erreur : ' . $e->getMessage()); }
@@ -47,7 +44,7 @@ if (isset($_SESSION['authentification']) && $_SESSION['privilege']>= 3)
$reponse = $bdd->query($sqlIns);
echo "<p class='alert alert-success alert-anim'>";
echo "<i class='glyphicon glyphicon-ok'></i>";
echo " Configuration <strong>".$_POST['NewName']."</strong> ".$osmw_save_user_ok."</p>";
echo " Configuration ".$osmw_save_user_ok."</p>";
}
}
// ******************************************************
-16
View File
@@ -1,16 +0,0 @@
<span class="label label-default label-primary">
<?php echo $webui_actual_language; ?>
</span>
<?php
foreach ($languages as $langCode => $langName)
{
if ($langCode != $webui_language_code)
{
echo '
<a href="?page='.$_GET[page].'&amp;lang=' . $langCode . '">
<img src="img/flags/flag-'. $langCode . '.png" alt="' . $langName . '" title="' . $langName . '" />
</a>
';
}
}
?>
+42 -23
View File
@@ -1,4 +1,27 @@
<?php
if (isset($_GET['a'])){$PAGE = $_GET['a'];}else{$PAGE = "";}
// **********************
// TRADUCTIONS
// **********************
if (isset($_SESSION['authentification']))
{
//echo $_COOKIE['lang'];
$languages = array("fr" => "French","en" => "English");
if (!empty($_COOKIE['lang']))$lang=$_COOKIE['lang'];
if (!empty($_GET['lang']))$lang=$_GET['lang'];
if (!empty($lang) && array_key_exists($lang, $languages))
{
include('./inc/lang/lang_'.$lang.'.php');
setcookie('lang',$lang,time()+3600*25*365,'/');
}
}
?>
<!-- MENU NAVBAR -->
<nav class="navbar navbar-default">
@@ -6,41 +29,37 @@
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
<ul class="nav navbar-nav">
<li <?php if ($_GET['a'] == "GestSims") {echo 'class="active"';} ?>>
<li <?php if ($PAGE == "GestSims") {echo 'class="active"';} ?>>
<a href="index.php?a=GestSims"><i class="glyphicon glyphicon-th-large"></i> <?php echo $osmw_menu_GestSims;?> </a>
</li>
<li <?php if ($_GET['a'] == "GestSave") {echo 'class="active"';} ?>>
<li <?php if ($PAGE == "GestSave") {echo 'class="active"';} ?>>
<a href="index.php?a=GestSave"><i class="glyphicon glyphicon-hdd"></i> <?php echo $osmw_menu_GestSave;?> </a>
</li>
<!-- MENU MAP-->
<?php if (isset($_SESSION['authentification']) && $_SESSION['privilege']>= 3){?>
<li <?php if ($_GET['a'] == "Map") {echo 'class="active"';} ?>>
<a href="index.php?a=Map"><i class="glyphicon glyphicon-globe"></i> <?php echo $osmw_menu_Map;?></a>
</li>
<?php }?>
<?php if (isset($_SESSION['authentification']) && $_SESSION['privilege']>= 3){?>
<li <?php if ($PAGE == "AdminSims") {echo 'class="active"';} ?>>
<a href="index.php?a=AdminSims"> <i class="glyphicon glyphicon-folder-open"></i> <?php echo $osmw_menu_admin_Sims;?></a>
</li>
<li <?php if ($PAGE == "AdminLands") {echo 'class="active"';} ?>>
<a href="index.php?a=AdminLands"><i class="glyphicon glyphicon-th"></i> <?php echo $osmw_menu_admin_Lands;?></a>
</li>
<?php }?>
<!-- MENU ADMINISTRATOR NAVBAR (SETTINGS)-->
<?php if (isset($_SESSION['authentification']) && $_SESSION['privilege']>= 3){?>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
<i class="glyphicon glyphicon-wrench"></i> <?php echo $osmw_menu_admin;?> <span class="caret"></span>
</a>
<ul class="dropdown-menu">
<li <?php if ($_GET['a'] == "AdminSims") {echo 'class="active"';} ?>>
<a href="index.php?a=AdminSims"> <i class="glyphicon glyphicon-folder-open"></i> <?php echo $osmw_menu_admin_Sims;?></a>
</li>
<li <?php if ($_GET['a'] == "AdminLands") {echo 'class="active"';} ?>>
<a href="index.php?a=AdminLands"><i class="glyphicon glyphicon-th"></i> <?php echo $osmw_menu_admin_Lands;?></a>
</li>
<li role="separator" class="divider"></li>
<li <?php if ($_GET['a'] == "AdminUsers") {echo 'class="active"';} ?>>
<ul class="dropdown-menu">
<li <?php if ($PAGE == "AdminUsers") {echo 'class="active"';} ?>>
<a href="index.php?a=AdminUsers"> <i class="glyphicon glyphicon-user"></i> <?php echo $osmw_menu_admin_Users;?></a>
</li>
<li <?php if ($_GET['a'] == "AdminOsmw") {echo 'class="active"';} ?>>
<li <?php if ($PAGE == "AdminOsmw") {echo 'class="active"';} ?>>
<a href="index.php?a=AdminOsmw"><i class="glyphicon glyphicon-cog"></i> <?php echo $osmw_menu_admin_Osmw;?></a>
</li>
<li <?php if ($_GET['a'] == "AdminEdit") {echo 'class="active"';} ?>>
<a href="index.php?a=AdminEdit"><i class="glyphicon glyphicon-warning-sign"></i> <?php echo $osmw_menu_admin_Edit;?></a>
<li <?php if ($PAGE == "AdminEdit") {echo 'class="active"';} ?>>
<a href="index.php?a=Help"><i class="glyphicon glyphicon glyphicon-book"></i> <?php echo $osmw_menu_help;?></a>
</li>
</ul>
</li>
@@ -52,7 +71,7 @@
<ul class="nav navbar-nav navbar-right">
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
<i class="glyphicon glyphicon-user"></i> <strong><?php echo $_SESSION['login']; ?></strong> <span class="caret"></span>
<i class="glyphicon glyphicon-user"></i> <strong><?php echo $_SESSION['login']; ?></strong> <span class="label label-default"><?php echo $_SESSION['privilege']; ?></span> <span class="caret"></span>
</a>
<ul class="dropdown-menu">
<li><a href="index.php?a=GestUsers"><i class="glyphicon glyphicon-check"></i> <?php echo $osmw_menu_user_login;?></a></li>
+38 -70
View File
@@ -1,58 +1,45 @@
-- MySQL dump 10.13 Distrib 5.6.17, for Win64 (x86_64)
--
-- Host: localhost Database: osmw
-- ------------------------------------------------------
-- Server version 5.6.23-log
-- --------------------------------------------------------
-- Hôte: 127.0.0.1
-- Version du serveur: 8.0.30 - MySQL Community Server - GPL
-- SE du serveur: Win64
-- HeidiSQL Version: 12.1.0.6537
-- --------------------------------------------------------
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!50503 SET NAMES utf8mb4 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
--
-- Table structure for table `config`
--
DROP TABLE IF EXISTS `config`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `config` (
`id` int(11) NOT NULL AUTO_INCREMENT,
-- Listage de la structure de la base pour osmw
CREATE DATABASE IF NOT EXISTS `osmw` /*!40100 DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci */ /*!80016 DEFAULT ENCRYPTION='N' */;
USE `osmw`;
-- Listage de la structure de table osmw. config
CREATE TABLE IF NOT EXISTS `config` (
`id` int NOT NULL AUTO_INCREMENT,
`cheminAppli` varchar(50) NOT NULL,
`destinataire` varchar(50) NOT NULL,
`Autorized` int(2) NOT NULL,
`NbAutorized` int(2) NOT NULL,
`Autorized` int NOT NULL,
`NbAutorized` int NOT NULL,
`VersionOSMW` varchar(50) NOT NULL,
`urlOSMW` varchar(255) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `config`
--
LOCK TABLES `config` WRITE;
-- Listage des données de la table osmw.config : 1 rows
/*!40000 ALTER TABLE `config` DISABLE KEYS */;
INSERT INTO `config` VALUES (1,'','contact@fgagod.net',1,5,'Version 22','');
INSERT INTO `config` (`id`, `cheminAppli`, `destinataire`, `Autorized`, `NbAutorized`, `VersionOSMW`, `urlOSMW`) VALUES
(1, '/OSMW/', 'mymail@domain.com', 1, 4, 'Version 24.11', 'https://www.domain.com/');
/*!40000 ALTER TABLE `config` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `moteurs`
--
DROP TABLE IF EXISTS `moteurs`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `moteurs` (
`osAutorise` tinyint(4) NOT NULL AUTO_INCREMENT,
-- Listage de la structure de table osmw. moteurs
CREATE TABLE IF NOT EXISTS `moteurs` (
`osAutorise` tinyint NOT NULL AUTO_INCREMENT,
`id_os` varchar(50) NOT NULL,
`name` varchar(50) NOT NULL,
`version` varchar(50) NOT NULL,
@@ -60,52 +47,33 @@ CREATE TABLE `moteurs` (
`DB_OS` varchar(50) NOT NULL,
`hypergrid` varchar(255) NOT NULL,
PRIMARY KEY (`osAutorise`)
) ENGINE=MyISAM AUTO_INCREMENT=7 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
) ENGINE=MyISAM AUTO_INCREMENT=10 DEFAULT CHARSET=latin1;
--
-- Dumping data for table `moteurs`
--
LOCK TABLES `moteurs` WRITE;
-- Listage des données de la table osmw.moteurs : 1 rows
/*!40000 ALTER TABLE `moteurs` DISABLE KEYS */;
INSERT INTO `users` VALUES (1,'Super','Admin','5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8',4,'');
INSERT INTO `moteurs` (`osAutorise`, `id_os`, `name`, `version`, `address`, `DB_OS`, `hypergrid`) VALUES
(1, 'Simulateur_1', 'Whitman Corporation', 'Opensim 0.9.3', 'C:/OPENSIM/', 'addon-modules/osgrid/config/osgrid.ini', 'hg.osgrid.org:80');
/*!40000 ALTER TABLE `moteurs` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `users`
--
DROP TABLE IF EXISTS `users`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `users` (
`id` int(11) NOT NULL AUTO_INCREMENT,
-- Listage de la structure de table osmw. users
CREATE TABLE IF NOT EXISTS `users` (
`id` int NOT NULL AUTO_INCREMENT,
`firstname` varchar(15) NOT NULL,
`lastname` varchar(15) NOT NULL,
`password` text NOT NULL,
`privilege` int(11) NOT NULL,
`privilege` int NOT NULL,
`osAutorise` varchar(50) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=6 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
) ENGINE=MyISAM AUTO_INCREMENT=10 DEFAULT CHARSET=latin1;
--
-- Dumping data for table `users`
--
LOCK TABLES `users` WRITE;
-- Listage des données de la table osmw.users : 2 rows
/*!40000 ALTER TABLE `users` DISABLE KEYS */;
INSERT INTO `users` VALUES (1,'Nino85','Whitman','27eedc1e245d7253a951f5960a239661ef2556fa',4,'');
INSERT INTO `users` (`id`, `firstname`, `lastname`, `password`, `privilege`, `osAutorise`) VALUES
(1, 'Super', 'Admin', 'dc79f6a0f51567c820d0535f0c72a77cc5152258', 4, '');
/*!40000 ALTER TABLE `users` ENABLE KEYS */;
UNLOCK TABLES;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40103 SET TIME_ZONE=IFNULL(@OLD_TIME_ZONE, 'system') */;
/*!40101 SET SQL_MODE=IFNULL(@OLD_SQL_MODE, '') */;
/*!40014 SET FOREIGN_KEY_CHECKS=IFNULL(@OLD_FOREIGN_KEY_CHECKS, 1) */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
/*!40111 SET SQL_NOTES=IFNULL(@OLD_SQL_NOTES, 1) */;
-10
View File
@@ -1,10 +0,0 @@
<?php
if (!empty($_COOKIE['lang']))$lang=$_COOKIE['lang'];
if (!empty($_GET['lang']))$lang=$_GET['lang'];
if (!empty($lang) && array_key_exists($lang, $languages))
{
include_once('./inc/lang/lang_'.$lang.'.php');
setcookie('lang',$lang,time()+3600*25*365,'/');
}
else include_once('./inc/lang/lang_fr.php'); // Fr by default
?>
+1
View File
@@ -0,0 +1 @@
<?php header('Location: ../index.php'; ?>
+8 -14
View File
@@ -1,6 +1,4 @@
<?php
$webui_language_code='en';
$webui_actual_language='English';
//*******************************************************
// top of mind and menu
@@ -8,23 +6,22 @@ $webui_actual_language='English';
$osmw_menu_GestSims = "Manage";
$osmw_menu_GestSave = "Save";
$osmw_menu_GestUpload = "Upload";
$osmw_menu_Map = "Map (beta)";
$osmw_menu_admin = "Settings";
$osmw_menu_admin_Sims = "Settings Sumulators";
$osmw_menu_admin_Lands = "Settings lands";
$osmw_menu_admin_Sims = "Sumulators";
$osmw_menu_admin_Lands = "Lands";
$osmw_menu_admin_Users = "Settings Users";
$osmw_menu_admin_Osmw = "Settings OSMW";
$osmw_menu_admin_Edit = "Files Settings";
$osmw_menu_help = "Help";
$osmw_menu_user_login = "Modify your account";
$osmw_menu_user_logout = "Logout";
//*******************************************************
$osmw_menu_sim_section1 = "";
$osmw_menu_sim_section2 = "";
$osmw_menu_sim_section3 = "";
$osmw_menu_sim_section4 = "";
$osmw_menu_sim_section1 = "Actions Simulator";
$osmw_menu_sim_section2 = "Actions Région";
$osmw_menu_sim_section3 = "Actions Lands";
$osmw_menu_sim_section4 = "Actions Vaious";
//*******************************************************
// label and message
@@ -53,11 +50,8 @@ $osmw_save_user_ok = "records successfully";
$osmw_edit_user_ok = "changes successfully";
$osmw_delete_user_ok = "removes successfully";
$osmw_label_totl_simulator = "Total Simulators";
$osmw_label_total_sim = "Total Regions";
$osmw_label_nb_max_sim = "Maximum Number of Regions";
$osmw_label_nb_max_sim = "Maximum Number of lands";
$osmw_label_add_sim_check = "Adding area (1 = OK) / No addition region ( 0 = Nok)";
$osmw_menu_choix_change = "Select the file has changed:";
$osmw_file_change = "Changing the file";
$osmw_label_info_iar_id = "Save your Inventory Inworld";
$osmw_label_info_iar = "IAR backup of the InWorld folder <b>''OSMWExport''</b> OR All Inventory <b>!!! WARNING !!! Is very long long time, view log.</b>";
+5 -12
View File
@@ -1,6 +1,4 @@
<?php
$webui_language_code = "fr";
$webui_actual_language = "Français";
//*******************************************************
// Entete et menu
@@ -8,15 +6,13 @@ $webui_actual_language = "Français";
$osmw_menu_GestSims = "Gérer";
$osmw_menu_GestSave = "Sauvegarder";
$osmw_menu_GestUpload = "Envoyer";
$osmw_menu_Map = "Carte (Béta)";
$osmw_menu_admin = "Paramétrage";
$osmw_menu_admin_Sims = "Gestion des Simulateurs";
$osmw_menu_admin_Lands = "Gestion des Regions";
$osmw_menu_admin_Sims = "Simulateurs";
$osmw_menu_admin_Lands = "Regions";
$osmw_menu_admin_Users = "Gestion des Utilisateurs";
$osmw_menu_admin_Osmw = "Configuration de OSMW ";
$osmw_menu_admin_Edit = "Fichiers de Configuration";
$osmw_menu_help = "Aide";
$osmw_menu_user_login = "Modifier son compte";
$osmw_menu_user_logout = "Deconnexion";
@@ -54,14 +50,11 @@ $osmw_save_user_ok = "enregistré avec succés";
$osmw_edit_user_ok = "mis à jour avec succés";
$osmw_delete_user_ok = "supprimé avec succés";
$osmw_label_totl_simulator = "Nombre total de Simulateurs";
$osmw_label_total_sim = "Nombre total de Régions";
$osmw_label_nb_max_sim = "Nombre Maximum de Régions Aurorisées";
$osmw_label_add_sim_check = "Ajout de region (1 = OK) / Pas d'ajout de région ( 0 = Nok)";
$osmw_menu_choix_change = "Choisir le fichier à modifier:";
$osmw_file_change = "Modification sur le fichier";
$osmw_label_info_iar_id = "Sauvegarder votre Inventaire Inworld";
$osmw_label_info_iar = "Dossier InWorld <b>''OSMWExport''</b> OU inventaire complet <b>!!! ATTENTION !!! trés trés long , consulter le log.</b>";
$osmw_label_info_iar_id = "Sauvegarde de votre Inventaire Inworld";
$osmw_label_info_iar = "1- Inventaire complet <b>(!!! ATTENTION !!! trés trés long , consulter le log.)</b><br> 2- Sauvegarde du dossier InWorld <b>OSMWExport (Partiel)</b>";
//*******************************************************
// boutons
+94
View File
@@ -0,0 +1,94 @@
<?php
$webui_language_code='it';
$webui_actual_language='Italian';
//*******************************************************
// in cima ai pensieri e al menu
//*******************************************************
$osmw_menu_GestSims = "Gestisci";
$osmw_menu_GestSave = "Salva";
$osmw_menu_GestUpload = "Carica";
$osmw_menu_Map = "Mappa (beta)";
$osmw_menu_admin = "Impostazioni";
$osmw_menu_admin_Sims = "Impostazioni Simulatore";
$osmw_menu_admin_Lands = "Impostazioni Regioni";
$osmw_menu_admin_Users = "Impostazioni Utenti";
$osmw_menu_admin_Osmw = "Impostazioni ZNMW";
$osmw_menu_admin_Edit = "Impostazioni File";
$osmw_menu_user_login = "Modifica il tuo account";
$osmw_menu_user_logout = "Esci";
//*******************************************************
$osmw_menu_sim_section1 = "";
$osmw_menu_sim_section2 = "";
$osmw_menu_sim_section3 = "";
$osmw_menu_sim_section4 = "";
//*******************************************************
// label and message
//*******************************************************
$osmw_simu = "Simulatori";
$osmw_menu_choix = "Scegli un'opzione qui sotto:";
$osmw_label_msg_send = "Invia messaggio nel mondo";
$osmw_label_consult_log = "Creazione file corrente, visita Log";
$osmw_label_msg_inventaire1 = "Richiesta effettuata con successo";
$osmw_label_msg_inventaire2 = "Consultare il registro. Il trattamento può essere lungo a seconda dell'inventario";
$osmw_label_file_size = "Dimensione del file";
$osmw_label_conatct_coord = "I vostri dati";
$osmw_label_conatct_msg = "Il tuo messaggio";
$osmw_label_list_user = "Elenco degli utenti";
$osmw_label_total_user = "Totale utenti";
$osmw_label_all_simulator = "Tutti i simulatori";
$osmw_label_simulator = "Simulatori";
$osmw_label_new_password = "Nuova password";
$osmw_label_new_password_confirm = "Conferma nuova password";
$osmw_label_modifier_password = "Cambia password";
$osmw_label_simu_ok = "Simulatore verificato = Autorizzato";
$osmw_label_simu_nok = "Simulatore senza segno di spunta = Non autorizzato";
$osmw_change_user_ok = "Cambio di considerazione effettuato con successo";
$osmw_change_user_nok = "Nessuna modifica della password, riprovare!";
$osmw_save_user_ok = "Registrazione riuscita";
$osmw_edit_user_ok = "modifiche di successo";
$osmw_delete_user_ok = "rimosso con successo";
$osmw_label_totl_simulator = "Totale Simulatori";
$osmw_label_total_sim = "Totale Regioni";
$osmw_label_nb_max_sim = "Numero massimo di regioni";
$osmw_label_add_sim_check = "Area di aggiunta (1 = OK) / Nessuna area di aggiunta ( 0 = Nok)";
$osmw_menu_choix_change = "Selezionare il file è cambiato:";
$osmw_file_change = "Modifica del file";
$osmw_label_info_iar_id = "Salva il tuo Inventario Inworld";
$osmw_label_info_iar = "Backup IAR della cartella InWorld <b>''ZNMWExport''</b> O tutto l'inventario <b>!!! ATTENZIONE !!! È un tempo molto lungo, visualizzare il log.</b>";
//*******************************************************
// bottoni
//*******************************************************
$osmw_btn_msg_send = "Invia Messaggio";
$osmw_btn_recuperer = "Ripristina";
$osmw_btn_map_zoom = "Applica Zoom";
$osmw_btn_ajout_user = "Aggiungi";
$osmw_btn_reset = "Ripristina";
$osmw_btn_modifier = "Aggiorna";
$osmw_btn_supprimer = "Elimina";
$osmw_btn_annuler = "Annulla";
$osmw_btn_enregistrer = "Salva";
$osmw_btn_ajout_simu = "Aggiungi";
$osmw_btn_search = "Cerca";
$osmw_btn_view_save = "Visualizza file di backup";
$osmw_btnave_sventory= "Salva una sezione del suo inventario";
//*******************************************************
// errori
//*******************************************************
$osmw_erreur_acces = "Non è possibile accedere a questa pagina";
$osmw_erreur_file_exist = "Il file non esiste";
$osmw_erreur_file_ini_exist = "Problema di lettura del file .ini";
//*******************************************************
// Home
//*******************************************************
$osmw_message_home = "Scegliere il simulatore da gestire e l'azione desiderata nei menu";
?>
+24 -22
View File
@@ -2,8 +2,13 @@
/*
foreach($_POST as $key => $val) echo '$_POST["'.$key.'"]='.$val.'<br />';
foreach($_GET as $key => $val) echo '$_GET["'.$key.'"]='.$val.'<br />';
foreach($_SESSION as $key => $val) echo '$_SESSION["'.$key.'"]='.$val.'<br />';
*/
$i = rand(1, 9);
$LOGO = 'img/logo'.$i.'.png';
$fichier = './inc/config/config.php';
if (file_exists($fichier) AND filesize($fichier ) > 0)
{
@@ -11,7 +16,7 @@ if (file_exists($fichier) AND filesize($fichier ) > 0)
require_once ('inc/config/fonctions.php');
require_once ('inc/config/radmin.php');
if ($_GET['a'] == 'logout')
if (isset($_GET['a']) AND $_GET['a'] == 'logout')
{
$_SESSION = array();
session_destroy();
@@ -36,8 +41,8 @@ if (file_exists($fichier) AND filesize($fichier ) > 0)
<link rel="stylesheet" href="css/btn3d.css" type="text/css" />
<link rel="stylesheet" href="css/login.css" type="text/css" />
<link rel="stylesheet" href="css/custom.css" type="text/css" />
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
@@ -46,7 +51,9 @@ if (file_exists($fichier) AND filesize($fichier ) > 0)
<script src="js/button.js"></script>
</head>
<body>
<div class="container">
<?php
@@ -76,7 +83,6 @@ if (isset($_POST['firstname']) && isset($_POST['lastname']) && isset($_POST['pas
$_SESSION['privilege'] = $data['privilege'];
$_SESSION['osAutorise'] = $data['osAutorise'];
$_SESSION['authentification']=true;
$_SESSION['zooming_select']=50;
$_GET['a'] ="GestSims";
break;
}
@@ -99,16 +105,6 @@ if (isset($_POST['firstname']) && isset($_POST['lastname']) && isset($_POST['pas
$reponse->closeCursor();
}
if ($translator && isset($_SESSION['authentification']))
{
require_once ('./inc/config/translator.php');
echo('<div class="pull-right">');
echo '<span class="label label-danger">Security level <span class="label label-default">'.$_SESSION['privilege'].'</span></span> ';
include_once("./inc/config/flags.php");
echo('</div>');
}
// **********************
// PAGE EN ACCES SECURISE
// **********************
@@ -121,13 +117,13 @@ if (isset($_SESSION['authentification']))
// Si le moteur selectionne a change
if (isset($_POST['OSSelect'])){$_SESSION['opensim_select'] = trim($_POST['OSSelect']);}
if ($_GET['a'])
if (isset($_GET['a']))
{
$a = $_GET['a'];
//***************************************** OpenSim Manager Web **************************************************************************
if ($a == "GestSims") {include('inc/GestSims.php'); } // # Gestion Simulator
if ($a == "GestSave") {include('inc/GestSave.php');} // # Gestion backup
if ($a == "Map") {include('inc/GestMap.php');} // # Map
if ($a == "Help") {include('inc/Help.php');} // # Aide
if ($a == "AdminLands") {include('inc/admin/GestRegion.php');} // admin // # Gestion des Regions par moteur
if ($a == "AdminUsers") {include('inc/admin/GestAdminUsers.php');} // admin // # Gestion des utilisateurs
if ($a == "AdminSims") {include('inc/admin/GestSimulateur.php');} // admin // # Gestion des simulateurs
@@ -156,7 +152,8 @@ else
{
?>
<div class="text-center"><h2 class="title"><span><br>OSMW</span></h2></div>
<!-- <div class="text-center"><h2 class="title"><span><br>OSMW</span></h2></div> -->
<form class="form-signin" action="index.php" method="post" name="connect">
<?php if (isset($_GET['erreur']) && ($_GET['erreur'] == "login")): ?>
<div class="alert alert-danger alert-dismissible" role="alert">
@@ -192,7 +189,7 @@ else
</div>
<?php endif; ?>
<img style="height:256px;" class="img-thumbnail img-circle center-block" alt="Logo Server" src="img/logo.png">
<img style="height:256px;" class="img-thumbnail img-circle center-block" alt="Logo Server" src="<?php echo $LOGO;?>">
<!--<h2 class="form-signin-heading text-center"></h2>-->
<br />
<label for="firstname" class="sr-only">Firstname</label>
@@ -209,14 +206,18 @@ else
<?php } ?>
<div class="clearfix"></div>
</div>
<footer class="footer">
<p class="text-center"> <u><b>OpenSimulator Manager Web by fgagod</b></u> <span class="badge badge-pill badge-info"><?php echo INI_Conf('VersionOSMW', 'VersionOSMW'); ?></span></p>
<div class="alert alert-info fade in">
<a href="." class="close" data-dismiss="alert" aria-label="close">&times;</a>
<center> <u><b>Open Simulator Manager Web (O.S.M.W) <br> <?php echo INI_Conf('VersionOSMW', 'VersionOSMW');?></b></u> by Nino85 Whitman</center>
</div>
</footer>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
<!--<script src="https://code.jquery.com/jquery-3.7.1.js"></script>--!>
<script src="js/jquery.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/pdf.js"></script>
@@ -231,6 +232,7 @@ else
</body>
</html>
<?php
}
else
+34 -11
View File
@@ -53,6 +53,27 @@
</div>
</div>
<div class="form-group">
<label for="base" class="col-sm-2 control-label">DNS Name Server :</label>
<div class="col-sm-4">
<input class="form-control" type="text" name="domaine" maxlength="40" />
</div>
</div>
<div class="form-group">
<label for="base" class="col-sm-2 control-label">Username SSH :</label>
<div class="col-sm-4">
<input class="form-control" type="text" name="ussh" maxlength="40" />
</div>
</div>
<div class="form-group">
<label for="base" class="col-sm-2 control-label">Password SSH :</label>
<div class="col-sm-4">
<input class="form-control" type="text" name="pssh" maxlength="40" />
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
@@ -92,32 +113,34 @@ if (isset($_POST['etape']) AND $_POST['etape'] == 1)
$login = trim($_POST['login']);
$pass = trim($_POST['mdp']);
$base = trim($_POST['base']);
$domaine = trim($_POST['domaine']);
// on vérifie la connectivité avec le serveur avant d'aller plus loin
try{ $bdd = new PDO('mysql:host='.$hote.';dbname='.$base.';charset=utf8', $login, $pass); }
catch (Exception $e){ die('Erreur : ' . $e->getMessage()); }
$a = str_replace("-","",implode('-', str_split(substr(strtolower(md5(microtime().rand(1000, 9999))), 0, 40), 10)));
$b = str_replace("-","",implode('-', str_split(substr(strtolower(md5(microtime().rand(1000, 9999))), 0, 40), 10)));
echo $api_key = $a.$b;
// le texte que l'on va mettre dans le config.php
$texte = '
<?php
$hostname = "'.$domaine.'"; // Url of server
$hostnameBDD = "'. $hote .'"; // IP of Bdd
$userBDD = "'. $login .'"; // login
$passBDD = "'. $pass .'"; // password
$database = "'. $base .'"; // Name of BDD
//FOR LINUX HOST SIMULATOR
$usernameSSH = "'.$ussh.'";
$passwordSSH = "'.$pssh.'";
/* Position center of your MAP */
$px = 7000;
$py = 7000;
$api_key="'.$api_key.'";
/* Themes */
$themes = true;
/* Languages */
$translator = true;
$languages=array("fr" => "French","en" => "English");
// Languages
// fr / en /it
$lang = "fr";
?>';
-27
View File
@@ -1,27 +0,0 @@
Install OSMW
=============================
- http://domain.com/osmw/install.php
More configuration
=============================
- inc/config.php
Admin Login for new install
=============================
firstname = super
lastname = admin
password = password
For Linux !!! prerequis !!!!
=============================
- tmux
apt install tmux
-lib php ssh2
apt install php-ssh2
Writing permission /inc/config.php just for Installation after remove permission
Writing permission writing for install.php and delete after installation
Writing permission for folder files /Regions of Opensimulator (writing Regions.ini)
Enjoy!
View File
-118
View File
@@ -1,118 +0,0 @@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Configuration requise pour OpenSimulator Manager Web (OSMW):
-- Apache / Mysql / TMUX / LibSSH2
Fonctionnement:
-- OSMW envoi des commandes au simulateur via Remote Admin sauf pour le START (Demarrage en console TMUX)
-- Le simulateur est lancé par le fichier batch "RunOpensim.sh" ou .bat
-- Certains fichiers doivent avoir les droits 777 pour pouvoir etre modifier par OSMW (LINUX)
-- ATTENTION aux droits d'accés aux fichiers et le format des données saisie dans vos fichiers INI
--> Régions.ini (droits écriture) / OpensimDefaults.ini , etc.. qui doivent etre accessible
--> Préférer l'utilisation de fichier de config dans addon-modules/NameGrid/config/NameGrid.ini
Gestion des Utilisateurs:
=> 4 Niveaux d'accés sont autorisés
-- Administrateurs
-- Gestionnaires de sauvegardes
-- Invités / Compte privé par moteur
-- 1 compte root
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
******************************************
********* Suivi de versions **********
******************************************
-------------------------------------------------------
*** V 21.6 (Juin 2021) ***
/* NEWS 2021 by Nino85 Whitman (creator)*/
-- Cleanup page
-- Optimize size of project
-- Fix bugs
-- Add more actions, options, infos, ...
And more ...
-------------------------------------------------------
-------------------------------------------------------
*** V 20.8 (Aout 2020) ***
/* NEWS 2020 by Nino85 Whitman (creator)*/
-- add TMUX command for simulator
-- Fix bugs
-- Add more actions, options, infos, ...
And more ...
-------------------------------------------------------
-------------------------------------------------------
*** V 9.0 ***
/* NEWS 2019 by Nino85 Whitman (creator)*/
-- compatible PHP 7
-- bdd mysql format PDO
-- Cleanup Code
-- Fix bugs
-- Add more actions, options, infos, ...
And more ...
-------------------------------------------------------
-------------------------------------------------------
*** V 7 ***
/* NEWS 2017 by Nino85 Whitman (creator)*/
-- Cleanup Code
-- Fix bugs
-- Add more actions, options, infos, ...
And more ...
-------------------------------------------------------
*** V 5.5 ***
/* NEWS 2015 by Nino85 Whitman (creator)*/
-- Cleanup Code
-- Fix bugs
-------------------------------------------------------
*** V 5.0 ***
/* NEWS 2015 by djphil and modified by Nino85 Whitman (creator)*/
-- Cleanup Code
-- Fix bugs
-- Add Themes
-- Add bootstrap
-- Add Multilanguage
-- Add Google Recaptcha v2.0
-- Add Navbar
-- Add more actions, options, infos, ...
And more ...
-------------------------------------------------------
*** V 4 Beta *** En cours
-- Mise à jours des SESSION
-- Systeme d'installation intégrés **
-- ...
-------------------------------------------------------
*** V 3.2 Final ***
-- Gestion des sauvegardes de la config des moteurs Opensim et pour chaque sim
-- Transfert des fichiers de sauvagardes vers un serveur FTP exterieur
-- Detection des fichiers de config moteurs
-------------------------------------------------------
*** V 3.0 *** MISE A JOUR MAJEUR *** 2010
-- OSMW à sa propre base de donnée *** Nouveauté
-- Les Fichiers de config , conf moteurs et users sont en BDD ( prb de sécurité !)
-- Compte Utilisateur filtré au niveau des moteurs (choix du moteur) *** Nouveauté
-- Verifier/ Modifier/ configurer vos INIs, opensim, grid, ... *** Nouveauté
-- Connectivité AdmOSMW (Referencement sur le site Fgagod.net)
-------------------------------------------------------
*** V 2.0 ***
-- Optimisations du code
-------------------------------------------------------
*** V 1.1 ***
-- Refonte complete de l'interface
-- Système d'installation simplifié
-- Gestion des moteurs OpenSim, des utilisateurs et de la config en .INI
-- ...
--------------------------------------------------------
*** V 1.0 ***
-- Ajout de la gestion multi-Utilisateurs dans OSMW
--------------------------------------------------------
*** V0.9.11 ***
-- Authentification multi-users via fichier texte (pas encore intégrer à OSMW)
--------------------------------------------------------
*** V0.7.11 *** 2077
-- Ajouts de Fonctionnaltées;
-- Cartographie ajouté
-- TOUS demarrer et arreter d'une seule fois
-- Une serie de tests pour voir si tous fonctionne bien
-- Ce fichier LOL
-- Optimisations du code
--------------------------------------------------------
*** V0.6.11 ***
-- Premiere version de OSWebManager