From 7332a3fe8c187e9a8b1940c5a9dc03455bd74c9f Mon Sep 17 00:00:00 2001
From: ramon
Date: Thu, 22 Feb 2018 13:36:00 +0000
Subject: #730: Copiar OpenGnsys 1.1.0 en rama {{{tags/opengnsys-1.1.0}}}
git-svn-id: https://opengnsys.es/svn/tags/opengnsys-1.1.0@5607 a21b9725-9963-47de-94b9-378ad31fedc9
---
admin/Database/ogAdmBD-1.0.6a-1.0.6b.sql | 8 +-
admin/Database/ogAdmBD-1.0.6b-1.1.0.sql | 161 +++
admin/Database/ogAdmBD-1.0.6b-postinst.sql | 41 -
admin/Database/ogAdmBD-1.1.0-postinst.sql | 49 +
admin/Database/ogAdmBD-1.1.0pre-1.1.0.sql | 270 ++++
admin/Database/ogAdmBD.sql | 443 ++++---
admin/Interface/CambiarAcceso | 8 +-
admin/Interface/Configurar | 4 +-
admin/Interface/CrearImagen | 18 +-
admin/Interface/getConfiguration | 45 +-
admin/Sources/Clients/README.es.txt | 9 +
admin/Sources/Clients/ogAdmClient/Makefile | 6 +-
.../Clients/ogAdmClient/sources/ogAdmClient.c | 92 +-
admin/Sources/Clients/ogAdmLnxClient/Makefile | 34 -
.../Clients/ogAdmLnxClient/ogAdmLnxClient.cfg | 4 -
.../ogAdmLnxClient/sources/ogAdmLnxClient.c | 499 --------
.../ogAdmLnxClient/sources/ogAdmLnxClient.h | 54 -
admin/Sources/Clients/ogAdmWinClient/Readme | 25 -
.../ogAdmWinClient/sources/ogAdmWinClient.cpp | 713 -----------
.../ogAdmWinClient/sources/ogAdmWinClient.h | 60 -
.../Clients/ogAdmWinClient/sources/servicio.c | 628 ----------
.../Clients/ogAdmWinClient/sources/servicio.h | 153 ---
admin/Sources/Clients/ogagent/INSTALL.es.txt | 89 ++
admin/Sources/Clients/ogagent/linux/Makefile | 72 ++
.../Clients/ogagent/linux/build-packages.sh | 35 +
.../Sources/Clients/ogagent/linux/debian/changelog | 12 +
admin/Sources/Clients/ogagent/linux/debian/compat | 1 +
admin/Sources/Clients/ogagent/linux/debian/control | 15 +
.../Sources/Clients/ogagent/linux/debian/copyright | 26 +
admin/Sources/Clients/ogagent/linux/debian/docs | 1 +
.../Clients/ogagent/linux/debian/ogagent.init | 23 +
.../Clients/ogagent/linux/debian/ogagent.links | 2 +
.../Clients/ogagent/linux/debian/ogagent.postinst | 21 +
.../linux/debian/ogagent.postinst.debhelper | 5 +
.../Clients/ogagent/linux/debian/ogagent.postrm | 10 +
.../ogagent/linux/debian/ogagent.postrm.debhelper | 12 +
.../Clients/ogagent/linux/debian/ogagent.substvars | 2 +
admin/Sources/Clients/ogagent/linux/debian/rules | 44 +
.../Clients/ogagent/linux/debian/source/format | 1 +
.../ogagent/linux/desktop/OGAgentTool.desktop | 12 +
.../Clients/ogagent/linux/ogagent-template.spec | 65 +
.../org.openuds.pkexec.UDSActorConfig.policy | 20 +
admin/Sources/Clients/ogagent/linux/readme.txt | 3 +
.../Clients/ogagent/linux/scripts/OGAgentTool | 6 +
.../ogagent/linux/scripts/OGAgentTool-startup | 10 +
.../Sources/Clients/ogagent/linux/scripts/ogagent | 6 +
admin/Sources/Clients/ogagent/macos/build-pkg.sh | 87 ++
.../macos/scripts/es.opengnsys.ogagent.plist | 15 +
.../Sources/Clients/ogagent/macos/scripts/ogagent | 6 +
.../Clients/ogagent/macos/scripts/postinstall | 17 +
admin/Sources/Clients/ogagent/requires.txt | 3 +
.../Clients/ogagent/src/OGAServiceHelper.py | 57 +
admin/Sources/Clients/ogagent/src/OGAgent.manifest | 17 +
admin/Sources/Clients/ogagent/src/OGAgent.qrc | 5 +
admin/Sources/Clients/ogagent/src/OGAgentUser.py | 358 ++++++
admin/Sources/Clients/ogagent/src/OGAgent_rc.py | 289 +++++
admin/Sources/Clients/ogagent/src/VERSION | 1 +
admin/Sources/Clients/ogagent/src/about-dialog.ui | 244 ++++
admin/Sources/Clients/ogagent/src/cfg/ogagent.cfg | 21 +
admin/Sources/Clients/ogagent/src/cfg/ogclient.cfg | 11 +
.../Sources/Clients/ogagent/src/img/oga-48x48.ico | Bin 0 -> 9662 bytes
admin/Sources/Clients/ogagent/src/img/oga-512.png | Bin 0 -> 44217 bytes
admin/Sources/Clients/ogagent/src/img/oga.ico | Bin 0 -> 9662 bytes
admin/Sources/Clients/ogagent/src/img/oga.png | Bin 0 -> 3906 bytes
admin/Sources/Clients/ogagent/src/license.txt | 27 +
.../Sources/Clients/ogagent/src/message-dialog.ui | 89 ++
.../Clients/ogagent/src/opengnsys/RESTApi.py | 160 +++
.../Clients/ogagent/src/opengnsys/__init__.py | 57 +
.../Sources/Clients/ogagent/src/opengnsys/certs.py | 101 ++
.../Clients/ogagent/src/opengnsys/config.py | 59 +
.../Clients/ogagent/src/opengnsys/httpserver.py | 150 +++
admin/Sources/Clients/ogagent/src/opengnsys/ipc.py | 423 +++++++
.../ogagent/src/opengnsys/linux/OGAgentService.py | 147 +++
.../ogagent/src/opengnsys/linux/__init__.py | 32 +
.../Clients/ogagent/src/opengnsys/linux/daemon.py | 182 +++
.../Clients/ogagent/src/opengnsys/linux/log.py | 80 ++
.../ogagent/src/opengnsys/linux/operations.py | 286 +++++
.../src/opengnsys/linux/renamer/__init__.py | 61 +
.../ogagent/src/opengnsys/linux/renamer/debian.py | 68 +
.../src/opengnsys/linux/renamer/opensuse.py | 66 +
.../ogagent/src/opengnsys/linux/renamer/redhat.py | 74 ++
.../Clients/ogagent/src/opengnsys/loader.py | 111 ++
admin/Sources/Clients/ogagent/src/opengnsys/log.py | 103 ++
.../ogagent/src/opengnsys/macos/__init__.py | 32 +
.../ogagent/src/opengnsys/macos/operations.py | 255 ++++
.../ogagent/src/opengnsys/modules/__init__.py | 0
.../opengnsys/modules/client/OpenGnSys/__init__.py | 63 +
.../src/opengnsys/modules/client/__init__.py | 0
.../opengnsys/modules/server/OpenGnSys/__init__.py | 250 ++++
.../src/opengnsys/modules/server/__init__.py | 0
.../Clients/ogagent/src/opengnsys/operations.py | 50 +
.../Clients/ogagent/src/opengnsys/scriptThread.py | 51 +
.../Clients/ogagent/src/opengnsys/service.py | 249 ++++
.../Sources/Clients/ogagent/src/opengnsys/utils.py | 72 ++
.../src/opengnsys/windows/OGAgentService.py | 124 ++
.../ogagent/src/opengnsys/windows/__init__.py | 39 +
.../Clients/ogagent/src/opengnsys/windows/log.py | 77 ++
.../ogagent/src/opengnsys/windows/operations.py | 261 ++++
.../ogagent/src/opengnsys/workers/__init__.py | 2 +
.../ogagent/src/opengnsys/workers/client_worker.py | 114 ++
.../ogagent/src/opengnsys/workers/server_worker.py | 186 +++
.../ogagent/src/prototypes/threaded_server.py | 170 +++
admin/Sources/Clients/ogagent/src/setup.py | 136 ++
.../Clients/ogagent/src/test_modules/__init__.py | 0
.../src/test_modules/client/Sample1/__init__.py | 38 +
.../ogagent/src/test_modules/client/__init__.py | 0
.../src/test_modules/server/Sample1/__init__.py | 2 +
.../src/test_modules/server/Sample1/sample1.py | 40 +
.../server/Sample1/sample_pkg/__init__.py | 36 +
.../ogagent/src/test_modules/server/__init__.py | 0
.../Clients/ogagent/src/test_rest_server.py | 210 ++++
admin/Sources/Clients/ogagent/src/update.sh | 41 +
.../Clients/ogagent/windows/build-windows.sh | 5 +
admin/Sources/Clients/ogagent/windows/build.bat | 6 +
admin/Sources/Clients/ogagent/windows/ogagent.nsi | 192 +++
.../Clients/ogagent/windows/py2exe-wine-linux.sh | 71 ++
admin/Sources/Includes/Database.cpp | 5 +
admin/Sources/Includes/Database.h | 1 +
.../Services/ogAdmAgent/sources/ogAdmAgent.h | 2 +-
admin/Sources/Services/ogAdmRepo/ogAdmRepo.cfg | 1 +
.../Services/ogAdmServer/sources/ogAdmServer.cpp | 162 ++-
.../Services/ogAdmServer/sources/ogAdmServer.h | 2 +-
admin/Sources/Services/ogAdmServerAux | 7 +-
admin/Sources/Services/opengnsys.default | 4 +-
admin/Sources/Services/opengnsys.init | 8 +-
.../asistentes/AsistenteCloneRemotePartition.php | 12 +-
.../WebConsole/asistentes/AsistenteDeployImage.php | 11 +-
.../asistentes/AsistenteParticionado.php | 10 +-
.../WebConsole/asistentes/AsistenteUpdateCache.php | 10 +-
.../asistentes/gestores/gestor_Comandos.php | 5 +-
.../includes/asistentes/AyudanteFormularios.php | 915 +++++++-------
.../asistentes/formCloneRemotePartition.php | 14 +-
.../includes/asistentes/formDeployImage.php | 19 +-
.../includes/asistentes/formParticionado_gpt.php | 7 +-
.../includes/asistentes/formParticionado_msdos.php | 3 +-
.../asistentes/includes/capturaacciones.php | 2 +-
.../asistentes/includes/formularioacciones.php | 18 +-
.../asistentes/includes/opcionesacciones.php | 38 +-
.../asistentes/jscripts/EjecutarScripts.js | 2 +-
admin/WebConsole/asistentes/jscripts/asistentes.js | 199 ++-
admin/WebConsole/asistentes/xajax.server.php | 4 +-
admin/WebConsole/barramenu.php | 38 +-
admin/WebConsole/clases/AdoPhp.php | 13 +-
admin/WebConsole/clases/ArbolVistaXML.php | 2 +-
admin/WebConsole/clases/XmlPhp.php | 2 +-
admin/WebConsole/comandos/Apagar.php | 6 +-
admin/WebConsole/comandos/Arrancar.php | 4 +-
admin/WebConsole/comandos/Comando.php | 6 +-
admin/WebConsole/comandos/Configurar.php | 37 +-
admin/WebConsole/comandos/CrearImagen.php | 58 +-
admin/WebConsole/comandos/CrearImagenBasica.php | 28 +-
admin/WebConsole/comandos/CrearSoftIncremental.php | 34 +-
admin/WebConsole/comandos/EjecutarScripts.php | 21 +-
admin/WebConsole/comandos/EliminarImagenCache.php | 68 +-
.../comandos/EliminarImagenRepositorio.php | 402 +++---
admin/WebConsole/comandos/EnviarMensaje.php | 97 ++
admin/WebConsole/comandos/IniciarSesion.php | 8 +-
admin/WebConsole/comandos/InventarioHardware.php | 6 +-
admin/WebConsole/comandos/InventarioSoftware.php | 10 +-
admin/WebConsole/comandos/Reiniciar.php | 6 +-
admin/WebConsole/comandos/RestaurarImagen.php | 65 +-
.../WebConsole/comandos/RestaurarImagenBasica.php | 43 +-
.../comandos/RestaurarSoftIncremental.php | 41 +-
.../comandos/gestores/gestor_Comandos.php | 120 +-
.../comandos/gestores/wakeonlan_repo.php | 85 ++
.../comandos/includes/FiltradoAmbito.php | 126 +-
.../comandos/includes/capturaacciones.php | 2 +-
.../comandos/includes/formularioacciones.php | 18 +-
.../comandos/includes/opcionesacciones.php | 40 +-
admin/WebConsole/comandos/jscripts/Configurar.js | 35 +-
admin/WebConsole/comandos/jscripts/CrearImagen.js | 6 +-
.../comandos/jscripts/EjecutarScripts.js | 6 +
.../WebConsole/comandos/jscripts/EnviarMensaje.js | 49 +
.../comandos/jscripts/RestaurarImagen.js | 40 +-
admin/WebConsole/controlacceso.php | 1 -
admin/WebConsole/controlpostacceso.php | 6 +-
admin/WebConsole/descargas/README.es.html | 85 ++
admin/WebConsole/descargas/index.php | 68 +
admin/WebConsole/estilos.css | 12 +-
admin/WebConsole/gestores/gestor_accionmenu.php | 2 +-
.../gestores/gestor_administradores_centros.php | 2 +-
.../gestores/gestor_administradores_usuarios.php | 2 +-
admin/WebConsole/gestores/gestor_aulas.php | 40 +-
admin/WebConsole/gestores/gestor_centros.php | 13 +-
.../gestores/gestor_componentehardwares.php | 2 +-
.../gestores/gestor_componentesoftwares.php | 2 +-
admin/WebConsole/gestores/gestor_entidades.php | 10 +-
admin/WebConsole/gestores/gestor_entornos.php | 8 +-
.../gestores/gestor_gruposordenadores.php | 6 +-
admin/WebConsole/gestores/gestor_imagenes.php | 25 +-
.../gestores/gestor_inclusionacciones.php | 2 +-
admin/WebConsole/gestores/gestor_ordenadores.php | 99 +-
.../gestores/gestor_ordenadorestandar.php | 6 +-
.../gestores/gestor_perfilcomponente_hard.php | 2 +-
.../gestores/gestor_perfilcomponente_soft.php | 2 +-
.../WebConsole/gestores/gestor_perfilsoftwares.php | 2 +-
.../WebConsole/gestores/gestor_procedimientos.php | 2 +-
.../gestores/gestor_procedimientoscomandos.php | 2 +-
.../WebConsole/gestores/gestor_programaciones.php | 2 +-
admin/WebConsole/gestores/gestor_repositorios.php | 14 +-
admin/WebConsole/gestores/gestor_reservas.php | 2 +-
admin/WebConsole/gestores/gestor_tareas.php | 2 +-
.../WebConsole/gestores/gestor_tareascomandos.php | 2 +-
admin/WebConsole/gestores/gestor_tipohardwares.php | 2 +-
admin/WebConsole/gestores/gestor_universidades.php | 6 +-
admin/WebConsole/gestores/gestor_usuarios.php | 17 +-
.../gestores/relaciones/aulas_eliminacion.php | 2 +-
.../gestores/relaciones/centros_eliminacion.php | 2 +-
.../gestores/relaciones/entidades_eliminacion.php | 2 +-
.../relaciones/gruposordenadores_eliminacion.php | 2 +-
.../gestores/relaciones/hardwares_eliminacion.php | 2 +-
.../gestores/relaciones/imagenes_eliminacion.php | 2 +-
.../relaciones/incrementales_eliminacion.php | 2 +-
.../gestores/relaciones/menus_eliminacion.php | 2 +-
.../relaciones/perfileshard_eliminacion.php | 2 +-
.../relaciones/perfilessoft_eliminacion.php | 2 +-
.../relaciones/procedimientos_eliminacion.php | 2 +-
.../relaciones/repositorios_eliminacion.php | 2 +-
.../gestores/relaciones/reservas_eliminacion.php | 2 +-
.../gestores/relaciones/softwares_eliminacion.php | 2 +-
.../gestores/relaciones/tareas_eliminacion.php | 2 +-
.../gestores/relaciones/trabajos_eliminacion.php | 2 +-
.../gestores/relaciones/usuarios_eliminacion.php | 2 +-
.../idiomas/javascripts/cat/asistentes_cat.js | 10 +
.../cat/comandos/comunescomandos_cat.js | 1 +
.../javascripts/cat/comandos/configurar_cat.js | 3 +-
.../javascripts/cat/comandos/enviarmensaje_cat.js | 9 +
.../cat/comandos/restaurarimagen_cat.js | 3 +-
.../javascripts/cat/propiedades_aulas_cat.js | 3 +-
.../javascripts/cat/propiedades_centros_cat.js | 7 +-
.../javascripts/cat/propiedades_entidades_cat.js | 5 +-
.../javascripts/cat/propiedades_ordenadores_cat.js | 4 +-
.../javascripts/cat/propiedades_usuarios_cat.js | 3 +-
.../idiomas/javascripts/eng/asistentes_eng.js | 10 +
.../eng/comandos/comunescomandos_eng.js | 1 +
.../javascripts/eng/comandos/configurar_eng.js | 3 +-
.../javascripts/eng/comandos/enviarmensaje_eng.js | 9 +
.../eng/comandos/restaurarimagen_eng.js | 9 +-
.../javascripts/eng/propiedades_aulas_eng.js | 3 +-
.../javascripts/eng/propiedades_centros_eng.js | 6 +-
.../javascripts/eng/propiedades_entidades_eng.js | 5 +-
.../javascripts/eng/propiedades_ordenadores_eng.js | 6 +-
.../javascripts/eng/propiedades_usuarios_eng.js | 2 +
.../idiomas/javascripts/esp/asistentes_esp.js | 10 +
.../esp/comandos/comunescomandos_esp.js | 1 +
.../javascripts/esp/comandos/configurar_esp.js | 2 +
.../javascripts/esp/comandos/enviarmensaje_esp.js | 9 +
.../esp/comandos/restaurarimagen_esp.js | 8 +-
.../javascripts/esp/propiedades_aulas_esp.js | 3 +-
.../javascripts/esp/propiedades_centros_esp.js | 5 +-
.../javascripts/esp/propiedades_entidades_esp.js | 5 +-
.../javascripts/esp/propiedades_ordenadores_esp.js | 4 +-
.../javascripts/esp/propiedades_usuarios_esp.js | 3 +-
admin/WebConsole/idiomas/php/cat/acceso_cat.php | 4 +-
admin/WebConsole/idiomas/php/cat/acciones_cat.php | 2 +-
.../WebConsole/idiomas/php/cat/accionmenu_cat.php | 2 +-
admin/WebConsole/idiomas/php/cat/acercade_cat.php | 6 +-
.../WebConsole/idiomas/php/cat/actualizar_cat.php | 2 +-
.../idiomas/php/cat/administracion_cat.php | 2 +-
.../php/cat/administradores_centros_cat.php | 2 +-
.../php/cat/administradores_usuarios_cat.php | 2 +-
admin/WebConsole/idiomas/php/cat/aulas_cat.php | 2 +-
admin/WebConsole/idiomas/php/cat/avisos_cat.php | 5 +-
admin/WebConsole/idiomas/php/cat/barramenu_cat.php | 2 +-
.../idiomas/php/cat/boot_grub4dos_cat.php | 2 +-
admin/WebConsole/idiomas/php/cat/buscar_cat.php | 2 +-
.../idiomas/php/cat/clases/Almanaque_cat.php | 28 +-
.../idiomas/php/cat/clases/Calendario_cat.php | 2 +-
.../idiomas/php/cat/colasacciones_cat.php | 2 +-
.../idiomas/php/cat/colasreservas_cat.php | 2 +-
.../idiomas/php/cat/comandos/apagar_cat.php | 2 +-
.../idiomas/php/cat/comandos/arrancar_cat.php | 2 +-
.../idiomas/php/cat/comandos/comando_cat.php | 2 +-
.../idiomas/php/cat/comandos/configurar_cat.php | 2 +
.../idiomas/php/cat/comandos/conmutar_cat.php | 2 +-
.../idiomas/php/cat/comandos/crearimagen_cat.php | 2 +-
.../php/cat/comandos/crearimagenbasica_cat.php | 2 +-
.../php/cat/comandos/crearperfilsoftware_cat.php | 2 +-
.../php/cat/comandos/crearsoftincremental_cat.php | 2 +-
.../php/cat/comandos/ejecutarscripts_cat.php | 7 +
.../php/cat/comandos/eliminarimagencache_cat.php | 10 +-
.../php/cat/comandos/eliminarimagenrepo_cat.php | 5 +-
.../idiomas/php/cat/comandos/enviarmensaje_cat.php | 23 +
.../cat/comandos/gestor_ejecutarscripts_cat.php | 2 +-
.../idiomas/php/cat/comandos/mensajes_cat.php | 1 +
.../php/cat/comandos/opcionesacciones_cat.php | 2 +-
.../php/cat/comandos/particionaryformatear_cat.php | 2 +-
.../idiomas/php/cat/comandos/reiniciar_cat.php | 2 +-
.../idiomas/php/cat/comandos/rembooffline_cat.php | 2 +-
.../php/cat/comandos/restaurarimagen_cat.php | 2 +-
.../php/cat/comandos/restaurarimagenbasica_cat.php | 2 +-
.../cat/comandos/restaurarsoftincremental_cat.php | 2 +-
.../php/cat/comandos/tomaconfiguracion_cat.php | 2 +-
.../idiomas/php/cat/configuraciones_cat.php | 2 +-
admin/WebConsole/idiomas/php/cat/conmutar_cat.php | 2 +-
.../idiomas/php/cat/consolaremota_cat.php | 2 +-
admin/WebConsole/idiomas/php/cat/descargas_cat.php | 13 +
admin/WebConsole/idiomas/php/cat/ecoremoto_cat.php | 2 +-
.../idiomas/php/cat/ejecutaracciones_cat.php | 2 +-
admin/WebConsole/idiomas/php/cat/estados_cat.php | 7 +-
.../idiomas/php/cat/gestor_ordenadores_cat.php | 10 +
admin/WebConsole/idiomas/php/cat/hardwares_cat.php | 2 +-
admin/WebConsole/idiomas/php/cat/iconos_cat.php | 2 +-
admin/WebConsole/idiomas/php/cat/imagenes_cat.php | 2 +-
.../idiomas/php/cat/imagenincremental_cat.php | 2 +-
.../idiomas/php/cat/inclusionacciones_cat.php | 2 +-
.../php/cat/incrementalcomponente_soft_cat.php | 2 +-
.../idiomas/php/cat/informacion_acciones_cat.php | 2 +-
.../idiomas/php/cat/informacion_imagenes_cat.php | 2 +-
.../php/cat/informacion_incrementales_cat.php | 2 +-
.../idiomas/php/cat/informacion_menus_cat.php | 2 +-
.../php/cat/informacion_perfileshard_cat.php | 2 +-
.../php/cat/informacion_perfilessoft_cat.php | 2 +-
.../php/cat/informacion_procedimientos_cat.php | 2 +-
.../idiomas/php/cat/informacion_tareas_cat.php | 2 +-
.../WebConsole/idiomas/php/cat/menucliente_cat.php | 2 +-
admin/WebConsole/idiomas/php/cat/menus_cat.php | 2 +-
.../WebConsole/idiomas/php/cat/msgbrowser_cat.php | 2 +-
admin/WebConsole/idiomas/php/cat/nada_cat.php | 2 +-
.../idiomas/php/cat/perfilcomponente_hard_cat.php | 2 +-
.../idiomas/php/cat/perfilcomponente_soft_cat.php | 2 +-
.../idiomas/php/cat/pintaParticiones_cat.php | 11 +-
.../idiomas/php/cat/procedimientoscomandos_cat.php | 2 +-
.../idiomas/php/cat/programaciones_cat.php | 2 +-
.../idiomas/php/cat/programacionesaulas_cat.php | 2 +-
.../idiomas/php/cat/programacionesreservas_cat.php | 2 +-
.../idiomas/php/cat/propiedades_aulas_cat.php | 16 +-
.../idiomas/php/cat/propiedades_centros_cat.php | 6 +-
.../cat/propiedades_componentehardwares_cat.php | 2 +-
.../cat/propiedades_componentesoftwares_cat.php | 2 +-
.../idiomas/php/cat/propiedades_entidades_cat.php | 5 +-
.../idiomas/php/cat/propiedades_entornos_cat.php | 2 +-
.../idiomas/php/cat/propiedades_grupos_cat.php | 2 +-
.../idiomas/php/cat/propiedades_imagenes_cat.php | 9 +-
.../idiomas/php/cat/propiedades_menus_cat.php | 1 +
.../php/cat/propiedades_ordenadores_cat.php | 26 +-
.../php/cat/propiedades_ordenadorestandar_cat.php | 2 +-
.../php/cat/propiedades_perfilsoftwares_cat.php | 2 +-
.../php/cat/propiedades_procedimientos_cat.php | 2 +-
.../php/cat/propiedades_repositorios_cat.php | 13 +-
.../idiomas/php/cat/propiedades_reservas_cat.php | 2 +-
.../idiomas/php/cat/propiedades_tareas_cat.php | 2 +-
.../php/cat/propiedades_tipohardwares_cat.php | 2 +-
.../php/cat/propiedades_universidades_cat.php | 2 +-
.../idiomas/php/cat/propiedades_usuarios_cat.php | 14 +-
admin/WebConsole/idiomas/php/cat/purgar_cat.php | 2 +-
.../idiomas/php/cat/repositorios_cat.php | 2 +-
admin/WebConsole/idiomas/php/cat/reservas_cat.php | 2 +-
admin/WebConsole/idiomas/php/cat/softwares_cat.php | 2 +-
admin/WebConsole/idiomas/php/cat/sondeo_cat.php | 2 +-
.../idiomas/php/cat/tareascomandos_cat.php | 2 +-
.../idiomas/php/cat/tiposhardwares_cat.php | 27 +
admin/WebConsole/idiomas/php/eng/acceso_eng.php | 4 +-
admin/WebConsole/idiomas/php/eng/acciones_eng.php | 2 +-
.../WebConsole/idiomas/php/eng/accionmenu_eng.php | 2 +-
admin/WebConsole/idiomas/php/eng/acercade_eng.php | 6 +-
.../WebConsole/idiomas/php/eng/actualizar_eng.php | 2 +-
.../idiomas/php/eng/administracion_eng.php | 2 +-
.../php/eng/administradores_centros_eng.php | 2 +-
.../php/eng/administradores_usuarios_eng.php | 2 +-
admin/WebConsole/idiomas/php/eng/aulas_eng.php | 2 +-
admin/WebConsole/idiomas/php/eng/avisos_eng.php | 9 +-
admin/WebConsole/idiomas/php/eng/barramenu_eng.php | 2 +-
.../idiomas/php/eng/boot_grub4dos_eng.php | 2 +-
admin/WebConsole/idiomas/php/eng/buscar_eng.php | 2 +-
.../idiomas/php/eng/clases/Almanaque_eng.php | 28 +-
.../idiomas/php/eng/clases/Calendario_eng.php | 2 +-
.../idiomas/php/eng/colasacciones_eng.php | 2 +-
.../idiomas/php/eng/colasreservas_eng.php | 2 +-
.../idiomas/php/eng/comandos/apagar_eng.php | 2 +-
.../idiomas/php/eng/comandos/arrancar_eng.php | 2 +-
.../idiomas/php/eng/comandos/configurar_eng.php | 2 +
.../idiomas/php/eng/comandos/conmutar_eng.php | 2 +-
.../idiomas/php/eng/comandos/crearimagen_eng.php | 2 +-
.../php/eng/comandos/crearimagenbasica_eng.php | 2 +-
.../php/eng/comandos/crearperfilsoftware_eng.php | 2 +-
.../php/eng/comandos/crearsoftincremental_eng.php | 2 +-
.../php/eng/comandos/ejecutarscripts_eng.php | 9 +-
.../php/eng/comandos/eliminarimagencache_eng.php | 12 +-
.../php/eng/comandos/eliminarimagenrepo_eng.php | 5 +-
.../idiomas/php/eng/comandos/enviarmensaje_eng.php | 24 +
.../eng/comandos/gestor_ejecutarscripts_eng.php | 2 +-
.../idiomas/php/eng/comandos/mensajes_eng.php | 1 +
.../php/eng/comandos/opcionesacciones_eng.php | 2 +-
.../php/eng/comandos/particionaryformatear_eng.php | 2 +-
.../idiomas/php/eng/comandos/reiniciar_eng.php | 2 +-
.../idiomas/php/eng/comandos/rembooffline_eng.php | 2 +-
.../php/eng/comandos/restaurarimagen_eng.php | 2 +-
.../php/eng/comandos/restaurarimagenbasica_eng.php | 2 +-
.../eng/comandos/restaurarsoftincremental_eng.php | 2 +-
.../php/eng/comandos/tomaconfiguracion_eng.php | 2 +-
.../idiomas/php/eng/configuraciones_eng.php | 2 +-
admin/WebConsole/idiomas/php/eng/conmutar_eng.php | 2 +-
.../idiomas/php/eng/consolaremota_eng.php | 2 +-
admin/WebConsole/idiomas/php/eng/descargas_eng.php | 12 +
admin/WebConsole/idiomas/php/eng/ecoremoto_eng.php | 2 +-
.../idiomas/php/eng/ejecutaracciones_eng.php | 2 +-
admin/WebConsole/idiomas/php/eng/estados_eng.php | 7 +-
.../idiomas/php/eng/gestor_ordenadores_eng.php | 10 +
admin/WebConsole/idiomas/php/eng/hardwares_eng.php | 2 +-
admin/WebConsole/idiomas/php/eng/iconos_eng.php | 2 +-
admin/WebConsole/idiomas/php/eng/imagenes_eng.php | 2 +-
.../idiomas/php/eng/imagenincremental_eng.php | 2 +-
.../idiomas/php/eng/inclusionacciones_eng.php | 2 +-
.../php/eng/incrementalcomponente_soft_eng.php | 2 +-
.../idiomas/php/eng/informacion_acciones_eng.php | 2 +-
.../idiomas/php/eng/informacion_imagenes_eng.php | 2 +-
.../php/eng/informacion_incrementales_eng.php | 2 +-
.../idiomas/php/eng/informacion_menus_eng.php | 2 +-
.../php/eng/informacion_perfileshard_eng.php | 2 +-
.../php/eng/informacion_perfilessoft_eng.php | 2 +-
.../php/eng/informacion_procedimientos_eng.php | 2 +-
.../php/eng/informacion_repositorio_eng.php | 2 +-
.../idiomas/php/eng/informacion_tareas_eng.php | 2 +-
.../WebConsole/idiomas/php/eng/menucliente_eng.php | 2 +-
admin/WebConsole/idiomas/php/eng/menus_eng.php | 2 +-
.../WebConsole/idiomas/php/eng/msgbrowser_eng.php | 2 +-
admin/WebConsole/idiomas/php/eng/nada_eng.php | 2 +-
.../idiomas/php/eng/perfilcomponente_hard_eng.php | 2 +-
.../idiomas/php/eng/perfilcomponente_soft_eng.php | 2 +-
.../idiomas/php/eng/pintaParticiones_eng.php | 49 +-
.../idiomas/php/eng/procedimientoscomandos_eng.php | 2 +-
.../idiomas/php/eng/programaciones_eng.php | 2 +-
.../idiomas/php/eng/programacionesaulas_eng.php | 2 +-
.../idiomas/php/eng/programacionesreservas_eng.php | 2 +-
.../idiomas/php/eng/propiedades_aulas_eng.php | 26 +-
.../idiomas/php/eng/propiedades_centros_eng.php | 4 +-
.../eng/propiedades_componentehardwares_eng.php | 2 +-
.../eng/propiedades_componentesoftwares_eng.php | 2 +-
.../idiomas/php/eng/propiedades_entidades_eng.php | 3 +-
.../idiomas/php/eng/propiedades_entornos_eng.php | 6 +-
.../idiomas/php/eng/propiedades_grupos_eng.php | 2 +-
.../idiomas/php/eng/propiedades_imagenes_eng.php | 9 +-
.../idiomas/php/eng/propiedades_menus_eng.php | 1 +
.../php/eng/propiedades_ordenadores_eng.php | 9 +-
.../php/eng/propiedades_ordenadorestandar_eng.php | 2 +-
.../php/eng/propiedades_perfilsoftwares_eng.php | 2 +-
.../php/eng/propiedades_procedimientos_eng.php | 2 +-
.../php/eng/propiedades_repositorios_eng.php | 13 +-
.../idiomas/php/eng/propiedades_reservas_eng.php | 2 +-
.../idiomas/php/eng/propiedades_tareas_eng.php | 2 +-
.../php/eng/propiedades_tipohardwares_eng.php | 2 +-
.../php/eng/propiedades_universidades_eng.php | 2 +-
.../idiomas/php/eng/propiedades_usuarios_eng.php | 10 +-
admin/WebConsole/idiomas/php/eng/purgar_eng.php | 2 +-
.../idiomas/php/eng/repositorios_eng.php | 2 +-
admin/WebConsole/idiomas/php/eng/reservas_eng.php | 2 +-
admin/WebConsole/idiomas/php/eng/softwares_eng.php | 2 +-
admin/WebConsole/idiomas/php/eng/sondeo_eng.php | 2 +-
.../idiomas/php/eng/tareascomandos_eng.php | 2 +-
.../idiomas/php/eng/tiposhardwares_eng.php | 5 +-
admin/WebConsole/idiomas/php/esp/acceso_esp.php | 4 +-
admin/WebConsole/idiomas/php/esp/acciones_esp.php | 2 +-
.../WebConsole/idiomas/php/esp/accionmenu_esp.php | 2 +-
admin/WebConsole/idiomas/php/esp/acercade_esp.php | 6 +-
.../WebConsole/idiomas/php/esp/actualizar_esp.php | 2 +-
.../idiomas/php/esp/administracion_esp.php | 2 +-
.../php/esp/administradores_centros_esp.php | 2 +-
.../php/esp/administradores_usuarios_esp.php | 2 +-
admin/WebConsole/idiomas/php/esp/aulas_esp.php | 2 +-
admin/WebConsole/idiomas/php/esp/avisos_esp.php | 3 +
admin/WebConsole/idiomas/php/esp/barramenu_esp.php | 2 +-
.../idiomas/php/esp/boot_grub4dos_esp.php | 2 +-
admin/WebConsole/idiomas/php/esp/buscar_esp.php | 2 +-
.../idiomas/php/esp/clases/Almanaque_esp.php | 34 +-
.../idiomas/php/esp/clases/Calendario_esp.php | 2 +-
.../idiomas/php/esp/colasacciones_esp.php | 2 +-
.../idiomas/php/esp/colasreservas_esp.php | 2 +-
.../idiomas/php/esp/comandos/apagar_esp.php | 2 +-
.../idiomas/php/esp/comandos/arrancar_esp.php | 2 +-
.../idiomas/php/esp/comandos/comando_esp.php | 2 +-
.../idiomas/php/esp/comandos/configurar_esp.php | 2 +
.../idiomas/php/esp/comandos/conmutar_esp.php | 2 +-
.../idiomas/php/esp/comandos/crearimagen_esp.php | 2 +-
.../php/esp/comandos/crearimagenbasica_esp.php | 2 +-
.../php/esp/comandos/crearperfilsoftware_esp.php | 2 +-
.../php/esp/comandos/crearsoftincremental_esp.php | 2 +-
.../php/esp/comandos/ejecutarscripts_esp.php | 7 +
.../php/esp/comandos/eliminarimagencache_esp.php | 10 +-
.../php/esp/comandos/eliminarimagenrepo_esp.php | 3 +-
.../idiomas/php/esp/comandos/enviarmensaje_esp.php | 24 +
.../esp/comandos/gestor_ejecutarscripts_esp.php | 2 +-
.../idiomas/php/esp/comandos/mensajes_esp.php | 8 +-
.../php/esp/comandos/opcionesacciones_esp.php | 2 +-
.../php/esp/comandos/particionaryformatear_esp.php | 2 +-
.../idiomas/php/esp/comandos/reiniciar_esp.php | 2 +-
.../idiomas/php/esp/comandos/rembooffline_esp.php | 2 +-
.../php/esp/comandos/restaurarimagen_esp.php | 2 +-
.../php/esp/comandos/restaurarimagenbasica_esp.php | 2 +-
.../esp/comandos/restaurarsoftincremental_esp.php | 2 +-
.../php/esp/comandos/tomaconfiguracion_esp.php | 2 +-
.../idiomas/php/esp/configuraciones_esp.php | 2 +-
admin/WebConsole/idiomas/php/esp/conmutar_esp.php | 2 +-
.../idiomas/php/esp/consolaremota_esp.php | 2 +-
admin/WebConsole/idiomas/php/esp/descargas_esp.php | 13 +
admin/WebConsole/idiomas/php/esp/ecoremoto_esp.php | 2 +-
.../idiomas/php/esp/ejecutaracciones_esp.php | 2 +-
admin/WebConsole/idiomas/php/esp/estados_esp.php | 7 +-
.../idiomas/php/esp/gestor_ordenadores_esp.php | 10 +
admin/WebConsole/idiomas/php/esp/hardwares_esp.php | 2 +-
admin/WebConsole/idiomas/php/esp/iconos_esp.php | 2 +-
admin/WebConsole/idiomas/php/esp/imagenes_esp.php | 2 +-
.../idiomas/php/esp/imagenincremental_esp.php | 2 +-
.../idiomas/php/esp/inclusionacciones_esp.php | 2 +-
.../php/esp/incrementalcomponente_soft_esp.php | 2 +-
.../idiomas/php/esp/informacion_acciones_esp.php | 2 +-
.../idiomas/php/esp/informacion_imagenes_esp.php | 2 +-
.../php/esp/informacion_incrementales_esp.php | 2 +-
.../idiomas/php/esp/informacion_menus_esp.php | 2 +-
.../php/esp/informacion_perfileshard_esp.php | 2 +-
.../php/esp/informacion_perfilessoft_esp.php | 2 +-
.../php/esp/informacion_procedimientos_esp.php | 2 +-
.../idiomas/php/esp/informacion_tareas_esp.php | 2 +-
.../WebConsole/idiomas/php/esp/menucliente_esp.php | 2 +-
admin/WebConsole/idiomas/php/esp/menus_esp.php | 2 +-
.../WebConsole/idiomas/php/esp/msgbrowser_esp.php | 2 +-
admin/WebConsole/idiomas/php/esp/nada_esp.php | 2 +-
.../idiomas/php/esp/perfilcomponente_hard_esp.php | 2 +-
.../idiomas/php/esp/perfilcomponente_soft_esp.php | 2 +-
.../idiomas/php/esp/pintaParticiones_esp.php | 11 +-
.../idiomas/php/esp/procedimientoscomandos_esp.php | 2 +-
.../idiomas/php/esp/programaciones_esp.php | 2 +-
.../idiomas/php/esp/programacionesaulas_esp.php | 2 +-
.../idiomas/php/esp/programacionesreservas_esp.php | 2 +-
.../idiomas/php/esp/propiedades_aulas_esp.php | 16 +-
.../idiomas/php/esp/propiedades_centros_esp.php | 5 +-
.../esp/propiedades_componentehardwares_esp.php | 2 +-
.../esp/propiedades_componentesoftwares_esp.php | 2 +-
.../idiomas/php/esp/propiedades_entidades_esp.php | 4 +-
.../idiomas/php/esp/propiedades_entornos_esp.php | 2 +-
.../idiomas/php/esp/propiedades_grupos_esp.php | 2 +-
.../idiomas/php/esp/propiedades_imagenes_esp.php | 29 +-
.../idiomas/php/esp/propiedades_menus_esp.php | 3 +-
.../php/esp/propiedades_ordenadores_esp.php | 8 +-
.../php/esp/propiedades_ordenadorestandar_esp.php | 4 +-
.../php/esp/propiedades_perfilsoftwares_esp.php | 2 +-
.../php/esp/propiedades_procedimientos_esp.php | 2 +-
.../php/esp/propiedades_repositorios_esp.php | 13 +-
.../idiomas/php/esp/propiedades_reservas_esp.php | 2 +-
.../idiomas/php/esp/propiedades_tareas_esp.php | 2 +-
.../php/esp/propiedades_tipohardwares_esp.php | 2 +-
.../php/esp/propiedades_universidades_esp.php | 2 +-
.../idiomas/php/esp/propiedades_usuarios_esp.php | 11 +-
admin/WebConsole/idiomas/php/esp/purgar_esp.php | 2 +-
.../idiomas/php/esp/repositorios_esp.php | 2 +-
admin/WebConsole/idiomas/php/esp/reservas_esp.php | 2 +-
admin/WebConsole/idiomas/php/esp/softwares_esp.php | 2 +-
admin/WebConsole/idiomas/php/esp/sondeo_esp.php | 2 +-
.../idiomas/php/esp/tareascomandos_esp.php | 2 +-
.../idiomas/php/esp/tiposhardwares_esp.php | 5 +-
admin/WebConsole/images/L_Iconos.php | 36 +-
admin/WebConsole/images/M_Iconos.php | 66 +-
admin/WebConsole/images/iconos/almacenamiento.png | Bin 0 -> 448 bytes
admin/WebConsole/images/iconos/arranque.png | Bin 0 -> 532 bytes
admin/WebConsole/images/ordenador_BSY.gif | Bin 811 -> 0 bytes
admin/WebConsole/images/ordenador_BSY.png | Bin 0 -> 762 bytes
admin/WebConsole/images/ordenador_INI.gif | Bin 1117 -> 0 bytes
admin/WebConsole/images/ordenador_INI.png | Bin 0 -> 1065 bytes
admin/WebConsole/images/ordenador_LNX.gif | Bin 801 -> 0 bytes
admin/WebConsole/images/ordenador_LNX.png | Bin 0 -> 746 bytes
admin/WebConsole/images/ordenador_LNXS.png | Bin 0 -> 729 bytes
admin/WebConsole/images/ordenador_OFF.gif | Bin 810 -> 0 bytes
admin/WebConsole/images/ordenador_OFF.png | Bin 0 -> 778 bytes
admin/WebConsole/images/ordenador_OPG.gif | Bin 1060 -> 0 bytes
admin/WebConsole/images/ordenador_OPG.png | Bin 0 -> 756 bytes
admin/WebConsole/images/ordenador_OSX.png | Bin 0 -> 901 bytes
admin/WebConsole/images/ordenador_W2K.gif | Bin 804 -> 0 bytes
admin/WebConsole/images/ordenador_W95.gif | Bin 798 -> 0 bytes
admin/WebConsole/images/ordenador_W98.gif | Bin 808 -> 0 bytes
admin/WebConsole/images/ordenador_WIN.png | Bin 0 -> 747 bytes
admin/WebConsole/images/ordenador_WINS.png | Bin 0 -> 733 bytes
admin/WebConsole/images/ordenador_WML.gif | Bin 804 -> 0 bytes
admin/WebConsole/images/ordenador_WXP.gif | Bin 801 -> 0 bytes
admin/WebConsole/images/ver.php | 2 +-
.../includes/ConfiguracionesParticiones.php | 161 ++-
admin/WebConsole/includes/CreaComando.php | 2 +-
admin/WebConsole/includes/CreaTablaParametros.php | 2 +-
admin/WebConsole/includes/HTMLCTEMULSELECT.php | 2 +-
admin/WebConsole/includes/HTMLMULSELECT.php | 2 +-
admin/WebConsole/includes/HTMLSELECT.php | 2 +-
admin/WebConsole/includes/InvFecha.php | 6 +-
admin/WebConsole/includes/RecopilaIpesMacs.php | 25 +-
admin/WebConsole/includes/RedireccionaError.php | 2 +-
admin/WebConsole/includes/TomaDato.php | 2 +-
admin/WebConsole/includes/TomanDatos.php | 2 +-
admin/WebConsole/includes/comunes.php | 20 +
admin/WebConsole/includes/cuestionacciones.php | 2 +-
admin/WebConsole/includes/cuestionaccionescab.php | 2 +-
admin/WebConsole/includes/opciones.php | 2 +-
admin/WebConsole/includes/opcionesbotones.php | 4 +-
admin/WebConsole/includes/opcionesbotonesop.php | 2 +-
admin/WebConsole/includes/opcionesprotocolos.php | 22 +-
admin/WebConsole/includes/pintaParticiones.php | 103 +-
.../includes/pintaTablaConfiguraciones.php | 13 +-
admin/WebConsole/includes/restfunctions.php | 72 ++
admin/WebConsole/includes/tftputils.php | 100 +-
admin/WebConsole/index.php | 24 +-
admin/WebConsole/jscripts/aula.js | 39 +-
admin/WebConsole/jscripts/aulas.js | 5 +-
admin/WebConsole/jscripts/comunes.js | 1 +
admin/WebConsole/jscripts/propiedades_aulas.js | 1 +
admin/WebConsole/jscripts/propiedades_centros.js | 18 +-
admin/WebConsole/jscripts/propiedades_entidades.js | 24 +-
admin/WebConsole/jscripts/propiedades_imagenes.js | 1 -
.../WebConsole/jscripts/propiedades_ordenadores.js | 4 +-
admin/WebConsole/jscripts/propiedades_usuarios.js | 10 +-
admin/WebConsole/jscripts/validators.js | 3 +
admin/WebConsole/menus/examplemenu.html | 79 --
admin/WebConsole/menus/examplemenu.php | 94 ++
admin/WebConsole/menus/menuejemplo.html | 83 --
admin/WebConsole/menus/menuejemplo.php | 97 ++
admin/WebConsole/menus/privatemenu.php | 46 +
admin/WebConsole/pagerror.php | 4 +-
admin/WebConsole/principal/acciones.php | 10 +-
admin/WebConsole/principal/acercade.php | 19 +-
admin/WebConsole/principal/actualizar.php | 2 +-
admin/WebConsole/principal/administracion.php | 11 +-
admin/WebConsole/principal/aula.php | 34 +-
admin/WebConsole/principal/aulas.php | 32 +-
admin/WebConsole/principal/boot_grub4dos.php | 10 +-
admin/WebConsole/principal/boot_grub4dos_crear.php | 126 +-
admin/WebConsole/principal/boot_grub4dos_tabla.php | 30 +-
admin/WebConsole/principal/boot_pxelinux.php | 217 ----
admin/WebConsole/principal/colasacciones.php | 48 +-
admin/WebConsole/principal/colasreservas.php | 10 +-
admin/WebConsole/principal/comandos.php | 16 +-
admin/WebConsole/principal/configuraciones.php | 78 +-
admin/WebConsole/principal/consolaremota.php | 24 +-
admin/WebConsole/principal/ecoconsola.php | 2 +-
admin/WebConsole/principal/ecoremoto.php | 20 +-
admin/WebConsole/principal/hardwares.php | 10 +-
admin/WebConsole/principal/imagenes.php | 18 +-
admin/WebConsole/principal/menus.php | 10 +-
admin/WebConsole/principal/programacionesaulas.php | 10 +-
.../principal/programacionesreservas.php | 10 +-
admin/WebConsole/principal/purgar.php | 2 +-
admin/WebConsole/principal/repositorios.php | 8 +-
admin/WebConsole/principal/reservas.php | 10 +-
admin/WebConsole/principal/shellconsola.php | 2 +-
admin/WebConsole/principal/softwares.php | 10 +-
admin/WebConsole/principal/sondeo.php | 32 +-
admin/WebConsole/principal/verlog.php | 6 +-
admin/WebConsole/principal/verlogseguimiento.php | 6 +-
admin/WebConsole/propiedades/propiedades_aulas.php | 254 ++--
.../WebConsole/propiedades/propiedades_centros.php | 60 +-
.../propiedades_componentehardwares.php | 26 +-
.../propiedades_componentesoftwares.php | 32 +-
.../propiedades/propiedades_entidades.php | 57 +-
.../propiedades/propiedades_entornos.php | 28 +-
.../WebConsole/propiedades/propiedades_grupos.php | 24 +-
.../propiedades/propiedades_imagenes.php | 314 +++--
admin/WebConsole/propiedades/propiedades_menus.php | 47 +-
.../propiedades/propiedades_ordenadores.php | 100 +-
.../propiedades/propiedades_ordenadorestandar.php | 44 +-
.../propiedades/propiedades_perfilhardwares.php | 36 +-
.../propiedades/propiedades_perfilsoftwares.php | 30 +-
.../propiedades/propiedades_procedimientos.php | 26 +-
.../propiedades/propiedades_repositorios.php | 191 +--
.../propiedades/propiedades_reservas.php | 62 +-
.../WebConsole/propiedades/propiedades_tareas.php | 36 +-
.../propiedades/propiedades_tipohardwares.php | 26 +-
.../propiedades/propiedades_universidades.php | 24 +-
.../propiedades/propiedades_usuarios.php | 126 +-
admin/WebConsole/rest/common.php | 292 +++++
admin/WebConsole/rest/index.php | 75 ++
admin/WebConsole/rest/ogagent.php | 272 ++++
admin/WebConsole/rest/opengnsys-api.yml | 1300 ++++++++++++++++++++
admin/WebConsole/rest/remotepc.php | 553 +++++++++
admin/WebConsole/rest/repository.php | 215 ++++
admin/WebConsole/rest/server.php | 1041 ++++++++++++++++
admin/WebConsole/validacion/html/close.php | 2 +-
admin/WebConsole/validacion/html/login_prueba.php | 4 +-
.../WebConsole/validacion/html/validacion_ldap.php | 2 +-
.../validacion/html/validacion_prueba.php | 2 +-
.../validacion/html/validacion_template.php | 2 +-
admin/WebConsole/varios/acceso_operador.php | 4 +-
admin/WebConsole/varios/accesoperadores.php | 4 +-
admin/WebConsole/varios/accionmenu.php | 28 +-
.../WebConsole/varios/administradores_centros.php | 14 +-
.../WebConsole/varios/administradores_usuarios.php | 14 +-
admin/WebConsole/varios/calendario_ventana.php | 10 +-
.../WebConsole/varios/consulta_programaciones.php | 2 +-
admin/WebConsole/varios/desplegablesambitos.php | 2 +-
admin/WebConsole/varios/ejecutaracciones.php | 16 +-
admin/WebConsole/varios/ejecutaritem.php | 2 +-
admin/WebConsole/varios/horareser_ventana.php | 4 +-
admin/WebConsole/varios/horario_ventana.php | 4 +-
admin/WebConsole/varios/incluiracciones.php | 38 +-
admin/WebConsole/varios/inclusionacciones.php | 18 +-
admin/WebConsole/varios/incorporaordenadores.php | 76 +-
.../varios/incrementalcomponente_soft.php | 22 +-
admin/WebConsole/varios/informacion_acciones.php | 2 +-
admin/WebConsole/varios/informacion_imagenes.php | 29 +-
admin/WebConsole/varios/informacion_menus.php | 20 +-
.../varios/informacion_perfileshardware.php | 12 +-
.../varios/informacion_perfilessoftware.php | 24 +-
.../varios/informacion_procedimientos.php | 12 +-
.../WebConsole/varios/informacion_repositorios.php | 8 +-
admin/WebConsole/varios/informacion_tareas.php | 6 +-
admin/WebConsole/varios/menubrowser.php | 4 +-
admin/WebConsole/varios/msgbrowser.php | 4 +-
admin/WebConsole/varios/perfilcomponente_hard.php | 35 +-
admin/WebConsole/varios/perfilcomponente_soft.php | 31 +-
admin/WebConsole/varios/procedimientoscomandos.php | 22 +-
admin/WebConsole/varios/programaciones.php | 42 +-
admin/WebConsole/varios/tareascomandos.php | 22 +-
admin/WebConsole/varios/toma_mes.php | 2 +-
admin/slim-2.6.1.zip | Bin 0 -> 58715 bytes
admin/swagger-ui-2.2.5.zip | Bin 0 -> 955075 bytes
client/README.es.txt | 8 +-
client/boot-tools/INSTALL.es.txt | 9 +-
client/boot-tools/boottoolsfunctions.lib | 102 +-
client/boot-tools/boottoolsgenerator.sh | 21 +-
.../includes/etc/apt/sources.list.ubuntu | 6 +-
.../includes/etc/initramfs-tools/modules | 15 +-
.../etc/initramfs-tools/scripts/VERSION.txt | 1 +
.../etc/initramfs-tools/scripts/ogfunctions | 171 ++-
.../includes/etc/initramfs-tools/scripts/oginit | 16 +-
.../etc/modprobe.d/blacklist-framebuffer.conf | 3 +-
.../usr/bin/boot-tools/boottoolsBootGraphics.sh | 5 +-
.../usr/bin/boot-tools/boottoolsFsOpengnsys.sh | 19 +-
.../usr/bin/boot-tools/boottoolsSoftwareCompile.sh | 34 +-
.../usr/bin/boot-tools/boottoolsSoftwareInstall.sh | 53 +-
.../usr/bin/boot-tools/listpackages/sw.Xwindow | 7 +-
.../usr/bin/boot-tools/listpackages/sw.Zinitrd | 3 -
.../usr/bin/boot-tools/listpackages/sw.basic | 6 +-
.../usr/bin/boot-tools/listpackages/sw.cloning | 3 -
.../usr/bin/boot-tools/listpackages/sw.compile | 7 +-
.../usr/bin/boot-tools/listpackages/sw.compresor | 3 +-
.../boot-tools/listpackages/sw.filesystem.local | 18 +-
.../boot-tools/listpackages/sw.filesystem.remote | 3 +-
.../usr/bin/boot-tools/listpackages/sw.networking | 7 +-
.../usr/bin/boot-tools/listpackages/sw.testing | 21 +-
.../busybox-static_1.17.1-10ubuntu1_i386.deb | Bin 747212 -> 0 bytes
.../archivesOG/busybox_1.17.1-10ubuntu1_i386.deb | Bin 290464 -> 0 bytes
.../cache/apt/archivesOG/partclone_0.2.38_i386.deb | Bin 6319500 -> 0 bytes
.../apt/archivesOG/partclone_0.2.7-1drbl_i386.deb | Bin 5023908 -> 0 bytes
.../cache/apt/archivesOG/partclone_0.2.8_i386.deb | Bin 5025002 -> 0 bytes
.../includes/var/cache/apt/archivesOG/xvesa.deb | Bin 541364 -> 0 bytes
.../includes/var/lib/locales/supported.d/local | 4 +-
client/boot-tools/kernelParameterOG.es.txt | 2 +-
client/browser/browser.pro | 2 +-
client/browser/digitalclock/digitalclock.cpp | 72 ++
client/browser/digitalclock/digitalclock.h | 59 +
client/browser/digitalclock/digitalclock.pro | 23 +
client/browser/po/ca.po | 110 ++
client/browser/po/en.po | 112 ++
client/browser/src/main.cpp | 20 +-
client/browser/src/mainwindow.cpp | 145 ++-
client/browser/src/mainwindow.h | 9 +-
client/browser/src/src.pro | 4 +-
client/engine/Boot.lib | 1162 +++++++++++++++--
client/engine/Cache.lib | 85 +-
client/engine/Disk.lib | 379 ++++--
client/engine/File.lib | 33 +-
client/engine/FileSystem.lib | 201 ++-
client/engine/Image.lib | 348 +++++-
client/engine/Inventory.lib | 305 +++--
client/engine/Net.lib | 61 +-
client/engine/PostConf.lib | 147 ++-
client/engine/PostConfEAC.lib | 93 ++
client/engine/Protocol.lib | 106 +-
client/engine/README.es.txt | 8 +-
client/engine/Registry.lib | 84 +-
client/engine/Rsync.lib | 83 +-
client/engine/System.lib | 45 +-
client/shared/README.es.txt | 10 +-
client/shared/bin/browser | Bin 442268 -> 430012 bytes
client/shared/bin/grub-probe1.99 | Bin 358216 -> 0 bytes
client/shared/bin/grub-probe1.99_i686 | Bin 0 -> 358216 bytes
client/shared/bin/grub-probe1.99_x86_64 | Bin 0 -> 336600 bytes
client/shared/bin/poweroffconf | 5 +-
client/shared/etc/engine.cfg | 17 +-
client/shared/etc/init/default.sh | 13 +-
client/shared/etc/lang.ca_ES.conf | 118 +-
client/shared/etc/lang.en_GB.conf | 118 +-
client/shared/etc/lang.es_ES.conf | 119 +-
client/shared/etc/preinit/default.sh | 4 +-
client/shared/etc/preinit/fileslinks.sh | 6 +-
client/shared/etc/preinit/loadenviron.sh | 6 +-
client/shared/etc/preinit/metadevs.sh | 6 +-
client/shared/etc/preinit/mountrepo.sh | 5 +-
client/shared/etc/preinit/otherservices.sh | 4 +-
client/shared/etc/preinit/poweroff.sh | 11 +-
.../burg/themes/OpenGnsys/background-original.png | Bin 0 -> 136 bytes
.../lib/burg/themes/OpenGnsys/background.png | Bin 0 -> 74953 bytes
client/shared/lib/burg/themes/OpenGnsys/extended | 79 ++
.../burg/themes/OpenGnsys/icons/hover_debian.png | Bin 0 -> 3715 bytes
.../themes/OpenGnsys/icons/hover_elementary.png | Bin 0 -> 5496 bytes
.../burg/themes/OpenGnsys/icons/hover_freebsd.png | Bin 0 -> 4416 bytes
.../burg/themes/OpenGnsys/icons/hover_haiku.png | Bin 0 -> 1912 bytes
.../burg/themes/OpenGnsys/icons/hover_linux.png | Bin 0 -> 33041 bytes
.../themes/OpenGnsys/icons/hover_opengnsys.png | Bin 0 -> 11389 bytes
.../burg/themes/OpenGnsys/icons/hover_opensuse.png | Bin 0 -> 4429 bytes
.../lib/burg/themes/OpenGnsys/icons/hover_os.png | Bin 0 -> 4586 bytes
.../lib/burg/themes/OpenGnsys/icons/hover_osx.png | Bin 0 -> 2457 bytes
.../burg/themes/OpenGnsys/icons/hover_recovery.png | Bin 0 -> 4442 bytes
.../burg/themes/OpenGnsys/icons/hover_restart.png | Bin 0 -> 5057 bytes
.../burg/themes/OpenGnsys/icons/hover_shutdown.png | Bin 0 -> 4539 bytes
.../burg/themes/OpenGnsys/icons/hover_ubuntu.png | Bin 0 -> 14374 bytes
.../burg/themes/OpenGnsys/icons/hover_windows.png | Bin 0 -> 20160 bytes
.../themes/OpenGnsys/icons/hover_windows10.png | Bin 0 -> 5101 bytes
.../burg/themes/OpenGnsys/icons/hover_windows7.png | Bin 0 -> 18024 bytes
.../themes/OpenGnsys/icons/hover_windows_metro.png | Bin 0 -> 1583 bytes
.../shared/lib/burg/themes/OpenGnsys/icons/icons | 21 +
.../burg/themes/OpenGnsys/icons/normal_debian.png | Bin 0 -> 3451 bytes
.../themes/OpenGnsys/icons/normal_elementary.png | Bin 0 -> 5204 bytes
.../burg/themes/OpenGnsys/icons/normal_freebsd.png | Bin 0 -> 4080 bytes
.../burg/themes/OpenGnsys/icons/normal_haiku.png | Bin 0 -> 1652 bytes
.../burg/themes/OpenGnsys/icons/normal_linux.png | Bin 0 -> 33691 bytes
.../themes/OpenGnsys/icons/normal_opengnsys.png | Bin 0 -> 11119 bytes
.../themes/OpenGnsys/icons/normal_opensuse.png | Bin 0 -> 4059 bytes
.../lib/burg/themes/OpenGnsys/icons/normal_os.png | Bin 0 -> 4242 bytes
.../lib/burg/themes/OpenGnsys/icons/normal_osx.png | Bin 0 -> 2066 bytes
.../themes/OpenGnsys/icons/normal_recovery.png | Bin 0 -> 4081 bytes
.../burg/themes/OpenGnsys/icons/normal_restart.png | Bin 0 -> 4718 bytes
.../themes/OpenGnsys/icons/normal_shutdown.png | Bin 0 -> 4182 bytes
.../burg/themes/OpenGnsys/icons/normal_ubuntu.png | Bin 0 -> 14036 bytes
.../burg/themes/OpenGnsys/icons/normal_windows.png | Bin 0 -> 20637 bytes
.../themes/OpenGnsys/icons/normal_windows10.png | Bin 0 -> 4791 bytes
.../themes/OpenGnsys/icons/normal_windows7.png | Bin 0 -> 17786 bytes
.../OpenGnsys/icons/normal_windows_metro.png | Bin 0 -> 1280 bytes
.../burg/themes/OpenGnsys/images/000-70opaque.png | Bin 0 -> 109 bytes
.../lib/burg/themes/OpenGnsys/images/button-bg.png | Bin 0 -> 146 bytes
.../themes/OpenGnsys/images/button-hover-bg.png | Bin 0 -> 146 bytes
.../themes/OpenGnsys/images/button-hover-l.png | Bin 0 -> 525 bytes
.../themes/OpenGnsys/images/button-hover-r.png | Bin 0 -> 671 bytes
.../lib/burg/themes/OpenGnsys/images/button-l.png | Bin 0 -> 725 bytes
.../lib/burg/themes/OpenGnsys/images/button-r.png | Bin 0 -> 562 bytes
.../themes/OpenGnsys/images/button-tools-hover.png | Bin 0 -> 1550 bytes
.../burg/themes/OpenGnsys/images/button-tools.png | Bin 0 -> 1398 bytes
.../burg/themes/OpenGnsys/images/container-b.png | Bin 0 -> 153 bytes
.../burg/themes/OpenGnsys/images/container-bg.png | Bin 0 -> 146 bytes
.../burg/themes/OpenGnsys/images/container-bl.png | Bin 0 -> 154 bytes
.../burg/themes/OpenGnsys/images/container-br.png | Bin 0 -> 154 bytes
.../burg/themes/OpenGnsys/images/container-l.png | Bin 0 -> 155 bytes
.../burg/themes/OpenGnsys/images/container-r.png | Bin 0 -> 148 bytes
.../burg/themes/OpenGnsys/images/container-t.png | Bin 0 -> 159 bytes
.../themes/OpenGnsys/images/container-title-bg.png | Bin 0 -> 144 bytes
.../themes/OpenGnsys/images/container-title-l.png | Bin 0 -> 139 bytes
.../themes/OpenGnsys/images/container-title-r.png | Bin 0 -> 139 bytes
.../themes/OpenGnsys/images/container-title-t.png | Bin 0 -> 151 bytes
.../themes/OpenGnsys/images/container-title-tl.png | Bin 0 -> 181 bytes
.../themes/OpenGnsys/images/container-title-tr.png | Bin 0 -> 188 bytes
.../burg/themes/OpenGnsys/images/container-tl.png | Bin 0 -> 154 bytes
.../burg/themes/OpenGnsys/images/container-tr.png | Bin 0 -> 154 bytes
.../lib/burg/themes/OpenGnsys/images/dialog-b.png | Bin 0 -> 135 bytes
.../lib/burg/themes/OpenGnsys/images/dialog-bg.png | Bin 0 -> 144 bytes
.../lib/burg/themes/OpenGnsys/images/dialog-bl.png | Bin 0 -> 177 bytes
.../lib/burg/themes/OpenGnsys/images/dialog-bl.xcf | Bin 0 -> 889 bytes
.../lib/burg/themes/OpenGnsys/images/dialog-br.png | Bin 0 -> 168 bytes
.../lib/burg/themes/OpenGnsys/images/dialog-lr.png | Bin 0 -> 131 bytes
.../burg/themes/OpenGnsys/images/dialog-spacer.png | Bin 0 -> 140 bytes
.../lib/burg/themes/OpenGnsys/images/dialog-t.png | Bin 0 -> 135 bytes
.../lib/burg/themes/OpenGnsys/images/dialog-tl.png | Bin 0 -> 181 bytes
.../lib/burg/themes/OpenGnsys/images/dialog-tr.png | Bin 0 -> 188 bytes
.../themes/OpenGnsys/images/progressbar-bg-b.png | Bin 0 -> 156 bytes
.../themes/OpenGnsys/images/progressbar-bg-bl.png | Bin 0 -> 169 bytes
.../themes/OpenGnsys/images/progressbar-bg-br.png | Bin 0 -> 215 bytes
.../themes/OpenGnsys/images/progressbar-bg-l.png | Bin 0 -> 346 bytes
.../themes/OpenGnsys/images/progressbar-bg-r.png | Bin 0 -> 165 bytes
.../themes/OpenGnsys/images/progressbar-bg-t.png | Bin 0 -> 155 bytes
.../themes/OpenGnsys/images/progressbar-bg-tl.png | Bin 0 -> 183 bytes
.../themes/OpenGnsys/images/progressbar-bg-tr.png | Bin 0 -> 186 bytes
.../themes/OpenGnsys/images/progressbar-bg.png | Bin 0 -> 152 bytes
.../burg/themes/OpenGnsys/images/text-line-l.png | Bin 0 -> 254 bytes
.../burg/themes/OpenGnsys/images/text-line-r.png | Bin 0 -> 260 bytes
.../lib/burg/themes/OpenGnsys/images/tick.png | Bin 0 -> 253 bytes
.../lib/burg/themes/OpenGnsys/images/txt-about.png | Bin 0 -> 905 bytes
.../lib/burg/themes/OpenGnsys/images/txt-help.png | Bin 0 -> 423 bytes
.../burg/themes/OpenGnsys/images/txt-select.png | Bin 0 -> 4367 bytes
.../lib/burg/themes/OpenGnsys/images/txt-tools.png | Bin 0 -> 474 bytes
.../themes/OpenGnsys/images/ubuntu-glow-96.png | Bin 0 -> 9155 bytes
client/shared/lib/burg/themes/OpenGnsys/menus | 188 +++
client/shared/lib/burg/themes/OpenGnsys/style | 158 +++
client/shared/lib/burg/themes/OpenGnsys/theme | 231 ++++
client/shared/lib/engine/tests/Modify/Cache.shtest | 8 +-
.../shared/lib/engine/tests/NoModify/Lock1.shtest | 10 +-
client/shared/lib/engine/tests/crearTestLock2 | 4 +-
client/shared/lib/httpd/httpd-log.sh | 5 +-
client/shared/lib/httpd/httpd-runengine.sh | 1 +
client/shared/lib/locale/ca/LC_MESSAGES/browser.mo | Bin 0 -> 899 bytes
client/shared/lib/locale/en/LC_MESSAGES/browser.mo | Bin 0 -> 2134 bytes
client/shared/lib/os-probes/10zvol-test | 14 +
client/shared/lib/os-probes/50mounted-tests | 99 ++
client/shared/lib/os-probes/init/10filesystems | 39 +
client/shared/lib/os-probes/mounted/05efi | 71 ++
client/shared/lib/os-probes/mounted/10freedos | 23 +
client/shared/lib/os-probes/mounted/10qnx | 21 +
client/shared/lib/os-probes/mounted/20macosx | 30 +
client/shared/lib/os-probes/mounted/20microsoft | 140 +++
client/shared/lib/os-probes/mounted/30utility | 33 +
client/shared/lib/os-probes/mounted/40lsb | 48 +
client/shared/lib/os-probes/mounted/70hurd | 16 +
client/shared/lib/os-probes/mounted/80minix | 28 +
client/shared/lib/os-probes/mounted/83haiku | 35 +
client/shared/lib/os-probes/mounted/90linux-distro | 138 +++
client/shared/lib/os-probes/mounted/90solaris | 19 +
client/shared/lib/os-probes/mounted/efi/10elilo | 24 +
.../shared/lib/os-probes/mounted/efi/20microsoft | 28 +
client/shared/lib/pictures/oglogo.png | Bin 0 -> 736 bytes
client/shared/scripts/ImagenesSincronizadas.lib | 2 +-
client/shared/scripts/README.es.txt | 19 +-
client/shared/scripts/bootOs | 48 +-
client/shared/scripts/bootOsCustom.template | 83 ++
client/shared/scripts/configureOs | 36 +-
client/shared/scripts/createBaseImage | 10 +-
client/shared/scripts/createDiffImage | 10 +-
client/shared/scripts/createImage | 54 +-
client/shared/scripts/deployImage | 38 +-
client/shared/scripts/formatFs | 2 +-
client/shared/scripts/grubSyntax | 83 +-
client/shared/scripts/initCache | 77 +-
client/shared/scripts/launchOgagentInstaller | 147 +++
client/shared/scripts/listHardwareInfo | 4 +-
client/shared/scripts/listSoftwareInfo | 11 +-
client/shared/scripts/menuBrowser | 3 +-
client/shared/scripts/poweroff | 18 +-
client/shared/scripts/reboot | 19 +-
client/shared/scripts/restoreBaseImage | 2 +-
client/shared/scripts/restoreDiffImage | 2 +-
client/shared/scripts/restoreImage | 45 +-
client/shared/scripts/restoreImageCustom.template | 13 +-
client/shared/scripts/setBootMode | 32 +-
client/shared/scripts/updateBootCache | 47 +-
client/shared/scripts/updateCache | 72 +-
doc/CHANGELOG.es.txt | 116 +-
doc/INSTALL.en.txt | 28 +-
doc/INSTALL.es.txt | 37 +-
doc/README.en.txt | 29 +-
doc/README.es.txt | 19 +-
doc/VERSION.txt | 2 +-
doc/filetree.en.txt | 15 +-
doc/filetree.es.txt | 14 +-
doc/userManual/Tema0-Laboratorio_virtual.pdf | Bin 0 -> 3544233 bytes
doc/userManual/Tema1-Introduccion.pdf | Bin 312799 -> 1073113 bytes
doc/userManual/Tema2-Instalacion.pdf | Bin 167663 -> 845442 bytes
.../Tema3.1-Administracion_componentes.pdf | Bin 691692 -> 1020845 bytes
.../Tema3.2-Administracion_consola_web.pdf | Bin 617183 -> 1289992 bytes
.../Tema3.3-Administracion_unidad_organizativa.pdf | Bin 1475303 -> 2607159 bytes
doc/userManual/Tema4-Ambito_aplicacion.pdf | Bin 568451 -> 2394682 bytes
doc/userManual/Tema5-Particionado_discos.pdf | Bin 644412 -> 1455816 bytes
doc/userManual/Tema6.1-Creacion_imagenes.pdf | Bin 652924 -> 1939762 bytes
.../Tema6.2-Restauracion_y_despliegue_imagenes.pdf | Bin 2055792 -> 2487581 bytes
doc/userManual/Tema6.3-Eliminacion_imagenes.pdf | Bin 190772 -> 1017185 bytes
doc/userManual/Tema7-Acciones_y_menus_usuario.pdf | Bin 1079262 -> 1666428 bytes
installer/INSTALL.en.txt | 12 +-
installer/INSTALL.es.txt | 14 +-
installer/README.es.txt | 11 +-
installer/ogGenerateDoc.sh | 6 +-
installer/ogagent-devel-installer.sh | 113 ++
installer/ogagentpkgs-1.1.0.tar.gz | Bin 0 -> 17012444 bytes
installer/opengnsys_export.sh | 114 ++
installer/opengnsys_import.sh | 331 +++++
installer/opengnsys_installer.sh | 402 +++---
installer/opengnsys_makecompress.sh | 4 +-
installer/opengnsys_uninstall.sh | 34 +-
installer/opengnsys_update.sh | 485 +++++---
installer/vagrant/README.es.txt | 75 ++
installer/vagrant/Vagrantfile-1.0.6b-vbox | 152 +++
installer/vagrant/Vagrantfile-boottools-vbox | 55 +
installer/vagrant/Vagrantfile-browser-vbox | 69 ++
installer/vagrant/Vagrantfile-devel-vbox | 185 +++
installer/vagrant/Vagrantfile-ogagent-vbox | 72 ++
installer/vagrant/Vagrantfile-trunk-vbox | 164 +++
repoman/README.es.txt | 4 +-
repoman/bin/checkrepo | 230 ++++
repoman/bin/createfileimage | 65 +
repoman/bin/deleteimage | 19 +-
repoman/bin/deletepreimage | 66 +-
repoman/bin/mountimage | 71 ++
repoman/bin/opengnsys.cron | 4 +-
repoman/bin/partclone2sync | 178 +++
repoman/bin/reduceimage | 58 +
repoman/bin/torrent-creator | 4 +-
repoman/bin/unmountimage | 52 +
server/README.es.txt | 5 +-
server/bin/checkperms | 27 +-
server/bin/comparedhcpopengnsys | 2 +-
server/bin/comparemac | 2 +-
server/bin/createfileimage | 61 -
server/bin/installmodule | 97 ++
server/bin/installoglive | 95 +-
server/bin/listclientlive | 50 +
server/bin/listclientmode | 2 +-
server/bin/mountimage | 66 -
server/bin/ogagentqueue.cron | 100 ++
server/bin/oglivecli | 482 ++++++++
server/bin/partclone2sync | 174 ---
server/bin/reduceimage | 54 -
server/bin/registeredsoftware | 23 +-
server/bin/setclientlive | 73 ++
server/bin/setclientmode | 101 +-
server/bin/setserveraddr | 4 +-
server/bin/setsmbpass | 126 +-
server/bin/unmountimage | 47 -
server/etc/apache-prev2.4.conf.tmpl | 18 +-
server/etc/apache.conf.tmpl | 18 +-
server/etc/dhcpd.conf.tmpl | 11 +
server/etc/smb-og.conf.tmpl | 8 +-
server/lib/security-config | 86 ++
server/tftpboot/NetbootPXE.es.txt | 10 +-
server/tftpboot/menu.lst/templates/00unknown | 1 -
server/tftpboot/menu.lst/templates/01 | 1 -
server/tftpboot/menu.lst/templates/11 | 1 -
server/tftpboot/menu.lst/templates/12 | 1 -
server/tftpboot/menu.lst/templates/19pxeADMIN | 17 +-
server/tftpboot/menu.lst/templates/pxe | 29 +-
1008 files changed, 26454 insertions(+), 8384 deletions(-)
create mode 100644 admin/Database/ogAdmBD-1.0.6b-1.1.0.sql
delete mode 100644 admin/Database/ogAdmBD-1.0.6b-postinst.sql
create mode 100644 admin/Database/ogAdmBD-1.1.0-postinst.sql
create mode 100644 admin/Database/ogAdmBD-1.1.0pre-1.1.0.sql
create mode 100644 admin/Sources/Clients/README.es.txt
delete mode 100644 admin/Sources/Clients/ogAdmLnxClient/Makefile
delete mode 100644 admin/Sources/Clients/ogAdmLnxClient/ogAdmLnxClient.cfg
delete mode 100644 admin/Sources/Clients/ogAdmLnxClient/sources/ogAdmLnxClient.c
delete mode 100644 admin/Sources/Clients/ogAdmLnxClient/sources/ogAdmLnxClient.h
delete mode 100644 admin/Sources/Clients/ogAdmWinClient/Readme
delete mode 100644 admin/Sources/Clients/ogAdmWinClient/sources/ogAdmWinClient.cpp
delete mode 100644 admin/Sources/Clients/ogAdmWinClient/sources/ogAdmWinClient.h
delete mode 100644 admin/Sources/Clients/ogAdmWinClient/sources/servicio.c
delete mode 100644 admin/Sources/Clients/ogAdmWinClient/sources/servicio.h
create mode 100644 admin/Sources/Clients/ogagent/INSTALL.es.txt
create mode 100644 admin/Sources/Clients/ogagent/linux/Makefile
create mode 100755 admin/Sources/Clients/ogagent/linux/build-packages.sh
create mode 100644 admin/Sources/Clients/ogagent/linux/debian/changelog
create mode 100644 admin/Sources/Clients/ogagent/linux/debian/compat
create mode 100644 admin/Sources/Clients/ogagent/linux/debian/control
create mode 100644 admin/Sources/Clients/ogagent/linux/debian/copyright
create mode 100644 admin/Sources/Clients/ogagent/linux/debian/docs
create mode 100644 admin/Sources/Clients/ogagent/linux/debian/ogagent.init
create mode 100644 admin/Sources/Clients/ogagent/linux/debian/ogagent.links
create mode 100644 admin/Sources/Clients/ogagent/linux/debian/ogagent.postinst
create mode 100644 admin/Sources/Clients/ogagent/linux/debian/ogagent.postinst.debhelper
create mode 100644 admin/Sources/Clients/ogagent/linux/debian/ogagent.postrm
create mode 100644 admin/Sources/Clients/ogagent/linux/debian/ogagent.postrm.debhelper
create mode 100644 admin/Sources/Clients/ogagent/linux/debian/ogagent.substvars
create mode 100755 admin/Sources/Clients/ogagent/linux/debian/rules
create mode 100644 admin/Sources/Clients/ogagent/linux/debian/source/format
create mode 100644 admin/Sources/Clients/ogagent/linux/desktop/OGAgentTool.desktop
create mode 100644 admin/Sources/Clients/ogagent/linux/ogagent-template.spec
create mode 100644 admin/Sources/Clients/ogagent/linux/policy/org.openuds.pkexec.UDSActorConfig.policy
create mode 100644 admin/Sources/Clients/ogagent/linux/readme.txt
create mode 100644 admin/Sources/Clients/ogagent/linux/scripts/OGAgentTool
create mode 100644 admin/Sources/Clients/ogagent/linux/scripts/OGAgentTool-startup
create mode 100644 admin/Sources/Clients/ogagent/linux/scripts/ogagent
create mode 100755 admin/Sources/Clients/ogagent/macos/build-pkg.sh
create mode 100644 admin/Sources/Clients/ogagent/macos/scripts/es.opengnsys.ogagent.plist
create mode 100755 admin/Sources/Clients/ogagent/macos/scripts/ogagent
create mode 100755 admin/Sources/Clients/ogagent/macos/scripts/postinstall
create mode 100644 admin/Sources/Clients/ogagent/requires.txt
create mode 100644 admin/Sources/Clients/ogagent/src/OGAServiceHelper.py
create mode 100644 admin/Sources/Clients/ogagent/src/OGAgent.manifest
create mode 100644 admin/Sources/Clients/ogagent/src/OGAgent.qrc
create mode 100644 admin/Sources/Clients/ogagent/src/OGAgentUser.py
create mode 100644 admin/Sources/Clients/ogagent/src/OGAgent_rc.py
create mode 100644 admin/Sources/Clients/ogagent/src/VERSION
create mode 100644 admin/Sources/Clients/ogagent/src/about-dialog.ui
create mode 100644 admin/Sources/Clients/ogagent/src/cfg/ogagent.cfg
create mode 100644 admin/Sources/Clients/ogagent/src/cfg/ogclient.cfg
create mode 100644 admin/Sources/Clients/ogagent/src/img/oga-48x48.ico
create mode 100644 admin/Sources/Clients/ogagent/src/img/oga-512.png
create mode 100644 admin/Sources/Clients/ogagent/src/img/oga.ico
create mode 100644 admin/Sources/Clients/ogagent/src/img/oga.png
create mode 100644 admin/Sources/Clients/ogagent/src/license.txt
create mode 100644 admin/Sources/Clients/ogagent/src/message-dialog.ui
create mode 100644 admin/Sources/Clients/ogagent/src/opengnsys/RESTApi.py
create mode 100644 admin/Sources/Clients/ogagent/src/opengnsys/__init__.py
create mode 100644 admin/Sources/Clients/ogagent/src/opengnsys/certs.py
create mode 100644 admin/Sources/Clients/ogagent/src/opengnsys/config.py
create mode 100644 admin/Sources/Clients/ogagent/src/opengnsys/httpserver.py
create mode 100644 admin/Sources/Clients/ogagent/src/opengnsys/ipc.py
create mode 100644 admin/Sources/Clients/ogagent/src/opengnsys/linux/OGAgentService.py
create mode 100644 admin/Sources/Clients/ogagent/src/opengnsys/linux/__init__.py
create mode 100644 admin/Sources/Clients/ogagent/src/opengnsys/linux/daemon.py
create mode 100644 admin/Sources/Clients/ogagent/src/opengnsys/linux/log.py
create mode 100644 admin/Sources/Clients/ogagent/src/opengnsys/linux/operations.py
create mode 100644 admin/Sources/Clients/ogagent/src/opengnsys/linux/renamer/__init__.py
create mode 100644 admin/Sources/Clients/ogagent/src/opengnsys/linux/renamer/debian.py
create mode 100644 admin/Sources/Clients/ogagent/src/opengnsys/linux/renamer/opensuse.py
create mode 100644 admin/Sources/Clients/ogagent/src/opengnsys/linux/renamer/redhat.py
create mode 100644 admin/Sources/Clients/ogagent/src/opengnsys/loader.py
create mode 100644 admin/Sources/Clients/ogagent/src/opengnsys/log.py
create mode 100644 admin/Sources/Clients/ogagent/src/opengnsys/macos/__init__.py
create mode 100644 admin/Sources/Clients/ogagent/src/opengnsys/macos/operations.py
create mode 100644 admin/Sources/Clients/ogagent/src/opengnsys/modules/__init__.py
create mode 100644 admin/Sources/Clients/ogagent/src/opengnsys/modules/client/OpenGnSys/__init__.py
create mode 100644 admin/Sources/Clients/ogagent/src/opengnsys/modules/client/__init__.py
create mode 100644 admin/Sources/Clients/ogagent/src/opengnsys/modules/server/OpenGnSys/__init__.py
create mode 100644 admin/Sources/Clients/ogagent/src/opengnsys/modules/server/__init__.py
create mode 100644 admin/Sources/Clients/ogagent/src/opengnsys/operations.py
create mode 100644 admin/Sources/Clients/ogagent/src/opengnsys/scriptThread.py
create mode 100644 admin/Sources/Clients/ogagent/src/opengnsys/service.py
create mode 100644 admin/Sources/Clients/ogagent/src/opengnsys/utils.py
create mode 100644 admin/Sources/Clients/ogagent/src/opengnsys/windows/OGAgentService.py
create mode 100644 admin/Sources/Clients/ogagent/src/opengnsys/windows/__init__.py
create mode 100644 admin/Sources/Clients/ogagent/src/opengnsys/windows/log.py
create mode 100644 admin/Sources/Clients/ogagent/src/opengnsys/windows/operations.py
create mode 100644 admin/Sources/Clients/ogagent/src/opengnsys/workers/__init__.py
create mode 100644 admin/Sources/Clients/ogagent/src/opengnsys/workers/client_worker.py
create mode 100644 admin/Sources/Clients/ogagent/src/opengnsys/workers/server_worker.py
create mode 100644 admin/Sources/Clients/ogagent/src/prototypes/threaded_server.py
create mode 100644 admin/Sources/Clients/ogagent/src/setup.py
create mode 100644 admin/Sources/Clients/ogagent/src/test_modules/__init__.py
create mode 100644 admin/Sources/Clients/ogagent/src/test_modules/client/Sample1/__init__.py
create mode 100644 admin/Sources/Clients/ogagent/src/test_modules/client/__init__.py
create mode 100644 admin/Sources/Clients/ogagent/src/test_modules/server/Sample1/__init__.py
create mode 100644 admin/Sources/Clients/ogagent/src/test_modules/server/Sample1/sample1.py
create mode 100644 admin/Sources/Clients/ogagent/src/test_modules/server/Sample1/sample_pkg/__init__.py
create mode 100644 admin/Sources/Clients/ogagent/src/test_modules/server/__init__.py
create mode 100644 admin/Sources/Clients/ogagent/src/test_rest_server.py
create mode 100755 admin/Sources/Clients/ogagent/src/update.sh
create mode 100755 admin/Sources/Clients/ogagent/windows/build-windows.sh
create mode 100644 admin/Sources/Clients/ogagent/windows/build.bat
create mode 100644 admin/Sources/Clients/ogagent/windows/ogagent.nsi
create mode 100755 admin/Sources/Clients/ogagent/windows/py2exe-wine-linux.sh
create mode 100644 admin/WebConsole/comandos/EnviarMensaje.php
create mode 100644 admin/WebConsole/comandos/gestores/wakeonlan_repo.php
create mode 100644 admin/WebConsole/comandos/jscripts/EnviarMensaje.js
create mode 100644 admin/WebConsole/descargas/README.es.html
create mode 100644 admin/WebConsole/descargas/index.php
create mode 100644 admin/WebConsole/idiomas/javascripts/cat/asistentes_cat.js
create mode 100644 admin/WebConsole/idiomas/javascripts/cat/comandos/enviarmensaje_cat.js
create mode 100644 admin/WebConsole/idiomas/javascripts/eng/asistentes_eng.js
create mode 100644 admin/WebConsole/idiomas/javascripts/eng/comandos/enviarmensaje_eng.js
create mode 100644 admin/WebConsole/idiomas/javascripts/esp/asistentes_esp.js
create mode 100644 admin/WebConsole/idiomas/javascripts/esp/comandos/enviarmensaje_esp.js
create mode 100644 admin/WebConsole/idiomas/php/cat/comandos/enviarmensaje_cat.php
create mode 100644 admin/WebConsole/idiomas/php/cat/descargas_cat.php
create mode 100644 admin/WebConsole/idiomas/php/cat/gestor_ordenadores_cat.php
create mode 100644 admin/WebConsole/idiomas/php/cat/tiposhardwares_cat.php
create mode 100644 admin/WebConsole/idiomas/php/eng/comandos/enviarmensaje_eng.php
create mode 100644 admin/WebConsole/idiomas/php/eng/descargas_eng.php
create mode 100644 admin/WebConsole/idiomas/php/eng/gestor_ordenadores_eng.php
create mode 100644 admin/WebConsole/idiomas/php/esp/comandos/enviarmensaje_esp.php
create mode 100644 admin/WebConsole/idiomas/php/esp/descargas_esp.php
create mode 100644 admin/WebConsole/idiomas/php/esp/gestor_ordenadores_esp.php
create mode 100644 admin/WebConsole/images/iconos/almacenamiento.png
create mode 100644 admin/WebConsole/images/iconos/arranque.png
delete mode 100644 admin/WebConsole/images/ordenador_BSY.gif
create mode 100644 admin/WebConsole/images/ordenador_BSY.png
delete mode 100644 admin/WebConsole/images/ordenador_INI.gif
create mode 100644 admin/WebConsole/images/ordenador_INI.png
delete mode 100644 admin/WebConsole/images/ordenador_LNX.gif
create mode 100644 admin/WebConsole/images/ordenador_LNX.png
create mode 100644 admin/WebConsole/images/ordenador_LNXS.png
delete mode 100644 admin/WebConsole/images/ordenador_OFF.gif
create mode 100644 admin/WebConsole/images/ordenador_OFF.png
delete mode 100644 admin/WebConsole/images/ordenador_OPG.gif
create mode 100644 admin/WebConsole/images/ordenador_OPG.png
create mode 100644 admin/WebConsole/images/ordenador_OSX.png
delete mode 100644 admin/WebConsole/images/ordenador_W2K.gif
delete mode 100644 admin/WebConsole/images/ordenador_W95.gif
delete mode 100644 admin/WebConsole/images/ordenador_W98.gif
create mode 100644 admin/WebConsole/images/ordenador_WIN.png
create mode 100644 admin/WebConsole/images/ordenador_WINS.png
delete mode 100644 admin/WebConsole/images/ordenador_WML.gif
delete mode 100644 admin/WebConsole/images/ordenador_WXP.gif
create mode 100644 admin/WebConsole/includes/restfunctions.php
delete mode 100644 admin/WebConsole/menus/examplemenu.html
create mode 100644 admin/WebConsole/menus/examplemenu.php
delete mode 100644 admin/WebConsole/menus/menuejemplo.html
create mode 100644 admin/WebConsole/menus/menuejemplo.php
create mode 100644 admin/WebConsole/menus/privatemenu.php
delete mode 100644 admin/WebConsole/principal/boot_pxelinux.php
create mode 100644 admin/WebConsole/rest/common.php
create mode 100644 admin/WebConsole/rest/index.php
create mode 100644 admin/WebConsole/rest/ogagent.php
create mode 100644 admin/WebConsole/rest/opengnsys-api.yml
create mode 100644 admin/WebConsole/rest/remotepc.php
create mode 100644 admin/WebConsole/rest/repository.php
create mode 100644 admin/WebConsole/rest/server.php
create mode 100644 admin/slim-2.6.1.zip
create mode 100644 admin/swagger-ui-2.2.5.zip
create mode 100644 client/boot-tools/includes/etc/initramfs-tools/scripts/VERSION.txt
delete mode 100644 client/boot-tools/includes/usr/bin/boot-tools/listpackages/sw.Zinitrd
delete mode 100644 client/boot-tools/includes/var/cache/apt/archivesOG/busybox-static_1.17.1-10ubuntu1_i386.deb
delete mode 100644 client/boot-tools/includes/var/cache/apt/archivesOG/busybox_1.17.1-10ubuntu1_i386.deb
delete mode 100644 client/boot-tools/includes/var/cache/apt/archivesOG/partclone_0.2.38_i386.deb
delete mode 100755 client/boot-tools/includes/var/cache/apt/archivesOG/partclone_0.2.7-1drbl_i386.deb
delete mode 100755 client/boot-tools/includes/var/cache/apt/archivesOG/partclone_0.2.8_i386.deb
delete mode 100644 client/boot-tools/includes/var/cache/apt/archivesOG/xvesa.deb
create mode 100644 client/browser/digitalclock/digitalclock.cpp
create mode 100644 client/browser/digitalclock/digitalclock.h
create mode 100644 client/browser/digitalclock/digitalclock.pro
create mode 100644 client/browser/po/ca.po
create mode 100644 client/browser/po/en.po
delete mode 100755 client/shared/bin/grub-probe1.99
create mode 100755 client/shared/bin/grub-probe1.99_i686
create mode 100755 client/shared/bin/grub-probe1.99_x86_64
create mode 100644 client/shared/lib/burg/themes/OpenGnsys/background-original.png
create mode 100755 client/shared/lib/burg/themes/OpenGnsys/background.png
create mode 100644 client/shared/lib/burg/themes/OpenGnsys/extended
create mode 100644 client/shared/lib/burg/themes/OpenGnsys/icons/hover_debian.png
create mode 100644 client/shared/lib/burg/themes/OpenGnsys/icons/hover_elementary.png
create mode 100644 client/shared/lib/burg/themes/OpenGnsys/icons/hover_freebsd.png
create mode 100644 client/shared/lib/burg/themes/OpenGnsys/icons/hover_haiku.png
create mode 100644 client/shared/lib/burg/themes/OpenGnsys/icons/hover_linux.png
create mode 100644 client/shared/lib/burg/themes/OpenGnsys/icons/hover_opengnsys.png
create mode 100644 client/shared/lib/burg/themes/OpenGnsys/icons/hover_opensuse.png
create mode 100644 client/shared/lib/burg/themes/OpenGnsys/icons/hover_os.png
create mode 100644 client/shared/lib/burg/themes/OpenGnsys/icons/hover_osx.png
create mode 100644 client/shared/lib/burg/themes/OpenGnsys/icons/hover_recovery.png
create mode 100644 client/shared/lib/burg/themes/OpenGnsys/icons/hover_restart.png
create mode 100644 client/shared/lib/burg/themes/OpenGnsys/icons/hover_shutdown.png
create mode 100644 client/shared/lib/burg/themes/OpenGnsys/icons/hover_ubuntu.png
create mode 100644 client/shared/lib/burg/themes/OpenGnsys/icons/hover_windows.png
create mode 100644 client/shared/lib/burg/themes/OpenGnsys/icons/hover_windows10.png
create mode 100644 client/shared/lib/burg/themes/OpenGnsys/icons/hover_windows7.png
create mode 100644 client/shared/lib/burg/themes/OpenGnsys/icons/hover_windows_metro.png
create mode 100644 client/shared/lib/burg/themes/OpenGnsys/icons/icons
create mode 100644 client/shared/lib/burg/themes/OpenGnsys/icons/normal_debian.png
create mode 100644 client/shared/lib/burg/themes/OpenGnsys/icons/normal_elementary.png
create mode 100644 client/shared/lib/burg/themes/OpenGnsys/icons/normal_freebsd.png
create mode 100644 client/shared/lib/burg/themes/OpenGnsys/icons/normal_haiku.png
create mode 100644 client/shared/lib/burg/themes/OpenGnsys/icons/normal_linux.png
create mode 100644 client/shared/lib/burg/themes/OpenGnsys/icons/normal_opengnsys.png
create mode 100644 client/shared/lib/burg/themes/OpenGnsys/icons/normal_opensuse.png
create mode 100644 client/shared/lib/burg/themes/OpenGnsys/icons/normal_os.png
create mode 100644 client/shared/lib/burg/themes/OpenGnsys/icons/normal_osx.png
create mode 100644 client/shared/lib/burg/themes/OpenGnsys/icons/normal_recovery.png
create mode 100644 client/shared/lib/burg/themes/OpenGnsys/icons/normal_restart.png
create mode 100644 client/shared/lib/burg/themes/OpenGnsys/icons/normal_shutdown.png
create mode 100644 client/shared/lib/burg/themes/OpenGnsys/icons/normal_ubuntu.png
create mode 100644 client/shared/lib/burg/themes/OpenGnsys/icons/normal_windows.png
create mode 100644 client/shared/lib/burg/themes/OpenGnsys/icons/normal_windows10.png
create mode 100644 client/shared/lib/burg/themes/OpenGnsys/icons/normal_windows7.png
create mode 100644 client/shared/lib/burg/themes/OpenGnsys/icons/normal_windows_metro.png
create mode 100644 client/shared/lib/burg/themes/OpenGnsys/images/000-70opaque.png
create mode 100644 client/shared/lib/burg/themes/OpenGnsys/images/button-bg.png
create mode 100644 client/shared/lib/burg/themes/OpenGnsys/images/button-hover-bg.png
create mode 100644 client/shared/lib/burg/themes/OpenGnsys/images/button-hover-l.png
create mode 100644 client/shared/lib/burg/themes/OpenGnsys/images/button-hover-r.png
create mode 100644 client/shared/lib/burg/themes/OpenGnsys/images/button-l.png
create mode 100644 client/shared/lib/burg/themes/OpenGnsys/images/button-r.png
create mode 100644 client/shared/lib/burg/themes/OpenGnsys/images/button-tools-hover.png
create mode 100644 client/shared/lib/burg/themes/OpenGnsys/images/button-tools.png
create mode 100644 client/shared/lib/burg/themes/OpenGnsys/images/container-b.png
create mode 100644 client/shared/lib/burg/themes/OpenGnsys/images/container-bg.png
create mode 100644 client/shared/lib/burg/themes/OpenGnsys/images/container-bl.png
create mode 100644 client/shared/lib/burg/themes/OpenGnsys/images/container-br.png
create mode 100644 client/shared/lib/burg/themes/OpenGnsys/images/container-l.png
create mode 100644 client/shared/lib/burg/themes/OpenGnsys/images/container-r.png
create mode 100644 client/shared/lib/burg/themes/OpenGnsys/images/container-t.png
create mode 100644 client/shared/lib/burg/themes/OpenGnsys/images/container-title-bg.png
create mode 100644 client/shared/lib/burg/themes/OpenGnsys/images/container-title-l.png
create mode 100644 client/shared/lib/burg/themes/OpenGnsys/images/container-title-r.png
create mode 100644 client/shared/lib/burg/themes/OpenGnsys/images/container-title-t.png
create mode 100644 client/shared/lib/burg/themes/OpenGnsys/images/container-title-tl.png
create mode 100644 client/shared/lib/burg/themes/OpenGnsys/images/container-title-tr.png
create mode 100644 client/shared/lib/burg/themes/OpenGnsys/images/container-tl.png
create mode 100644 client/shared/lib/burg/themes/OpenGnsys/images/container-tr.png
create mode 100644 client/shared/lib/burg/themes/OpenGnsys/images/dialog-b.png
create mode 100644 client/shared/lib/burg/themes/OpenGnsys/images/dialog-bg.png
create mode 100644 client/shared/lib/burg/themes/OpenGnsys/images/dialog-bl.png
create mode 100644 client/shared/lib/burg/themes/OpenGnsys/images/dialog-bl.xcf
create mode 100644 client/shared/lib/burg/themes/OpenGnsys/images/dialog-br.png
create mode 100644 client/shared/lib/burg/themes/OpenGnsys/images/dialog-lr.png
create mode 100644 client/shared/lib/burg/themes/OpenGnsys/images/dialog-spacer.png
create mode 100644 client/shared/lib/burg/themes/OpenGnsys/images/dialog-t.png
create mode 100644 client/shared/lib/burg/themes/OpenGnsys/images/dialog-tl.png
create mode 100644 client/shared/lib/burg/themes/OpenGnsys/images/dialog-tr.png
create mode 100644 client/shared/lib/burg/themes/OpenGnsys/images/progressbar-bg-b.png
create mode 100644 client/shared/lib/burg/themes/OpenGnsys/images/progressbar-bg-bl.png
create mode 100644 client/shared/lib/burg/themes/OpenGnsys/images/progressbar-bg-br.png
create mode 100644 client/shared/lib/burg/themes/OpenGnsys/images/progressbar-bg-l.png
create mode 100644 client/shared/lib/burg/themes/OpenGnsys/images/progressbar-bg-r.png
create mode 100644 client/shared/lib/burg/themes/OpenGnsys/images/progressbar-bg-t.png
create mode 100644 client/shared/lib/burg/themes/OpenGnsys/images/progressbar-bg-tl.png
create mode 100644 client/shared/lib/burg/themes/OpenGnsys/images/progressbar-bg-tr.png
create mode 100644 client/shared/lib/burg/themes/OpenGnsys/images/progressbar-bg.png
create mode 100644 client/shared/lib/burg/themes/OpenGnsys/images/text-line-l.png
create mode 100644 client/shared/lib/burg/themes/OpenGnsys/images/text-line-r.png
create mode 100644 client/shared/lib/burg/themes/OpenGnsys/images/tick.png
create mode 100644 client/shared/lib/burg/themes/OpenGnsys/images/txt-about.png
create mode 100644 client/shared/lib/burg/themes/OpenGnsys/images/txt-help.png
create mode 100644 client/shared/lib/burg/themes/OpenGnsys/images/txt-select.png
create mode 100644 client/shared/lib/burg/themes/OpenGnsys/images/txt-tools.png
create mode 100644 client/shared/lib/burg/themes/OpenGnsys/images/ubuntu-glow-96.png
create mode 100644 client/shared/lib/burg/themes/OpenGnsys/menus
create mode 100644 client/shared/lib/burg/themes/OpenGnsys/style
create mode 100644 client/shared/lib/burg/themes/OpenGnsys/theme
create mode 100644 client/shared/lib/locale/ca/LC_MESSAGES/browser.mo
create mode 100644 client/shared/lib/locale/en/LC_MESSAGES/browser.mo
create mode 100755 client/shared/lib/os-probes/10zvol-test
create mode 100755 client/shared/lib/os-probes/50mounted-tests
create mode 100755 client/shared/lib/os-probes/init/10filesystems
create mode 100755 client/shared/lib/os-probes/mounted/05efi
create mode 100755 client/shared/lib/os-probes/mounted/10freedos
create mode 100755 client/shared/lib/os-probes/mounted/10qnx
create mode 100755 client/shared/lib/os-probes/mounted/20macosx
create mode 100755 client/shared/lib/os-probes/mounted/20microsoft
create mode 100755 client/shared/lib/os-probes/mounted/30utility
create mode 100755 client/shared/lib/os-probes/mounted/40lsb
create mode 100755 client/shared/lib/os-probes/mounted/70hurd
create mode 100755 client/shared/lib/os-probes/mounted/80minix
create mode 100755 client/shared/lib/os-probes/mounted/83haiku
create mode 100755 client/shared/lib/os-probes/mounted/90linux-distro
create mode 100755 client/shared/lib/os-probes/mounted/90solaris
create mode 100755 client/shared/lib/os-probes/mounted/efi/10elilo
create mode 100755 client/shared/lib/os-probes/mounted/efi/20microsoft
create mode 100644 client/shared/lib/pictures/oglogo.png
create mode 100755 client/shared/scripts/bootOsCustom.template
create mode 100755 client/shared/scripts/launchOgagentInstaller
create mode 100644 doc/userManual/Tema0-Laboratorio_virtual.pdf
create mode 100755 installer/ogagent-devel-installer.sh
create mode 100644 installer/ogagentpkgs-1.1.0.tar.gz
create mode 100755 installer/opengnsys_export.sh
create mode 100755 installer/opengnsys_import.sh
create mode 100644 installer/vagrant/README.es.txt
create mode 100644 installer/vagrant/Vagrantfile-1.0.6b-vbox
create mode 100644 installer/vagrant/Vagrantfile-boottools-vbox
create mode 100644 installer/vagrant/Vagrantfile-browser-vbox
create mode 100644 installer/vagrant/Vagrantfile-devel-vbox
create mode 100644 installer/vagrant/Vagrantfile-ogagent-vbox
create mode 100644 installer/vagrant/Vagrantfile-trunk-vbox
create mode 100755 repoman/bin/checkrepo
create mode 100755 repoman/bin/createfileimage
create mode 100755 repoman/bin/mountimage
create mode 100755 repoman/bin/partclone2sync
create mode 100755 repoman/bin/reduceimage
create mode 100755 repoman/bin/unmountimage
delete mode 100755 server/bin/createfileimage
create mode 100755 server/bin/installmodule
mode change 100755 => 120000 server/bin/installoglive
create mode 100755 server/bin/listclientlive
delete mode 100755 server/bin/mountimage
create mode 100755 server/bin/ogagentqueue.cron
create mode 100755 server/bin/oglivecli
delete mode 100755 server/bin/partclone2sync
delete mode 100755 server/bin/reduceimage
create mode 100755 server/bin/setclientlive
delete mode 100755 server/bin/unmountimage
create mode 100755 server/lib/security-config
diff --git a/admin/Database/ogAdmBD-1.0.6a-1.0.6b.sql b/admin/Database/ogAdmBD-1.0.6a-1.0.6b.sql
index f5fa8b19..c772ee3e 100644
--- a/admin/Database/ogAdmBD-1.0.6a-1.0.6b.sql
+++ b/admin/Database/ogAdmBD-1.0.6a-1.0.6b.sql
@@ -1,12 +1,12 @@
+### Fichero de actualización de la base de datos.
# OpenGnSys 1.0.6, 1.0.6a - 1.0.6b
#use ogAdmBD
-ALTER TABLE ordenadores
- ADD INDEX idaulaip (idaula ASC, ip ASC);
-
-# Añadir nuevos sistemas de ficheros (ticket #758)
INSERT INTO sistemasficheros (idsistemafichero, nemonico, descripcion) VALUES
(19, 'LINUX-SWAP', 'LINUX-SWAP')
ON DUPLICATE KEY UPDATE
idsistemafichero=VALUES(idsistemafichero), nemonico=VALUES(nemonico), descripcion=VALUES(descripcion);
+ALTER TABLE ordenadores
+ ADD INDEX idaulaip (idaula ASC, ip ASC);
+
diff --git a/admin/Database/ogAdmBD-1.0.6b-1.1.0.sql b/admin/Database/ogAdmBD-1.0.6b-1.1.0.sql
new file mode 100644
index 00000000..6b7ad95e
--- /dev/null
+++ b/admin/Database/ogAdmBD-1.0.6b-1.1.0.sql
@@ -0,0 +1,161 @@
+### Fichero de actualización de la base de datos.
+# OpenGnSys 1.0.6b - OpenGnsys 1.1.0
+#use ogAdmBD
+
+### NOTA: la configuración de MySQL solo puede modificarla el usuario "root".
+# Soportar cláusuloas GROUP BY especiales para configuración de equipos.
+#SET GLOBAL sql_mode = TRIM(BOTH ',' FROM REPLACE(@@sql_mode, 'ONLY_FULL_GROUP_BY', ''));
+# Activar calendario de eventos de MySQL.
+#SET GLOBAL event_scheduler = ON;
+
+# Nuevos tipos de particiones y de sistemas de ficheros (ticket #758).
+INSERT INTO tipospar (codpar, tipopar, clonable) VALUES
+ (CONV('A9',16,10), 'NETBSD', 1),
+ (CONV('2700',16,10), 'WIN-RECOV', 1),
+ (CONV('8302',16,10), 'LINUX', 1),
+ (CONV('A504',16,10), 'FREEBSD', 1),
+ (CONV('A901',16,10), 'NETBSD-SWAP', 0),
+ (CONV('A902',16,10), 'NETBSD', 1),
+ (CONV('A903',16,10), 'NETBSD', 1),
+ (CONV('A904',16,10), 'NETBSD', 1),
+ (CONV('A905',16,10), 'NETBSD', 1),
+ (CONV('A906',16,10), 'NETBSD-RAID', 1),
+ (CONV('AF02',16,10), 'HFS-RAID', 1),
+ (CONV('FB00',16,10), 'VMFS', 1),
+ (CONV('FB01',16,10), 'VMFS-RESERV', 1),
+ (CONV('FB02',16,10), 'VMFS-KRN', 1),
+ (CONV('10000',16,10), 'LVM-LV', 1),
+ (CONV('10010',16,10), 'ZFS-VOL', 1)
+ ON DUPLICATE KEY UPDATE
+ codpar=VALUES(codpar), tipopar=VALUES(tipopar), clonable=VALUES(clonable);
+INSERT INTO sistemasficheros (idsistemafichero, nemonico, descripcion) VALUES
+ (20, 'F2FS', 'F2FS'),
+ (21, 'NILFS2', 'NILFS2')
+ ON DUPLICATE KEY UPDATE
+ idsistemafichero=VALUES(idsistemafichero), nemonico=VALUES(nemonico), descripcion=VALUES(descripcion);
+
+# Eliminar campos sin uso (ticket #730).
+# Añadir campos para aulas: servidor NTP e inclusión en proyecto Remote PC (tickets #725 y #708).
+ALTER TABLE aulas
+ DROP cuadro_x,
+ DROP cuadro_y,
+ ADD ntp VARCHAR(30) AFTER proxy,
+ ADD inremotepc TINYINT DEFAULT 0;
+# Añadir campos para nº de revisión de imágenes y su inclusión en proyecto Remote PC (tickets #737 y #708).
+ALTER TABLE imagenes
+ ADD revision SMALLINT UNSIGNED NOT NULL DEFAULT 0 AFTER nombreca,
+ ADD inremotepc TINYINT DEFAULT 0;
+
+# Adaptar campo para codificar claves de usuarios (ticket #778),
+# eliminar campo sin uso (ticket #730),
+# añadir clave de acceso a la API REST (tickets #708).
+ALTER TABLE usuarios
+ MODIFY pasguor VARCHAR(56) NOT NULL DEFAULT '',
+ ADD apikey VARCHAR(32) NOT NULL DEFAULT '';
+# Preparar generación de clave de acceso a la API REST para el usuario principal (ticket #708).
+UPDATE usuarios
+ SET apikey = 'APIKEY'
+ WHERE idusuario = 1 AND apikey = '';
+# Codificar claves de usuarios (ticket #)
+INSERT INTO usuarios (idusuario, pasguor)
+ SELECT idusuario, pasguor FROM usuarios
+ ON DUPLICATE KEY UPDATE
+ idusuario=VALUES(idusuario), pasguor=SHA2(VALUES(pasguor),224);
+
+# Añadir nº de revisión de imagen restaurada (ticket #737),
+# añadir porcentaje de uso de sistema de ficheros (ticket #711),
+# evitar errores "TEXT NOT NULL" y "NO_ZERO_DATE" (ticket #730).
+ALTER TABLE ordenadores_particiones
+ MODIFY cache TEXT,
+ ADD revision SMALLINT UNSIGNED NOT NULL DEFAULT 0 AFTER idimagen,
+ ADD uso TINYINT NOT NULL DEFAULT 0;
+ALTER TABLE acciones
+ MODIFY restrambito TEXT,
+ MODIFY fechahorareg DATETIME NOT NULL DEFAULT '1970-01-01 00:00:00',
+ MODIFY fechahorafin DATETIME NOT NULL DEFAULT '1970-01-01 00:00:00';
+ALTER TABLE parametros
+ MODIFY descripcion TEXT;
+ALTER TABLE tareas
+ MODIFY restrambito TEXT;
+
+# Actualizar componentes hardware y añadir nº de serie, clave de acceso a API REST de OGAgent y directorio de ogLive(tickets #713, #718 y #768)
+ALTER TABLE tipohardwares
+ DROP pci;
+INSERT INTO tipohardwares (idtipohardware, descripcion, urlimg, nemonico) VALUES
+ (17, 'Chasis del Sistema', '', 'cha'),
+ (18, 'Controladores de almacenamiento', '../images/iconos/almacenamiento.png', 'sto'),
+ (19, 'Tipo de proceso de arranque', '../images/iconos/arranque.png', 'boo');
+ALTER TABLE ordenadores
+ ADD numserie VARCHAR(25) DEFAULT NULL AFTER nombreordenador,
+ ADD agentkey VARCHAR(32) DEFAULT NULL,
+ ADD oglivedir VARCHAR(50) NOT NULL DEFAULT 'ogLive';
+
+# Directorios en repo para distintas UO (ticket #678).
+ALTER TABLE entidades
+ ADD ogunit TINYINT(1) NOT NULL DEFAULT 0;
+ALTER TABLE centros
+ ADD directorio VARCHAR(50) DEFAULT '';
+
+# Incluir campo ID sistema operativo en el perfil de software (tickets #738 #713)
+ALTER TABLE perfilessoft
+ ADD idnombreso SMALLINT UNSIGNED AFTER idperfilsoft;
+
+# Añadir campo y generar clave de acceso a la API REST del repositorio (ticket #743).
+ALTER TABLE repositorios
+ ADD apikey VARCHAR(32) NOT NULL DEFAULT '';
+UPDATE repositorios
+ SET apikey = 'REPOKEY'
+ WHERE idrepositorio = 1 AND apikey = '';
+
+# Número de puestos del aula permite valores hasta 32768 (ticket #747)
+ALTER TABLE aulas
+ MODIFY puestos smallint DEFAULT NULL;
+
+# Nuevas tablas para datos del proyecto Remote PC y operaciones de OGAgent (ticket #708).
+CREATE TABLE IF NOT EXISTS remotepc (
+ id INT(11) NOT NULL,
+ reserved DATETIME DEFAULT NULL,
+ urllogin VARCHAR(100),
+ urllogout VARCHAR(100),
+ PRIMARY KEY (id)
+ ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+CREATE TABLE IF NOT EXISTS ogagent_queue (
+ id INT(11) NOT NULL AUTO_INCREMENT,
+ clientid INT(11) NOT NULL,
+ exectime DATETIME DEFAULT NULL,
+ operation VARCHAR(25),
+ PRIMARY KEY (id)
+ ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+
+# Nuevo comando "Enviar mensaje" (ticket #779)
+INSERT INTO comandos (idcomando, descripcion, pagina, gestor, funcion, urlimg,
+ aplicambito, visuparametros, parametros, comentarios, activo, submenu) VALUES
+ (16, 'Enviar mensaje', '../comandos/EnviarMensaje.php', '../comandos/gestores/gestor_Comandos.php', 'EnviarMensaje', '',
+ 31, 'tit;msj', 'nfn;iph;tit;msj', '', 1, '' );
+INSERT INTO parametros (idparametro, nemonico, descripcion, nomidentificador, nomtabla, nomliteral, tipopa, visual) VALUES
+ (39, 'tit', 'Título', '', '', '', 0, 1),
+ (40, 'msj', 'Contenido', '', '', '', 0, 1);
+
+# Crear tabla de log para la cola de acciones (ticket #782)
+CREATE TABLE IF NOT EXISTS acciones_log LIKE acciones;
+ALTER TABLE acciones_log ADD fecha_borrado DATETIME;
+DELIMITER //
+CREATE TRIGGER registrar_acciones BEFORE DELETE ON acciones FOR EACH ROW BEGIN
+ INSERT INTO acciones_log VALUES
+ (OLD.idaccion, OLD.tipoaccion, OLD.idtipoaccion, OLD.descriaccion,
+ OLD.idordenador, OLD.ip, OLD.sesion, OLD.idcomando, OLD.parametros,
+ OLD.fechahorareg, OLD.fechahorafin, OLD.estado, OLD.resultado,
+ OLD.descrinotificacion, OLD.ambito, OLD.idambito, OLD.restrambito,
+ OLD.idprocedimiento, OLD.idtarea, OLD.idcentro, OLD.idprogramacion, NOW());
+END//
+DELIMITER ;
+
+# Ampliar programación de tareas hasta 2025 (ticket #732).
+ALTER TABLE programaciones
+ MODIFY annos SMALLINT DEFAULT NULL,
+ MODIFY meses SMALLINT DEFAULT NULL;
+
+# Eliminar tabla sin uso (ticket #730).
+DROP TABLE IF EXISTS campus;
+
diff --git a/admin/Database/ogAdmBD-1.0.6b-postinst.sql b/admin/Database/ogAdmBD-1.0.6b-postinst.sql
deleted file mode 100644
index 81cb77ab..00000000
--- a/admin/Database/ogAdmBD-1.0.6b-postinst.sql
+++ /dev/null
@@ -1,41 +0,0 @@
-### Procedimiento para actualización de la base de datos.
-# Postinstalación de OpenGnSys 1.0.5+
-#use ogAdmBD
-
-# Nota: retocar el fichero para sustituir KERNELVERSION por la versión del
-# Kernel del cliente ogLive con el formato V.RR (V=versión, RR=revisión).
-
-# Cambiar parámetro de resolución de pantalla para Kernel anteriores a 3.7.
-UPDATE menus
- SET resolucion = CASE resolucion
- WHEN 'uvesafb:1152x864-16' THEN '355'
- WHEN 'uvesafb:800x600-16' THEN '788'
- WHEN 'uvesafb:800x600-24' THEN '789'
- WHEN 'uvesafb:1024x768-16' THEN '791'
- WHEN 'uvesafb:1024x768-24' THEN '792'
- WHEN 'uvesafb:1280x1024-16' THEN '794'
- WHEN 'uvesafb:1280x1024-24' THEN '795'
- WHEN 'uvesafb:1600x1200-16' THEN '798'
- WHEN 'uvesafb:1600x1200-24' THEN '799'
- WHEN NULL or '0' THEN '788'
- ELSE resolucion
- END
- WHERE KERNELVERSION < 3.07;
-
-# Cambiar parámetro de resolución de pantalla para Kernel 3.7 o superior.
-UPDATE menus
- SET resolucion = CASE resolucion
- WHEN '355' THEN 'uvesafb:1152x864-16'
- WHEN '788' THEN 'uvesafb:800x600-16'
- WHEN '789' THEN 'uvesafb:800x600-24'
- WHEN '791' THEN 'uvesafb:1024x768-16'
- WHEN '792' THEN 'uvesafb:1024x768-24'
- WHEN '794' THEN 'uvesafb:1280x1024-16'
- WHEN '795' THEN 'uvesafb:1280x1024-24'
- WHEN '798' THEN 'uvesafb:1600x1200-16'
- WHEN '799' THEN 'uvesafb:1600x1200-24'
- WHEN NULL or '0' THEN 'uvesafb:800x600-16'
- ELSE resolucion
- END
- WHERE KERNELVERSION >= 3.07;
-
diff --git a/admin/Database/ogAdmBD-1.1.0-postinst.sql b/admin/Database/ogAdmBD-1.1.0-postinst.sql
new file mode 100644
index 00000000..7ebbfd14
--- /dev/null
+++ b/admin/Database/ogAdmBD-1.1.0-postinst.sql
@@ -0,0 +1,49 @@
+### Procedimiento para actualización de la base de datos.
+# Postinstalación de OpenGnsys 1.1.0
+#use ogAdmBD
+
+# Nota: retocar el fichero para sustituir KERNELVERSION por la versión del
+# Kernel del cliente ogLive con el formato V.RR (V=versión, RR=revisión).
+
+# Cambiar parámetro de resolución de pantalla para Kernel anteriores a 3.7.
+UPDATE menus
+ SET resolucion = CASE resolucion
+ WHEN 'uvesafb:1152x864-16' THEN '355'
+ WHEN 'uvesafb:800x600-16' THEN '788'
+ WHEN 'uvesafb:800x600-24' THEN '789'
+ WHEN 'uvesafb:800x600-32' THEN '814'
+ WHEN 'uvesafb:1024x768-16' THEN '791'
+ WHEN 'uvesafb:1024x768-24' THEN '792'
+ WHEN 'uvesafb:1024x768-32' THEN '824'
+ WHEN 'uvesafb:1280x1024-16' THEN '794'
+ WHEN 'uvesafb:1280x1024-24' THEN '795'
+ WHEN 'uvesafb:1280x1024-32' THEN '829'
+ WHEN 'uvesafb:1600x1200-16' THEN '798'
+ WHEN 'uvesafb:1600x1200-24' THEN '799'
+ WHEN 'uvesafb:1600x1200-32' THEN '834'
+ WHEN NULL or '0' THEN '788'
+ ELSE resolucion
+ END
+ WHERE KERNELVERSION < 3.07;
+
+# Cambiar parámetro de resolución de pantalla para Kernel 3.7 o superior.
+UPDATE menus
+ SET resolucion = CASE resolucion
+ WHEN '355' THEN 'uvesafb:1152x864-16'
+ WHEN '788' THEN 'uvesafb:800x600-16'
+ WHEN '789' THEN 'uvesafb:800x600-24'
+ WHEN '791' THEN 'uvesafb:1024x768-16'
+ WHEN '792' THEN 'uvesafb:1024x768-24'
+ WHEN '794' THEN 'uvesafb:1280x1024-16'
+ WHEN '795' THEN 'uvesafb:1280x1024-24'
+ WHEN '798' THEN 'uvesafb:1600x1200-16'
+ WHEN '799' THEN 'uvesafb:1600x1200-24'
+ WHEN '814' THEN 'uvesafb:800x600-32'
+ WHEN '824' THEN 'uvesafb:1024x768-32'
+ WHEN '829' THEN 'uvesafb:1280x1024-32'
+ WHEN '834' THEN 'uvesafb:1600x1200-32'
+ WHEN NULL or '0' THEN 'uvesafb:800x600-16'
+ ELSE resolucion
+ END
+ WHERE KERNELVERSION >= 3.07;
+
diff --git a/admin/Database/ogAdmBD-1.1.0pre-1.1.0.sql b/admin/Database/ogAdmBD-1.1.0pre-1.1.0.sql
new file mode 100644
index 00000000..ed296e44
--- /dev/null
+++ b/admin/Database/ogAdmBD-1.1.0pre-1.1.0.sql
@@ -0,0 +1,270 @@
+### Fichero de actualización de la base de datos.
+# OpenGnsys 1.1.0pre - 1.1.0
+#use ogAdmBD
+
+### NOTA: la configuración de MySQL solo puede modificarla el usuario "root".
+# Soportar cláusuloas GROUP BY especiales para configuración de equipos.
+#SET GLOBAL sql_mode = TRIM(BOTH ',' FROM REPLACE(@@sql_mode, 'ONLY_FULL_GROUP_BY', ''));
+# Activar calendario de eventos de MySQL.
+#SET GLOBAL event_scheduler = ON;
+
+# Eliminar procedimiento y disparador para evitar errores de ejecución.
+DROP PROCEDURE IF EXISTS addcols;
+DROP TRIGGER IF EXISTS registrar_acciones;
+# Procedimiento para actualización condicional de tablas.
+DELIMITER '//'
+CREATE PROCEDURE addcols() BEGIN
+ # Añadir campo para incluir aulas en proyecto Remote PC (ticket #708).
+ IF NOT EXISTS (SELECT * FROM information_schema.COLUMNS
+ WHERE COLUMN_NAME='inremotepc' AND TABLE_NAME='aulas' AND TABLE_SCHEMA=DATABASE())
+ THEN
+ ALTER TABLE aulas
+ ADD inremotepc TINYINT DEFAULT 0;
+ END IF;
+ # Añadir campo para incluir imágenes en proyecto Remote PC (ticket #708).
+ IF NOT EXISTS (SELECT * FROM information_schema.COLUMNS
+ WHERE COLUMN_NAME='inremotepc' AND TABLE_NAME='imagenes' AND TABLE_SCHEMA=DATABASE())
+ THEN
+ ALTER TABLE imagenes
+ ADD inremotepc TINYINT DEFAULT 0;
+ END IF;
+ # Añadir campo para clave de acceso a la API REST (ticket #708).
+ IF NOT EXISTS (SELECT * FROM information_schema.COLUMNS
+ WHERE COLUMN_NAME='apikey' AND TABLE_NAME='usuarios' AND TABLE_SCHEMA=DATABASE())
+ THEN
+ ALTER TABLE usuarios
+ ADD apikey VARCHAR(32) NOT NULL DEFAULT '';
+ END IF;
+ # Añadir porcentaje de uso de sistema de ficheros (ticket #711)
+ IF NOT EXISTS (SELECT * FROM information_schema.COLUMNS
+ WHERE COLUMN_NAME='uso' AND TABLE_NAME='ordenadores_particiones' AND TABLE_SCHEMA=DATABASE())
+ THEN
+ ALTER TABLE ordenadores_particiones
+ ADD uso TINYINT NOT NULL DEFAULT 0;
+ END IF;
+ # Añadir nº de serie (ticket #713)
+ IF NOT EXISTS (SELECT * FROM information_schema.COLUMNS
+ WHERE COLUMN_NAME='numserie' AND TABLE_NAME='ordenadores' AND TABLE_SCHEMA=DATABASE())
+ THEN
+ ALTER TABLE ordenadores
+ ADD numserie varchar(25) DEFAULT NULL AFTER nombreordenador;
+ END IF;
+ # Añadir campo para clave de acceso a la API REST de OGAgent (ticket #718).
+ IF NOT EXISTS (SELECT * FROM information_schema.COLUMNS
+ WHERE COLUMN_NAME='agentkey' AND TABLE_NAME='ordenadores' AND TABLE_SCHEMA=DATABASE())
+ THEN
+ ALTER TABLE ordenadores
+ ADD agentkey VARCHAR(32) DEFAULT NULL;
+ END IF;
+ # Añadir índice para mostrar correctamente el formulario de estado.
+ IF NOT EXISTS (SELECT * FROM information_schema.STATISTICS
+ WHERE INDEX_NAME='idaulaip' AND TABLE_NAME='ordenadores' AND TABLE_SCHEMA=DATABASE())
+ THEN
+ ALTER TABLE ordenadores
+ ADD KEY idaulaip (idaula ASC, ip ASC);
+ END IF;
+ # Añadir campo para directorio de ogLive asociado al cliente (ticket #768).
+ IF NOT EXISTS (SELECT * FROM information_schema.COLUMNS
+ WHERE COLUMN_NAME='oglivedir' AND TABLE_NAME='ordenadores' AND TABLE_SCHEMA=DATABASE())
+ THEN
+ ALTER TABLE ordenadores
+ ADD oglivedir VARCHAR(50) NOT NULL DEFAULT 'ogLive';
+ END IF;
+ # Añadir campo para directorio de ogLive asociado al cliente (ticket #768).
+ IF NOT EXISTS (SELECT * FROM information_schema.COLUMNS
+ WHERE COLUMN_NAME='oglivedir' AND TABLE_NAME='aulas' AND TABLE_SCHEMA=DATABASE())
+ THEN
+ ALTER TABLE aulas
+ ADD oglivedir VARCHAR(50) NOT NULL DEFAULT 'ogLive';
+ END IF;
+ # Eliminar campos sin uso en aulas (ticket #730).
+ IF EXISTS (SELECT * FROM information_schema.COLUMNS
+ WHERE COLUMN_NAME='cuadro_x' AND TABLE_NAME='aulas' AND TABLE_SCHEMA=DATABASE())
+ THEN
+ ALTER TABLE aulas
+ DROP cuadro_x,
+ DROP cuadro_y;
+ END IF;
+ # Eliminar campos no usado en inventario de hardware (ticket #713).
+ IF EXISTS (SELECT * FROM information_schema.COLUMNS
+ WHERE COLUMN_NAME='pci' AND TABLE_NAME='tipohardwares' AND TABLE_SCHEMA=DATABASE())
+ THEN
+ ALTER TABLE tipohardwares
+ DROP pci;
+ END IF;
+ # Añadir servidor de sincronización horaria NTP (ticket #725).
+ IF NOT EXISTS (SELECT * FROM information_schema.COLUMNS
+ WHERE COLUMN_NAME='ntp' AND TABLE_NAME='aulas' AND TABLE_SCHEMA=DATABASE())
+ THEN
+ ALTER TABLE aulas
+ ADD ntp VARCHAR(30) AFTER proxy;
+ END IF;
+ # Directorios en repo para distintas UO (ticket #678).
+ IF NOT EXISTS (SELECT * FROM information_schema.COLUMNS
+ WHERE COLUMN_NAME='ogunit' AND TABLE_NAME='entidades' AND TABLE_SCHEMA=DATABASE())
+ THEN
+ ALTER TABLE entidades
+ ADD ogunit TINYINT(1) NOT NULL DEFAULT 0;
+ END IF;
+ IF NOT EXISTS (SELECT * FROM information_schema.COLUMNS
+ WHERE COLUMN_NAME='directorio' AND TABLE_NAME='centros' AND TABLE_SCHEMA=DATABASE())
+ THEN
+ ALTER TABLE centros
+ ADD directorio VARCHAR(50) DEFAULT '';
+ END IF;
+ # Nº de revisión de imagen (ticket #737).
+ IF NOT EXISTS (SELECT * FROM information_schema.COLUMNS
+ WHERE COLUMN_NAME='revision' AND TABLE_NAME='imagenes' AND TABLE_SCHEMA=DATABASE())
+ THEN
+ ALTER TABLE imagenes
+ ADD revision SMALLINT UNSIGNED NOT NULL DEFAULT 0 AFTER nombreca;
+ END IF;
+ IF NOT EXISTS (SELECT * FROM information_schema.COLUMNS
+ WHERE COLUMN_NAME='revision' AND TABLE_NAME='ordenadores_particiones' AND TABLE_SCHEMA=DATABASE())
+ THEN
+ ALTER TABLE ordenadores_particiones
+ ADD revision SMALLINT UNSIGNED NOT NULL DEFAULT 0 AFTER idimagen;
+ END IF;
+ # Incluir campo sistema operativo en el perfil de software (tickets #738 #713)
+ IF NOT EXISTS (SELECT * FROM information_schema.COLUMNS
+ WHERE COLUMN_NAME='idnombreso' AND TABLE_NAME='perfilessoft' AND TABLE_SCHEMA=DATABASE())
+ THEN
+ ALTER TABLE perfilessoft
+ ADD idnombreso SMALLINT UNSIGNED AFTER idperfilsoft;
+ END IF;
+ # Añadir campo para clave de acceso a la API REST del repositorio (ticket #743).
+ IF NOT EXISTS (SELECT * FROM information_schema.COLUMNS
+ WHERE COLUMN_NAME='apikey' AND TABLE_NAME='repositorios' AND TABLE_SCHEMA=DATABASE())
+ THEN
+ ALTER TABLE repositorios
+ ADD apikey VARCHAR(32) NOT NULL DEFAULT '';
+ END IF;
+ # Codificar claves de los usuarios, si fuese necesario (ticket #778)
+ IF ((SELECT CHARACTER_MAXIMUM_LENGTH FROM information_schema.COLUMNS
+ WHERE COLUMN_NAME='pasguor' AND TABLE_NAME='usuarios' AND TABLE_SCHEMA=DATABASE()) != 56)
+ THEN
+ ALTER TABLE usuarios
+ MODIFY pasguor VARCHAR(56) NOT NULL DEFAULT '';
+ INSERT INTO usuarios (idusuario, pasguor)
+ SELECT idusuario, pasguor FROM usuarios
+ ON DUPLICATE KEY UPDATE
+ pasguor=SHA2(VALUES(pasguor),224);
+ END IF;
+ # Crear tabla de log para la cola de acciones (ticket #782)
+ IF NOT EXISTS (SELECT * FROM information_schema.COLUMNS
+ WHERE TABLE_NAME='acciones_log' AND TABLE_SCHEMA=DATABASE())
+ THEN
+ CREATE TABLE acciones_log LIKE acciones;
+ ALTER TABLE acciones_log ADD fecha_borrado DATETIME;
+ END IF;
+END//
+# Disparador para mover acciones borradas a la tabla de registro de acciones.
+CREATE TRIGGER registrar_acciones BEFORE DELETE ON acciones FOR EACH ROW
+BEGIN
+ INSERT INTO acciones_log VALUES
+ (OLD.idaccion, OLD.tipoaccion, OLD.idtipoaccion, OLD.descriaccion,
+ OLD.idordenador, OLD.ip, OLD.sesion, OLD.idcomando, OLD.parametros,
+ OLD.fechahorareg, OLD.fechahorafin, OLD.estado, OLD.resultado,
+ OLD.descrinotificacion, OLD.ambito, OLD.idambito, OLD.restrambito,
+ OLD.idprocedimiento, OLD.idtarea, OLD.idcentro, OLD.idprogramacion,
+ NOW());
+END//
+# Ejecutar actualización condicional.
+DELIMITER ';'
+CALL addcols();
+DROP PROCEDURE addcols;
+
+# Nuevos tipos de particiones y de sistemas de ficheros.
+INSERT INTO tipospar (codpar, tipopar, clonable) VALUES
+ (CONV('A9',16,10), 'NETBSD', 1),
+ (CONV('2700',16,10), 'WIN-RECOV', 1),
+ (CONV('8302',16,10), 'LINUX', 1),
+ (CONV('A504',16,10), 'FREEBSD', 1),
+ (CONV('A901',16,10), 'NETBSD-SWAP', 0),
+ (CONV('A902',16,10), 'NETBSD', 1),
+ (CONV('A903',16,10), 'NETBSD', 1),
+ (CONV('A904',16,10), 'NETBSD', 1),
+ (CONV('A905',16,10), 'NETBSD', 1),
+ (CONV('A906',16,10), 'NETBSD-RAID', 1),
+ (CONV('AF02',16,10), 'HFS-RAID', 1),
+ (CONV('FB00',16,10), 'VMFS', 1),
+ (CONV('FB01',16,10), 'VMFS-RESERV', 1),
+ (CONV('FB02',16,10), 'VMFS-KRN', 1),
+ (CONV('10000',16,10), 'LVM-LV', 1),
+ (CONV('10010',16,10), 'ZFS-VOL', 1)
+ ON DUPLICATE KEY UPDATE
+ codpar=VALUES(codpar), tipopar=VALUES(tipopar), clonable=VALUES(clonable);
+INSERT INTO sistemasficheros (idsistemafichero, nemonico, descripcion) VALUES
+ (19, 'LINUX-SWAP', 'LINUX-SWAP'),
+ (20, 'F2FS', 'F2FS'),
+ (21, 'NILFS2', 'NILFS2')
+ ON DUPLICATE KEY UPDATE
+ idsistemafichero=VALUES(idsistemafichero), nemonico=VALUES(nemonico), descripcion=VALUES(descripcion);
+
+
+# Preparar generación de claves de acceso a la API REST para el usuario principal y a la del repositorio principal (tickets #708 y #743).
+UPDATE usuarios
+ SET apikey = 'APIKEY'
+ WHERE idusuario = 1 AND apikey = '';
+UPDATE repositorios
+ SET apikey = 'REPOKEY'
+ WHERE idrepositorio = 1 AND apikey = '';
+
+# Nuevos componentes hardware (ticket #713)
+INSERT INTO tipohardwares (idtipohardware, descripcion, urlimg, nemonico) VALUES
+ (17, 'Chasis del Sistema', '', 'cha'),
+ (18, 'Controladores de almacenamiento', '../images/iconos/almacenamiento.png', 'sto'),
+ (19, 'Tipo de proceso de arranque', '../images/iconos/arranque.png', 'boo')
+ ON DUPLICATE KEY UPDATE
+ descripcion=VALUES(descripcion), urlimg=VALUES(urlimg), nemonico=VALUES(nemonico);
+
+# Número de puestos del aula permite valores hasta 32768 (ticket #747)
+ALTER TABLE aulas
+ MODIFY puestos SMALLINT DEFAULT NULL;
+
+# Nuevas tablas para datos del proyecto Remote PC y operaciones de OGAgent (ticket #708).
+DROP TABLE IF EXISTS remotepc;
+CREATE TABLE remotepc (
+ id INT(11) NOT NULL,
+ reserved DATETIME DEFAULT NULL,
+ urllogin VARCHAR(100),
+ urllogout VARCHAR(100),
+ language VARCHAR(5),
+ PRIMARY KEY (id)
+ ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+DROP TABLE IF EXISTS ogagent_queue;
+CREATE TABLE ogagent_queue (
+ id INT(11) NOT NULL AUTO_INCREMENT,
+ clientid INT(11) NOT NULL,
+ exectime DATETIME DEFAULT NULL,
+ operation VARCHAR(25),
+ PRIMARY KEY (id)
+ ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+# Nuevo comando "Enviar mensaje" (ticket #779)
+INSERT INTO comandos (idcomando, descripcion, pagina, gestor, funcion, urlimg,
+ aplicambito, visuparametros, parametros, comentarios, activo, submenu) VALUES
+ (16, 'Enviar mensaje', '../comandos/EnviarMensaje.php', '../comandos/gestores/gestor_Comandos.php', 'EnviarMensaje', '', 31, '', '', '', 1, '' )
+ ON DUPLICATE KEY UPDATE
+ descripcion=VALUES(descripcion), pagina=VALUES(pagina),
+ gestor=VALUES(gestor), funcion=VALUES(funcion),
+ aplicambito=VALUES(aplicambito), activo=VALUES(activo);
+INSERT INTO parametros (idparametro, nemonico, descripcion, nomidentificador, nomtabla, nomliteral, tipopa, visual) VALUES
+ (39, 'tit', 'Título', '', '', '', 0, 1),
+ (40, 'msj', 'Contenido', '', '', '', 0, 1)
+ ON DUPLICATE KEY UPDATE
+ nemonico=VALUES(nemonico), descripcion=VALUES(descripcion),
+ tipopa=VALUES(tipopa), visual=VALUES(visual);
+
+# Evitar error de MySQL con modo NO_ZERO_DATE (ticket #730).
+ALTER TABLE acciones
+ MODIFY fechahorareg DATETIME NOT NULL DEFAULT '1970-01-01 00:00:00',
+ MODIFY fechahorafin DATETIME NOT NULL DEFAULT '1970-01-01 00:00:00';
+
+# Ampliar programación de tareas hasta 2025 (ticket #732).
+ALTER TABLE programaciones
+ MODIFY annos SMALLINT DEFAULT NULL;
+
+# Eliminar tabla sin uso (ticket #730).
+DROP TABLE IF EXISTS campus;
+
diff --git a/admin/Database/ogAdmBD.sql b/admin/Database/ogAdmBD.sql
index 06ca3e08..c126f63c 100644
--- a/admin/Database/ogAdmBD.sql
+++ b/admin/Database/ogAdmBD.sql
@@ -1,6 +1,8 @@
-- Fichero de instalación de la base de datos.
-SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
+SET sql_mode = "NO_AUTO_VALUE_ON_ZERO";
+SET GLOBAL sql_mode = TRIM(BOTH ',' FROM REPLACE(@@sql_mode, 'ONLY_FULL_GROUP_BY', ''));
+SET GLOBAL event_scheduler = ON;
--
-- Base de datos: `ogAdmBD`
@@ -12,24 +14,25 @@ SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO";
-- Estructura de tabla para la tabla `acciones`
--
-CREATE TABLE IF NOT EXISTS `acciones` (
+DROP TABLE IF EXISTS `acciones`;
+CREATE TABLE `acciones` (
`idaccion` int(11) NOT NULL AUTO_INCREMENT,
- `tipoaccion` smallint(6) NOT NULL,
- `idtipoaccion` int(11) NOT NULL,
- `descriaccion` varchar(250) NOT NULL,
- `idordenador` int(11) NOT NULL,
- `ip` varchar(50) NOT NULL,
- `sesion` int(11) NOT NULL,
- `idcomando` int(11) NOT NULL,
+ `tipoaccion` smallint(6) NOT NULL DEFAULT '0',
+ `idtipoaccion` int(11) NOT NULL DEFAULT '0',
+ `descriaccion` varchar(250) NOT NULL DEFAULT '',
+ `idordenador` int(11) NOT NULL DEFAULT '0',
+ `ip` varchar(50) NOT NULL DEFAULT '',
+ `sesion` int(11) NOT NULL DEFAULT '0',
+ `idcomando` int(11) NOT NULL DEFAULT '0',
`parametros` text,
- `fechahorareg` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
- `fechahorafin` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
+ `fechahorareg` datetime NOT NULL DEFAULT '1970-01-01 00:00:00',
+ `fechahorafin` datetime NOT NULL DEFAULT '1970-01-01 00:00:00',
`estado` tinyint(1) NOT NULL DEFAULT '0',
`resultado` tinyint(1) NOT NULL DEFAULT '0',
`descrinotificacion` varchar(256) DEFAULT NULL,
`ambito` smallint(6) NOT NULL DEFAULT '0',
`idambito` int(11) NOT NULL DEFAULT '0',
- `restrambito` text NOT NULL,
+ `restrambito` text,
`idprocedimiento` int(11) NOT NULL DEFAULT '0',
`idtarea` int(11) NOT NULL DEFAULT '0',
`idcentro` int(11) NOT NULL DEFAULT '0',
@@ -43,11 +46,33 @@ CREATE TABLE IF NOT EXISTS `acciones` (
-- --------------------------------------------------------
+--
+-- Estructura de tabla para la tabla `acciones_log`
+--
+
+DROP TABLE IF EXISTS `acciones_log`;
+CREATE TABLE acciones_log LIKE acciones;
+ALTER TABLE acciones_log ADD fecha_borrado DATETIME;
+DELIMITER //
+-- Trigger para guardar acciones antes de ser borradas.
+CREATE TRIGGER registrar_acciones BEFORE DELETE ON acciones FOR EACH ROW BEGIN
+ INSERT INTO acciones_log VALUES
+ (OLD.idaccion, OLD.tipoaccion, OLD.idtipoaccion, OLD.descriaccion,
+ OLD.idordenador, OLD.ip, OLD.sesion, OLD.idcomando, OLD.parametros,
+ OLD.fechahorareg, OLD.fechahorafin, OLD.estado, OLD.resultado,
+ OLD.descrinotificacion, OLD.ambito, OLD.idambito, OLD.restrambito,
+ OLD.idprocedimiento, OLD.idtarea, OLD.idcentro, OLD.idprogramacion, NOW());
+END//
+DELIMITER ;
+
+-- --------------------------------------------------------
+
--
-- Estructura de tabla para la tabla `acciones_menus`
--
-CREATE TABLE IF NOT EXISTS `acciones_menus` (
+DROP TABLE IF EXISTS `acciones_menus`;
+CREATE TABLE `acciones_menus` (
`idaccionmenu` int(11) NOT NULL AUTO_INCREMENT,
`tipoaccion` tinyint(4) NOT NULL DEFAULT '0',
`idtipoaccion` int(11) NOT NULL DEFAULT '0',
@@ -65,7 +90,8 @@ CREATE TABLE IF NOT EXISTS `acciones_menus` (
-- Estructura de tabla para la tabla `administradores_centros`
--
-CREATE TABLE IF NOT EXISTS `administradores_centros` (
+DROP TABLE IF EXISTS `administradores_centros`;
+CREATE TABLE `administradores_centros` (
`idadministradorcentro` int(11) NOT NULL AUTO_INCREMENT,
`idusuario` int(11) NOT NULL DEFAULT '0',
`idcentro` int(11) NOT NULL DEFAULT '0',
@@ -81,34 +107,36 @@ INSERT INTO `administradores_centros` (`idadministradorcentro`, `idusuario`, `id
-- Estructura de tabla para la tabla `aulas`
--
-CREATE TABLE IF NOT EXISTS `aulas` (
+DROP TABLE IF EXISTS `aulas`;
+CREATE TABLE `aulas` (
`idaula` int(11) NOT NULL AUTO_INCREMENT,
`nombreaula` varchar(100) NOT NULL DEFAULT '',
`idcentro` int(11) NOT NULL DEFAULT '0',
`urlfoto` varchar(250) DEFAULT NULL,
- `cuadro_y` char(3) DEFAULT NULL,
- `cuadro_x` char(3) DEFAULT NULL,
`cagnon` tinyint(1) DEFAULT NULL,
`pizarra` tinyint(1) DEFAULT NULL,
`grupoid` int(11) DEFAULT NULL,
`ubicacion` varchar(255) DEFAULT NULL,
`comentarios` text,
- `puestos` tinyint(4) DEFAULT NULL,
+ `puestos` smallint DEFAULT NULL,
`horaresevini` tinyint(4) DEFAULT NULL,
`horaresevfin` tinyint(4) DEFAULT NULL,
- `modomul` tinyint(4) NOT NULL,
- `ipmul` varchar(16) NOT NULL,
- `pormul` int(11) NOT NULL,
+ `modomul` tinyint(4) NOT NULL DEFAULT '0',
+ `ipmul` varchar(16) NOT NULL DEFAULT '',
+ `pormul` int(11) NOT NULL DEFAULT '0',
`velmul` smallint(6) NOT NULL DEFAULT '70',
`router` varchar( 30 ),
`netmask` varchar( 30 ),
`dns` varchar (30),
`proxy` varchar (30),
+ `ntp` varchar (30),
`modp2p` enum('seeder','peer','leecher') DEFAULT 'peer',
`timep2p` int(11) NOT NULL DEFAULT '60',
`validacion` tinyint(1) DEFAULT '0',
`paginalogin` varchar(100),
`paginavalidacion` varchar(100),
+ `inremotepc` tinyint DEFAULT '0',
+ `oglivedir` varchar(50) NOT NULL DEFAULT 'ogLive',
PRIMARY KEY (`idaula`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
@@ -117,18 +145,19 @@ CREATE TABLE IF NOT EXISTS `aulas` (
-- Estructura de tabla para la tabla `asistentes`
--
-CREATE TABLE IF NOT EXISTS `asistentes` (
+DROP TABLE IF EXISTS `asistentes`;
+CREATE TABLE `asistentes` (
`idcomando` int(11) NOT NULL AUTO_INCREMENT,
`descripcion` varchar(250) NOT NULL DEFAULT '',
- `pagina` varchar(256) NOT NULL,
- `gestor` varchar(256) NOT NULL,
- `funcion` varchar(64) NOT NULL,
+ `pagina` varchar(256) NOT NULL DEFAULT '',
+ `gestor` varchar(256) NOT NULL DEFAULT '',
+ `funcion` varchar(64) NOT NULL DEFAULT '',
`urlimg` varchar(250) DEFAULT NULL,
`aplicambito` tinyint(4) DEFAULT NULL,
`visuparametros` varchar(250) DEFAULT NULL,
`parametros` varchar(250) DEFAULT NULL,
`comentarios` text,
- `activo` tinyint(1) NOT NULL,
+ `activo` tinyint(1) NOT NULL DEFAULT '0',
PRIMARY KEY ( `idcomando` , `descripcion` )
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=11 ;
@@ -141,39 +170,19 @@ INSERT INTO `asistentes` (`idcomando`, `descripcion`, `pagina`, `gestor`, `funci
('8', 'Asistente Particionado', '../asistentes/AsistenteParticionado.php', '../asistentes/gestores/gestor_Comandos.php', 'EjecutarScript', ' ', '31', 'iph;tis;dcr;dsp', 'nfn;iph;tis;dcr;scp', ' ', '1');
-
--- --------------------------------------------------------
-
---
--- Estructura de tabla para la tabla `campus`
---
-
-CREATE TABLE IF NOT EXISTS `campus` (
- `idcampus` int(11) NOT NULL AUTO_INCREMENT,
- `nombrecampus` varchar(100) NOT NULL DEFAULT '',
- `iduniversidad` int(11) DEFAULT NULL,
- `urlmapa` varchar(255) DEFAULT NULL,
- `cuadro_y` tinyint(3) DEFAULT NULL,
- `cuadro_x` tinyint(3) DEFAULT NULL,
- PRIMARY KEY (`idcampus`)
-) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
-
---
--- Volcar la base de datos para la tabla `campus`
---
-
-
-- --------------------------------------------------------
--
-- Estructura de tabla para la tabla `centros`
--
-CREATE TABLE IF NOT EXISTS `centros` (
+DROP TABLE IF EXISTS `centros`;
+CREATE TABLE `centros` (
`idcentro` int(11) NOT NULL AUTO_INCREMENT,
`nombrecentro` varchar(100) NOT NULL DEFAULT '',
`identidad` int(11) DEFAULT NULL,
`comentarios` text,
+ `directorio` varchar(50) DEFAULT '',
PRIMARY KEY (`idcentro`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
@@ -182,7 +191,7 @@ CREATE TABLE IF NOT EXISTS `centros` (
-- Volcar la base de datos para la tabla `centros`
--
INSERT INTO `centros` (`idcentro`,`nombrecentro`,`identidad`,`comentarios`) VALUES
- (1,'Unidad Organizativa (Default)',1,'Esta Unidad Organizativa se crea automáticamente en el proceso de instalación de OpenGnSys');
+ (1,'Unidad Organizativa (Default)',1,'Esta Unidad Organizativa se crea automáticamente en el proceso de instalación de OpenGnsys');
-- --------------------------------------------------------
@@ -191,18 +200,19 @@ INSERT INTO `centros` (`idcentro`,`nombrecentro`,`identidad`,`comentarios`) VALU
-- Estructura de tabla para la tabla `comandos`
--
-CREATE TABLE IF NOT EXISTS `comandos` (
+DROP TABLE IF EXISTS `comandos`;
+CREATE TABLE `comandos` (
`idcomando` int(11) NOT NULL AUTO_INCREMENT,
`descripcion` varchar(250) NOT NULL DEFAULT '',
- `pagina` varchar(256) NOT NULL,
- `gestor` varchar(256) NOT NULL,
- `funcion` varchar(64) NOT NULL,
+ `pagina` varchar(256) NOT NULL DEFAULT '',
+ `gestor` varchar(256) NOT NULL DEFAULT '',
+ `funcion` varchar(64) NOT NULL DEFAULT '',
`urlimg` varchar(250) DEFAULT NULL,
`aplicambito` tinyint(4) DEFAULT NULL,
`visuparametros` varchar(250) DEFAULT NULL,
`parametros` varchar(250) DEFAULT NULL,
`comentarios` text,
- `activo` tinyint(1) NOT NULL,
+ `activo` tinyint(1) NOT NULL DEFAULT '0',
`submenu` varchar(50) NOT NULL DEFAULT '',
PRIMARY KEY (`idcomando`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=13 ;
@@ -226,7 +236,8 @@ INSERT INTO `comandos` (`idcomando`, `descripcion`, `pagina`, `gestor`, `funcion
(12, 'Crear Imagen Basica', '../comandos/CrearImagenBasica.php', '../comandos/gestores/gestor_Comandos.php', 'CrearImagenBasica', '', 16, 'dsk;par;cpt;idi;nci;ipr;iph;bpi;cpc;bpc;rti;nba', 'nfn;dsk;par;cpt;idi;nci;ipr;iph;bpi;cpc;bpc;rti;nba', '', 1, 'Sincronizacion'),
(13, 'Restaurar Imagen Basica', '../comandos/RestaurarImagenBasica.php', '../comandos/gestores/gestor_Comandos.php', 'RestaurarImagenBasica', '', 28, 'dsk;par;idi;nci;ipr;iph;bpi;cpc;bpc;rti;nba;met', 'nfn;dsk;par;idi;nci;ipr;iph;bpi;cpc;bpc;rti;nba;met', '', 1, 'Sincronizacion'),
(14, 'Crear Software Incremental', '../comandos/CrearSoftIncremental.php', '../comandos/gestores/gestor_Comandos.php', 'CrearSoftIncremental', '', 16, 'dsk;par;idi;nci;ipr;idf;ncf;bpi;cpc;bpc;iph;rti;nba', 'nfn;dsk;par;idi;nci;ipr;idf;ncf;bpi;cpc;bpc;iph;rti;nba', '', 1, 'Sincronizacion'),
-(15, 'Restaurar Software Incremental', '../comandos/RestaurarSoftIncremental.php', '../comandos/gestores/gestor_Comandos.php', 'RestaurarSoftIncremental', '', 28, 'dsk;par;idi;nci;ipr;idf;ncf;bpi;cpc;bpc;iph;rti;met;nba', 'nfn;dsk;par;idi;nci;ipr;idf;ncf;bpi;cpc;bpc;iph;rti;met;nba', '', 1, 'Sincronizacion');
+(15, 'Restaurar Software Incremental', '../comandos/RestaurarSoftIncremental.php', '../comandos/gestores/gestor_Comandos.php', 'RestaurarSoftIncremental', '', 28, 'dsk;par;idi;nci;ipr;idf;ncf;bpi;cpc;bpc;iph;rti;met;nba', 'nfn;dsk;par;idi;nci;ipr;idf;ncf;bpi;cpc;bpc;iph;rti;met;nba', '', 1, 'Sincronizacion'),
+(16, 'Enviar mensaje', '../comandos/EnviarMensaje.php', '../comandos/gestores/gestor_Comandos.php', 'EnviarMensaje', '', 31, 'tit;msj', 'nfn;iph;tit;msj', '', 1, '');
@@ -236,12 +247,14 @@ INSERT INTO `comandos` (`idcomando`, `descripcion`, `pagina`, `gestor`, `funcion
-- Estructura de tabla para la tabla `entidades`
--
-CREATE TABLE IF NOT EXISTS `entidades` (
+DROP TABLE IF EXISTS `entidades`;
+CREATE TABLE `entidades` (
`identidad` int(11) NOT NULL AUTO_INCREMENT,
`nombreentidad` varchar(200) NOT NULL DEFAULT '',
`comentarios` text,
`iduniversidad` int(11) DEFAULT NULL,
`grupoid` int(11) DEFAULT NULL,
+ `ogunit` tinyint(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`identidad`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=2 ;
@@ -250,7 +263,7 @@ CREATE TABLE IF NOT EXISTS `entidades` (
--
INSERT INTO `entidades` (`identidad`, `nombreentidad`, `comentarios`, `iduniversidad`, `grupoid`) VALUES
-(1, 'Entidad (Default)', 'Esta Entidad se crea automáticamente en el proceso de instalación de OpenGnSys', 1, 0);
+(1, 'Entidad (Default)', 'Esta Entidad se crea automáticamente en el proceso de instalación de OpenGnsys', 1, 0);
-- --------------------------------------------------------
@@ -258,11 +271,12 @@ INSERT INTO `entidades` (`identidad`, `nombreentidad`, `comentarios`, `idunivers
-- Estructura de tabla para la tabla `entornos`
--
-CREATE TABLE IF NOT EXISTS `entornos` (
+DROP TABLE IF EXISTS `entornos`;
+CREATE TABLE `entornos` (
`identorno` int(11) NOT NULL AUTO_INCREMENT,
- `ipserveradm` varchar(50) NOT NULL,
- `portserveradm` int(20) NOT NULL,
- `protoclonacion` varchar(50) NOT NULL,
+ `ipserveradm` varchar(50) NOT NULL DEFAULT '',
+ `portserveradm` int(20) NOT NULL DEFAULT 2008,
+ `protoclonacion` varchar(50) NOT NULL DEFAULT '',
PRIMARY KEY (`identorno`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=2 ;
@@ -279,7 +293,8 @@ INSERT INTO `entornos` (`identorno`, `ipserveradm`, `portserveradm`, `protoclona
-- Estructura de tabla para la tabla `estatus`
--
-CREATE TABLE IF NOT EXISTS `estatus` (
+DROP TABLE IF EXISTS `estatus`;
+CREATE TABLE `estatus` (
`idestatus` int(11) NOT NULL AUTO_INCREMENT,
`descripcion` varchar(250) NOT NULL DEFAULT '',
PRIMARY KEY (`idestatus`)
@@ -302,7 +317,8 @@ INSERT INTO `estatus` (`idestatus`, `descripcion`) VALUES
-- Estructura de tabla para la tabla `grupos`
--
-CREATE TABLE IF NOT EXISTS `grupos` (
+DROP TABLE IF EXISTS `grupos`;
+CREATE TABLE `grupos` (
`idgrupo` int(11) NOT NULL AUTO_INCREMENT,
`nombregrupo` varchar(250) NOT NULL DEFAULT '',
`grupoid` int(11) NOT NULL DEFAULT '0',
@@ -319,7 +335,8 @@ CREATE TABLE IF NOT EXISTS `grupos` (
-- Estructura de tabla para la tabla `gruposordenadores`
--
-CREATE TABLE IF NOT EXISTS `gruposordenadores` (
+DROP TABLE IF EXISTS `gruposordenadores`;
+CREATE TABLE `gruposordenadores` (
`idgrupo` int(11) NOT NULL AUTO_INCREMENT,
`nombregrupoordenador` varchar(250) NOT NULL DEFAULT '',
`idaula` int(11) NOT NULL DEFAULT '0',
@@ -334,7 +351,8 @@ CREATE TABLE IF NOT EXISTS `gruposordenadores` (
-- Estructura de tabla para la tabla `hardwares`
--
-CREATE TABLE IF NOT EXISTS `hardwares` (
+DROP TABLE IF EXISTS `hardwares`;
+CREATE TABLE `hardwares` (
`idhardware` int(11) NOT NULL AUTO_INCREMENT,
`idtipohardware` int(11) NOT NULL DEFAULT '0',
`descripcion` varchar(250) NOT NULL DEFAULT '',
@@ -350,7 +368,8 @@ CREATE TABLE IF NOT EXISTS `hardwares` (
-- Estructura de tabla para la tabla `iconos`
--
-CREATE TABLE IF NOT EXISTS `iconos` (
+DROP TABLE IF EXISTS `iconos`;
+CREATE TABLE `iconos` (
`idicono` int(11) NOT NULL AUTO_INCREMENT,
`urlicono` varchar(200) DEFAULT NULL,
`idtipoicono` int(11) DEFAULT NULL,
@@ -384,7 +403,8 @@ INSERT INTO `iconos` (`idicono`, `urlicono`, `idtipoicono`, `descripcion`) VALUE
-- Estructura de tabla para la tabla `idiomas`
--
-CREATE TABLE IF NOT EXISTS `idiomas` (
+DROP TABLE IF EXISTS `idiomas`;
+CREATE TABLE `idiomas` (
`ididioma` int(11) NOT NULL AUTO_INCREMENT,
`descripcion` varchar(100) DEFAULT NULL,
`nemonico` char(3) DEFAULT NULL,
@@ -406,23 +426,26 @@ INSERT INTO `idiomas` (`ididioma`, `descripcion`, `nemonico`) VALUES
-- Estructura de tabla para la tabla `imagenes`
--
-CREATE TABLE IF NOT EXISTS `imagenes` (
+DROP TABLE IF EXISTS `imagenes`;
+CREATE TABLE `imagenes` (
`idimagen` int(11) NOT NULL AUTO_INCREMENT,
- `nombreca` varchar(50) NOT NULL,
+ `nombreca` varchar(50) NOT NULL DEFAULT '',
+ `revision` smallint UNSIGNED NOT NULL DEFAULT '0',
`descripcion` varchar(250) NOT NULL DEFAULT '',
`idperfilsoft` int(11) DEFAULT NULL,
`idcentro` int(11) DEFAULT NULL,
`comentarios` text,
`grupoid` int(11) DEFAULT NULL,
- `idrepositorio` int(11) NOT NULL DEFAULT 0,
- `idordenador` int(11) NOT NULL DEFAULT 0,
- `numdisk` smallint NOT NULL DEFAULT 0,
- `numpar` smallint NOT NULL DEFAULT 0,
- `codpar` int(8) NOT NULL DEFAULT 0,
+ `idrepositorio` int(11) NOT NULL DEFAULT '0',
+ `idordenador` int(11) NOT NULL DEFAULT '0',
+ `numdisk` smallint NOT NULL DEFAULT '0',
+ `numpar` smallint NOT NULL DEFAULT '0',
+ `codpar` int(8) NOT NULL DEFAULT '0',
`tipo` tinyint NULL,
- `imagenid` int NOT NULL DEFAULT 0,
+ `imagenid` int NOT NULL DEFAULT '0',
`ruta` varchar(250) NULL,
`fechacreacion` datetime DEFAULT NULL,
+ `inremotepc` tinyint DEFAULT '0',
PRIMARY KEY (`idimagen`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
@@ -432,7 +455,8 @@ CREATE TABLE IF NOT EXISTS `imagenes` (
-- Estructura de tabla para la tabla `menus`
--
-CREATE TABLE IF NOT EXISTS `menus` (
+DROP TABLE IF EXISTS `menus`;
+CREATE TABLE `menus` (
`idmenu` int(11) NOT NULL AUTO_INCREMENT,
`descripcion` varchar(250) NOT NULL DEFAULT '',
`idcentro` int(11) NOT NULL DEFAULT '0',
@@ -454,23 +478,42 @@ CREATE TABLE IF NOT EXISTS `menus` (
-- Estructura de tabla para la tabla `nombresos`
--
-CREATE TABLE IF NOT EXISTS `nombresos` (
+DROP TABLE IF EXISTS `nombresos`;
+CREATE TABLE `nombresos` (
`idnombreso` smallint(11) NOT NULL AUTO_INCREMENT,
- `nombreso` varchar(250) NOT NULL,
+ `nombreso` varchar(250) NOT NULL DEFAULT '',
`idtiposo` int(11) DEFAULT '0',
PRIMARY KEY (`idnombreso`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
+--
+-- Estructura de tabla para la tabla `ogagent_queue`
+--
+
+DROP TABLE IF EXISTS `ogagent_queue`;
+CREATE TABLE `ogagent_queue` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `clientid` int(11) NOT NULL,
+ `exectime` datetime DEFAULT NULL,
+ `operation` varchar(25),
+-- `parameters` varchar(100),
+ PRIMARY KEY (`id`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
--
-- Estructura de tabla para la tabla `ordenadores`
--
-CREATE TABLE IF NOT EXISTS `ordenadores` (
+DROP TABLE IF EXISTS `ordenadores`;
+CREATE TABLE `ordenadores` (
`idordenador` int(11) NOT NULL AUTO_INCREMENT,
`nombreordenador` varchar(100) DEFAULT NULL,
- `ip` varchar(16) NOT NULL,
+ `numserie` varchar(25) DEFAULT NULL,
+ `ip` varchar(16) NOT NULL DEFAULT '',
`mac` varchar(12) DEFAULT NULL,
`idaula` int(11) DEFAULT NULL,
`idperfilhard` int(11) DEFAULT NULL,
@@ -478,16 +521,18 @@ CREATE TABLE IF NOT EXISTS `ordenadores` (
`grupoid` int(11) DEFAULT NULL,
`idmenu` int(11) DEFAULT NULL,
`cache` int(11) DEFAULT NULL,
- `router` varchar(16) NOT NULL,
- `mascara` varchar(16) NOT NULL,
- `idproautoexec` int(11) NOT NULL DEFAULT 0,
- `arranque` VARCHAR( 30 ) NOT NULL DEFAULT '00unknown',
+ `router` varchar(16) NOT NULL DEFAULT '',
+ `mascara` varchar(16) NOT NULL DEFAULT '',
+ `idproautoexec` int(11) NOT NULL DEFAULT '0',
+ `arranque` varchar(30) NOT NULL DEFAULT '00unknown',
`netiface` enum('eth0','eth1','eth2') DEFAULT 'eth0',
- `netdriver` varchar( 30 ) NOT NULL DEFAULT 'generic',
- `fotoord` varchar( 250 ) NOT NULL DEFAULT 'fotoordenador.gif',
+ `netdriver` varchar(30) NOT NULL DEFAULT 'generic',
+ `fotoord` varchar(250) NOT NULL DEFAULT 'fotoordenador.gif',
`validacion` tinyint(1) DEFAULT '0',
`paginalogin` varchar(100),
`paginavalidacion` varchar(100),
+ `agentkey` varchar(32),
+ `oglivedir` varchar(50) NOT NULL DEFAULT 'ogLive',
PRIMARY KEY (`idordenador`),
KEY `idaulaip` (`idaula` ASC, `ip` ASC)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
@@ -500,18 +545,21 @@ CREATE TABLE IF NOT EXISTS `ordenadores` (
-- Estructura de tabla para la tabla `ordenadores_particiones`
--
-CREATE TABLE IF NOT EXISTS `ordenadores_particiones` (
- `idordenador` int(11) NOT NULL,
- `numdisk` smallint NOT NULL,
- `numpar` smallint NOT NULL,
- `codpar` int(8) NOT NULL,
- `tamano` int(11) NOT NULL,
- `idsistemafichero` smallint(11) NOT NULL,
- `idnombreso` smallint(11) NOT NULL,
- `idimagen` int(11) NOT NULL,
- `idperfilsoft` int(11) NOT NULL,
+DROP TABLE IF EXISTS `ordenadores_particiones`;
+CREATE TABLE `ordenadores_particiones` (
+ `idordenador` int(11) NOT NULL DEFAULT '0',
+ `numdisk` smallint NOT NULL DEFAULT '0',
+ `numpar` smallint NOT NULL DEFAULT '0',
+ `codpar` int(8) NOT NULL DEFAULT '0',
+ `tamano` int(11) NOT NULL DEFAULT '0',
+ `uso` tinyint NOT NULL DEFAULT '0',
+ `idsistemafichero` smallint(11) NOT NULL DEFAULT '0',
+ `idnombreso` smallint(11) NOT NULL DEFAULT '0',
+ `idimagen` int(11) NOT NULL DEFAULT '0',
+ `revision` smallint UNSIGNED NOT NULL DEFAULT '0',
+ `idperfilsoft` int(11) NOT NULL DEFAULT '0',
`fechadespliegue` datetime NULL,
- `cache` text NOT NULL,
+ `cache` text,
UNIQUE KEY `idordenadornumdisknumpar` (`idordenador`,`numdisk`,`numpar`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
@@ -521,13 +569,14 @@ CREATE TABLE IF NOT EXISTS `ordenadores_particiones` (
-- Estructura de tabla para la tabla `parametros`
--
-CREATE TABLE IF NOT EXISTS `parametros` (
+DROP TABLE IF EXISTS `parametros`;
+CREATE TABLE `parametros` (
`idparametro` int(11) NOT NULL AUTO_INCREMENT,
- `nemonico` char(3) NOT NULL,
- `descripcion` text NOT NULL,
- `nomidentificador` varchar(64) NOT NULL,
- `nomtabla` varchar(64) NOT NULL,
- `nomliteral` varchar(64) NOT NULL,
+ `nemonico` char(3) NOT NULL DEFAULT '',
+ `descripcion` text,
+ `nomidentificador` varchar(64) NOT NULL DEFAULT '',
+ `nomtabla` varchar(64) NOT NULL DEFAULT '',
+ `nomliteral` varchar(64) NOT NULL DEFAULT '',
`tipopa` tinyint(1) DEFAULT '0',
`visual` tinyint(4) NOT NULL DEFAULT '0',
PRIMARY KEY (`idparametro`),
@@ -575,7 +624,9 @@ INSERT INTO `parametros` (`idparametro`, `nemonico`, `descripcion`, `nomidentifi
(35, 'bpc', 'Borrado previo de la imagen en cache', '', '', '', 5, 1),
(36, 'rti', 'Ruta de origen', '', '', '', 0, 1),
(37, 'met', 'Método clonación', ';', '', 'Desde caché; Desde repositorio', 3, 1),
-(38, 'nba', 'No borrar archivos en destino', '', '', '', 0, 1);
+(38, 'nba', 'No borrar archivos en destino', '', '', '', 0, 1),
+(39, 'tit', 'Título', '', '', '', 0, 1),
+(40, 'msj', 'Contenido', '', '', '', 0, 1);
-- --------------------------------------------------------
@@ -584,12 +635,13 @@ INSERT INTO `parametros` (`idparametro`, `nemonico`, `descripcion`, `nomidentifi
--
-CREATE TABLE IF NOT EXISTS `perfileshard` (
+DROP TABLE IF EXISTS `perfileshard`;
+CREATE TABLE `perfileshard` (
`idperfilhard` int(11) NOT NULL AUTO_INCREMENT,
`descripcion` varchar(250) NOT NULL DEFAULT '',
`comentarios` text,
`grupoid` int(11) DEFAULT NULL,
- `idcentro` int(11) NOT NULL,
+ `idcentro` int(11) NOT NULL DEFAULT '0',
`winboot` enum( 'reboot', 'kexec' ) NOT NULL DEFAULT 'reboot',
PRIMARY KEY (`idperfilhard`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
@@ -601,7 +653,8 @@ CREATE TABLE IF NOT EXISTS `perfileshard` (
-- Estructura de tabla para la tabla `perfileshard_hardwares`
--
-CREATE TABLE IF NOT EXISTS `perfileshard_hardwares` (
+DROP TABLE IF EXISTS `perfileshard_hardwares`;
+CREATE TABLE `perfileshard_hardwares` (
`idperfilhard` int(11) NOT NULL DEFAULT '0',
`idhardware` int(11) NOT NULL DEFAULT '0',
KEY `idperfilhard` (`idperfilhard`)
@@ -613,12 +666,14 @@ CREATE TABLE IF NOT EXISTS `perfileshard_hardwares` (
-- Estructura de tabla para la tabla `perfilessoft`
--
-CREATE TABLE IF NOT EXISTS `perfilessoft` (
+DROP TABLE IF EXISTS `perfilessoft`;
+CREATE TABLE `perfilessoft` (
`idperfilsoft` int(11) NOT NULL AUTO_INCREMENT,
+ `idnombreso` smallint(5) unsigned DEFAULT NULL,
`descripcion` varchar(250) NOT NULL DEFAULT '',
`comentarios` text,
`grupoid` int(11) DEFAULT NULL,
- `idcentro` int(11) NOT NULL,
+ `idcentro` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`idperfilsoft`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
@@ -628,7 +683,8 @@ CREATE TABLE IF NOT EXISTS `perfilessoft` (
-- Estructura de tabla para la tabla `perfilessoft_softwares`
--
-CREATE TABLE IF NOT EXISTS `perfilessoft_softwares` (
+DROP TABLE IF EXISTS `perfilessoft_softwares`;
+CREATE TABLE `perfilessoft_softwares` (
`idperfilsoft` int(11) NOT NULL DEFAULT '0',
`idsoftware` int(11) NOT NULL DEFAULT '0'
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
@@ -639,9 +695,10 @@ CREATE TABLE IF NOT EXISTS `perfilessoft_softwares` (
-- Estructura de tabla para la tabla `plataformas`
--
-CREATE TABLE IF NOT EXISTS `plataformas` (
+DROP TABLE IF EXISTS `plataformas`;
+CREATE TABLE `plataformas` (
`idplataforma` int(11) NOT NULL AUTO_INCREMENT,
- `plataforma` varchar(250) NOT NULL,
+ `plataforma` varchar(250) NOT NULL DEFAULT '',
PRIMARY KEY (`idplataforma`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=18 ;
@@ -662,7 +719,8 @@ INSERT INTO `plataformas` (`idplataforma`, `plataforma`) VALUES
-- Estructura de tabla para la tabla `procedimientos`
--
-CREATE TABLE IF NOT EXISTS `procedimientos` (
+DROP TABLE IF EXISTS `procedimientos`;
+CREATE TABLE `procedimientos` (
`idprocedimiento` int(11) NOT NULL AUTO_INCREMENT,
`descripcion` varchar(250) NOT NULL DEFAULT '',
`urlimg` varchar(250) DEFAULT NULL,
@@ -678,13 +736,14 @@ CREATE TABLE IF NOT EXISTS `procedimientos` (
-- Estructura de tabla para la tabla `procedimientos_acciones`
--
-CREATE TABLE IF NOT EXISTS `procedimientos_acciones` (
+DROP TABLE IF EXISTS `procedimientos_acciones`;
+CREATE TABLE `procedimientos_acciones` (
`idprocedimientoaccion` int(11) NOT NULL AUTO_INCREMENT,
`idprocedimiento` int(11) NOT NULL DEFAULT '0',
`orden` smallint(4) DEFAULT NULL,
`idcomando` int(11) NOT NULL DEFAULT '0',
`parametros` text,
- `procedimientoid` int(11) NOT NULL,
+ `procedimientoid` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`idprocedimientoaccion`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
@@ -694,13 +753,14 @@ CREATE TABLE IF NOT EXISTS `procedimientos_acciones` (
-- Estructura de tabla para la tabla `programaciones`
--
-CREATE TABLE IF NOT EXISTS `programaciones` (
+DROP TABLE IF EXISTS `programaciones`;
+CREATE TABLE `programaciones` (
`idprogramacion` int(11) NOT NULL AUTO_INCREMENT,
`tipoaccion` int(11) DEFAULT NULL,
`identificador` int(11) DEFAULT NULL,
`nombrebloque` varchar(255) DEFAULT NULL,
- `annos` tinyint(4) DEFAULT NULL,
- `meses` smallint(4) DEFAULT NULL,
+ `annos` smallint DEFAULT NULL,
+ `meses` smallint DEFAULT NULL,
`diario` int(11) DEFAULT NULL,
`dias` tinyint(4) DEFAULT NULL,
`semanas` tinyint(4) DEFAULT NULL,
@@ -715,30 +775,48 @@ CREATE TABLE IF NOT EXISTS `programaciones` (
`ampmfin` tinyint(1) DEFAULT NULL,
`minutosfin` tinyint(4) DEFAULT NULL,
`suspendida` tinyint(1) DEFAULT NULL,
- `sesion` int(11) NOT NULL,
+ `sesion` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`idprogramacion`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
-- --------------------------------------------------------
+--
+-- Estructura de tabla para la tabla `remotepc`
+--
+
+DROP TABLE IF EXISTS `remotepc`;
+CREATE TABLE `remotepc` (
+ `id` int(11) NOT NULL,
+ `reserved` datetime DEFAULT NULL,
+ `urllogin` varchar(100),
+ `urllogout` varchar(100),
+ `language` varchar(5),
+ PRIMARY KEY (`id`)
+) ENGINE=MyISAM DEFAULT CHARSET=utf8;
+
+-- --------------------------------------------------------
+
--
-- Estructura de tabla para la tabla `repositorios`
--
-CREATE TABLE IF NOT EXISTS `repositorios` (
+DROP TABLE IF EXISTS `repositorios`;
+CREATE TABLE `repositorios` (
`idrepositorio` int(11) NOT NULL AUTO_INCREMENT,
- `nombrerepositorio` varchar(250) NOT NULL,
+ `nombrerepositorio` varchar(250) NOT NULL DEFAULT '',
`ip` varchar(15) NOT NULL DEFAULT '',
`passguor` varchar(50) NOT NULL DEFAULT '',
`idcentro` int(11) DEFAULT NULL,
`grupoid` int(11) DEFAULT NULL,
`comentarios` text,
- `puertorepo` int(11) NOT NULL,
+ `puertorepo` int(11) NOT NULL DEFAULT '0',
+ `apikey` varchar(32) NOT NULL DEFAULT '',
PRIMARY KEY (`idrepositorio`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
-INSERT INTO `repositorios` (`idrepositorio`,`nombrerepositorio`,`ip`,`passguor`,`idcentro`,`grupoid`,`comentarios`,`puertorepo`) VALUES
- (1,'Repositorio (Default)','SERVERIP','',1,0,'',2002);
+INSERT INTO `repositorios` (`idrepositorio`,`nombrerepositorio`,`ip`,`passguor`,`idcentro`,`grupoid`,`comentarios`,`puertorepo`,`apikey`) VALUES
+ (1,'Repositorio (Default)','SERVERIP','',1,0,'',2002,'REPOKEY');
-- --------------------------------------------------------
@@ -747,11 +825,12 @@ INSERT INTO `repositorios` (`idrepositorio`,`nombrerepositorio`,`ip`,`passguor`,
-- Estructura de tabla para la tabla `sistemasficheros`
--
-CREATE TABLE IF NOT EXISTS `sistemasficheros` (
+DROP TABLE IF EXISTS `sistemasficheros`;
+CREATE TABLE `sistemasficheros` (
`idsistemafichero` smallint(11) NOT NULL AUTO_INCREMENT,
`descripcion` varchar(50) NOT NULL DEFAULT '',
`nemonico` varchar(16) DEFAULT NULL,
- `codpar` int(8) NOT NULL,
+ `codpar` int(8) NOT NULL DEFAULT '0',
PRIMARY KEY (`idsistemafichero`),
UNIQUE KEY (`descripcion`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
@@ -774,7 +853,9 @@ INSERT INTO `sistemasficheros` (`idsistemafichero`, `descripcion`, `nemonico`, `
(16, 'UFS', 'UFS', 0),
(17, 'XFS', 'XFS', 0),
(18, 'EXFAT', 'EXFAT', 0),
- (19, 'LINUX-SWAP', 'LINUX-SWAP', 0);
+ (19, 'LINUX-SWAP', 'LINUX-SWAP', 0),
+ (20, 'F2FS', 'F2FS', 0),
+ (21, 'NILFS2', 'NILFS2', 0);
-- --------------------------------------------------------
@@ -783,7 +864,8 @@ INSERT INTO `sistemasficheros` (`idsistemafichero`, `descripcion`, `nemonico`, `
-- Estructura de tabla para la tabla `softwares`
--
-CREATE TABLE IF NOT EXISTS `softwares` (
+DROP TABLE IF EXISTS `softwares`;
+CREATE TABLE `softwares` (
`idsoftware` int(11) NOT NULL AUTO_INCREMENT,
`idtiposoftware` int(11) NOT NULL DEFAULT '0',
`descripcion` varchar(250) NOT NULL DEFAULT '',
@@ -800,14 +882,15 @@ CREATE TABLE IF NOT EXISTS `softwares` (
-- Estructura de tabla para la tabla `tareas`
--
-CREATE TABLE IF NOT EXISTS `tareas` (
+DROP TABLE IF EXISTS `tareas`;
+CREATE TABLE `tareas` (
`idtarea` int(11) NOT NULL AUTO_INCREMENT,
`descripcion` varchar(250) NOT NULL DEFAULT '',
`urlimg` varchar(250) DEFAULT NULL,
`idcentro` int(11) NOT NULL DEFAULT '0',
`ambito` smallint(6) NOT NULL DEFAULT '0',
`idambito` int(11) NOT NULL DEFAULT '0',
- `restrambito` text NOT NULL,
+ `restrambito` text,
`comentarios` text,
`grupoid` int(11) DEFAULT '0',
PRIMARY KEY (`idtarea`)
@@ -819,7 +902,8 @@ CREATE TABLE IF NOT EXISTS `tareas` (
-- Estructura de tabla para la tabla `tareas_acciones`
--
-CREATE TABLE IF NOT EXISTS `tareas_acciones` (
+DROP TABLE IF EXISTS `tareas_acciones`;
+CREATE TABLE `tareas_acciones` (
`idtareaaccion` int(11) NOT NULL AUTO_INCREMENT,
`idtarea` int(11) NOT NULL DEFAULT '0',
`orden` smallint(6) NOT NULL DEFAULT '0',
@@ -834,12 +918,12 @@ CREATE TABLE IF NOT EXISTS `tareas_acciones` (
-- Estructura de tabla para la tabla `tipohardwares`
--
-CREATE TABLE IF NOT EXISTS `tipohardwares` (
+DROP TABLE IF EXISTS `tipohardwares`;
+CREATE TABLE `tipohardwares` (
`idtipohardware` int(11) NOT NULL AUTO_INCREMENT,
`descripcion` varchar(250) NOT NULL DEFAULT '',
`urlimg` varchar(250) NOT NULL DEFAULT '',
- `nemonico` char(3) NOT NULL,
- `pci` tinyint(1) NOT NULL,
+ `nemonico` char(3) NOT NULL DEFAULT '',
PRIMARY KEY (`idtipohardware`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=17 ;
@@ -847,22 +931,25 @@ CREATE TABLE IF NOT EXISTS `tipohardwares` (
-- Volcar la base de datos para la tabla `tipohardwares`
--
-INSERT INTO `tipohardwares` (`idtipohardware`, `descripcion`, `urlimg`, `nemonico`, `pci`) VALUES
-(1, 'Placas', '../images/iconos/placabase.gif', 'boa', 0),
-(2, 'Dispositivos Multimedia', '../images/iconos/tsonido.gif', 'mul', 0),
-(3, 'Tarjetas de Red', '../images/iconos/nic.gif', 'net', 0),
-(4, 'Microprocesadores', '../images/iconos/micro.gif', 'cpu', 0),
-(5, 'Memorias', '../images/iconos/confihard.gif', 'mem', 0),
-(7, 'Tarjetas gráficas', '../images/iconos/vga.gif', 'vga', 0),
-(8, 'Discos', '../images/iconos/discoduro.gif', 'dis', 0),
-(9, 'Dispositivos de sonido', '../images/iconos/audio.gif', 'aud', 0),
-(10, 'Marca y modelo del equipo', '../images/iconos/confihard.gif', 'mod', 0),
-(11, 'Modelo y version de la bios', '../images/iconos/confihard.gif', 'bio', 0),
-(12, 'Modelo de grabadora o grabadora de CD/DVD', '../images/iconos/dvdcd.gif', 'cdr', 0),
-(13, 'Controladores IDE', '../images/iconos/ide.gif', 'ide', 0),
-(14, 'Controladores FireWire', '../images/iconos/confihard.gif', 'fir', 0),
-(15, 'Controladores USB', '../images/iconos/usb.gif', 'usb', 0),
-(16, 'Bus del Sistema', '../images/iconos/confihard.gif', 'bus', 0);
+INSERT INTO `tipohardwares` (`idtipohardware`, `descripcion`, `urlimg`, `nemonico`) VALUES
+(1, 'Placas', '../images/iconos/placabase.gif', 'boa'),
+(2, 'Dispositivos Multimedia', '../images/iconos/tsonido.gif', 'mul'),
+(3, 'Tarjetas de Red', '../images/iconos/nic.gif', 'net'),
+(4, 'Microprocesadores', '../images/iconos/micro.gif', 'cpu'),
+(5, 'Memorias', '../images/iconos/confihard.gif', 'mem'),
+(7, 'Tarjetas gráficas', '../images/iconos/vga.gif', 'vga'),
+(8, 'Discos', '../images/iconos/discoduro.gif', 'dis'),
+(9, 'Dispositivos de sonido', '../images/iconos/audio.gif', 'aud'),
+(10, 'Marca y modelo del equipo', '../images/iconos/confihard.gif', 'mod'),
+(11, 'Modelo y version de la bios', '../images/iconos/confihard.gif', 'bio'),
+(12, 'Modelo de grabadora o grabadora de CD/DVD', '../images/iconos/dvdcd.gif', 'cdr'),
+(13, 'Controladores IDE', '../images/iconos/ide.gif', 'ide'),
+(14, 'Controladores FireWire', '../images/iconos/confihard.gif', 'fir'),
+(15, 'Controladores USB', '../images/iconos/usb.gif', 'usb'),
+(16, 'Bus del Sistema', '../images/iconos/confihard.gif', 'bus'),
+(17, 'Chasis del Sistema', '', 'cha'),
+(18, 'Controladores de almacenamiento', '../images/iconos/almacenamiento.png', 'sto'),
+(19, 'Tipo de proceso de arranque', '../images/iconos/arranque.png', 'boo');
-- --------------------------------------------------------
@@ -870,7 +957,8 @@ INSERT INTO `tipohardwares` (`idtipohardware`, `descripcion`, `urlimg`, `nemonic
-- Estructura de tabla para la tabla `tiposoftwares`
--
-CREATE TABLE IF NOT EXISTS `tiposoftwares` (
+DROP TABLE IF EXISTS `tiposoftwares`;
+CREATE TABLE `tiposoftwares` (
`idtiposoftware` int(11) NOT NULL AUTO_INCREMENT,
`descripcion` varchar(250) NOT NULL DEFAULT '',
`urlimg` varchar(250) NOT NULL DEFAULT '',
@@ -892,10 +980,11 @@ INSERT INTO `tiposoftwares` (`idtiposoftware`, `descripcion`, `urlimg`) VALUES
-- Estructura de tabla para la tabla `tiposos`
--
-CREATE TABLE IF NOT EXISTS `tiposos` (
+DROP TABLE IF EXISTS `tiposos`;
+CREATE TABLE `tiposos` (
`idtiposo` int(11) NOT NULL AUTO_INCREMENT,
- `tiposo` varchar(250) NOT NULL,
- `idplataforma` int(11) NOT NULL,
+ `tiposo` varchar(250) NOT NULL DEFAULT '',
+ `idplataforma` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`idtiposo`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=21 ;
@@ -920,10 +1009,11 @@ INSERT INTO `tiposos` (`idtiposo`, `tiposo`, `idplataforma`) VALUES
-- Estructura de tabla para la tabla `tipospar`
--
-CREATE TABLE IF NOT EXISTS `tipospar` (
+DROP TABLE IF EXISTS `tipospar`;
+CREATE TABLE `tipospar` (
`codpar` int(8) NOT NULL,
- `tipopar` varchar(250) NOT NULL,
- `clonable` tinyint(4) NOT NULL,
+ `tipopar` varchar(250) NOT NULL DEFAULT '',
+ `clonable` tinyint(4) NOT NULL DEFAULT '0',
UNIQUE KEY `codpar` (`codpar`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
@@ -947,6 +1037,7 @@ INSERT INTO `tipospar` (`codpar`, `tipopar`, `clonable`) VALUES
(CONV('8E',16,10), 'LINUX-LVM', 1),
(CONV('A5',16,10), 'FREEBSD', 1),
(CONV('A6',16,10), 'OPENBSD', 1),
+(CONV('A9',16,10), 'NETBSD', 1),
(CONV('AF',16,10), 'HFS', 1),
(CONV('BE',16,10), 'SOLARIS-BOOT', 1),
(CONV('BF',16,10), 'SOLARIS', 1),
@@ -958,20 +1049,30 @@ INSERT INTO `tipospar` (`codpar`, `tipopar`, `clonable`) VALUES
(CONV('FD',16,10), 'LINUX-RAID', 1),
(CONV('0700',16,10), 'WINDOWS', 1),
(CONV('0C01',16,10), 'WIN-RESERV', 1),
+(CONV('2700',16,10), 'WIN-RECOV', 1),
(CONV('7F00',16,10), 'CHROMEOS-KRN', 1),
(CONV('7F01',16,10), 'CHROMEOS', 1),
(CONV('7F02',16,10), 'CHROMEOS-RESERV', 1),
(CONV('8200',16,10), 'LINUX-SWAP', 0),
(CONV('8300',16,10), 'LINUX', 1),
(CONV('8301',16,10), 'LINUX-RESERV', 1),
+(CONV('8302',16,10), 'LINUX', 1),
(CONV('8E00',16,10), 'LINUX-LVM', 1),
(CONV('A500',16,10), 'FREEBSD-DISK', 0),
(CONV('A501',16,10), 'FREEBSD-BOOT', 1),
(CONV('A502',16,10), 'FREEBSD-SWAP', 0),
(CONV('A503',16,10), 'FREEBSD', 1),
+(CONV('A504',16,10), 'FREEBSD', 1),
+(CONV('A901',16,10), 'NETBSD-SWAP', 0),
+(CONV('A902',16,10), 'NETBSD', 1),
+(CONV('A903',16,10), 'NETBSD', 1),
+(CONV('A904',16,10), 'NETBSD', 1),
+(CONV('A905',16,10), 'NETBSD', 1),
+(CONV('A906',16,10), 'NETBSD-RAID', 1),
(CONV('AB00',16,10), 'HFS-BOOT', 1),
(CONV('AF00',16,10), 'HFS', 1),
(CONV('AF01',16,10), 'HFS-RAID', 1),
+(CONV('AF02',16,10), 'HFS-RAID', 1),
(CONV('BE00',16,10), 'SOLARIS-BOOT', 1),
(CONV('BF00',16,10), 'SOLARIS', 1),
(CONV('BF01',16,10), 'SOLARIS', 1),
@@ -983,8 +1084,14 @@ INSERT INTO `tipospar` (`codpar`, `tipopar`, `clonable`) VALUES
(CONV('EF00',16,10), 'EFI', 1),
(CONV('EF01',16,10), 'MBR', 0),
(CONV('EF02',16,10), 'BIOS-BOOT', 0),
+(CONV('FB00',16,10), 'VMFS', 1),
+(CONV('FB01',16,10), 'VMFS-RESERV', 1),
+(CONV('FB02',16,10), 'VMFS-KRN', 1),
(CONV('FD00',16,10), 'LINUX-RAID', 1),
-(CONV('FFFF',16,10), 'UNKNOWN', 1);
+(CONV('FFFF',16,10), 'UNKNOWN', 1),
+(CONV('10000',16,10), 'LVM-LV', 1),
+(CONV('10010',16,10), 'ZFS-VOL', 1);
+
-- --------------------------------------------------------
@@ -992,7 +1099,8 @@ INSERT INTO `tipospar` (`codpar`, `tipopar`, `clonable`) VALUES
-- Estructura de tabla para la tabla `universidades`
--
-CREATE TABLE IF NOT EXISTS `universidades` (
+DROP TABLE IF EXISTS `universidades`;
+CREATE TABLE `universidades` (
`iduniversidad` int(11) NOT NULL AUTO_INCREMENT,
`nombreuniversidad` varchar(200) NOT NULL DEFAULT '',
`comentarios` text,
@@ -1004,7 +1112,7 @@ CREATE TABLE IF NOT EXISTS `universidades` (
--
INSERT INTO `universidades` (`iduniversidad`, `nombreuniversidad`, `comentarios`) VALUES
-(1, 'Universidad (Default)', 'Esta Universidad se crea automáticamentese en el proceso de instalación de OpenGnSys');
+(1, 'Universidad (Default)', 'Esta Universidad se crea automáticamentese en el proceso de instalación de OpenGnsys');
-- --------------------------------------------------------
@@ -1012,7 +1120,8 @@ INSERT INTO `universidades` (`iduniversidad`, `nombreuniversidad`, `comentarios`
-- Estructura de tabla para la tabla `urlimagesitems`
--
-CREATE TABLE IF NOT EXISTS `urlimagesitems` (
+DROP TABLE IF EXISTS `urlimagesitems`;
+CREATE TABLE `urlimagesitems` (
`idurlimagesitems` int(11) NOT NULL AUTO_INCREMENT,
`descripcion` varchar(250) NOT NULL DEFAULT '',
PRIMARY KEY (`idurlimagesitems`)
@@ -1029,14 +1138,16 @@ CREATE TABLE IF NOT EXISTS `urlimagesitems` (
-- Estructura de tabla para la tabla `usuarios`
--
-CREATE TABLE IF NOT EXISTS `usuarios` (
+DROP TABLE IF EXISTS `usuarios`;
+CREATE TABLE `usuarios` (
`idusuario` int(11) NOT NULL AUTO_INCREMENT,
`usuario` varchar(50) NOT NULL DEFAULT '',
- `pasguor` varchar(50) NOT NULL DEFAULT '',
+ `pasguor` varchar(56) NOT NULL DEFAULT '',
`nombre` varchar(200) DEFAULT NULL,
`email` varchar(200) DEFAULT NULL,
`ididioma` int(11) DEFAULT NULL,
`idtipousuario` tinyint(4) DEFAULT NULL,
+ `apikey` varchar(32) NOT NULL DEFAULT '',
PRIMARY KEY (`idusuario`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=2 ;
@@ -1044,7 +1155,7 @@ CREATE TABLE IF NOT EXISTS `usuarios` (
-- Volcar la base de datos para la tabla `usuarios`
--
-INSERT INTO `usuarios` (`idusuario`, `usuario`, `pasguor`, `nombre`, `email`, `ididioma`, `idtipousuario`) VALUES
-(1, 'DBUSER', 'DBPASSWORD', 'Usuario de la base de datos MySql', '', 1, 1);
+INSERT INTO `usuarios` (`idusuario`, `usuario`, `pasguor`, `nombre`, `email`, `ididioma`, `idtipousuario`, `apikey`) VALUES
+(1, 'DBUSER', SHA2('DBPASSWORD', 224), 'Usuario de la base de datos MySql', '', 1, 1, 'APIKEY');
diff --git a/admin/Interface/CambiarAcceso b/admin/Interface/CambiarAcceso
index 50df9b49..b57cfcd2 100755
--- a/admin/Interface/CambiarAcceso
+++ b/admin/Interface/CambiarAcceso
@@ -6,7 +6,7 @@
# $1 modo (admin, user)
#______________________________________
-# Error si llamada no se realliza desde OpenGnSys Client.
+# Error si llamada no se realliza desde OpenGnsys Client.
PROG=$(basename $0)
CALLER=$(ogGetCaller)
if ! $(ogCheckStringInGroup "$CALLER" "CrearImagen ConsolaRemota CrearImagenBasica CrearSoftIncremental"); then
@@ -41,12 +41,14 @@ esac
# Desmontar repositorio y volver a montarlo con el modo adecuado.
umount $OGIMG
+# Unidad organizativa
+[ "$ogunit" != "" ] && OGUNIT="/$ogunit"
ogEcho info "$PROG: Montar repositorio $REPO por $PROTO en modo $1"
case "$PROTO" in
- nfs) mount -t nfs $REPOIP:$OGIMG $OGIMG -o $MODE ;;
+ nfs) mount -t nfs $REPOIP:$OGIMG$OGUNIT $OGIMG -o $MODE ;;
smb) PASS=$(grep "^[ ]*\(export \)\?OPTIONS=" /scripts/ogfunctions 2>&1 | \
sed 's/\(.*\)pass=\(\w*\)\(.*\)/\2/')
PASS=${PASS:-"og"}
- mount.cifs //$REPOIP/ogimages $OGIMG -o $MODE,serverino,acl,username=opengnsys,password=$PASS
+ mount.cifs //$REPOIP/ogimages$OGUNIT $OGIMG -o $MODE,serverino,acl,username=opengnsys,password=$PASS
esac
diff --git a/admin/Interface/Configurar b/admin/Interface/Configurar
index fcf77b95..554e52c9 100755
--- a/admin/Interface/Configurar
+++ b/admin/Interface/Configurar
@@ -12,7 +12,7 @@ echo " " > $OGLOGSESSION; echo " " > $OGLOGCOMMAND; echo " " > ${OGLOGCOMMAND}.t
# Registro de inicio de ejecución
ogEcho log session "$MSG_INTERFACE_START $0 $*"
-# Solo ejecutable por OpenGnSys Client.
+# Solo ejecutable por OpenGnsys Client.
PATH=$PATH:$(dirname $0)
PROG=$(basename $0)
@@ -78,7 +78,7 @@ for ((i=0; i<${#TBPRM[@]}; i++)); do
# Si se activa operación de formatear, componer datos de formateo.
if [ "$ope" == 1 ]; then
# Comprobamos que la particion y el s.f sean validos.
- ogCheckStringInGroup $cpt "EMPTY EXTENDED LINUX-LVM"
+ ogCheckStringInGroup $cpt "EMPTY EXTENDED LINUX-LVM LVM ZPOOL"
[ $? -ne 0 ] && TBF[par]="$sfi"
fi
# Obtener la partición mayor.
diff --git a/admin/Interface/CrearImagen b/admin/Interface/CrearImagen
index c3fa9b45..e3b21c7a 100755
--- a/admin/Interface/CrearImagen
+++ b/admin/Interface/CrearImagen
@@ -42,7 +42,7 @@ echo " " > $OGLOGSESSION; echo " " > $OGLOGCOMMAND; echo " " > ${OGLOGCOMMAND}.t
# Registro de inicio de ejecución
ogEcho log session "$MSG_INTERFACE_START $0 $*"
-# Solo ejecutable por OpenGnSys Client.
+# Solo ejecutable por OpenGnsys Client.
PATH=$PATH:$(dirname $0)
PROG=$(basename $0)
CALLER=$(ogGetCaller)
@@ -53,9 +53,16 @@ fi
# Valor por defecto para el repositorio.
REPO=${4:-"REPO"}
-[ "$REPO" == "$(ogGetRepoIp)" ] && REPO="REPO"
[ "$REPO" == "$(ogGetIpAddress)" ] && REPO="CACHE"
-[ "$REPO" == "CACHE" ] && REPO="CACHE"
+# Si es una ip y es distinta a la del recurso samba cambiamos de REPO.
+ogCheckIpAddress $REPO
+if [ $? == 0 -o $REPO == "REPO" ] ; then
+ # Unidad organizativa
+ [ "$ogunit" != "" ] && OGUNIT="$ogunit"
+ # Si falla el cambio -> salimos con error repositorio no valido
+ ogChangeRepo $REPO $OGUNIT || exit $(ogRaiseError $OG_ERR_NOTFOUND '$REPO'; echo $?)
+ REPO="REPO"
+fi
# Si el destino es REPO y el cliente no está en modo "admin"; activar repositorio para escritura,
if [ "$REPO" == "REPO" -a "$boot" != "admin" ]
@@ -65,11 +72,12 @@ then
[ $RETVAL -gt 0 ] && exit $RETVAL
fi
+ogEcho createImage "$1" "$2" "$4" /"$3"
# Si existe, ejecuta script personalizado "createImageCustom"; si no, llama al genérico "createImage".
if which createImageCustom &>/dev/null; then
- createImageCustom "$1" "$2" "$REPO" /"$3" &>> $OGLOGCOMMAND
+ createImageCustom "$1" "$2" "$4" /"$3" &>> $OGLOGCOMMAND
else
- createImage "$1" "$2" "$REPO" /"$3" &>> $OGLOGCOMMAND
+ createImage "$1" "$2" "$4" /"$3" &>> $OGLOGCOMMAND
fi
RETVAL=$?
diff --git a/admin/Interface/getConfiguration b/admin/Interface/getConfiguration
index 0979986d..ddfc3821 100755
--- a/admin/Interface/getConfiguration
+++ b/admin/Interface/getConfiguration
@@ -7,6 +7,10 @@
#_______________________________________________________________________________________________________________________________
+# No registrar los errores.
+export DEBUG="no"
+
+ser=$(ogGetSerialNumber)
cfg=""
disks=$(ogDiskToDev | wc -w)
for ((dsk=1; dsk<=$disks; dsk++)); do
@@ -18,10 +22,11 @@ for ((dsk=1; dsk<=$disks; dsk++)); do
MSDOS) ptt=1 ;;
GPT) ptt=2 ;;
LVM) ptt=3 ;;
+ ZPOOL) ptt=4 ;;
*) ptt=0 ;;
esac
# Información de disco (partición 0)
- cfg="$cfg$dsk:0:$ptt:::$(ogGetDiskSize $dsk);"
+ cfg="$cfg$dsk:0:$ptt:::$(ogGetDiskSize $dsk):0;"
for ((par=1;par<=$particiones;par++)); do
# Código del identificador de tipo de partición
cod=$(ogGetPartitionId $dsk $par 2>/dev/null)
@@ -33,14 +38,23 @@ for ((dsk=1; dsk<=$disks; dsk++)); do
tam=${tam:-"0"}
# Sistema operativo instalado
case "$fsi" in
- ""|EMPTY|CACHE|LINUX-SWAP|LINUX-LVM)
- soi="" ;;
- *) soi=$(getOsVersion $dsk $par 2>/dev/null | cut -f2 -d:)
- # Sistema de archivos para datos (sistema operativo "DATA")
- [ -z "$soi" -a "$fsi" != "EMPTY" -a "$fsi" != "CACHE" ] && soi="DATA"
+ ""|EMPTY|LINUX-SWAP|LINUX-LVM|ZVOL)
+ soi=""; uso=0 ;;
+ *) if [ -n "$(ogMount $dsk $par 2>/dev/null)" ]; then
+ soi=$(getOsVersion $dsk $par 2>/dev/null | cut -f2 -d:)
+ # Hacer un 2º intento para algunos casos especiales.
+ [ -z "$soi" ] && soi=$(getOsVersion $dsk $par 2>/dev/null | cut -f2 -d:)
+ # Sistema de archivos para datos (sistema operativo "DATA")
+ [ -z "$soi" -a "$fsi" != "EMPTY" -a "$fsi" != "CACHE" ] && soi="DATA"
+ # Obtener porcentaje de uso.
+ uso=$(df $(ogGetMountPoint $dsk $par) | awk '{getline; printf "%d",$5}')
+ uso=${uso:0}
+ else
+ soi=""; uso=0
+ fi
;;
esac
- cfg="$cfg$dsk:$par:$cod:$fsi:$soi:$tam;"
+ cfg="$cfg$dsk:$par:$cod:$fsi:$soi:$tam:$uso;"
done
done
@@ -49,7 +63,7 @@ done
# Guardar salida en fichero temporal.
cfgfile=/tmp/getconfig
-echo $cfg > $cfgfile
+echo "${ser:+$ser;}$cfg" > $cfgfile
# Crear el menú por defecto a partir del fichero generado (no dar ninguna salida).
generateMenuDefault &>/dev/null
@@ -57,9 +71,18 @@ generateMenuDefault &>/dev/null
# Componer salida formateada.
awk '{ n=split($0,sep,";");
for (i=1; i=DEBUG_MAXIMO) {
@@ -1483,6 +1484,11 @@ BOOLEAN RestaurarImagen(TRAMA* ptrTrama)
else
muestraMensaje(11,NULL);
+ /* Obtener nueva configuracin */
+ cfg=LeeConfiguracion();
+ if(!cfg){ // No se puede recuperar la configuracin del cliente
+ errorLog(modulo,36,FALSE);
+ }
/* Envia respuesta de ejecucin de la funcin de interface */
initParametros(ptrTrama,0);
@@ -1491,6 +1497,7 @@ BOOLEAN RestaurarImagen(TRAMA* ptrTrama)
lon+=sprintf(ptrTrama->parametros+lon,"dsk=%s\r",dsk); // Nmero de disco
lon+=sprintf(ptrTrama->parametros+lon,"par=%s\r",par); // Nmero de particin
lon+=sprintf(ptrTrama->parametros+lon,"ifs=%s\r",ifs); // Identificador del perfil software
+ lon+=sprintf(ptrTrama->parametros+lon,"cfg=%s\r",cfg); // Configuracin de discos
respuestaEjecucionComando(ptrTrama,herror,ids);
liberaMemoria(nfn);
@@ -1500,6 +1507,7 @@ BOOLEAN RestaurarImagen(TRAMA* ptrTrama)
liberaMemoria(nci);
liberaMemoria(ipr);
liberaMemoria(ifs);
+ liberaMemoria(cfg);
liberaMemoria(ptc);
liberaMemoria(ids);
@@ -1521,7 +1529,7 @@ BOOLEAN RestaurarImagen(TRAMA* ptrTrama)
BOOLEAN RestaurarImagenBasica(TRAMA* ptrTrama)
{
int lon;
- char *nfn,*dsk,*par,*idi,*ipr,*met,*nci,*rti,*ifs,*msy,*whl,*eli,*cmp,*tpt,*bpi,*cpc,*bpc,*nba,*ids,msglog[LONSTD];
+ char *nfn,*dsk,*par,*idi,*ipr,*met,*nci,*rti,*ifs,*cfg,*msy,*whl,*eli,*cmp,*tpt,*bpi,*cpc,*bpc,*nba,*ids,msglog[LONSTD];
char modulo[] = "RestaurarImagenBasica()";
if (ndebug>=DEBUG_MAXIMO) {
@@ -1544,8 +1552,6 @@ BOOLEAN RestaurarImagenBasica(TRAMA* ptrTrama)
eli=copiaParametro("eli",ptrTrama); // Elimiar archivos en destino que no estn en origen
cmp=copiaParametro("cmp",ptrTrama); // Comprimir antes de enviar
-
-
bpi=copiaParametro("bpi",ptrTrama); // Borrar la imagen antes de crearla
cpc=copiaParametro("cpc",ptrTrama); // Copiar tambin imagen a la cache
bpc=copiaParametro("bpc",ptrTrama); // Borrarla de la cache antes de copiarla en ella
@@ -1565,6 +1571,12 @@ BOOLEAN RestaurarImagenBasica(TRAMA* ptrTrama)
else
muestraMensaje(32,NULL);
+ /* Obtener nueva configuracin */
+ cfg=LeeConfiguracion();
+ if(!cfg){ // No se puede recuperar la configuracin del cliente
+ errorLog(modulo,36,FALSE);
+ }
+
/* Envia respuesta de ejecucin de la funcin de interface */
initParametros(ptrTrama,0);
lon=sprintf(ptrTrama->parametros,"nfn=%s\r","RESPUESTA_RestaurarImagenBasica");
@@ -1572,33 +1584,35 @@ BOOLEAN RestaurarImagenBasica(TRAMA* ptrTrama)
lon+=sprintf(ptrTrama->parametros+lon,"dsk=%s\r",dsk); // Nmero de disco
lon+=sprintf(ptrTrama->parametros+lon,"par=%s\r",par); // Nmero de particin
lon+=sprintf(ptrTrama->parametros+lon,"ifs=%s\r",ifs); // Identificador del perfil software
+ lon+=sprintf(ptrTrama->parametros+lon,"cfg=%s\r",cfg); // Configuracin de discos
respuestaEjecucionComando(ptrTrama,herror,ids);
-
- liberaMemoria(nfn);
- liberaMemoria(dsk);
- liberaMemoria(par);
- liberaMemoria(idi);
- liberaMemoria(nci);
- liberaMemoria(rti);
- liberaMemoria(ifs);
- liberaMemoria(ipr);
+
+ liberaMemoria(nfn);
+ liberaMemoria(dsk);
+ liberaMemoria(par);
+ liberaMemoria(idi);
+ liberaMemoria(nci);
+ liberaMemoria(rti);
+ liberaMemoria(ifs);
+ liberaMemoria(cfg);
+ liberaMemoria(ipr);
liberaMemoria(met);
- liberaMemoria(tpt);
- liberaMemoria(msy);
+ liberaMemoria(tpt);
+ liberaMemoria(msy);
- liberaMemoria(whl);
- liberaMemoria(eli);
- liberaMemoria(cmp);
+ liberaMemoria(whl);
+ liberaMemoria(eli);
+ liberaMemoria(cmp);
- liberaMemoria(bpi);
- liberaMemoria(cpc);
- liberaMemoria(bpc);
+ liberaMemoria(bpi);
+ liberaMemoria(cpc);
+ liberaMemoria(bpc);
liberaMemoria(nba);
- liberaMemoria(ids);
+ liberaMemoria(ids);
muestraMenu();
-
+
return(TRUE);
}
//______________________________________________________________________________________________________
diff --git a/admin/Sources/Clients/ogAdmLnxClient/Makefile b/admin/Sources/Clients/ogAdmLnxClient/Makefile
deleted file mode 100644
index bc2fe3a9..00000000
--- a/admin/Sources/Clients/ogAdmLnxClient/Makefile
+++ /dev/null
@@ -1,34 +0,0 @@
-# makefile
-
-# Nombre del proyecto
-PROYECTO := ogAdmLnxClient
-
-# Directorios y librerias
-DIRS :=
-LIBS := -static
-
-# Opciones de compilacion
-#OPCS := -m32 -O0 -g -Wall # Depuracion
-OPCS := -m32 -O3 -Wall # Optimizacion
-
-# Ficheros objetos
-OBJS := sources/ogAdmLnxClient.o
-
-all: $(PROYECTO)
-
-$(PROYECTO): $(OBJS)
- g++ $(OPCS) $(DIRS) $(LIBS) $(OBJS) -o $(PROYECTO)
- strip $(PROYECTO) # Optimizacion
-
-clean:
- rm $(PROYECTO) $(OBJS)
-
-sources/%.o: sources/%.cpp
- g++ $(OPCS) -c -o"$@" "$<"
-
-sources/%.o: sources/%.c
- gcc $(OPCS) -I ../../Includes -c -o"$@" "$<"
-
-
-
-
diff --git a/admin/Sources/Clients/ogAdmLnxClient/ogAdmLnxClient.cfg b/admin/Sources/Clients/ogAdmLnxClient/ogAdmLnxClient.cfg
deleted file mode 100644
index 80d69686..00000000
--- a/admin/Sources/Clients/ogAdmLnxClient/ogAdmLnxClient.cfg
+++ /dev/null
@@ -1,4 +0,0 @@
-ServidorAdm=Direccin IP del servidor de administracin
-PUERTO=Puerto del servidor de administracin
-IPLOCAL=Direccin IP local
-
diff --git a/admin/Sources/Clients/ogAdmLnxClient/sources/ogAdmLnxClient.c b/admin/Sources/Clients/ogAdmLnxClient/sources/ogAdmLnxClient.c
deleted file mode 100644
index 0c4c431e..00000000
--- a/admin/Sources/Clients/ogAdmLnxClient/sources/ogAdmLnxClient.c
+++ /dev/null
@@ -1,499 +0,0 @@
-// ********************************************************************************************************
-// Cliernte: ogAdmLnxClient
-// Autor: José Manuel Alonso (E.T.S.I.I.) Universidad de Sevilla
-// Fecha Creación: Febrero-2012
-// Fecha Última modificación: Febrero-2012
-// Nombre del fichero: ogAdmLnxClient.c
-// Descripción :Este fichero implementa el cliente windows del sistema
-// ********************************************************************************************************
-#include "ogAdmLnxClient.h"
-#include "ogAdmLib.c"
-
-// ________________________________________________________________________________________________________
-// Función: EjecutarScript
-//
-// Descripción:
-// Ejecuta código de script
-// Parámetros:
-// ptrTrama: contenido del mensaje
-// Devuelve:
-// TRUE: Si el proceso es correcto
-// FALSE: En caso de ocurrir algún error
-//______________________________________________________________________________________________________
-BOOLEAN EjecutarScript(TRAMA* ptrTrama)
-{
- int lon,resul,res;
- char *nfn,*ids,*cod,*scp,msglog[LONSTD];
- char modulo[] = "EjecutarScript()";
-
-
- if (ndebug>=DEBUG_MAXIMO) {
- sprintf(msglog, "%s:%s",tbMensajes[21],modulo);
- infoDebug(msglog);
- }
-
- nfn=copiaParametro("nfn",ptrTrama);
- ids=copiaParametro("ids",ptrTrama);
-
- scp=copiaParametro("scp",ptrTrama);
- cod=URLDecode(scp);
-
- res=0;
- /* Nombre del archivo de script */
- char filescript[LONPRM];
- sprintf(filescript,"/tmp/_script_%s",IPlocal);
- if(!escribeArchivo(filescript,cod)){
- errorLog(modulo, 52, FALSE);
- res=52; // Error al crear fichero de comandos
- }
-
- if(res==0){
- sprintf(filescript,"chmod 0777 /tmp/_script_%s",IPlocal);
-
- resul=system(filescript);
- if (resul==0) {
- sprintf(filescript,"/tmp/_script_%s",IPlocal);
- resul=system(filescript);
- if (resul>0) {
- errorLog(modulo, 86, FALSE);
- }
- }
- }
-
- initParametros(ptrTrama,0);
- lon=sprintf(ptrTrama->parametros,"nfn=%s\r","RESPUESTA_EjecutarScript");
- respuestaEjecucionComando(ptrTrama,resul,ids);
- return(TRUE);
-}
-//________________________________________________________________________________________________________
-// Función: tomaConfiguracion
-//
-// Descripción:
-// Lee el fichero de configuración del servicio
-// Parámetros:
-// filecfg : Ruta completa al fichero de configuración
-// Devuelve:
-// TRUE: Si el proceso es correcto
-// FALSE: En caso de ocurrir algún error
-//________________________________________________________________________________________________________
-BOOLEAN tomaConfiguracion(char* filecfg)
-{
- char modulo[] = "tomaConfiguracion()";
-
- if (filecfg == NULL || strlen(filecfg) == 0) {
- errorLog(modulo, 1, FALSE); // Fichero de configuración del cliente vacío
- return (FALSE);
- }
- FILE *fcfg;
- int lSize;
- char * buffer, *lineas[MAXPRM], *dualparametro[2];
- int i, numlin, resul;
-
- fcfg = fopen(filecfg, "rt");
- if (fcfg == NULL) {
- errorLog(modulo, 2, FALSE); // No existe fichero de configuración del cliente
- return (FALSE);
- }
-
- fseek(fcfg, 0, SEEK_END);
- lSize = ftell(fcfg); // Obtiene tamaño del fichero.
- rewind(fcfg);
- buffer = (char*) reservaMemoria(lSize+1); // Toma memoria para el buffer de lectura.
- if (buffer == NULL) { // No hay memoria suficiente para el buffer
- errorLog(modulo, 3, FALSE);
- return (FALSE);
- }
- lSize=fread(buffer, 1, lSize, fcfg); // Lee contenido del fichero
- buffer[lSize]=CHARNULL;
- fclose(fcfg);
-
- /* Inicializar variables globales */
- servidoradm[0]=CHARNULL;
- puerto[0] = CHARNULL;
- IPlocal[0]=CHARNULL;
-
- numlin = splitCadena(lineas, buffer, '\n');
- for (i = 0; i < numlin; i++){
- splitCadena(dualparametro, lineas[i], '=');
-
- resul = strcmp(StrToUpper(dualparametro[0]), "SERVIDORADM");
- if (resul == 0)
- strcpy(servidoradm, dualparametro[1]);
-
- resul = strcmp(StrToUpper(dualparametro[0]), "PUERTO");
- if (resul == 0)
- strcpy(puerto, dualparametro[1]);
-
- resul = strcmp(StrToUpper(dualparametro[0]), "IPLOCAL");
- if (resul == 0)
- strcpy(IPlocal, dualparametro[1]);
- }
-
- if (servidoradm[0] == CHARNULL) {
- errorLog(modulo,4, FALSE); // Falta parámetro SERVIDORADM
- return (FALSE);
- }
-
- if (puerto[0] == CHARNULL) {
- errorLog(modulo,5, FALSE); // Falta parámetro PUERTO
- return (FALSE);
- }
- if (IPlocal[0] == CHARNULL) {
- errorLog(modulo, 92, FALSE); // Falta parámetro IPLOCAL
- return (FALSE);
- }
- return (TRUE);
-}
-//______________________________________________________________________________________________________
-// Función: InclusionClienteWinLnx
-// Descripción:
-// Abre una sesión en el servidor de administración y registra al cliente en el sistema
-// Parámetros:
-// Ninguno
-// Devuelve:
-// TRUE: Si el proceso es correcto
-// FALSE: En caso de ocurrir algún error
-//______________________________________________________________________________________________________
-BOOLEAN InclusionClienteWinLnx(TRAMA* ptrTrama)
-{
- int lon;
- SOCKET socket_c;
- char modulo[] = "InclusionClienteWinLnx()";
-
- initParametros(ptrTrama,0);
- lon=sprintf(ptrTrama->parametros,"nfn=InclusionClienteWinLnx\r"); // Nombre de la función a ejecutar en el servidor
-
- if(!enviaMensajeServidor(&socket_c,ptrTrama,MSG_PETICION)){
- errorLog(modulo,37,FALSE);
- return(FALSE);
- }
- ptrTrama=recibeMensaje(&socket_c);
- if(!ptrTrama){
- errorLog(modulo,22,FALSE);
- return(FALSE);
- }
- close(socket_c);
-
- if(!gestionaTrama(ptrTrama)){ // Análisis de la trama
- errorLog(modulo,39,FALSE);
- return(FALSE);
- }
-
- return(TRUE);
-}
-//______________________________________________________________________________________________________
-// Función: RESPUESTA_InclusionClienteWinLnx
-//
-// Descripción:
-// Respuesta del servidor de administración a la petición de inicio
-// enviando los datos identificativos del cliente
-// Parámetros:
-// - ptrTrama: Trama recibida por el servidor con el contenido y los parámetros
-// Devuelve:
-// TRUE: Si el proceso es correcto
-// FALSE: En caso de ocurrir algún error
-//______________________________________________________________________________________________________
-BOOLEAN RESPUESTA_InclusionClienteWinLnx(TRAMA* ptrTrama)
-{
- char* res;
- char modulo[] = "RESPUESTA_InclusionClienteWinLnx()";
- int err;
-
- res=copiaParametro("res",ptrTrama); // Resultado del proceso de inclusión
- err=(int)atoi(res); // Código de error devuelto por el servidor
- if(err>0){ // Error en el proceso de inclusión
- errorLog(modulo,41,FALSE);
- errorLog(modulo,err,FALSE);
- return (FALSE);
- }
- strcpy(idordenador,copiaParametro("ido",ptrTrama)); // Identificador del ordenador
- strcpy(nombreordenador,copiaParametro("npc",ptrTrama)); // Nombre del ordenador
-
- if(idordenador==NULL || nombreordenador==NULL){
- errorLog(modulo,40,FALSE);
- return (FALSE);
- }
- return(TRUE);
-}
-//______________________________________________________________________________________________________
-// Función: ProcesaComandos
-//
-// Descripción:
-// Espera comando desde el Servidor de Administración para ejecutarlos
-// Parámetros:
-// Ninguno
-// Devuelve:
-// TRUE: Si el proceso es correcto
-// FALSE: En caso de ocurrir algún error
-// ________________________________________________________________________________________________________
-void procesaComandos(TRAMA* ptrTrama)
-{
- int lon;
- SOCKET socket_c;
- char modulo[] = "procesaComandos()";
-
- initParametros(ptrTrama,0);
- while(TRUE){
- lon=sprintf(ptrTrama->parametros,"nfn=DisponibilidadComandos\r");
- lon+=sprintf(ptrTrama->parametros+lon,"tpc=%s\r",CLIENTE_LNX); // Activar disponibilidad
- if(!enviaMensajeServidor(&socket_c,ptrTrama,MSG_INFORMACION)){
- errorLog(modulo,43,FALSE);
- return;
- }
- infoLog(19); // Disponibilidad de cliente activada
- ptrTrama=recibeMensaje(&socket_c);
- if(!ptrTrama){
- errorLog(modulo,46,FALSE);
- return;
- }
-
- close(socket_c);
-
- if(!gestionaTrama(ptrTrama)){ // Análisis de la trama
- errorLog(modulo,39,FALSE);
- return;
- }
- }
-}
-//_____________________________________________________________________________________________________
-// Función: Apagar
-//
-// Descripción:
-// Apaga el cliente
-// Parámetros:
-// ptrTrama: contenido del mensaje
-// Devuelve:
-// TRUE: Si el proceso es correcto
-// FALSE: En caso de ocurrir algún error
-//_____________________________________________________________________________________________________
-BOOLEAN Apagar(TRAMA* ptrTrama)
-{
- int lon;
- char *ids,msglog[LONSTD];
- char modulo[] = "Apagar()";
-
- if (ndebug>=DEBUG_MAXIMO) {
- sprintf(msglog, "%s:%s",tbMensajes[21],modulo);
- infoDebug(msglog);
- }
- ids=copiaParametro("ids",ptrTrama);
-
- initParametros(ptrTrama,0);
- lon=sprintf(ptrTrama->parametros,"nfn=%s\r","RESPUESTA_Apagar");
- respuestaEjecucionComando(ptrTrama,0,ids);
-
- system("shutdown -h now");
- return(TRUE);
-}
-//_____________________________________________________________________________________________________
-// Función: Reiniciar
-//
-// Descripción:
-// Apaga el cliente
-// Parámetros:
-// ptrTrama: contenido del mensaje
-// Devuelve:
-// TRUE: Si el proceso es correcto
-// FALSE: En caso de ocurrir algún errorservidoradm
-//_____________________________________________________________________________________________________
-BOOLEAN Reiniciar(TRAMA* ptrTrama)
-{
- int lon;
- char *ids,msglog[LONSTD];
- char modulo[] = "Reiniciar()";
-
- if (ndebug>=DEBUG_MAXIMO) {
- sprintf(msglog, "%s:%s",tbMensajes[21],modulo);
- infoDebug(msglog);
- }
- ids=copiaParametro("ids",ptrTrama);
-
- initParametros(ptrTrama,0);
- lon=sprintf(ptrTrama->parametros,"nfn=%s\r","RESPUESTA_Reiniciar");
- respuestaEjecucionComando(ptrTrama,0,ids);
-
- system("shutdown -r now");
-
- return(TRUE);
-}
-//______________________________________________________________________________________________________
-// Función: Sondeo
-//
-// Descripción:
-// Envía al servidor una confirmación de que está dentro del sistema
-// Parámetros:
-// ptrTrama: contenido del mensajede
-// Devuelve:
-// TRUE: Si el proceso es correcto
-// FALSE: En caso de ocurrir algún error
-//______________________________________________________________________________________________________
-BOOLEAN Sondeo(TRAMA* ptrTrama)
-{
- return(TRUE);
-}
-//______________________________________________________________________________________________________
-// Función: respuestaEjecucionComando
-//
-// Descripción:
-// Envia una respuesta a una ejecucion de comando al servidor de Administración
-// Parámetros:
-// - ptrTrama: contenido del mensaje
-// - res: Resultado de la ejecución (Código de error devuelto por el script ejecutado)
-// - ids: Identificador de la sesion (En caso de no haber seguimiento es NULO)
-// Devuelve:
-// TRUE: Si el proceso es correcto
-// FALSE: En caso de ocurrir algún error
-// ________________________________________________________________________________________________________
-BOOLEAN respuestaEjecucionComando(TRAMA* ptrTrama,int res,char *ids)
-{
- int lon;
- SOCKET socket_c;
- char modulo[] = "respuestaEjecucionComando()";
-
- lon=strlen(ptrTrama->parametros);
- if(ids){ // Existe seguimiento
- lon+=sprintf(ptrTrama->parametros+lon,"ids=%s\r",ids); // Añade identificador de la sesión
- }
- if (res==0){ // Resultado satisfactorio
- lon+=sprintf(ptrTrama->parametros+lon,"res=%s\r","1");
- lon+=sprintf(ptrTrama->parametros+lon,"der=%s\r","");
- }
- else{ // Algún error
- lon+=sprintf(ptrTrama->parametros+lon,"res=%s\r","2");
- lon+=sprintf(ptrTrama->parametros+lon,"der=(Errno:%d)-%s\r",res,tbErrores[res]);// Descripción del error
- }
- if(!(enviaMensajeServidor(&socket_c,ptrTrama,MSG_NOTIFICACION))){
- errorLog(modulo,44,FALSE);
- return(FALSE);
- }
- close(socket_c);
- return(TRUE);
-}
-// ________________________________________________________________________________________________________
-// Función: gestionaTrama
-//
-// Descripción:
-// Procesa las tramas recibidas.servidoradm
-// Parametros:
-// ptrTrama: contenido del mensaje
-// Devuelve:
-// TRUE: Si el proceso es correcto
-// FALSE: En caso de ocurrir algún error
-// ________________________________________________________________________________________________________
-BOOLEAN gestionaTrama(TRAMA *ptrTrama)
-{
- int i, res;
- char *nfn;
- char modulo[] = "gestionaTrama()";
-
- INTROaFINCAD(ptrTrama);
- nfn = copiaParametro("nfn", ptrTrama); // Toma nombre de función
-
- for (i = 0; i < MAXIMAS_FUNCIONES; i++) { // Recorre funciones que procesan las tramas
- res = strcmp(tbfuncionesClient[i].nf, nfn);
- if (res == 0) { // Encontrada la función que procesa el mensaje
- return(tbfuncionesClient[i].fptr(ptrTrama)); // Invoca la función
- }
- }
- errorLog(modulo, 18, FALSE);
- return (FALSE);
-}
-//______________________________________________________________________________________________________
-// Función: enviaMensajeServidor
-//
-// Descripción:
-// Envia un mensaje al servidor de Administración
-// Parámetros:
-// - socket_c: (Salida) Socket utilizado para el envío
-// - ptrTrama: contenido del mensaje
-// - tipo: Tipo de mensaje
-// C=Comando, N=Respuesta a un comando, P=Peticion,R=Respuesta a una petición, I=Informacion
-// Devuelve:
-// TRUE: Si el proceso es correcto
-// FALSE: En caso de ocurrir algún error
-// ________________________________________________________________________________________________________
-BOOLEAN enviaMensajeServidor(SOCKET *socket_c,TRAMA *ptrTrama,char tipo)
-{
- int lon;
- char modulo[] = "enviaMensajeServidor()";
-
- *socket_c=abreConexion();
- if(*socket_c==INVALID_SOCKET){
- errorLog(modulo,38,FALSE); // Error de conexión con el servidor
- return(FALSE);
- }
- ptrTrama->arroba='@'; // Cabecera de la trama
- strncpy(ptrTrama->identificador,"JMMLCAMDJ_MCDJ",14); // identificador de la trama
- ptrTrama->tipo=tipo; // Tipo de mensaje
- lon=strlen(ptrTrama->parametros); // Compone la trama
- lon+=sprintf(ptrTrama->parametros+lon,"iph=%s\r",IPlocal); // Ip del ordenador
- lon+=sprintf(ptrTrama->parametros+lon,"ido=%s\r",idordenador); // Identificador del ordenador
- lon+=sprintf(ptrTrama->parametros+lon,"npc=%s\r",nombreordenador); // Nombre del ordenador
-
- if (!mandaTrama(socket_c,ptrTrama)) {
- errorLog(modulo,26,FALSE);
- return (FALSE);
- }
- return(TRUE);
-}
-// ********************************************************************************************************
-// PROGRAMA PRINCIPAL (CLIENTE)
-// ********************************************************************************************************
-int main(int argc, char *argv[])
-{
- TRAMA *ptrTrama;
- char modulo[] = "main()";
-
- ptrTrama=(TRAMA *)reservaMemoria(sizeof(TRAMA));
- if (ptrTrama == NULL) { // No hay memoria suficiente para el bufer de las tramas
- errorLog(modulo, 3, FALSE);
- exit(EXIT_FAILURE);
- }
- /*--------------------------------------------------------------------------------------------------------
- Validación de parámetros de ejecución y fichero de configuración
- ---------------------------------------------------------------------------------------------------------*/
- /*--------------------------------------------------------------------------------------------------------
- Validación de parámetros de ejecución y fichero de configuración
- ---------------------------------------------------------------------------------------------------------*/
- if (!validacionParametros(argc, argv,7)) // Valida parámetros de ejecución
- exit(EXIT_FAILURE);
-
- if (!tomaConfiguracion(szPathFileCfg)) // Toma parametros de configuración
- exit(EXIT_FAILURE);
-
- /*--------------------------------------------------------------------------------------------------------
- Carga catálogo de funciones que procesan las tramas
- ---------------------------------------------------------------------------------------------------------*/
- int cf = 0;
-
- strcpy(tbfuncionesClient[cf].nf, "RESPUESTA_InclusionClienteWinLnx");
- tbfuncionesClient[cf++].fptr = &RESPUESTA_InclusionClienteWinLnx;
-
- strcpy(tbfuncionesClient[cf].nf, "Apagar");
- tbfuncionesClient[cf++].fptr = &Apagar;
-
- strcpy(tbfuncionesClient[cf].nf, "Reiniciar");
- tbfuncionesClient[cf++].fptr = &Reiniciar;
-
- strcpy(tbfuncionesClient[cf].nf, "Sondeo");
- tbfuncionesClient[cf++].fptr = &Sondeo;
-
- strcpy(tbfuncionesClient[cf].nf, "EjecutarScript");
- tbfuncionesClient[cf++].fptr = &EjecutarScript;
-
- /*--------------------------------------------------------------------------------------------------------
- Inicio de sesión
- ---------------------------------------------------------------------------------------------------------*/
- infoLog(1); // Inicio de sesión
- infoLog(3); // Abriendo sesión en el servidor de Administración;
- /*--------------------------------------------------------------------------------------------------------
- Inclusión del cliente en el sistema
- ---------------------------------------------------------------------------------------------------------*/
- if(!InclusionClienteWinLnx(ptrTrama)){ // Ha habido algún problema al abrir sesión
- errorLog(modulo,0,FALSE);
- exit(EXIT_FAILURE);
- }
- infoLog(4); // Cliente iniciado
- procesaComandos(ptrTrama); // Bucle para procesar comandos interactivos
- exit(EXIT_SUCCESS);
-}
diff --git a/admin/Sources/Clients/ogAdmLnxClient/sources/ogAdmLnxClient.h b/admin/Sources/Clients/ogAdmLnxClient/sources/ogAdmLnxClient.h
deleted file mode 100644
index 8371d2e4..00000000
--- a/admin/Sources/Clients/ogAdmLnxClient/sources/ogAdmLnxClient.h
+++ /dev/null
@@ -1,54 +0,0 @@
-// ********************************************************************************************************
-// Cliernte: ogAdmLnxClient
-// Autor: José Manuel Alonso (E.T.S.I.I.) Universidad de Sevilla
-// Fecha Creación: Marzo-2010
-// Fecha Última modificación: Marzo-2010
-// Nombre del fichero: ogAdmLnxClient.h
-// Descripción :Este fichero implementa el cliente general del sistema
-// ********************************************************************************************************
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include "ogAdmLib.h"
-// ________________________________________________________________________________________________________
-// Variables globales
-// ________________________________________________________________________________________________________
-char idordenador[LONPRM]; // Identificador del ordenador
-char nombreordenador[LONPRM]; // Nombre del ordenador
-
-char servidoradm[LONPRM]; // Dirección IP del servidor de administración
-char puerto[LONPRM]; // Puerto de comunicación
-char IPlocal[LONPRM]; // Path donde está la interface entre la administración y el módulo de clonación
-
-
-typedef struct{ // Estructura usada para referenciar las funciones que procesan las tramas
- char nf[LONFUN]; // Nombre de la función
- BOOLEAN (*fptr)(TRAMA*); // Puntero a la función que procesa la trama
-}MSGFUN;
-MSGFUN tbfuncionesClient[MAXIMAS_FUNCIONES];
-// ________________________________________________________________________________________________________
-// Prototipo de funciones
-// ________________________________________________________________________________________________________
-
-void procesaComandos(TRAMA*);
-BOOLEAN gestionaTrama(TRAMA *);
-BOOLEAN InclusionClienteWinLnx();
-BOOLEAN RESPUESTA_InclusionClienteWinLnx(TRAMA *);
-BOOLEAN respuestaEjecucionComando(TRAMA *,int,char*);
-
-BOOLEAN Apagar(TRAMA *);
-BOOLEAN Reiniciar(TRAMA *);
-BOOLEAN Sondeo(TRAMA *);
-
-BOOLEAN enviaMensajeServidor(SOCKET *,TRAMA *,char);
-
diff --git a/admin/Sources/Clients/ogAdmWinClient/Readme b/admin/Sources/Clients/ogAdmWinClient/Readme
deleted file mode 100644
index 6585e818..00000000
--- a/admin/Sources/Clients/ogAdmWinClient/Readme
+++ /dev/null
@@ -1,25 +0,0 @@
- El cliente opengnsys para Windows es una aplicacin que se instala como un servicio, de esta manera, no es necesario
- abrir sesin en este sistema operativo para que la mquina cliente se comunique con el administrador de opengnsys.
- Actualmente slo responde a los comandos "Apagar" y "Reiniciar".
-
-
-Para INSTALAR esta aplicacin como un servicio windows hay que seguir los siguentes pasos:
-
-1) Copiar el ejecutable ogAdmWinClient.exe en una carpeta cualquiera --se aconseja la carpeta c:\Windows\system32\opengnsys, crendola previamente--.
-2) Abrir una consola y posicionarse en la carpeta seleccionada
-3) Teclear:
- c>ogAdmClient t -install -s [IP servidor Opengnsys] -p [puerto] -i [IP local usada para comunicaciones con el servidor]
-
-Este servicio se da de alta en la base de datos de servicios de Windows con estado "detenido" y "manual" por lo que es necesario abrir la consola
-del administrador de servicios de Windows para iniciarlos y modificar las propiedades para que arranquen automticamente al iniciarse Windows.
-
-
- Para DESINTALAR esta aplicacin una vez que se ha instalado como servicio hay que hacer:
- 1) Abrir una consola y posicionarse en la carpeta donde est el ejecutable del servicio
- 2) Teclear:
- c>ogAdmClient t -remove
-
-
-
-*** El fichero de log del servicio se llama por defecto ogAdmWinClient.log y estar en el caso de que la carpeta del ejecutable sea c:\Windows\system32\opengnsys,
- este archivo estar en c:\Windows\system32\
diff --git a/admin/Sources/Clients/ogAdmWinClient/sources/ogAdmWinClient.cpp b/admin/Sources/Clients/ogAdmWinClient/sources/ogAdmWinClient.cpp
deleted file mode 100644
index 2f164d41..00000000
--- a/admin/Sources/Clients/ogAdmWinClient/sources/ogAdmWinClient.cpp
+++ /dev/null
@@ -1,713 +0,0 @@
-// ********************************************************************************************************
-// Cliente: ogAdmWinClient
-// Autor: Jos Manuel Alonso (E.T.S.I.I.) Universidad de Sevilla
-// Fecha Creacin: Febrero-2012
-// Fecha ltima modificacin: Febrero-2012
-// Nombre del fichero: ogAdmWinClient.cpp
-// Descripcin :Este fichero implementa el cliente windows del sistema
-// ********************************************************************************************************
-#include "ogAdmWinClient.h"
-#include "ogAdmLib.c"
-#include "registrow.c"
-//________________________________________________________________________________________________________
-// Funcin: tomaConfiguracion
-//
-// Descripcin:
-// Lee el fichero de configuracin del servicio
-// Parmetros:
-// filecfg : Ruta completa al fichero de configuracin
-// Devuelve:
-// TRUE: Si el proceso es correcto
-// FALSE: En caso de ocurrir algn error
-//________________________________________________________________________________________________________
-BOOLEAN tomaConfiguracion(char* filecfg)
-{
- char modulo[] = "tomaConfiguracion()";
-
- if (filecfg == NULL || strlen(filecfg) == 0) {
- errorLog(modulo, 1, FALSE); // Fichero de configuracin del cliente vaco
- return (FALSE);
- }
- FILE *fcfg;
- int lSize;
- char * buffer, *lineas[MAXPRM], *dualparametro[2];
- int i, numlin, resul;
-
- fcfg = fopen(filecfg, "rt");
- if (fcfg == NULL) {
- errorLog(modulo, 2, FALSE); // No existe fichero de configuracin del cliente
- return (FALSE);
- }
-
- fseek(fcfg, 0, SEEK_END);
- lSize = ftell(fcfg); // Obtiene tamao del fichero.
- rewind(fcfg);
- buffer = (char*) reservaMemoria(lSize+1); // Toma memoria para el buffer de lectura.
- if (buffer == NULL) { // No hay memoria suficiente para el buffer
- errorLog(modulo, 3, FALSE);
- return (FALSE);
- }
- lSize=fread(buffer, 1, lSize, fcfg); // Lee contenido del fichero
- buffer[lSize]=CHARNULL;
- fclose(fcfg);
-
- /* Inicializar variables globales */
- servidoradm[0]=CHARNULL;
- puerto[0] = CHARNULL;
- IPlocal[0]=CHARNULL;
-
- numlin = splitCadena(lineas, buffer, '\n');
- for (i = 0; i < numlin; i++){
- splitCadena(dualparametro, lineas[i], '=');
-
- resul = strcmp(StrToUpper(dualparametro[0]), "SERVIDORADM");
- if (resul == 0)
- strcpy(servidoradm, dualparametro[1]);
-
- resul = strcmp(StrToUpper(dualparametro[0]), "PUERTO");
- if (resul == 0)
- strcpy(puerto, dualparametro[1]);
-
- resul = strcmp(StrToUpper(dualparametro[0]), "IPLOCAL");
- if (resul == 0)
- strcpy(IPlocal, dualparametro[1]);
- }
-
- if (servidoradm[0] == CHARNULL) {
- errorLog(modulo,4, FALSE); // Falta parmetro SERVIDORADM
- return (FALSE);
- }
-
- if (puerto[0] == CHARNULL) {
- errorLog(modulo,5, FALSE); // Falta parmetro PUERTO
- return (FALSE);
- }
- if (IPlocal[0] == CHARNULL) {
- errorLog(modulo, 92, FALSE); // Falta parmetro IPLOCAL
- return (FALSE);
- }
- return (TRUE);
-}
-//______________________________________________________________________________________________________
-// Funcin: InclusionClienteWinLnx
-// Descripcin:
-// Abre una sesin en el servidor de administracin y registra al cliente en el sistema
-// Parmetros:
-// Ninguno
-// Devuelve:
-// TRUE: Si el proceso es correcto
-// FALSE: En caso de ocurrir algn error
-//______________________________________________________________________________________________________
-BOOLEAN InclusionClienteWinLnx(TRAMA* ptrTrama)
-{
- int lon;
- SOCKET socket_c;
- char modulo[] = "InclusionClienteWinLnx()";
-
- initParametros(ptrTrama,0);
- lon=sprintf(ptrTrama->parametros,"nfn=InclusionClienteWinLnx\r"); // Nombre de la funcin a ejecutar en el servidor
-
- if(!enviaMensajeServidor(&socket_c,ptrTrama,MSG_PETICION)){
- errorLog(modulo,37,FALSE);
- return(FALSE);
- }
- ptrTrama=recibeMensaje(&socket_c);
- if(!ptrTrama){
- errorLog(modulo,22,FALSE);
- return(FALSE);
- }
- closesocket(socket_c);
-
- if(!gestionaTrama(ptrTrama)){ // Anlisis de la trama
- errorLog(modulo,39,FALSE);
- return(FALSE);
- }
-
- return(TRUE);
-}
-//______________________________________________________________________________________________________
-// Funcin: RESPUESTA_InclusionClienteWinLnx
-//
-// Descripcin:
-// Respuesta del servidor de administracin a la peticin de inicio
-// enviando los datos identificativos del cliente
-// Parmetros:
-// - ptrTrama: Trama recibida por el servidor con el contenido y los parmetros
-// Devuelve:
-// TRUE: Si el proceso es correcto
-// FALSE: En caso de ocurrir algn error
-//______________________________________________________________________________________________________
-BOOLEAN RESPUESTA_InclusionClienteWinLnx(TRAMA* ptrTrama)
-{
- char* res;
- char modulo[] = "RESPUESTA_InclusionClienteWinLnx()";
- int err;
-
- res=copiaParametro("res",ptrTrama); // Resultado del proceso de inclusin
- err=(int)atoi(res); // Cdigo de error devuelto por el servidor
- if(err>0){ // Error en el proceso de inclusin
- errorLog(modulo,41,FALSE);
- errorLog(modulo,err,FALSE);
- return (FALSE);
- }
- strcpy(idordenador,copiaParametro("ido",ptrTrama)); // Identificador del ordenador
- strcpy(nombreordenador,copiaParametro("npc",ptrTrama)); // Nombre del ordenador
-
- if(idordenador==NULL || nombreordenador==NULL){
- errorLog(modulo,40,FALSE);
- return (FALSE);
- }
- return(TRUE);
-}
-//______________________________________________________________________________________________________
-// Funcin: ProcesaComandos
-//
-// Descripcin:
-// Espera comando desde el Servidor de Administracin para ejecutarlos
-// Parmetros:
-// Ninguno
-// Devuelve:
-// TRUE: Si el proceso es correcto
-// FALSE: En caso de ocurrir algn error
-// ________________________________________________________________________________________________________
-void procesaComandos(TRAMA* ptrTrama)
-{
- int lon;
- SOCKET socket_c;
- char modulo[] = "procesaComandos()";
-
- initParametros(ptrTrama,0);
- while(TRUE){
- lon=sprintf(ptrTrama->parametros,"nfn=DisponibilidadComandos\r");
- lon+=sprintf(ptrTrama->parametros+lon,"tpc=%s\r",CLIENTE_WIN); // Activar disponibilidad
- if(!enviaMensajeServidor(&socket_c,ptrTrama,MSG_INFORMACION)){
- errorLog(modulo,43,FALSE);
- return;
- }
- infoLog(19); // Disponibilidad de cliente activada
- ptrTrama=recibeMensaje(&socket_c);
- if(!ptrTrama){
- errorLog(modulo,46,FALSE);
- return;
- }
-
- closesocket(socket_c);
-
- if(!gestionaTrama(ptrTrama)){ // Anlisis de la trama
- errorLog(modulo,39,FALSE);
- return;
- }
- }
-}
-//_____________________________________________________________________________________________________
-// Funcin: Apagar
-//
-// Descripcin:
-// Apaga el cliente
-// Parmetros:
-// ptrTrama: contenido del mensaje
-// Devuelve:
-// TRUE: Si el proceso es correcto
-// FALSE: En caso de ocurrir algn error
-//_____________________________________________________________________________________________________
-BOOLEAN Apagar(TRAMA* ptrTrama)
-{
- int lon;
- char *ids,msglog[LONSTD];
- char modulo[] = "Apagar()";
-
- if (ndebug>=DEBUG_MAXIMO) {
- sprintf(msglog, "%s:%s",tbMensajes[21],modulo);
- infoDebug(msglog);
- }
- ids=copiaParametro("ids",ptrTrama);
-
- initParametros(ptrTrama,0);
- lon=sprintf(ptrTrama->parametros,"nfn=%s\r","RESPUESTA_Apagar");
- respuestaEjecucionComando(ptrTrama,0,ids);
-
- if(versionWin<5)
- ApagarReiniciar(EWX_POWEROFF | EWX_FORCE,ids,0);
- else
- ApagarReiniciar(EWX_SHUTDOWN | EWX_FORCE,ids,0);
- return(TRUE);
-}
-//_____________________________________________________________________________________________________
-// Funcin: Reiniciar
-//
-// Descripcin:
-// Apaga el cliente
-// Parmetros:
-// ptrTrama: contenido del mensaje
-// Devuelve:
-// TRUE: Si el proceso es correcto
-// FALSE: En caso de ocurrir algn errorservidoradm
-//_____________________________________________________________________________________________________
-BOOLEAN Reiniciar(TRAMA* ptrTrama)
-{
- int lon;
- char *ids,msglog[LONSTD];
- char modulo[] = "Reiniciar()";
-
- if (ndebug>=DEBUG_MAXIMO) {
- sprintf(msglog, "%s:%s",tbMensajes[21],modulo);
- infoDebug(msglog);
- }
- ids=copiaParametro("ids",ptrTrama);
-
- initParametros(ptrTrama,0);
- lon=sprintf(ptrTrama->parametros,"nfn=%s\r","RESPUESTA_Reiniciar");
- respuestaEjecucionComando(ptrTrama,0,ids);
-
- if(versionWin<5)
- ApagarReiniciar(EWX_REBOOT | EWX_FORCE,ids,1);
- else
- ApagarReiniciar(EWX_REBOOT | EWX_FORCE,ids,1);
-
- return(TRUE);
-}
-// _____________________________________________________________________________________________________________
-//
-// Funcin: ApagarReiniciar
-//
-// Descripcin:
-// Apaga o reinicia el ordenador o bien hace logout del usuario
-//
-// Parmetros:
-// - uFlags : Especifica el tipo de shutdown
-// _____________________________________________________________________________________________________________
-BOOLEAN ApagarReiniciar(UINT uFlags,char *ids,int sw)
-{
- HANDLE hToken;
- TOKEN_PRIVILEGES tkp;
- char modulo[] = "Reiniciar()";
-
- if (versionWin>4){
- if (!ExitWindowsEx(uFlags, 0)) {
- errorLog(modulo,86,FALSE);
- return(FALSE);
- }
- return TRUE;
- }
- // Get a token for this process.
- if (!OpenProcessToken(GetCurrentProcess(),TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, &hToken)) {
- errorLog(modulo,86,FALSE);
- return(FALSE);
- }
-
- // Get the LUID for the shutdown privilege.
- LookupPrivilegeValue(NULL, SE_SHUTDOWN_NAME,&tkp.Privileges[0].Luid);
-
- tkp.PrivilegeCount = 1; // one privilege to set
- tkp.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;
-
- // Get the shutdown privilege for this process.
- AdjustTokenPrivileges(hToken, FALSE, &tkp, 0, (PTOKEN_PRIVILEGES)NULL, 0);
-
- if (GetLastError() != ERROR_SUCCESS) {
- errorLog(modulo,86,FALSE);
- return(FALSE);
- }
-
- // Shut down the system and force all applications to close.
- if (!ExitWindowsEx(uFlags, 0)) {
- errorLog(modulo,86,FALSE);
- return(FALSE);
- }
-
- return TRUE;
-}
-// _____________________________________________________________________________________________________________
-//
-// Funcin: TomaVersionWindows
-//
-// Descripcin:
-// Toma la versin del sistema operativo
-//
-// Valores de retorno:
-// 1.- Microsoft Windows Server 2003
-// 2.- Microsoft Windows XP
-// 3.- Microsoft Windows 2000
-// 4.- Microsoft Windows NT
-// 5.- Microsoft Windows 95
-// 6.- Microsoft Windows 98
-// 7.- Microsoft Windows Millennium Edition
-// _____________________________________________________________________________________________________________
-int TomaVersionWindows()
-{
- OSVERSIONINFOEX osvi;
- BOOL bOsVersionInfoEx;
-
- // Intenta tomar la version usando la estructura OSVERSIONINFOEX
- // Si falla lo intentausando la estructura OSVERSIONINFO.
-
- ZeroMemory(&osvi, sizeof(OSVERSIONINFOEX));
- osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);
-
- if( !(bOsVersionInfoEx = GetVersionEx ((OSVERSIONINFO *) &osvi)) ){
- osvi.dwOSVersionInfoSize = sizeof (OSVERSIONINFO);
- if (! GetVersionEx ( (OSVERSIONINFO *) &osvi) )
- return -1;
- }
- switch (osvi.dwPlatformId){
- // Test for the Windows NT product family.
- case VER_PLATFORM_WIN32_NT:
- if ( osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 2 )
- return(1); // Microsoft Windows Server 2003
- if ( osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 1 )
- return(2); // Microsoft Windows XP
- if ( osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 0 )
- return(3); // Microsoft Windows 2000
- if ( osvi.dwMajorVersion <= 4 )
- return(4); // Microsoft Windows NT
- break;
-
- // Test for the Windows Me/98/95.
- case VER_PLATFORM_WIN32_WINDOWS:
- if (osvi.dwMajorVersion == 4 && osvi.dwMinorVersion == 0)
- return(5); // Microsoft Windows 95
- if (osvi.dwMajorVersion == 4 && osvi.dwMinorVersion == 10)
- return(6); // Microsoft Windows 98
- if (osvi.dwMajorVersion == 4 && osvi.dwMinorVersion == 90)
- return(7); // Microsoft Windows Millennium Edition
- break;
- }
- return -1;
-}
-//______________________________________________________________________________________________________
-// Funcin: Sondeo
-//
-// Descripcin:
-// Enva al servidor una confirmacin de que est dentro del sistema
-// Parmetros:
-// ptrTrama: contenido del mensajede
-// Devuelve:
-// TRUE: Si el proceso es correcto
-// FALSE: En caso de ocurrir algn error
-//______________________________________________________________________________________________________
-BOOLEAN Sondeo(TRAMA* ptrTrama)
-{
- return(TRUE);
-}
-//______________________________________________________________________________________________________
-// Funcin: Actualizar
-//
-// Descripcin:
-// Enva al servidor una confirmacin de que est dentro del sistema
-// Parmetros:
-// ptrTrama: contenido del mensajede
-// Devuelve:
-// TRUE: Si el proceso es correcto
-// FALSE: En caso de ocurrir algn error
-//______________________________________________________________________________________________________
-BOOLEAN Actualizar(TRAMA* ptrTrama)
-{
- return(TRUE);
-}
-//______________________________________________________________________________________________________
-// Funcin: respuestaEjecucionComando
-//
-// Descripcin:
-// Envia una respuesta a una ejecucion de comando al servidor de Administracin
-// Parmetros:
-// - ptrTrama: contenido del mensaje
-// - res: Resultado de la ejecucin (Cdigo de error devuelto por el script ejecutado)
-// - ids: Identificador de la sesion (En caso de no haber seguimiento es NULO)
-// Devuelve:
-// TRUE: Si el proceso es correcto
-// FALSE: En caso de ocurrir algn error
-// ________________________________________________________________________________________________________
-BOOLEAN respuestaEjecucionComando(TRAMA* ptrTrama,int res,char *ids)
-{
- int lon;
- SOCKET socket_c;
- char modulo[] = "respuestaEjecucionComando()";
-
- lon=strlen(ptrTrama->parametros);
- if(ids){ // Existe seguimiento
- lon+=sprintf(ptrTrama->parametros+lon,"ids=%s\r",ids); // Aade identificador de la sesin
- }
- if (res==0){ // Resultado satisfactorio
- lon+=sprintf(ptrTrama->parametros+lon,"res=%s\r","1");
- lon+=sprintf(ptrTrama->parametros+lon,"der=%s\r","");
- }
- else{ // Algn error
- lon+=sprintf(ptrTrama->parametros+lon,"res=%s\r","2");
- lon+=sprintf(ptrTrama->parametros+lon,"der=%s\r",tbErrores[res]);// Descripcin del error
- }
- if(!(enviaMensajeServidor(&socket_c,ptrTrama,MSG_NOTIFICACION))){
- errorLog(modulo,44,FALSE);
- return(FALSE);
- }
- closesocket(socket_c);
- return(TRUE);
-}
-// ________________________________________________________________________________________________________
-// Funcin: gestionaTrama
-//
-// Descripcin:
-// Procesa las tramas recibidas.servidoradm
-// Parametros:
-// ptrTrama: contenido del mensaje
-// Devuelve:
-// TRUE: Si el proceso es correcto
-// FALSE: En caso de ocurrir algn error
-// ________________________________________________________________________________________________________
-BOOLEAN gestionaTrama(TRAMA *ptrTrama)
-{
- int i, res;
- char *nfn;
- char modulo[] = "gestionaTrama()";
-
- INTROaFINCAD(ptrTrama);
- nfn = copiaParametro("nfn", ptrTrama); // Toma nombre de funcin
- for (i = 0; i < MAXIMAS_FUNCIONES; i++) { // Recorre funciones que procesan las tramas
- res = strcmp(tbfuncionesClient[i].nf, nfn);
- if (res == 0) { // Encontrada la funcin que procesa el mensaje
- return(tbfuncionesClient[i].fptr(ptrTrama)); // Invoca la funcin
- }
- }
- errorLog(modulo, 18, FALSE);
- return (FALSE);
-}
-//______________________________________________________________________________________________________
-// Funcin: enviaMensajeServidor
-//
-// Descripcin:
-// Envia un mensaje al servidor de Administracin
-// Parmetros:
-// - socket_c: (Salida) Socket utilizado para el envo
-// - ptrTrama: contenido del mensaje
-// - tipo: Tipo de mensaje
-// C=Comando, N=Respuesta a un comando, P=Peticion,R=Respuesta a una peticin, I=Informacion
-// Devuelve:
-// TRUE: Si el proceso es correcto
-// FALSE: En caso de ocurrir algn error
-// ________________________________________________________________________________________________________
-BOOLEAN enviaMensajeServidor(SOCKET *socket_c,TRAMA *ptrTrama,char tipo)
-{
- int lon;
- char modulo[] = "enviaMensajeServidor()";
-
- *socket_c=abreConexion();
- if(*socket_c==INVALID_SOCKET){
- errorLog(modulo,38,FALSE); // Error de conexin con el servidor
- return(FALSE);
- }
- ptrTrama->arroba='@'; // Cabecera de la trama
- strncpy(ptrTrama->identificador,"JMMLCAMDJ_MCDJ",14); // identificador de la trama
- ptrTrama->tipo=tipo; // Tipo de mensaje
- lon=strlen(ptrTrama->parametros); // Compone la trama
- lon+=sprintf(ptrTrama->parametros+lon,"iph=%s\r",IPlocal); // Ip del ordenador
- lon+=sprintf(ptrTrama->parametros+lon,"ido=%s\r",idordenador); // Identificador del ordenador
- lon+=sprintf(ptrTrama->parametros+lon,"npc=%s\r",nombreordenador); // Nombre del ordenador
-
- if (!mandaTrama(socket_c,ptrTrama)) {
- errorLog(modulo,26,FALSE);
- return (FALSE);
- }
- return(TRUE);
-}
-// _____________________________________________________________________________________________________________
-// Funcin: TomaParametrosReg
-//
-// Descripcin:
-// Toma los parmetros de conexin del registro
-// Devuelve:
-// TRUE: Si el proceso es correcto
-// FALSE: En caso de ocurrir algn error
-// _____________________________________________________________________________________________________________
-BOOLEAN TomaParametrosReg()
-{
- if(!ReadRegistryString(HIVE,BASE,"servidoradm",servidoradm,20))
- return(FALSE);
-
- if(!ReadRegistryString(HIVE,BASE,"puerto",puerto,20))
- return(FALSE);
-
- if(!ReadRegistryString(HIVE,BASE,"Iplocal",IPlocal,20))
- return(FALSE);
-
- return(TRUE);
-}
-//______________________________________________________________________________________________________
-// Funcin: TomaIP
-//
-// Descripcin:
-// Recupera la ip de la mquina
-// Parmetros:
-// Ninguno
-// Devuelve:
-// TRUE: Si el proceso es correcto
-// FALSE: En caso de ocurrir algn error
-// ________________________________________________________________________________________________________
-BOOLEAN TomaIP(char* ip)
-{
- char ac[80];
- struct in_addr addr;
- BOOLEAN ipv;
-
- if (gethostname(ac, sizeof(ac)) == SOCKET_ERROR) {
- return (FALSE);
- }
- struct hostent *phe = gethostbyname(ac);
- if (phe == 0) {
- return (FALSE);
- }
- ipv=FALSE;
- for (int i = 0; phe->h_addr_list[i] != 0 && !ipv; ++i) {
- memcpy(&addr, phe->h_addr_list[i], sizeof(struct in_addr));
- strcpy(ip,inet_ntoa(addr));
- if(strcmp(IPlocal,"127.0.0.1")==0)
- ipv=FALSE;
- else{
- ipv=true; // IP vlida distinta a loop
- break;
- }
- }
-
- return(ipv);
-}
-// ********************************************************************************************************
-// PROGRAMA PRINCIPAL (CLIENTE)
-// ********************************************************************************************************
-//int main(int argc, char *argv[])
-VOID ServiceStart (DWORD dwArgc, LPTSTR *lpszArgv)
- {
- //___________________________________________________________
- //
- // Service initialization (Report the status to the service control manager)
- //___________________________________________________________
- //
- if (!ReportStatusToSCMgr(
- SERVICE_START_PENDING, // service state
- NO_ERROR, // exit code
- 3000)) // wait hint
- return;
- //__________________________________________
-
- TRAMA *ptrTrama;
- char modulo[] = "main()";
-
- strcpy(szPathFileLog, "ogAdmWinClient.log"); // de configuracin y de logs
-
-
- WSADATA wsd;
- if (WSAStartup(MAKEWORD(2,2),&wsd)!=0){ // Carga librera Winsock
- errorLog(modulo, 93, FALSE);
- exit(EXIT_FAILURE);
- }
-
- ptrTrama=(TRAMA *)reservaMemoria(sizeof(TRAMA));
- if (ptrTrama == NULL) { // No hay memoria suficiente para el bufer de las tramas
- errorLog(modulo, 3, FALSE);
- exit(EXIT_FAILURE);
- }
- /*--------------------------------------------------------------------------------------------------------
- Validacin de parmetros de ejecucin y fichero de configuracin
- ---------------------------------------------------------------------------------------------------------*/
- if(!TomaParametrosReg()) // Toma parametros de configuracion
- exit(EXIT_FAILURE);
-
- //___________________________________________________________
- //
- // Service initialization (Report the status to the service control manager)
- //___________________________________________________________
- //
- if (!ReportStatusToSCMgr(
- SERVICE_START_PENDING, // service state
- NO_ERROR, // exit code
- 3000)) // wait hint
- return;
- //__________________________________________
- //
- // Toma IP local
- //___________________________________________
- //
- // Toma la ip tambin del registro
- /*if(!TomaIP(IPlocal)){
- errorLog(modulo,85,FALSE);
- exit(EXIT_FAILURE);
- }
- */
- versionWin=TomaVersionWindows(); // Toma versin de windows
-
- /*--------------------------------------------------------------------------------------------------------
- Carga catlogo de funciones que procesan las tramas
- ---------------------------------------------------------------------------------------------------------*/
- int cf = 0;
-
- strcpy(tbfuncionesClient[cf].nf, "RESPUESTA_InclusionClienteWinLnx");
- tbfuncionesClient[cf++].fptr = &RESPUESTA_InclusionClienteWinLnx;
-
- strcpy(tbfuncionesClient[cf].nf, "Apagar");
- tbfuncionesClient[cf++].fptr = &Apagar;
-
- strcpy(tbfuncionesClient[cf].nf, "Reiniciar");
- tbfuncionesClient[cf++].fptr = &Reiniciar;
-
- strcpy(tbfuncionesClient[cf].nf, "Sondeo");
- tbfuncionesClient[cf++].fptr = &Sondeo;
-
- strcpy(tbfuncionesClient[cf].nf, "Actualizar");
- tbfuncionesClient[cf++].fptr = &Actualizar;
-
- /*--------------------------------------------------------------------------------------------------------
- Inicio de sesin
- ---------------------------------------------------------------------------------------------------------*/
- infoLog(1); // Inicio de sesin
- infoLog(3); // Abriendo sesin en el servidor de Administracin;
- /*--------------------------------------------------------------------------------------------------------
- Inclusin del cliente en el sistema
- ---------------------------------------------------------------------------------------------------------*/
- if(!InclusionClienteWinLnx(ptrTrama)){ // Ha habido algn problema al abrir sesin
- errorLog(modulo,0,FALSE);
- exit(EXIT_FAILURE);
- }
- infoLog(4); // Cliente iniciado
-
- //__________________________________________
- // El servicio est instalado y debe ser iniciado
- // -- report the status to the service control manager.--
- //
- if (!ReportStatusToSCMgr(
- SERVICE_RUNNING, // service state
- NO_ERROR, // exit code
- 0)) // wait hint
- return;
- // End of initialization
- //__________________________________________
-
- //
- // Service is now running, perform work until shutdown
- //
- while (ssStatus.dwCurrentState == SERVICE_RUNNING) { // Bucle para escuchar peticiones de clientes
- procesaComandos(ptrTrama); // Bucle para procesar comandos interactivos
- }
- WSACleanup();
- // El servicio de detiene
-}
-/* _____________________________________________________________________________________________________________
- FUNCTION: ServiceStop
-
- PURPOSE: Stops the service
- PARAMETERS:
- none
-
- RETURN VALUE:
- none
-
- COMMENTS:
-
- If a ServiceStop procedure is going to
- take longer than 3 seconds to execute,
- it should spawn a thread to execute the
- stop code, and return. Otherwise, the
- ServiceControlManager will believe that
- the service has stopped responding.
- _____________________________________________________________________________________________________________*/
-VOID ServiceStop()
-{
- // Incluir aqu el cdigo necesario antes de parar el servicio
- ReportStatusToSCMgr(SERVICE_STOPPED, NO_ERROR, 0);
-}
\ No newline at end of file
diff --git a/admin/Sources/Clients/ogAdmWinClient/sources/ogAdmWinClient.h b/admin/Sources/Clients/ogAdmWinClient/sources/ogAdmWinClient.h
deleted file mode 100644
index 55e33ad8..00000000
--- a/admin/Sources/Clients/ogAdmWinClient/sources/ogAdmWinClient.h
+++ /dev/null
@@ -1,60 +0,0 @@
-// ********************************************************************************************************
-// Cliente: ogAdmWinClient
-// Autor: José Manuel Alonso (E.T.S.I.I.) Universidad de Sevilla
-// Fecha Creación: Febrero-2012
-// Fecha Última modificación: Febrero-2012
-// Nombre del fichero: ogAdmWinClient.h
-// Descripción :Este fichero implementa el cliente general del sistema
-// ********************************************************************************************************
-#define __WINDOWS__
-
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-#include "registrow.h"
-#include "ogAdmLib.h"
-#include "servicio.h"
-// ________________________________________________________________________________________________________
-// Variables globales
-// ________________________________________________________________________________________________________
-//
-int versionWin;
-char idordenador[LONPRM]; // Identificador del ordenador
-char nombreordenador[LONPRM]; // Nombre del ordenador
-
-char servidoradm[LONPRM]; // Dirección IP del servidor de administración
-char puerto[LONPRM]; // Puerto de comunicación
-char IPlocal[LONPRM]; // Ip local por donde se van a enviar las comunicaciones
-
-
-typedef struct{ // Estructura usada para referenciar las funciones que procesan las tramas
- char nf[LONFUN]; // Nombre de la función
- BOOLEAN (*fptr)(TRAMA*); // Puntero a la función que procesa la trama
-}MSGFUN;
-MSGFUN tbfuncionesClient[MAXIMAS_FUNCIONES];
-// ________________________________________________________________________________________________________
-// Prototipo de funciones
-// ________________________________________________________________________________________________________
-
-void procesaComandos(TRAMA*);
-BOOLEAN gestionaTrama(TRAMA *);
-BOOLEAN InclusionClienteWinLnx();
-BOOLEAN RESPUESTA_InclusionClienteWinLnx(TRAMA *);
-BOOLEAN respuestaEjecucionComando(TRAMA *,int,char*);
-
-BOOLEAN Apagar(TRAMA *);
-BOOLEAN Reiniciar(TRAMA *);
-BOOLEAN Sondeo(TRAMA *);
-
-BOOLEAN enviaMensajeServidor(SOCKET *,TRAMA *,char);
-BOOLEAN ApagarReiniciar(UINT,char *,int sw);
-
-SOCKADDR_IN *GetIPInterfaceList(SOCKET , int *);
\ No newline at end of file
diff --git a/admin/Sources/Clients/ogAdmWinClient/sources/servicio.c b/admin/Sources/Clients/ogAdmWinClient/sources/servicio.c
deleted file mode 100644
index 773ac883..00000000
--- a/admin/Sources/Clients/ogAdmWinClient/sources/servicio.c
+++ /dev/null
@@ -1,628 +0,0 @@
-// ******************************************************************************************************************************************************************************
-// Aplicacin HIDRA
-// Copyright 2003-2005 Jos Manuel Alonso. Todos los derechos reservados.
-// Fichero: servicio.c
-// Descripcin:
-// Este proyecto implementa el servicio hidra en un ordenador con plataforma windows NT. Este fichero aporta las funciones para crear el servicio
-// ******************************************************************************************************************************************************************************
-//____________________________________________________________________________________________________________________________
-// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
-// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
-// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
-// PARTICULAR PURPOSE.
-//
-// Copyright (C) 1993-1997 Microsoft Corporation. All Rights Reserved.
-//
-// MODULE: service.c
-// PURPOSE: Implements functions required by all services windows.
-//
-// FUNCTIONS:
-// main(int argc, char **argv);
-// service_ctrl(DWORD dwCtrlCode);
-// service_main(DWORD dwArgc, LPTSTR *lpszArgv);
-// CmdInstallService();
-// CmdRemoveService();
-// CmdDebugService(int argc, char **argv);
-// ControlHandler ( DWORD dwCtrlType );
-// GetLastErrorText( LPTSTR lpszBuf, DWORD dwSize );
-//
-// COMMENTS:
-// AUTHOR: Craig Link - Microsoft Developer Support
-//____________________________________________________________________________________________________________________________
-#include "servicio.h"
-//____________________________________________________________________________________________________________________________
-// internal variables
-DWORD dwErr = 0;
-BOOL bDebug = FALSE;
-TCHAR szErr[256];
-
-// internal function prototypes
-VOID WINAPI service_ctrl(DWORD dwCtrlCode);
-VOID WINAPI service_main(DWORD dwArgc, LPTSTR *lpszArgv);
-VOID CmdInstallService();
-VOID CmdRemoveService();
-VOID CmdDebugService(int argc, char **argv);
-BOOL WINAPI ControlHandler ( DWORD dwCtrlType );
-LPTSTR GetLastErrorText( LPTSTR lpszBuf, DWORD dwSize );
-//____________________________________________________________________________________________________________________________
-//
-// FUNCTION: tomarestoparametros
-//
-// Descripcin:
-//
-// Toma los parametros de conexin de la linea de comando y los graba en el Registro
-//____________________________________________________________________________________________________________________________
-int tomarestoparametros(int argc, char **argv)
-{
- int i,lon;
- char servidorhidra[20];
- char puerto[10];
- char iplocal[20];
-
- strcpy(servidorhidra,SERVIDOR_DEFAULT);
- strcpy(puerto,PUERTO_DEFAULT);
- strcpy(iplocal,IPLOCAL_DEFAULT);
-
- for(i=2;i 1) &&
- ((*argv[1] == '-') || (*argv[1] == '/')) )
- {
- if ( _stricmp( "install", argv[1]+1 ) == 0 )
- {
- if (!tomarestoparametros(argc,argv))
- exit(1);
- CmdInstallService();
- }
- else if ( _stricmp( "remove", argv[1]+1 ) == 0 )
- {
- borraparametros();
- CmdRemoveService();
- }
- else if ( _stricmp( "debug", argv[1]+1 ) == 0 )
- {
- bDebug = TRUE;
- CmdDebugService(argc, argv);
- }
- else
- {
- goto dispatch;
- }
- exit(0);
- }
- // if it doesn't match any of the above parameters
- // the service control manager may be starting the service
- // so we must call StartServiceCtrlDispatcher
- dispatch:
- // this is just to be friendly
- printf( "%s -install to install the service\n", SZAPPNAME );
- printf( "%s -remove to remove the service\n", SZAPPNAME );
- printf( "%s -debug to run as a console app for debugging\n", SZAPPNAME );
- printf( "\nStartServiceCtrlDispatcher being called.\n" );
- printf( "This may take several seconds. Please wait.\n" );
-
- if (!StartServiceCtrlDispatcher(dispatchTable))
- AddToMessageLog(TEXT("StartServiceCtrlDispatcher failed."));
-}
-//____________________________________________________________________________________________________________________________
-// FUNCTION: service_main
-//
-// PURPOSE: To perform actual initialization of the service
-//
-// PARAMETERS:
-// dwArgc - number of command line arguments
-// lpszArgv - array of command line arguments
-//
-// RETURN VALUE:
-// none
-//
-// COMMENTS:
-// This routine performs the service initialization and then calls
-// the user defined ServiceStart() routine to perform majority
-// of the work.
-//
-//____________________________________________________________________________________________________________________________
-void WINAPI service_main(DWORD dwArgc, LPTSTR *lpszArgv)
-{
- // register our service control handler:
- //
- sshStatusHandle = RegisterServiceCtrlHandler( TEXT(SZSERVICENAME), service_ctrl);
-
- if (!sshStatusHandle)
- goto cleanup;
-
- // SERVICE_STATUS members that don't change in example
- //
- ssStatus.dwServiceType = SERVICE_WIN32_OWN_PROCESS;
- ssStatus.dwServiceSpecificExitCode = 0;
-
-
- // report the status to the service control manager.
- //
- if (!ReportStatusToSCMgr(
- SERVICE_START_PENDING, // service state
- NO_ERROR, // exit code
- 3000)) // wait hint
- goto cleanup;
-
- ServiceStart( dwArgc, lpszArgv );
-
-cleanup:
-
- // try to report the stopped status to the service control manager.
- //
- if (sshStatusHandle)
- (VOID)ReportStatusToSCMgr(
- SERVICE_STOPPED,
- dwErr,
- 0);
- return;
-}
-//____________________________________________________________________________________________________________________________
-//
-// FUNCTION: service_ctrl
-//
-// PURPOSE: This function is called by the SCM whenever
-// ControlService() is called on this service.
-//
-// PARAMETERS:
-// dwCtrlCode - type of control requested
-//
-// RETURN VALUE:
-// none
-//
-// COMMENTS:
-//
-//____________________________________________________________________________________________________________________________
-VOID WINAPI service_ctrl(DWORD dwCtrlCode)
-{
- // Handle the requested control code.
- //
- switch(dwCtrlCode)
- {
- // Stop the service.
- //
- // SERVICE_STOP_PENDING should be reported before
- // setting the Stop Event - hServerStopEvent - in
- // ServiceStop(). This avoids a race condition
- // which may result in a 1053 - The Service did not respond...
- // error.
- case SERVICE_CONTROL_STOP:
- ReportStatusToSCMgr(SERVICE_STOP_PENDING, NO_ERROR, 0);
- ServiceStop();
- return;
-
- // Update the service status.
- //
- case SERVICE_CONTROL_INTERROGATE:
- break;
-
- // invalid control code
- //
- default:
- break;
-
- }
- ReportStatusToSCMgr(ssStatus.dwCurrentState, NO_ERROR, 0);
-}
-//____________________________________________________________________________________________________________________________
-//
-// FUNCTION: ReportStatusToSCMgr()
-//
-// PURPOSE: Sets the current status of the service and
-// reports it to the Service Control Manager
-//
-// PARAMETERS:
-// dwCurrentState - the state of the service
-// dwWin32ExitCode - error code to report
-// dwWaitHint - worst case estimate to next checkpoint
-//
-// RETURN VALUE:
-// TRUE - success
-// FALSE - failure
-//
-// COMMENTS:
-//
-//____________________________________________________________________________________________________________________________
-BOOL ReportStatusToSCMgr(DWORD dwCurrentState,DWORD dwWin32ExitCode,DWORD dwWaitHint)
-{
- static DWORD dwCheckPoint = 1;
- BOOL fResult = TRUE;
-
-
- if ( !bDebug ) // when debugging we don't report to the SCM
- {
- if (dwCurrentState == SERVICE_START_PENDING)
- ssStatus.dwControlsAccepted = 0;
- else
- ssStatus.dwControlsAccepted = SERVICE_ACCEPT_STOP;
-
- ssStatus.dwCurrentState = dwCurrentState;
- ssStatus.dwWin32ExitCode = dwWin32ExitCode;
- ssStatus.dwWaitHint = dwWaitHint;
-
- if ( ( dwCurrentState == SERVICE_RUNNING ) ||
- ( dwCurrentState == SERVICE_STOPPED ) )
- ssStatus.dwCheckPoint = 0;
- else
- ssStatus.dwCheckPoint = dwCheckPoint++;
-
- // Report the status of the service to the service control manager.
- //
- if (!(fResult = SetServiceStatus( sshStatusHandle, &ssStatus))) {
- AddToMessageLog(TEXT("SetServiceStatus"));
- }
- }
- return fResult;
-}
-//____________________________________________________________________________________________________________________________
-//
-// FUNCTION: AddToMessageLog(LPTSTR lpszMsg)
-//
-// PURPOSE: Allows any thread to log an error message
-//
-// PARAMETERS:
-// lpszMsg - text for message
-//
-// RETURN VALUE:
-// none
-//
-// COMMENTS:
-//
-//____________________________________________________________________________________________________________________________
-VOID AddToMessageLog(LPTSTR lpszMsg)
-{
- TCHAR szMsg[256];
- HANDLE hEventSource;
- LPTSTR lpszStrings[2];
-
- if ( !bDebug )
- {
- dwErr = GetLastError();
-
- // Use event logging to log the error.
- //
- hEventSource = RegisterEventSource(NULL, TEXT(SZSERVICENAME));
-
- _stprintf(szMsg, TEXT("%s error: %d"), TEXT(SZSERVICENAME), dwErr);
- lpszStrings[0] = szMsg;
- lpszStrings[1] = lpszMsg;
-
- if (hEventSource != NULL) {
- ReportEvent(hEventSource, // handle of event source
- EVENTLOG_ERROR_TYPE, // event type
- 0, // event category
- 0, // event ID
- NULL, // current user's SID
- 2, // strings in lpszStrings
- 0, // no bytes of raw data
- lpszStrings, // array of error strings
- NULL); // no raw data
-
- (VOID) DeregisterEventSource(hEventSource);
- }
- }
-}
-//____________________________________________________________________________________________________________________________
-//
-// The following code handles service installation and removal
-//
-//____________________________________________________________________________________________________________________________
-//
-// FUNCTION: CmdInstallService()
-//
-// PURPOSE: Installs the service
-// PARAMETERS:
-// none
-//
-// RETURN VALUE:
-// none
-//
-// COMMENTS:
-//____________________________________________________________________________________________________________________________
-void CmdInstallService()
-{
- SC_HANDLE schService;
- SC_HANDLE schSCManager;
-
- TCHAR szPath[512];
-
- if ( GetModuleFileName( NULL, szPath, 512 ) == 0 )
- {
- _tprintf(TEXT("Unable to install %s - %s\n"), TEXT(SZSERVICEDISPLAYNAME), GetLastErrorText(szErr, 256));
- return;
- }
- schSCManager = OpenSCManager(
- NULL, // machine (NULL == local)
- NULL, // database (NULL == default)
- SC_MANAGER_ALL_ACCESS // access required
- );
- if ( schSCManager )
- {
- schService = CreateService(
- schSCManager, // SCManager database
- TEXT(SZSERVICENAME), // name of service
- TEXT(SZSERVICEDISPLAYNAME), // name to display
- SERVICE_ALL_ACCESS, // desired access
- SERVICE_WIN32_OWN_PROCESS, // service type
- SERVICE_AUTO_START, // start type
- SERVICE_ERROR_NORMAL, // error control type
- szPath, // service's binary
- NULL, // no load ordering group
- NULL, // no tag identifier
- TEXT(SZDEPENDENCIES), // dependencies
- NULL, // LocalSystem account
- NULL); // no password
-
- if ( schService )
- {
- _tprintf(TEXT("%s installed.\n"), TEXT(SZSERVICEDISPLAYNAME) );
- CloseServiceHandle(schService);
- }
- else
- {
- _tprintf(TEXT("CreateService failed - %s\n"), GetLastErrorText(szErr, 256));
- }
-
- CloseServiceHandle(schSCManager);
- }
- else
- _tprintf(TEXT("OpenSCManager failed - %s\n"), GetLastErrorText(szErr,256));
-}
-//____________________________________________________________________________________________________________________________
-//
-// FUNCTION: CmdRemoveService()
-//
-// PURPOSE: Stops and removes the service
-//
-// PARAMETERS:
-// none
-//
-// RETURN VALUE:
-// none
-//
-// COMMENTS:
-//
-//____________________________________________________________________________________________________________________________
-void CmdRemoveService()
-{
- SC_HANDLE schService;
- SC_HANDLE schSCManager;
-
- schSCManager = OpenSCManager(
- NULL, // machine (NULL == local)
- NULL, // database (NULL == default)
- SC_MANAGER_ALL_ACCESS // access required
- );
- if ( schSCManager )
- {
- schService = OpenService(schSCManager, TEXT(SZSERVICENAME), SERVICE_ALL_ACCESS);
-
- if (schService)
- {
- // try to stop the service
- if ( ControlService( schService, SERVICE_CONTROL_STOP, &ssStatus ) )
- {
- _tprintf(TEXT("Stopping %s."), TEXT(SZSERVICEDISPLAYNAME));
- Sleep( 1000 );
-
- while( QueryServiceStatus( schService, &ssStatus ) )
- {
- if ( ssStatus.dwCurrentState == SERVICE_STOP_PENDING )
- {
- _tprintf(TEXT("."));
- Sleep( 1000 );
- }
- else
- break;
- }
-
- if ( ssStatus.dwCurrentState == SERVICE_STOPPED )
- _tprintf(TEXT("\n%s stopped.\n"), TEXT(SZSERVICEDISPLAYNAME) );
- else
- _tprintf(TEXT("\n%s failed to stop.\n"), TEXT(SZSERVICEDISPLAYNAME) );
-
- }
-
- // now remove the service
- if( DeleteService(schService) )
- _tprintf(TEXT("%s removed.\n"), TEXT(SZSERVICEDISPLAYNAME) );
- else
- _tprintf(TEXT("DeleteService failed - %s\n"), GetLastErrorText(szErr,256));
-
-
- CloseServiceHandle(schService);
- }
- else
- _tprintf(TEXT("OpenService failed - %s\n"), GetLastErrorText(szErr,256));
-
- CloseServiceHandle(schSCManager);
- }
- else
- _tprintf(TEXT("OpenSCManager failed - %s\n"), GetLastErrorText(szErr,256));
-}
-//____________________________________________________________________________________________________________________________
-//
-// The following code is for running the service as a console app
-//
-//
-// FUNCTION: CmdDebugService(int argc, char ** argv)
-//
-// PURPOSE: Runs the service as a console application
-//
-// PARAMETERS:
-// argc - number of command line arguments
-// argv - array of command line arguments
-//
-// RETURN VALUE:
-// none
-//
-// COMMENTS:
-//
-//____________________________________________________________________________________________________________________________
-void CmdDebugService(int argc, char ** argv)
-{
- DWORD dwArgc;
- LPTSTR *lpszArgv;
-
-#ifdef UNICODE
- lpszArgv = CommandLineToArgvW(GetCommandLineW(), &(dwArgc) );
-#else
- dwArgc = (DWORD) argc;
- lpszArgv = argv;
-#endif
-
- _tprintf(TEXT("Debugging %s.\n"), TEXT(SZSERVICEDISPLAYNAME));
-
- SetConsoleCtrlHandler( ControlHandler, TRUE );
-
- ServiceStart( dwArgc, lpszArgv );
-}
-//____________________________________________________________________________________________________________________________
-//
-// FUNCTION: ControlHandler ( DWORD dwCtrlType )
-//
-// PURPOSE: Handled console control events
-//
-// PARAMETERS:
-// dwCtrlType - type of control event
-//
-// RETURN VALUE:
-// True - handled
-// False - unhandled
-//
-// COMMENTS:
-//
-//____________________________________________________________________________________________________________________________
-BOOL WINAPI ControlHandler ( DWORD dwCtrlType )
-{
- switch( dwCtrlType )
- {
- case CTRL_BREAK_EVENT: // use Ctrl+C or Ctrl+Break to simulate
- case CTRL_C_EVENT: // SERVICE_CONTROL_STOP in debug mode
- _tprintf(TEXT("Stopping %s.\n"), TEXT(SZSERVICEDISPLAYNAME));
- ServiceStop();
- return TRUE;
- break;
-
- }
- return FALSE;
-}
-//____________________________________________________________________________________________________________________________
-//
-// FUNCTION: GetLastErrorText
-//
-// PURPOSE: copies error message text to string
-//
-// PARAMETERS:
-// lpszBuf - destination buffer
-// dwSize - size of buffer
-//
-// RETURN VALUE:
-// destination buffer
-//
-// COMMENTS:
-//
-//____________________________________________________________________________________________________________________________
-LPTSTR GetLastErrorText( LPTSTR lpszBuf, DWORD dwSize )
-{
- DWORD dwRet;
- LPTSTR lpszTemp = NULL;
-
- dwRet = FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM |FORMAT_MESSAGE_ARGUMENT_ARRAY,
- NULL,
- GetLastError(),
- LANG_NEUTRAL,
- (LPTSTR)&lpszTemp,
- 0,
- NULL );
-
- // supplied buffer is not long enough
- if ( !dwRet || ( (long)dwSize < (long)dwRet+14 ) )
- lpszBuf[0] = TEXT('\0');
- else
- {
- lpszTemp[lstrlen(lpszTemp)-2] = TEXT('\0'); //remove cr and newline character
- _stprintf( lpszBuf, TEXT("%s (0x%x)"), lpszTemp, GetLastError() );
- }
-
- if ( lpszTemp )
- LocalFree((HLOCAL) lpszTemp );
-
- return lpszBuf;
-}
diff --git a/admin/Sources/Clients/ogAdmWinClient/sources/servicio.h b/admin/Sources/Clients/ogAdmWinClient/sources/servicio.h
deleted file mode 100644
index 760d2c1a..00000000
--- a/admin/Sources/Clients/ogAdmWinClient/sources/servicio.h
+++ /dev/null
@@ -1,153 +0,0 @@
-// ******************************************************************************************************************************************************************************
-// Aplicacin HIDRA
-// Copyright 2003-2005 Jos Manuel Alonso. Todos los derechos reservados.
-// Fichero: servicio.h
-// Descripcin:
-// Este proyecto implementa el servicio hidra en un ordenador con plataforma windows NT. Este fichero aporta las funciones para crear el servicio
-// ******************************************************************************************************************************************************************************
-//____________________________________________________________________________________________________________________________
-// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
-// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
-// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
-// PARTICULAR PURPOSE.
-//
-// Copyright (C) 1993-1997 Microsoft Corporation. All Rights Reserved.
-//
-// MODULE: service.h
-// AUTHOR: Craig Link
-//
-// Comments: The use of this header file and the accompanying service.c
-// file simplifies the process of writting a service. You as a developer
-// simply need to follow the TODO's outlined in this header file, and
-// implement the ServiceStart() and ServiceStop() functions.
-//
-// There is no need to modify the code in service.c. Just add service.c
-// to your project and link with the following libraries...
-//
-// libcmt.lib kernel32.lib advapi.lib shell32.lib
-//
-// This code also supports unicode. Be sure to compile both service.c and
-// and code #include "service.h" with the same Unicode setting.
-//
-// Upon completion, your code will have the following command line interface
-//
-// -? to display this list
-// -install to install the service
-// -remove to remove the service
-// -debug to run as a console app for debugging
-//
-// Note: This code also implements Ctrl+C and Ctrl+Break handlers
-// when using the debug option. These console events cause
-// your ServiceStop routine to be called
-//
-// Also, this code only handles the OWN_SERVICE service type
-// running in the LOCAL_SYSTEM security context.
-//
-// To control your service ( start, stop, etc ) you may use the
-// Services control panel applet or the NET.EXE program.
-//
-// To aid in writing/debugging service, the
-// SDK contains a utility (MSTOOLS\BIN\SC.EXE) that
-// can be used to control, configure, or obtain service status.
-// SC displays complete status for any service/driver
-// in the service database, and allows any of the configuration
-// parameters to be easily changed at the command line.
-// For more information on SC.EXE, type SC at the command line.
-//
-//____________________________________________________________________________________________________________________________
-#include
-#include
-#include
-#include
-#include
-#include "registrow.h"
-
-#ifndef _SERVICE_H
-#define _SERVICE_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-// name of the executable
-#define SZAPPNAME "ogAdmWinClient"
-// internal name of the service
-#define SZSERVICENAME "Cliente Opengnsys"
-// displayed name of the service
-#define SZSERVICEDISPLAYNAME "Cliente Opengnsys"
-// list of service dependencies - "dep1\0dep2\0\0"
-#define SZDEPENDENCIES ""
-
-#define SERVIDOR_DEFAULT "0.0.0.0"
-#define PUERTO_DEFAULT "2003"
-#define IPLOCAL_DEFAULT "0.0.0.0"
-
-#define CHKREGISTRY(f) if (!(f)) { return 0;}
-#define RMVREGISTRY(f) if (!(f)) { return 0;}
-#define TOMAPARAMINT(p) p=atoi(&argv[i][3]);
-#define TOMAPARAMSTR(p) strcpy(p,&argv[i][3]);
-
-#define HIVE HKEY_LOCAL_MACHINE // Rama del registro donde estarn los parametros de conexin
-#define BASEKEY "SOFTWARE\\opengnsys" // Key del registro para parametros de conexin
-#define BASE "SOFTWARE\\opengnsys\\cliente" // SubKey del registro para parametros de conexin
-
-//____________________________________________________________________________________________________________________________
-//
-SERVICE_STATUS ssStatus; // current status of the service
-SERVICE_STATUS_HANDLE sshStatusHandle;
-//
-//____________________________________________________________________________________________________________________________
-// ServiceStart()must be defined by in your code.
-// The service should use ReportStatusToSCMgr to indicate
-// progress. This routine must also be used by StartService()
-// to report to the SCM when the service is running.
-//
-// If a ServiceStop procedure is going to take longer than
-// 3 seconds to execute, it should spawn a thread to
-// execute the stop code, and return. Otherwise, the
-// ServiceControlManager will believe that the service has
-// stopped responding
-//
-//____________________________________________________________________________________________________________________________
-VOID ServiceStart(DWORD dwArgc, LPTSTR *lpszArgv);
-VOID ServiceStop();
-//____________________________________________________________________________________________________________________________
-// The following are procedures which
-// may be useful to call within the above procedures,
-// but require no implementation by the user.
-// They are implemented in service.c
-//
-// FUNCTION: ReportStatusToSCMgr()
-//
-// PURPOSE: Sets the current status of the service and
-// reports it to the Service Control Manager
-//
-// PARAMETERS:
-// dwCurrentState - the state of the service
-// dwWin32ExitCode - error code to report
-// dwWaitHint - worst case estimate to next checkpoint
-//
-// RETURN VALUE:
-// TRUE - success
-// FALSE - failure
-//____________________________________________________________________________________________________________________________
-BOOL ReportStatusToSCMgr(DWORD dwCurrentState, DWORD dwWin32ExitCode, DWORD dwWaitHint);
-//____________________________________________________________________________________________________________________________
-// FUNCTION: AddToMessageLog(LPTSTR lpszMsg)
-//
-// PURPOSE: Allows any thread to log an error message
-//
-// PARAMETERS:
-// lpszMsg - text for message
-//
-// RETURN VALUE:
-// none
-//____________________________________________________________________________________________________________________________
-void AddToMessageLog(LPTSTR lpszMsg);
-//____________________________________________________________________________________________________________________________
-//
-#ifdef __cplusplus
-}
-#endif
-
-#endif
diff --git a/admin/Sources/Clients/ogagent/INSTALL.es.txt b/admin/Sources/Clients/ogagent/INSTALL.es.txt
new file mode 100644
index 00000000..3f43206f
--- /dev/null
+++ b/admin/Sources/Clients/ogagent/INSTALL.es.txt
@@ -0,0 +1,89 @@
+OGAgent: agente OpenGnsys para sistemas operativos INSTALL.es.txt
+====================================================================
+
+
+Requisitos de creación
+----------------------
+Sisitema operativo Linux con los siguientes paquetes instalados:
+- Subversion
+- GNU C++, Python, librerías PyQt4
+- Creación de instalador Exe (Wine 32 bits, Wine Gecko, Wine Mono, Samba Winbind, Cabextrct)
+- Creación de paquetes Deb (debhelper, dpkg-dev)
+- Creación de paquetes RPM (rpm-build)
+- Creación de paquetes Pkg (xar, bomutils)
+
+
+Crear instaladores de OGAgent
+-----------------------------
+- Paso previo: actaulizar componentes gráficos de PyQt para OGAgnet:
+ src/update.sh
+
+- Crear paquetes Deb y RPM para distribuciones Linux (requiere permisos de "root"):
+ sudo linux/build-packages.sh
+
+- Crear paquete Pkg para sistemas operativos macOS X:
+ sudo macos/build-pkg.sh
+
+- Crear el programa instalador para sistemas operativos Windows:
+ windows/build-windows.sh
+
+- Subir los nuevos ficheros .deb, .rpm, .pkg y .exe generados al directorio
+/opt/opengnsys/www/descargas del servidor OpenGnsys.
+
+
+Instalar OGAgent en cliente modelo
+----------------------------------
+- Descargar el fichero correspondiente en el sistema operativo del cliente.
+
+- Ubuntu, Debian y derivados:
+ - Instalar dependencias (NOTA: revisar dependencias para Ubuntu 12.04):
+ sudo apt-get install -y libxss1 policykit-1 python python-requests python-qt4 python-six python-prctl
+ - Descargar e instalar el agente:
+ sudo dpkg -i ogagent_Version_all.deb
+ - Configurar el agente:
+ sudo sed -i "0,/remote=/ s,remote=.*,remote=https://IPServidorOpenGnsys/opengnsys/rest/," /usr/share/OGAgent/cfg/ogagent.cfg
+ - Iniciar el servicio (se iniciará automáticamente en el proceso de arranque):
+ sudo service ogagent start
+
+- Red Hat, Fedora y derivados (como root):
+ - Descargar e instalar el agente:
+ yum install ogagent-Version.noarch.rpm (Red Hat/CentOS)
+ dnf install ogagent-Version.noarch.rpm (Fedora)
+ - Configurar el agente:
+ sed -i "0,/remote=/ s,remote=.*,remote=https://IPServidorOpenGnsys/opengnsys/rest/," /usr/share/OGAgent/cfg/ogagent.cfg
+ - Puede ser necesario corregir permisos antes de iniciar el servicio:
+ chmod +x /etc/init.d/ogagent
+ - Iniciar el servicio (se iniciará automáticamente en el proceso de arranque):
+ service ogagent start
+
+- OpenSuSE:
+ (en preparación)
+
+- Windows (como usuario administrador):
+ - Descargar e instalar el agente ejecutando:
+ OGAgentSetup-Version.exe
+ - Seguir las instrucciones del instalador.
+ - Editar el fichero de configuación "C:\Program Files\OGAgent\cfg\ogagent.cfg" (o C:\Archivos de programa\OGAgent\cfg\ogagent.cfg) y modificar el valor de la cláusula "remote" de la sección [OGAgent] inclyendo la dirección IP del servidor OpenGnsys.
+ - Iniciar el servicio (se iniciará automáticamente en el proceso de arranque):
+ NET START OGAgent
+
+- macOS:
+ - Instalar dependencias:
+ sudo easy_install pip
+ sudo pip install netifaces requests six
+ - Descargar e instalar el agente:
+ sudo installer -pkg OGAgentInstaller-Version.pkg -target /
+ - Descargar el paquete y usar Finder pulsando sobre el fichero para instalarlo.
+ - Configurar el agente:
+ sed -i "0,/remote=/ s,remote=.*,remote=https://IPServidorOpenGnsys/opengnsys/rest/," /Applications/OGAgent.app/cfg/ogagent.cfg
+ - Iniciar el servicio (se iniciará automáticamente en el proceso de arranque):
+ sudo ogagent start
+
+
+Postconfiguración para clientes clonados
+----------------------------------------
+- Ejecutar manualmente o configurar automáticamente OGAgent en los clientes clonados
+en el script de postconfiguración tras restuarar imagen:
+ ogConfigureOgagent NDisco Npart
+
+
diff --git a/admin/Sources/Clients/ogagent/linux/Makefile b/admin/Sources/Clients/ogagent/linux/Makefile
new file mode 100644
index 00000000..6ada91f5
--- /dev/null
+++ b/admin/Sources/Clients/ogagent/linux/Makefile
@@ -0,0 +1,72 @@
+#!/usr/bin/make -f
+# -*- makefile -*-
+
+# Directories
+SOURCEDIR := ../src
+LIBDIR := $(DESTDIR)/usr/share/OGAgent
+BINDIR := $(DESTDIR)/usr/bin
+SBINDIR = $(DESTDIR)/usr/sbin
+APPSDIR := $(DESTDIR)/usr/share/applications
+CFGDIR := $(DESTDIR)/etc/ogagent
+INITDIR := $(DESTDIR)/etc/init.d
+XDGAUTOSTARTDIR := $(DESTDIR)/etc/xdg/autostart
+KDEAUTOSTARTDIR := $(DESTDIR)/usr/share/autostart
+
+PYC := $(shell find $(SOURCEDIR) -name '*.py[co]')
+CACHES := $(shell find $(SOURCEDIR) -name '__pycache__')
+
+clean:
+ rm -rf $(PYC) $(CACHES) $(DESTDIR)
+install-ogagent:
+ rm -rf $(DESTDIR)
+ mkdir -p $(LIBDIR)
+ mkdir -p $(BINDIR)
+ mkdir -p $(SBINDIR)
+ mkdir -p $(APPSDIR)
+ mkdir -p $(CFGDIR)
+ mkdir -p $(XDGAUTOSTARTDIR)
+ mkdir -p $(KDEAUTOSTARTDIR)
+
+ mkdir $(LIBDIR)/img
+
+ # Cleans up .pyc and cache folders
+ rm -f $(PYC) $(CACHES)
+
+ cp -r $(SOURCEDIR)/opengnsys $(LIBDIR)/opengnsys
+ cp -r $(SOURCEDIR)/cfg $(LIBDIR)/cfg
+ cp $(SOURCEDIR)/img/oga.png $(LIBDIR)/img
+
+ cp $(SOURCEDIR)/OGAgentUser.py $(LIBDIR)
+ # QT Dialogs & resources
+ cp $(SOURCEDIR)/*_ui.py $(LIBDIR)
+ cp $(SOURCEDIR)/OGAgent_rc.py $(LIBDIR)
+
+ # Autostart elements for gnome/kde
+ cp desktop/OGAgentTool.desktop $(XDGAUTOSTARTDIR)
+ cp desktop/OGAgentTool.desktop $(KDEAUTOSTARTDIR)
+
+ # scripts
+ cp scripts/ogagent $(BINDIR)
+ cp scripts/OGAgentTool-startup $(BINDIR)
+ cp scripts/OGAgentTool $(BINDIR)
+
+ # Fix permissions
+ chmod 755 $(BINDIR)/ogagent
+ chmod 755 $(BINDIR)/OGAgentTool-startup
+ chmod 755 $(LIBDIR)/OGAgentUser.py
+ chmod 600 $(LIBDIR)/cfg/ogagent.cfg
+
+ # If for red hat based, copy init.d
+ifeq ($(DISTRO),rh)
+ mkdir -p $(INITDIR)
+ cp debian/ogagent.init $(INITDIR)/ogagent
+ chmod +x $(INITDIR)/ogagent
+ ln -fs /usr/share/OGAgent/cfg/ogagent.cfg $(CFGDIR)
+ ln -fs /usr/share/OGAgent/cfg/ogclient.cfg $(CFGDIR)
+endif
+
+ # chmod 0755 $(BINDIR)/ogagent
+uninstall:
+ rm -rf $(LIBDIR)
+ # rm -f $(BINDIR)/ogagent
+ rm -rf $(CFGDIR)
diff --git a/admin/Sources/Clients/ogagent/linux/build-packages.sh b/admin/Sources/Clients/ogagent/linux/build-packages.sh
new file mode 100755
index 00000000..b4f11077
--- /dev/null
+++ b/admin/Sources/Clients/ogagent/linux/build-packages.sh
@@ -0,0 +1,35 @@
+#!/bin/bash
+
+VERSION=1.1.0
+RELEASE=1
+
+cd $(dirname "$0")
+top=`pwd`
+
+# Debian based
+dpkg-buildpackage -b -d
+
+cat ogagent-template.spec |
+ sed -e s/"version 0.0.0"/"version ${VERSION}"/g |
+ sed -e s/"release 1"/"release ${RELEASE}"/g > ogagent-$VERSION.spec
+
+# Now fix dependencies for opensuse
+cat ogagent-template.spec |
+ sed -e s/"version 0.0.0"/"version ${VERSION}"/g |
+ sed -e s/"name ogagent"/"name ogagent-opensuse"/g |
+ sed -e s/"PyQt4"/"python-qt4"/g |
+ sed -e s/"libXScrnSaver"/"libXss1"/g > ogagent-opensuse-$VERSION.spec
+
+
+# Right now, ogagent-xrdp-1.7.0.spec is not needed
+for pkg in ogagent-$VERSION.spec ogagent-opensuse-$VERSION.spec; do
+
+ rm -rf rpm
+ for folder in SOURCES BUILD RPMS SPECS SRPMS; do
+ mkdir -p rpm/$folder
+ done
+
+ rpmbuild -v -bb --clean --buildroot=$top/rpm/BUILD/$pkg-root --target noarch $pkg 2>&1
+done
+
+#rm ogagent-$VERSION
diff --git a/admin/Sources/Clients/ogagent/linux/debian/changelog b/admin/Sources/Clients/ogagent/linux/debian/changelog
new file mode 100644
index 00000000..01fd564d
--- /dev/null
+++ b/admin/Sources/Clients/ogagent/linux/debian/changelog
@@ -0,0 +1,12 @@
+ogagent (1.1.0) stable; urgency=medium
+
+ * Functional OpenGnsys Agent interacting with OpenGnsys Server 1.1.0
+
+ -- Ramón M. Gómez Tue, 13 Oct 2016 17:00:00 +0200
+
+ogagent (1.0.0) stable; urgency=medium
+
+ * Initial release for OpenGnsys Agent
+
+ -- Adolfo Gómez García Tue, 18 Jul 2015 03:18:22 +0200
+
diff --git a/admin/Sources/Clients/ogagent/linux/debian/compat b/admin/Sources/Clients/ogagent/linux/debian/compat
new file mode 100644
index 00000000..f11c82a4
--- /dev/null
+++ b/admin/Sources/Clients/ogagent/linux/debian/compat
@@ -0,0 +1 @@
+9
\ No newline at end of file
diff --git a/admin/Sources/Clients/ogagent/linux/debian/control b/admin/Sources/Clients/ogagent/linux/debian/control
new file mode 100644
index 00000000..34d25de7
--- /dev/null
+++ b/admin/Sources/Clients/ogagent/linux/debian/control
@@ -0,0 +1,15 @@
+Source: ogagent
+Section: admin
+Priority: optional
+Maintainer: Ramón M. Gómez
+Build-Depends: debhelper (>= 7), po-debconf
+Standards-Version: 3.9.2
+Homepage: https://opengnsys.es
+
+Package: ogagent
+Section: admin
+Priority: optional
+Architecture: all
+Depends: policykit-1(>=0.100), python-requests (>=0.8.2), python-qt4 (>=4.9), python-six(>=1.1), python-prctl(>=1.1.1), python (>=2.7), libxss1, ${misc:Depends}
+Description: OpenGnsys Agent for Operating Systems
+ This package provides the required components to allow this machine to work on an environment managed by OpenGnsys.
diff --git a/admin/Sources/Clients/ogagent/linux/debian/copyright b/admin/Sources/Clients/ogagent/linux/debian/copyright
new file mode 100644
index 00000000..7b6ef31b
--- /dev/null
+++ b/admin/Sources/Clients/ogagent/linux/debian/copyright
@@ -0,0 +1,26 @@
+Format-Specification: http://svn.debian.org/wsvn/dep/web/deps/dep5.mdwn?op=file&rev=135
+Name: ogagent
+Maintainer: Ramón M. Gómez
+Source: https://opengnsys.es
+
+Copyright: 2014 Virtual Cable S.L.U.
+License: BSD-3-clause
+
+License: GPL-2+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+.
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+.
+You should have received a copy of the GNU General Public License along
+with this program; if not, write to the Free Software Foundation, Inc.,
+51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+.
+On Debian systems, the full text of the GNU General Public
+License version 2 can be found in the file
+`/usr/share/common-licenses/GPL-2'.
diff --git a/admin/Sources/Clients/ogagent/linux/debian/docs b/admin/Sources/Clients/ogagent/linux/debian/docs
new file mode 100644
index 00000000..b2b2a781
--- /dev/null
+++ b/admin/Sources/Clients/ogagent/linux/debian/docs
@@ -0,0 +1 @@
+readme.txt
diff --git a/admin/Sources/Clients/ogagent/linux/debian/ogagent.init b/admin/Sources/Clients/ogagent/linux/debian/ogagent.init
new file mode 100644
index 00000000..3eee35c1
--- /dev/null
+++ b/admin/Sources/Clients/ogagent/linux/debian/ogagent.init
@@ -0,0 +1,23 @@
+#!/bin/sh -e
+### BEGIN INIT INFO
+# Provides: ogagent
+# Required-Start: $local_fs $remote_fs $network $syslog $named
+# Required-Stop: $local_fs $remote_fs $network $syslog $named
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: OpenGnsys Agent Service
+### END INIT INFO
+#
+
+# . /lib/lsb/init-functions
+
+case "$1" in
+ start|stop|restart)
+ /usr/bin/ogagent $1
+ ;;
+ force-reload)
+ /usr/bin/ogagent restart
+ ;;
+ *) echo "Usage: $0 {start|stop|restart|force-reload}" >&2; exit 1 ;;
+esac
+
diff --git a/admin/Sources/Clients/ogagent/linux/debian/ogagent.links b/admin/Sources/Clients/ogagent/linux/debian/ogagent.links
new file mode 100644
index 00000000..9b970d7b
--- /dev/null
+++ b/admin/Sources/Clients/ogagent/linux/debian/ogagent.links
@@ -0,0 +1,2 @@
+/usr/share/OGAgent/cfg/ogagent.cfg /etc/ogagent/ogagent.cfg
+/usr/share/OGAgent/cfg/ogclient.cfg /etc/ogagent/ogclient.cfg
diff --git a/admin/Sources/Clients/ogagent/linux/debian/ogagent.postinst b/admin/Sources/Clients/ogagent/linux/debian/ogagent.postinst
new file mode 100644
index 00000000..b59cfa6f
--- /dev/null
+++ b/admin/Sources/Clients/ogagent/linux/debian/ogagent.postinst
@@ -0,0 +1,21 @@
+#!/bin/sh
+
+. /usr/share/debconf/confmodule
+
+set -e
+case "$1" in
+ configure)
+ chmod 600 /usr/share/OGAgent/cfg/ogagent.cfg
+ ;;
+ abort-upgrade|abort-remove|abort-deconfigure)
+ ;;
+
+ *)
+ echo "postinst called with unknown argument \`$1'" >&2
+ exit 1
+ ;;
+esac
+
+#DEBHELPER#
+
+exit 0
diff --git a/admin/Sources/Clients/ogagent/linux/debian/ogagent.postinst.debhelper b/admin/Sources/Clients/ogagent/linux/debian/ogagent.postinst.debhelper
new file mode 100644
index 00000000..e75924dc
--- /dev/null
+++ b/admin/Sources/Clients/ogagent/linux/debian/ogagent.postinst.debhelper
@@ -0,0 +1,5 @@
+# Automatically added by dh_installinit
+if [ -x "/etc/init.d/ogagent" ]; then
+ update-rc.d ogagent defaults >/dev/null || exit $?
+fi
+# End automatically added section
diff --git a/admin/Sources/Clients/ogagent/linux/debian/ogagent.postrm b/admin/Sources/Clients/ogagent/linux/debian/ogagent.postrm
new file mode 100644
index 00000000..a46fa487
--- /dev/null
+++ b/admin/Sources/Clients/ogagent/linux/debian/ogagent.postrm
@@ -0,0 +1,10 @@
+#!/bin/sh -e
+
+. /usr/share/debconf/confmodule
+
+set -e
+
+if [ "$1" = "purge" ] ; then
+ rm -rf /usr/share/OGAgent || true > /dev/null 2>&1
+fi
+
diff --git a/admin/Sources/Clients/ogagent/linux/debian/ogagent.postrm.debhelper b/admin/Sources/Clients/ogagent/linux/debian/ogagent.postrm.debhelper
new file mode 100644
index 00000000..3167f1f8
--- /dev/null
+++ b/admin/Sources/Clients/ogagent/linux/debian/ogagent.postrm.debhelper
@@ -0,0 +1,12 @@
+# Automatically added by dh_installinit
+if [ "$1" = "purge" ] ; then
+ update-rc.d ogagent remove >/dev/null
+fi
+
+
+# In case this system is running systemd, we make systemd reload the unit files
+# to pick up changes.
+if [ -d /run/systemd/system ] ; then
+ systemctl --system daemon-reload >/dev/null || true
+fi
+# End automatically added section
diff --git a/admin/Sources/Clients/ogagent/linux/debian/ogagent.substvars b/admin/Sources/Clients/ogagent/linux/debian/ogagent.substvars
new file mode 100644
index 00000000..978fc8b5
--- /dev/null
+++ b/admin/Sources/Clients/ogagent/linux/debian/ogagent.substvars
@@ -0,0 +1,2 @@
+misc:Depends=
+misc:Pre-Depends=
diff --git a/admin/Sources/Clients/ogagent/linux/debian/rules b/admin/Sources/Clients/ogagent/linux/debian/rules
new file mode 100755
index 00000000..fbe82e67
--- /dev/null
+++ b/admin/Sources/Clients/ogagent/linux/debian/rules
@@ -0,0 +1,44 @@
+#!/usr/bin/make -f
+# -*- makefile -*-
+configure: configure-stamp
+configure-stamp:
+ dh_testdir
+ touch configure-stamp
+build: build-arch build-indep
+build-arch: build-stamp
+build-indep: build-stamp
+build-stamp: configure-stamp
+ dh_testdir
+ $(MAKE)
+ touch $@
+clean:
+ dh_testdir
+ dh_testroot
+ rm -f build-stamp configure-stamp
+ dh_clean
+install: build
+ dh_testdir
+ dh_testroot
+ dh_prep
+ dh_installdirs
+ $(MAKE) DESTDIR=$(CURDIR)/debian/ogagent install-ogagent
+binary-arch: build install
+ # emptyness
+binary-indep: build install
+ dh_testdir
+ dh_testroot
+ dh_installchangelogs
+ dh_installdocs
+ dh_installdebconf
+ dh_installinit --no-start
+ dh_python2=python
+ dh_compress
+ dh_link
+ dh_fixperms
+ dh_installdeb
+ dh_shlibdeps
+ dh_gencontrol
+ dh_md5sums
+ dh_builddeb
+binary: binary-indep
+.PHONY: build clean binary-indep binary install configure
diff --git a/admin/Sources/Clients/ogagent/linux/debian/source/format b/admin/Sources/Clients/ogagent/linux/debian/source/format
new file mode 100644
index 00000000..9f674278
--- /dev/null
+++ b/admin/Sources/Clients/ogagent/linux/debian/source/format
@@ -0,0 +1 @@
+3.0 (native)
\ No newline at end of file
diff --git a/admin/Sources/Clients/ogagent/linux/desktop/OGAgentTool.desktop b/admin/Sources/Clients/ogagent/linux/desktop/OGAgentTool.desktop
new file mode 100644
index 00000000..fd3867d3
--- /dev/null
+++ b/admin/Sources/Clients/ogagent/linux/desktop/OGAgentTool.desktop
@@ -0,0 +1,12 @@
+[Desktop Entry]
+Name=OpenGnsys Agent Tools
+Comment=OpenGnsys Userspace tools
+Exec=/usr/bin/OGAgentTool-startup
+Icon=/usr/share/OGAgent/img/oga.png
+Terminal=false
+Type=Application
+NoDisplay=true
+X-KDE-autostart-after=panel
+X-KDE-StartupNotify=false
+X-DBUS-StartupType=Unique
+X-KDE-UniqueApplet=true
diff --git a/admin/Sources/Clients/ogagent/linux/ogagent-template.spec b/admin/Sources/Clients/ogagent/linux/ogagent-template.spec
new file mode 100644
index 00000000..1368cccb
--- /dev/null
+++ b/admin/Sources/Clients/ogagent/linux/ogagent-template.spec
@@ -0,0 +1,65 @@
+%define _topdir %(echo $PWD)/rpm
+%define name ogagent
+%define version 0.0.0
+%define release 1
+%define buildroot %{_topdir}/%{name}-%{version}-%{release}-root
+
+BuildRoot: %{buildroot}
+Name: %{name}
+Version: %{version}
+Release: %{release}
+Summary: OpenGnsys Agent & tools
+License: BSD3
+Group: Admin
+Requires: python-six python-requests PyQt4 libXScrnSaver
+Vendor: OpenGnsys Project
+URL: https://opengnsys.es
+Provides: ogagent
+
+%define _rpmdir ../
+%define _rpmfilename %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm
+
+
+%install
+curdir=`pwd`
+cd ../..
+make DESTDIR=$RPM_BUILD_ROOT DISTRO=rh install-ogagent
+cd $curdir
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+curdir=`pwd`
+cd ../..
+make DESTDIR=$RPM_BUILD_ROOT DISTRO=rh clean
+cd $curdir
+
+
+%post
+systemctl enable ogagent.service > /dev/null 2>&1
+
+%preun
+systemctl disable ogagent.service > /dev/null 2>&1
+systemctl stop ogagent.service > /dev/null 2>&1
+
+%postun
+# $1 == 0 on uninstall, == 1 on upgrade for preun and postun (just a reminder for me... :) )
+if [ $1 -eq 0 ]; then
+ rm -rf /etc/ogagent
+ rm /var/log/ogagent.log
+fi
+# And, posibly, the .pyc leaved behind on /usr/share/OGAgent
+rm -rf /usr/share/OGAgent > /dev/null 2>&1
+
+%description
+This package provides the required components to allow this machine to work on an environment managed by OpenGnsys.
+
+%files
+%defattr(-,root,root)
+/etc/ogagent
+/etc/xdg/autostart/OGAgentTool.desktop
+/etc/init.d/ogagent
+/usr/bin/OGAgentTool-startup
+/usr/bin/ogagent
+/usr/bin/OGAgentTool
+/usr/share/OGAgent/*
+/usr/share/autostart/OGAgentTool.desktop
diff --git a/admin/Sources/Clients/ogagent/linux/policy/org.openuds.pkexec.UDSActorConfig.policy b/admin/Sources/Clients/ogagent/linux/policy/org.openuds.pkexec.UDSActorConfig.policy
new file mode 100644
index 00000000..9afd775a
--- /dev/null
+++ b/admin/Sources/Clients/ogagent/linux/policy/org.openuds.pkexec.UDSActorConfig.policy
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+ Run UDS Actor Configuration Program
+ Authentication is required to run UDS Actor Configuration
+
+ no
+ no
+ auth_admin_keep
+
+ /usr/sbin/UDSActorConfig
+ TRUE
+
+
+
\ No newline at end of file
diff --git a/admin/Sources/Clients/ogagent/linux/readme.txt b/admin/Sources/Clients/ogagent/linux/readme.txt
new file mode 100644
index 00000000..a2771def
--- /dev/null
+++ b/admin/Sources/Clients/ogagent/linux/readme.txt
@@ -0,0 +1,3 @@
+OGAgent is the agent intended for OpengGnsys interaction.
+
+Please, visit https://opengnsys.es for more information
diff --git a/admin/Sources/Clients/ogagent/linux/scripts/OGAgentTool b/admin/Sources/Clients/ogagent/linux/scripts/OGAgentTool
new file mode 100644
index 00000000..5b300523
--- /dev/null
+++ b/admin/Sources/Clients/ogagent/linux/scripts/OGAgentTool
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+FOLDER=/usr/share/OGAgent
+
+cd $FOLDER
+python OGAgentUser.py $@
diff --git a/admin/Sources/Clients/ogagent/linux/scripts/OGAgentTool-startup b/admin/Sources/Clients/ogagent/linux/scripts/OGAgentTool-startup
new file mode 100644
index 00000000..bb3a848e
--- /dev/null
+++ b/admin/Sources/Clients/ogagent/linux/scripts/OGAgentTool-startup
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+# Simple hack to wait for systray to be present
+# Exec tool if not already runned by session manager
+ps -ef | grep "$USER" | grep -v grep | grep -v OGAgentTool-startup | grep 'OGAgentTool' -q
+# If not already running
+if [ $? -eq 1 ]; then
+ sleep 5
+ exec /usr/bin/OGAgentTool
+fi
\ No newline at end of file
diff --git a/admin/Sources/Clients/ogagent/linux/scripts/ogagent b/admin/Sources/Clients/ogagent/linux/scripts/ogagent
new file mode 100644
index 00000000..1bcc29b0
--- /dev/null
+++ b/admin/Sources/Clients/ogagent/linux/scripts/ogagent
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+FOLDER=/usr/share/OGAgent
+
+cd $FOLDER
+python -m opengnsys.linux.OGAgentService $@
diff --git a/admin/Sources/Clients/ogagent/macos/build-pkg.sh b/admin/Sources/Clients/ogagent/macos/build-pkg.sh
new file mode 100755
index 00000000..500da58e
--- /dev/null
+++ b/admin/Sources/Clients/ogagent/macos/build-pkg.sh
@@ -0,0 +1,87 @@
+#!/bin/bash
+# Create macOS installation packages.
+# Based on bomutils tutorail: http://bomutils.dyndns.org/tutorial.html
+
+VERSION=1.1.0
+AUTHOR="OpenGnsys Project"
+
+# Create empty directories.
+cd $(dirname $0)
+rm -fr build
+mkdir -p build && cd build
+mkdir -p flat/base.pkg flat/Resources/en.lproj
+mkdir -p root/Applications
+
+# Copy application and script files.
+cp -a ../../src root/Applications/OGAgent.app
+cp -a ../scripts .
+
+# Create plist file.
+cat << EOT > root/Applications/OGAgent.app/OGAgent.plist
+
+
+
+
+ BuildAliasOf
+ OGAgent
+ BuildVersion
+ $VERSION
+ $AUTHOR
+
+
+EOT
+
+# Add files in the base package.
+( cd root && find . | cpio -o --format odc --owner 0:80 | gzip -c ) > flat/base.pkg/Payload
+
+# Create PackageInfo file.
+cat << EOT > flat/base.pkg/PackageInfo
+
+
+
+
+
+
+
+
+
+EOT
+
+# Compress the scripts folder.
+( cd scripts && find . | cpio -o --format odc --owner 0:80 | gzip -c ) > flat/base.pkg/Scripts
+
+# Create BOM file.
+mkbom -u 0 -g 80 root flat/base.pkg/Bom
+
+# Create Distribution file.
+cat << EOT > flat/Distribution
+
+
+ OGAgent 1.1.0
+
+
+
+
+
+
+
+
+
+
+ #base.pkg
+
+EOT
+
+# Create new Xar application archive.
+rm -f ../../../OGAgentInstaller-$VERSION.pkg
+( cd flat && xar --compression none -cf "../../../OGAgentInstaller-$VERSION.pkg" * )
+
diff --git a/admin/Sources/Clients/ogagent/macos/scripts/es.opengnsys.ogagent.plist b/admin/Sources/Clients/ogagent/macos/scripts/es.opengnsys.ogagent.plist
new file mode 100644
index 00000000..5ec11fa5
--- /dev/null
+++ b/admin/Sources/Clients/ogagent/macos/scripts/es.opengnsys.ogagent.plist
@@ -0,0 +1,15 @@
+
+
+
+ Label
+ es.opengnsys.ogagent
+ ProgramArguments
+
+ /usr/bin/ogagent
+ start
+
+ RunAtLoad
+
+
+
+
diff --git a/admin/Sources/Clients/ogagent/macos/scripts/ogagent b/admin/Sources/Clients/ogagent/macos/scripts/ogagent
new file mode 100755
index 00000000..b139d7f2
--- /dev/null
+++ b/admin/Sources/Clients/ogagent/macos/scripts/ogagent
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+FOLDER=/Applications/OGAgent.app
+
+cd $FOLDER
+python -m opengnsys.linux.OGAgentService $@
diff --git a/admin/Sources/Clients/ogagent/macos/scripts/postinstall b/admin/Sources/Clients/ogagent/macos/scripts/postinstall
new file mode 100755
index 00000000..ebb2ca48
--- /dev/null
+++ b/admin/Sources/Clients/ogagent/macos/scripts/postinstall
@@ -0,0 +1,17 @@
+#!/usr/bin/env sh
+
+# Directories
+SRCDIR=$(dirname "$0")
+BINDIR=/usr/bin
+INITDIR=/Library/LaunchDaemons
+
+# Check if it needs to install Python dependencies:
+if ! which pip &>/dev/null; then
+ easy_install pip
+ pip install netifaces requests six
+fi
+
+# Copying files.
+cp $SRCDIR/ogagent $BINDIR
+cp $SRCDIR/es.opengnsys.ogagent.plist $INITDIR
+
diff --git a/admin/Sources/Clients/ogagent/requires.txt b/admin/Sources/Clients/ogagent/requires.txt
new file mode 100644
index 00000000..07ce387c
--- /dev/null
+++ b/admin/Sources/Clients/ogagent/requires.txt
@@ -0,0 +1,3 @@
+six
+requests
+
diff --git a/admin/Sources/Clients/ogagent/src/OGAServiceHelper.py b/admin/Sources/Clients/ogagent/src/OGAServiceHelper.py
new file mode 100644
index 00000000..79a6c81d
--- /dev/null
+++ b/admin/Sources/Clients/ogagent/src/OGAServiceHelper.py
@@ -0,0 +1,57 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+#
+# Copyright (c) 2014 Virtual Cable S.L.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without modification,
+# are permitted provided that the following conditions are met:
+#
+# * Redistributions of source code must retain the above copyright notice,
+# this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice,
+# this list of conditions and the following disclaimer in the documentation
+# and/or other materials provided with the distribution.
+# * Neither the name of Virtual Cable S.L. nor the names of its contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+'''
+@author: Adolfo Gómez, dkmaster at dkmon dot com
+'''
+from __future__ import unicode_literals
+
+import win32service
+import win32serviceutil
+
+svc_name = "UDSActor"
+
+try:
+ hscm = win32service.OpenSCManager(None, None, win32service.SC_MANAGER_ALL_ACCESS)
+
+ try:
+ hs = win32serviceutil.SmartOpenService(hscm, svc_name, win32service.SERVICE_ALL_ACCESS)
+ service_failure_actions = {
+ 'ResetPeriod': 864000, # Time in ms after which to reset the failure count to zero.
+ 'RebootMsg': u'', # Not using reboot option
+ 'Command': u'', # Not using run-command option
+ 'Actions': [
+ (win32service.SC_ACTION_RESTART, 5000), # action, delay in ms
+ (win32service.SC_ACTION_RESTART, 5000)
+ ]
+ }
+ win32service.ChangeServiceConfig2(hs, win32service.SERVICE_CONFIG_FAILURE_ACTIONS, service_failure_actions)
+ finally:
+ win32service.CloseServiceHandle(hs)
+finally:
+ win32service.CloseServiceHandle(hscm)
diff --git a/admin/Sources/Clients/ogagent/src/OGAgent.manifest b/admin/Sources/Clients/ogagent/src/OGAgent.manifest
new file mode 100644
index 00000000..0e5ff974
--- /dev/null
+++ b/admin/Sources/Clients/ogagent/src/OGAgent.manifest
@@ -0,0 +1,17 @@
+
+
+
+ Description
+
+
+
+
+
+
+
+
diff --git a/admin/Sources/Clients/ogagent/src/OGAgent.qrc b/admin/Sources/Clients/ogagent/src/OGAgent.qrc
new file mode 100644
index 00000000..59177668
--- /dev/null
+++ b/admin/Sources/Clients/ogagent/src/OGAgent.qrc
@@ -0,0 +1,5 @@
+
+
+ img/oga.png
+
+
diff --git a/admin/Sources/Clients/ogagent/src/OGAgentUser.py b/admin/Sources/Clients/ogagent/src/OGAgentUser.py
new file mode 100644
index 00000000..1c9bf30e
--- /dev/null
+++ b/admin/Sources/Clients/ogagent/src/OGAgentUser.py
@@ -0,0 +1,358 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+#
+# Copyright (c) 2014 Virtual Cable S.L.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without modification,
+# are permitted provided that the following conditions are met:
+#
+# * Redistributions of source code must retain the above copyright notice,
+# this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice,
+# this list of conditions and the following disclaimer in the documentation
+# and/or other materials provided with the distribution.
+# * Neither the name of Virtual Cable S.L. nor the names of its contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+'''
+@author: Adolfo Gómez, dkmaster at dkmon dot com
+'''
+from __future__ import unicode_literals
+
+import sys
+import time
+import signal
+import json
+import six
+import atexit
+from PyQt4 import QtGui
+from PyQt4 import QtCore
+
+from opengnsys import ipc
+from opengnsys import utils
+from opengnsys.log import logger
+from opengnsys.service import IPC_PORT
+from opengnsys import operations
+from about_dialog_ui import Ui_OGAAboutDialog
+from message_dialog_ui import Ui_OGAMessageDialog
+from opengnsys.scriptThread import ScriptExecutorThread
+from opengnsys import VERSION
+from opengnsys.config import readConfig
+from opengnsys.loader import loadModules
+
+# Set default characters encoding to UTF-8
+reload(sys)
+if hasattr(sys, 'setdefaultencoding'):
+ sys.setdefaultencoding('utf-8')
+
+trayIcon = None
+
+def sigAtExit():
+ if trayIcon:
+ trayIcon.quit()
+
+#def sigTerm(sigNo, stackFrame):
+# logger.debug("Exec sigTerm")
+# if trayIcon:
+# trayIcon.quit()
+
+# About dialog
+class OGAAboutDialog(QtGui.QDialog):
+ def __init__(self, parent=None):
+ QtGui.QDialog.__init__(self, parent)
+ self.ui = Ui_OGAAboutDialog()
+ self.ui.setupUi(self)
+ self.ui.VersionLabel.setText("Version " + VERSION)
+
+ def closeDialog(self):
+ self.hide()
+
+
+class OGAMessageDialog(QtGui.QDialog):
+ def __init__(self, parent=None):
+ QtGui.QDialog.__init__(self, parent)
+ self.ui = Ui_OGAMessageDialog()
+ self.ui.setupUi(self)
+
+ def message(self, message):
+ self.ui.message.setText(message)
+ self.show()
+
+ def closeDialog(self):
+ self.hide()
+
+
+class MessagesProcessor(QtCore.QThread):
+
+ logoff = QtCore.pyqtSignal(name='logoff')
+ message = QtCore.pyqtSignal(tuple, name='message')
+ script = QtCore.pyqtSignal(QtCore.QString, name='script')
+ exit = QtCore.pyqtSignal(name='exit')
+
+ def __init__(self, port):
+ super(self.__class__, self).__init__()
+ # Retries connection for a while
+ for _ in range(10):
+ try:
+ self.ipc = ipc.ClientIPC(port)
+ self.ipc.start()
+ break
+ except Exception:
+ logger.debug('IPC Server is not reachable')
+ self.ipc = None
+ time.sleep(2)
+
+ self.running = False
+
+ def stop(self):
+ self.running = False
+ if self.ipc:
+ self.ipc.stop()
+
+ def isAlive(self):
+ return self.ipc is not None
+
+ def sendLogin(self, userName, language):
+ if self.ipc:
+ self.ipc.sendLogin(userName, language)
+
+ def sendLogout(self, userName):
+ if self.ipc:
+ self.ipc.sendLogout(userName)
+
+ def run(self):
+ if self.ipc is None:
+ return
+ self.running = True
+
+ # Wait a bit so we ensure IPC thread is running...
+ time.sleep(2)
+
+ while self.running and self.ipc.running:
+ try:
+ msg = self.ipc.getMessage()
+ if msg is None:
+ break
+ msgId, data = msg
+ logger.debug('Got Message on User Space: {}:{}'.format(msgId, data))
+ if msgId == ipc.MSG_MESSAGE:
+ module, message, data = data.split('\0')
+ self.message.emit((module, message, data))
+ elif msgId == ipc.MSG_LOGOFF:
+ self.logoff.emit()
+ elif msgId == ipc.MSG_SCRIPT:
+ self.script.emit(QtCore.QString.fromUtf8(data))
+ except Exception as e:
+ try:
+ logger.error('Got error on IPC thread {}'.format(utils.exceptionToMessage(e)))
+ except:
+ logger.error('Got error on IPC thread (an unicode error??)')
+
+ if self.ipc.running is False and self.running is True:
+ logger.warn('Lost connection with Service, closing program')
+
+ self.exit.emit()
+
+
+class OGASystemTray(QtGui.QSystemTrayIcon):
+ def __init__(self, app_, parent=None):
+ self.app = app_
+ self.config = readConfig(client=True)
+
+ # Get opengnsys section as dict
+ cfg = dict(self.config.items('opengnsys'))
+
+ # Set up log level
+ logger.setLevel(cfg.get('log', 'INFO'))
+
+ self.ipcport = int(cfg.get('ipc_port', IPC_PORT))
+
+ # style = app.style()
+ # icon = QtGui.QIcon(style.standardPixmap(QtGui.QStyle.SP_ComputerIcon))
+ icon = QtGui.QIcon(':/images/img/oga.png')
+
+ QtGui.QSystemTrayIcon.__init__(self, icon, parent)
+ self.menu = QtGui.QMenu(parent)
+ exitAction = self.menu.addAction("About")
+ exitAction.triggered.connect(self.about)
+ self.setContextMenu(self.menu)
+ self.ipc = MessagesProcessor(self.ipcport)
+
+ if self.ipc.isAlive() is False:
+ raise Exception('No connection to service, exiting.')
+
+ self.timer = QtCore.QTimer()
+ self.timer.timeout.connect(self.timerFnc)
+
+
+ self.stopped = False
+
+ self.ipc.message.connect(self.message)
+ self.ipc.exit.connect(self.quit)
+ self.ipc.script.connect(self.executeScript)
+ self.ipc.logoff.connect(self.logoff)
+
+ self.aboutDlg = OGAAboutDialog()
+ self.msgDlg = OGAMessageDialog()
+
+ self.timer.start(1000) # Launch idle checking every 1 seconds
+
+ self.ipc.start()
+
+ def initialize(self):
+ # Load modules and activate them
+ # Also, sends "login" event to service
+ self.modules = loadModules(self, client=True)
+ logger.debug('Modules: {}'.format(list(v.name for v in self.modules)))
+
+ # Send init to all modules
+ validMods = []
+ for mod in self.modules:
+ try:
+ logger.debug('Activating module {}'.format(mod.name))
+ mod.activate()
+ validMods.append(mod)
+ except Exception as e:
+ logger.exception()
+ logger.error("Activation of {} failed: {}".format(mod.name, utils.exceptionToMessage(e)))
+
+ self.modules[:] = validMods # copy instead of assignment
+
+ # If this is running, it's because he have logged in, inform service of this fact
+ self.ipc.sendLogin(operations.getCurrentUser(), operations.getSessionLanguage())
+
+ def deinitialize(self):
+ for mod in reversed(self.modules): # Deinitialize reversed of initialization
+ try:
+ logger.debug('Deactivating module {}'.format(mod.name))
+ mod.deactivate()
+ except Exception as e:
+ logger.exception()
+ logger.error("Deactivation of {} failed: {}".format(mod.name, utils.exceptionToMessage(e)))
+
+ def timerFnc(self):
+ pass
+
+ def message(self, msg):
+ '''
+ Processes the message sent asynchronously, msg is an QString
+ '''
+ try:
+ logger.debug('msg: {}, {}'.format(type(msg), msg))
+ module, message, data = msg
+ except Exception as e:
+ logger.error('Got exception {} processing message {}'.format(e, msg))
+ return
+
+ for v in self.modules:
+ if v.name == module: # Case Sensitive!!!!
+ try:
+ logger.debug('Notifying message {} to module {} with json data {}'.format(message, v.name, data))
+ v.processMessage(message, json.loads(data))
+ return
+ except Exception as e:
+ logger.error('Got exception {} processing generic message on {}'.format(e, v.name))
+
+ logger.error('Module {} not found, messsage {} not sent'.format(module, message))
+
+ def executeScript(self, script):
+ logger.debug('Executing script')
+ script = six.text_type(script.toUtf8()).decode('base64')
+ th = ScriptExecutorThread(script)
+ th.start()
+
+ def logoff(self):
+ logger.debug('Logoff invoked')
+ operations.logoff() # Invoke log off
+
+ def about(self):
+ self.aboutDlg.exec_()
+
+ def cleanup(self):
+ logger.debug('Quit invoked')
+ if self.stopped is False:
+ self.stopped = True
+ try:
+ self.deinitialize()
+ except Exception:
+ logger.exception()
+ logger.error('Got exception deinitializing modules')
+
+ try:
+ # If we close Client, send Logoff to Broker
+ self.ipc.sendLogout(operations.getCurrentUser())
+ time.sleep(1)
+ self.timer.stop()
+ self.ipc.stop()
+ except Exception:
+ # May we have lost connection with server, simply log and exit in that case
+ logger.exception()
+ logger.exception("Got an exception, processing quit")
+
+ try:
+ # operations.logoff() # Uncomment this after testing to logoff user
+ pass
+ except Exception:
+ pass
+
+ def quit(self):
+ #logger.debug("Exec quit {}".format(self.stopped))
+ if self.stopped is False:
+ self.cleanup()
+ self.app.quit()
+
+ def closeEvent(self, event):
+ logger.debug("Exec closeEvent")
+ event.accept()
+ self.quit()
+
+if __name__ == '__main__':
+ app = QtGui.QApplication(sys.argv)
+
+ if not QtGui.QSystemTrayIcon.isSystemTrayAvailable():
+ # QtGui.QMessageBox.critical(None, "Systray", "I couldn't detect any system tray on this system.")
+ sys.exit(1)
+
+ # This is important so our app won't close on messages windows (alerts, etc...)
+ QtGui.QApplication.setQuitOnLastWindowClosed(False)
+
+ try:
+ trayIcon = OGASystemTray(app)
+ except Exception as e:
+ logger.exception()
+ logger.error('OGA Service is not running, or it can\'t contact with OGA Server. User Tools stopped: {}'.format(utils.exceptionToMessage(e)))
+ sys.exit(1)
+
+ try:
+ trayIcon.initialize() # Initialize modules, etc..
+ except Exception as e:
+ logger.exception()
+ logger.error('Exception initializing OpenGnsys User Agent {}'.format(utils.exceptionToMessage(e)))
+ trayIcon.quit()
+ sys.exit(1)
+
+ app.aboutToQuit.connect(trayIcon.cleanup)
+ trayIcon.show()
+
+ # Catch kill and logout user :)
+ #signal.signal(signal.SIGTERM, sigTerm)
+ atexit.register(sigAtExit)
+
+ res = app.exec_()
+
+ logger.debug('Exiting')
+ trayIcon.quit()
+
+ sys.exit(res)
diff --git a/admin/Sources/Clients/ogagent/src/OGAgent_rc.py b/admin/Sources/Clients/ogagent/src/OGAgent_rc.py
new file mode 100644
index 00000000..867ca2ab
--- /dev/null
+++ b/admin/Sources/Clients/ogagent/src/OGAgent_rc.py
@@ -0,0 +1,289 @@
+# -*- coding: utf-8 -*-
+
+# Resource object code
+#
+# Created by: The Resource Compiler for PyQt4 (Qt v4.8.6)
+#
+# WARNING! All changes made in this file will be lost!
+
+from PyQt4 import QtCore
+
+qt_resource_data = b"\
+\x00\x00\x0f\x42\
+\x89\
+\x50\x4e\x47\x0d\x0a\x1a\x0a\x00\x00\x00\x0d\x49\x48\x44\x52\x00\
+\x00\x00\x30\x00\x00\x00\x30\x08\x06\x00\x00\x01\x20\x05\xc9\x11\
+\x00\x00\x00\x09\x70\x48\x59\x73\x00\x00\x0e\xc7\x00\x00\x0e\xc7\
+\x01\x38\x92\x2f\x76\x00\x00\x0e\xf4\x49\x44\x41\x54\x78\xda\xc5\
+\x59\x07\x58\x53\xd9\x12\xbe\x29\xd4\x84\x12\x21\xf4\x22\x08\x08\
+\x02\x22\xa2\x22\x22\x22\x8a\xa0\xa0\x14\x1b\xae\x62\x05\xac\xb8\
+\x76\xd7\xde\xd6\xde\x15\xf5\xd9\x7b\x17\x51\x41\x50\x14\x10\x04\
+\x44\x94\x8e\xd2\x25\x80\x80\x48\xef\x24\xb4\xbc\x39\x59\x6e\x4c\
+\x42\xe2\x0a\xea\x7b\xf3\x7d\xe1\xde\x7b\xca\xcc\x9c\x73\xe6\xcc\
+\xfc\x33\x90\xd9\x6c\x36\x86\xe8\xe8\xe9\x9b\xe9\xab\x97\x79\x9a\
+\x62\x5d\x44\x46\x7f\xd6\x6f\x3f\xc1\xb6\xb7\x1d\xf6\xf7\xc3\xc0\
+\xf0\xf3\x53\x5c\xc6\x2e\xe4\x74\x9c\xbe\x78\xff\xcd\xc1\x9d\x2b\
+\x08\xf8\x48\x34\x48\x55\x85\x9e\x4a\x5e\xe6\x3d\x7d\x04\xfa\x40\
+\x8d\xd3\xdd\xc6\x6d\x73\x1c\x6b\x55\xd8\xd9\xd1\xf9\x88\xc3\x0a\
+\x9f\x11\x19\x93\xc8\x4e\x4e\xcb\xce\x5e\xeb\x3b\x7b\x07\x19\xe3\
+\xa1\xd1\x23\x2d\x08\xd0\x91\xcc\x91\x81\x6b\x15\x15\x9b\xb4\xd6\
+\xd6\x7a\xf0\x61\xae\x56\x1b\x77\x9d\x62\xed\xdb\xe6\x2b\x11\xfc\
+\x22\xfa\x10\x5f\x47\x47\x47\x87\x38\xc6\x4f\x6c\xee\x3a\x0e\x9f\
+\xba\x91\xd1\xa5\x00\x6a\x24\x30\x99\x2c\x39\x32\xef\x1a\x10\xed\
+\x3e\x7c\x91\xb5\x65\xad\xb7\x38\x9f\x56\x57\x6f\x3f\x79\xda\xd9\
+\xc9\x76\xae\xaa\xae\xd5\xe7\x6a\x85\x2f\x12\x71\x40\xef\x82\x9c\
+\xba\xed\xe1\x9c\x19\x13\x27\x9b\x18\xf5\x7b\x84\x77\xf8\x07\x86\
+\x5f\x98\xea\x32\xd6\x07\xbd\x57\xd7\xd4\xe9\xef\x3f\x7e\x35\x47\
+\x4d\x85\xde\x40\x3e\x70\xe2\x6a\x1e\x6a\xec\xec\xec\xe4\x4c\x6e\
+\x6f\xef\x90\x44\x4f\x34\xf8\xaf\x1d\x27\xd8\x07\x76\xac\xc0\x52\
+\xd3\x73\x36\x4d\x18\x67\x1d\x6a\x37\x72\x88\x23\xf9\xaf\x15\xf3\
+\xf4\xf8\x44\x92\x49\x4c\xa4\xce\xd5\xdb\x81\x9c\xc1\x70\x58\x71\
+\x70\x2e\xfb\x22\x5e\xbf\xdb\xcb\x55\x49\x18\x95\x55\xd4\xb4\xc0\
+\x43\x0a\x06\x5b\x9d\xba\x70\xaf\xc8\xd7\xc7\x03\xdb\xb0\xd3\xaf\
+\x43\xe4\x84\x0d\x2b\xe6\x4a\x27\xa5\x64\xb2\x07\x0f\x32\xc2\x5c\
+\x27\xd8\x6a\xc2\xc9\xb4\xed\xdf\xbe\x5c\x9c\xbb\x4b\x88\x92\xd3\
+\xb2\x66\xdd\x79\x18\x7a\x53\xd4\x0e\x71\x55\x82\x3d\x26\x6d\xd8\
+\x79\xb2\x7d\xa9\xd7\x34\x9b\x95\x4b\x66\x9a\xff\xeb\xb6\xa2\xc1\
+\x5b\xd7\xf9\xa8\xca\x50\xa5\xcb\xf0\xf3\x10\x29\x01\x1f\x80\x06\
+\xa3\xe7\xd0\xc1\xc6\x97\xdf\x27\x7d\x5c\xc0\x3b\x68\xdf\xb1\xcb\
+\x0d\x34\x79\x39\xaa\x89\xa1\xee\xca\x6e\x8b\xd6\xd3\xd1\x88\xc0\
+\x27\x7c\x29\xab\x1c\x25\x2f\x27\x13\x45\xa5\x50\x72\x86\x0e\x32\
+\x32\xa0\x50\xa4\x8f\x77\x9b\x80\x16\xbd\x69\xf5\x02\xed\xd6\xd6\
+\x36\x8a\xaa\x8a\x62\x14\xd8\x6b\xd6\xf2\x85\x1e\x46\x99\xd9\x05\
+\xec\x80\xa7\xaf\x0a\xc9\x72\xb2\xd4\xe2\xba\xfa\x46\x0d\x5c\x35\
+\xdd\xbe\xea\x51\xc0\xb5\x28\xe8\xf9\x6b\xf6\xa4\xf1\xa3\x30\x65\
+\xba\xc2\x01\xd4\x2e\x21\x21\x6e\xeb\x3e\xd1\x4e\x86\xbc\x79\x8d\
+\x97\xa6\xb0\xc5\xa1\xc1\x88\x86\x98\x0f\xb8\xfa\x22\x22\x2e\xc8\
+\x61\x8c\xd5\xc4\x80\xa0\x08\x86\xd0\x83\xcb\xc9\x2b\x74\x34\xd0\
+\xd3\xe6\x7e\x9b\x9b\x19\x4d\x44\xcf\xf8\xc4\xf4\xbe\x42\x27\xc0\
+\xe0\x50\xde\x2b\x95\x5f\x50\x82\xd1\x15\xe4\x31\xb0\x2d\xa2\x48\
+\xd3\x68\x6a\x6e\xa1\x1f\x3e\x75\x93\xb1\x75\xad\x17\xcd\xd2\xc2\
+\xb8\xcd\xef\xfc\xbd\x42\x58\xbc\x68\xe3\xcb\x67\x14\x8f\xd9\xbe\
+\xde\x87\xfa\x24\x24\xaa\xcd\xd5\xc9\x16\xf3\x99\xe3\x66\xc6\xe7\
+\x07\x78\xe9\xdc\xd5\x87\x11\x9f\x18\xc5\x76\xf8\xb7\xa6\xba\xf2\
+\xfb\xe5\x0b\x67\x0c\xc3\x7a\x41\x7c\x1a\xf1\x9a\x11\x5a\x1f\x81\
+\x80\xb1\x13\x53\x32\xe7\xdc\x7b\xf4\xe2\x1a\xde\xb7\x78\xfe\xd4\
+\xd1\xe8\xa8\x7a\x24\x20\x2a\x36\x71\x5d\xf0\x8b\x98\x83\xe8\x5d\
+\x52\x52\xa2\x6e\xd7\xc6\xc5\xf2\xf8\x00\x8b\x41\x46\xd7\x91\x00\
+\xfc\x1b\x8d\xed\x91\x80\xbc\xfc\xcf\x63\x71\xe6\x88\x78\x99\xe3\
+\xb4\x68\xfe\x14\xbb\x73\x57\x1e\xbe\xfa\xc7\xf6\x07\x5c\xe6\xf3\
+\x92\x6c\x36\x71\xcb\x9e\x33\x6d\xfa\xba\x5a\xc4\xd9\x1e\xce\x18\
+\x89\x44\xe4\xf1\x7e\x81\x35\xe4\xf3\xd7\x02\xc2\x04\x27\x10\x08\
+\x84\x4e\x3e\x73\xf7\x7f\x7e\x0b\x3d\x89\x44\x62\xbb\x89\x91\x5e\
+\x00\x7a\x2f\x2a\x2e\x73\x3a\x7b\xc5\x3f\x78\xef\x56\x5f\x6c\xcf\
+\x96\x65\xd8\xf6\xfd\x67\xeb\xd3\x3e\xe6\x2c\x95\x92\x92\x6c\xaf\
+\xab\x6f\xba\x0b\x96\x81\xa9\xa9\x2a\x7d\x21\x7b\xcf\x76\x1b\x7f\
+\xf1\xc6\xe3\xe7\x5c\xcf\xb2\xd3\xaf\xed\xc0\x8e\x3f\x49\x82\xe7\
+\x62\xa8\xdf\x37\x64\x81\xa7\xab\x33\xde\x06\xde\x06\x43\xcc\xbb\
+\xbe\x91\x3b\x96\xe3\x84\xb2\x33\x37\xd9\x43\x06\x0d\xa8\xdd\xba\
+\xe7\x0c\x79\xc3\xca\x79\xa3\xc9\xc8\x88\x91\x33\x89\x8e\x4b\x5e\
+\x05\xf7\xeb\x28\x5a\x01\xce\x14\x1d\xf2\x8a\xc5\x33\x07\xab\xab\
+\xd2\x93\x79\x05\xc2\x78\x5e\xc3\xc0\x78\x9d\x51\x7f\x3d\xed\xa0\
+\xa7\xa1\xd1\x93\xf4\x74\x34\xb1\xf8\x84\x8f\xe5\x5c\x2b\xb2\xb1\
+\x32\x3f\x86\x7e\xdf\x3b\xb0\x82\xa2\x52\x6b\xfb\xd1\x96\x22\xfb\
+\x71\x37\xef\xec\x60\xc3\x15\x4e\xee\x89\x4d\xab\x2a\xd3\xd3\xc2\
+\xa3\xde\xf3\xb5\x59\x5a\x98\x60\x17\xae\x3d\xea\xd4\xd6\x54\x21\
+\xcc\xfd\x63\x12\x8f\x7f\xce\xae\x9a\x60\x3f\xe2\x48\x8f\x04\x48\
+\x48\x88\x35\x8c\xb2\x1e\x3c\xee\xef\x43\x17\x43\x60\x7f\xc5\xc4\
+\xc4\xc8\x10\xbd\x87\x74\x1c\xf2\xbb\xce\xae\xad\xab\xaf\xb6\xb6\
+\x1c\xa4\xd4\x15\xc4\xc0\xb1\x7c\x48\x5f\x3c\x7f\xca\x3e\x72\x4f\
+\x6f\xa6\xbe\xae\x66\x18\xc4\x22\x83\x0b\xd7\x1f\x31\x1c\xc7\x58\
+\x61\xe9\x19\xb9\x24\x63\xc3\x7e\xfe\x39\x9f\x0a\xa7\x52\x28\x52\
+\x1c\xe6\x7b\x8f\x5e\x29\xdd\xb2\xd6\xcb\xee\xbb\x81\xed\x7b\xd4\
+\x87\x26\x5b\x00\x91\xfd\x6b\x42\x4a\x46\x2b\xf8\x4f\xcd\xe6\x66\
+\xe6\x54\x3b\x1b\x8b\x57\x87\xfd\xae\xab\x8d\xb7\xb7\xde\x08\xcc\
+\xb9\x31\x5b\xa8\x2f\x42\x04\x93\x14\x82\x42\x5f\x1f\x49\xfb\x98\
+\x3b\x8d\x4c\x22\xb5\xee\xdc\xb8\x98\xf6\xd3\xbe\x88\x13\x92\xbf\
+\x56\x9a\x1e\x3d\x73\x2b\x8d\xb7\x0d\xc5\x47\xac\x97\xc4\x27\xe0\
+\xc1\x93\xb0\x4b\x78\x44\x43\xb6\x8f\xee\x00\x7a\x87\xd8\x1f\x07\
+\x37\x77\xb8\xcb\x04\xdb\x15\x23\x87\x0f\x3a\xd9\x2b\x01\x8f\x9e\
+\xbe\x3a\x83\x33\x47\x0e\xce\xc3\xdd\x61\xae\xa0\x87\x0d\x7c\x16\
+\x75\xa2\x57\x02\x8a\x4b\xcb\x2d\xe2\xde\xa7\x2d\x41\xef\x52\x92\
+\x12\xb5\x38\xf3\x5f\x41\x1c\x01\x27\xcf\xdd\x49\xc0\x1b\x04\xa3\
+\xae\x9b\xd3\xe8\xe5\x8f\x43\x22\xfd\x7a\x2d\x20\x3c\xea\xdd\x16\
+\xde\x06\x71\x71\xb1\x46\xde\xef\x11\x96\x66\xa7\x7e\x44\x40\xc8\
+\xcb\xd8\x07\x1f\x33\x3f\xb9\x56\x54\xd5\x88\x71\x6e\xbd\x0a\x3d\
+\x6f\xd5\x92\x99\xfa\xe4\xd0\x88\xb8\xbf\xf1\x41\x70\x33\x5b\x7a\
+\xaa\xe1\xeb\x37\x49\x67\x82\x43\xa3\x97\x78\x7a\x38\x61\x4e\xe3\
+\xac\xb9\xed\x8d\x8d\x2d\x7a\x27\xcf\xde\x49\xe0\xb3\x22\x8a\xb4\
+\x54\xc5\xf7\x98\xa9\x28\x2b\xa6\xf3\x7e\xef\x39\x72\x89\xa9\xa3\
+\xad\x2e\x71\x00\xbc\x6b\x65\x55\x6d\x33\x18\x84\xb4\x9a\x32\xbd\
+\x73\xe5\xd2\x99\x44\x2a\x55\x0a\x6b\x6d\x6f\x97\xe1\x13\xd0\xd0\
+\xd8\xa4\x2a\xc8\x14\x07\xc7\x88\x16\xcc\x72\x71\xc6\xdf\xc1\xc1\
+\x35\xb9\x39\xdb\x49\x18\x1b\xea\x62\xe5\x15\xd5\x0d\xc7\xfe\x73\
+\x5b\x02\xb9\xed\x93\xe7\xef\x72\xad\x8e\x2a\x2d\x55\xc6\x27\xa0\
+\xa3\xa3\x53\x4c\x50\x00\x4a\x17\xba\xb6\xaf\x19\x30\xd9\x67\xf4\
+\x7e\xe4\xf4\xcd\xba\x31\x36\x43\xa4\x11\x73\x8e\xb0\xeb\x01\xf5\
+\x90\x88\x68\x7c\xcb\x34\x30\xec\xfe\xe3\x97\x59\x66\x03\x0d\xee\
+\x74\xbb\xc9\x9f\x4b\xbe\x0e\x45\x30\xa5\x6b\x7f\x57\xc3\xd2\xf5\
+\x39\x29\xc7\xe6\x65\xd4\x2e\x58\xe6\x29\x21\x2e\x26\x6b\x3e\xd0\
+\x90\x33\x1e\x00\x41\xb6\xfb\xc4\x31\xeb\xd1\x7b\x62\x6a\xe6\x5e\
+\x2a\x45\x1a\xbb\x7c\x2b\x30\xbd\xae\xbe\xa1\x13\x32\xab\xb3\x1c\
+\x30\x08\x7b\xf9\x19\x17\xe0\x77\xfe\xee\x3b\x04\x6e\x11\xf2\x42\
+\x50\x1a\xb5\x21\x3f\x84\xa2\x1b\x7a\x87\xf0\x7a\x83\x37\xa2\x01\
+\xac\xe9\x0f\xf7\x26\x90\x83\x3c\xb5\xd5\xcf\x41\x40\xcf\x30\x32\
+\xd0\x09\x2a\xfd\x5a\x69\xd6\xd8\xd8\xac\xc4\x81\xa7\x28\xcf\x82\
+\xcc\x24\x1f\x60\xaa\xfa\x3f\x67\xd1\xac\xc2\xc1\x84\xfd\xb4\x5e\
+\x78\xcf\x71\x77\xc4\x99\x65\xe5\x16\x4c\x1b\x31\xcc\x8c\xcb\xbc\
+\xbc\xb2\x06\x1b\x64\xda\xff\x0e\xfe\x2d\x29\x21\x51\xff\x30\x28\
+\xe2\x9a\x96\x9a\x32\xb1\xbf\x7e\x5f\x2c\x3c\x22\x21\x9a\xb3\x45\
+\x24\xf0\x96\xb0\x12\x8d\x7f\x33\xc9\x98\xf8\x94\x63\xde\x9e\x6e\
+\xdc\xef\xac\x1c\x46\xae\xf5\x70\x33\xee\x1d\xb9\xf7\xf8\x65\xf5\
+\xce\x0d\x8b\x10\x3f\xce\x77\xf0\xcb\x18\x9b\x1e\xc5\x83\x9c\xdc\
+\x42\x75\xde\x6f\x70\x2b\xc5\xb5\xb5\x0d\x5a\xda\x1a\xaa\x71\x57\
+\x6e\x05\x66\x8f\xb2\xb6\xe0\x32\xaf\xad\x6b\xc0\x10\xc4\x21\xff\
+\x8c\x9f\xa9\x6f\x68\x1a\x06\xfb\xbd\xa6\xa9\xa9\x45\xad\xb0\xf8\
+\x8b\x41\xbf\xbe\xdf\xe4\x83\xf3\xcc\x07\xc4\xbf\xb2\x47\x02\xe8\
+\x8a\xb4\x6a\x14\xd0\xbe\x21\x91\xc1\x94\x4b\x37\x1f\x27\x12\xe1\
+\x64\xb7\xad\x5b\xc8\x37\x36\x33\x87\xa1\x3b\x5f\xce\xe5\x73\x8f\
+\x04\x8c\xb2\x1a\xbc\xf1\x55\x74\xc2\x39\x3b\x9b\x21\x5d\x7e\x8b\
+\x8c\x2d\x59\x30\x95\xc0\x62\xb5\xb2\xf7\x1f\xbf\x4c\xd8\xb4\xda\
+\xab\xeb\xc2\x36\x63\xda\x9a\xaa\x6f\x7a\x1c\x93\x2d\x87\x98\x9c\
+\xdf\xb4\xeb\x94\x9f\xa4\xb8\xb8\xb8\x95\xe5\x40\x4e\x5b\x58\x64\
+\x7c\xea\xcb\xc8\x78\x53\x49\x09\x71\x2e\xf8\xba\x1b\x10\x9a\xe6\
+\x33\xc7\xdd\xa1\x57\x41\x7f\x2f\x98\x34\x30\xdd\xb6\x69\xf7\xa9\
+\x8d\x04\x36\x81\x34\xc5\x65\xec\x11\x40\x19\x0c\xd8\x92\x68\x7c\
+\x0c\xe4\x16\x03\xc0\x2b\x37\xf5\x1a\x55\xa4\x7e\xcc\x5d\xa4\xad\
+\xa1\x26\xe9\x3d\xdb\x1d\xdb\xb8\xeb\xe4\x75\x45\x05\x5a\xdd\xea\
+\xa5\xb3\x38\x7d\x37\xef\x3f\x7b\xb7\x7a\x99\xe7\x5c\x91\x41\xff\
+\x47\x48\xa1\x8f\x9c\xfc\xbc\x2e\x14\xb7\x6f\xdb\x72\xec\xdc\xb5\
+\x00\x39\x48\xfc\x31\x46\x61\x49\x45\x51\xf1\x17\x55\x25\x45\x5a\
+\xd6\x4f\x09\xb0\x1e\x66\xe6\x76\xe6\xd2\xfd\x13\x0e\x76\x23\x34\
+\x5a\x98\x4c\x19\x27\xfb\x11\xf5\x00\x9e\x1f\x46\xc6\x24\x4c\x80\
+\xa4\x5b\x8b\x2f\xa2\x89\xc2\x45\xc2\xe8\x53\x41\xf1\xe8\x98\xb8\
+\x94\x15\x59\xb9\x0c\x67\x61\x9e\x17\x05\x2c\x2f\x4f\xb7\x09\x3d\
+\xc9\x80\x7e\x49\xcc\xff\x1e\xa1\xb4\xe1\x59\x58\xec\xbe\xf6\xf6\
+\x0e\x89\x6e\x01\x4e\x49\xe1\x83\xa9\xb1\xbe\x3f\x84\x85\x27\x6a\
+\x2a\xf4\x14\xd8\x0b\x42\x76\x5e\xc1\xf8\xd0\xf0\xb8\xdd\xda\x5a\
+\xaa\xb1\x90\xb3\x3c\xfb\xbf\x2c\x00\x45\x81\x3b\x0f\x9f\xdf\x4a\
+\xfd\x90\xe3\x21\xd8\x87\x20\xd9\x94\x49\x63\x17\x82\xcd\xb0\xf0\
+\xb6\xf8\x84\x0f\x0b\x01\xfb\xbd\x15\x5c\x24\x44\xf8\xca\x2d\x6b\
+\xbd\xd5\x20\x2d\x6c\xfb\x9f\x2d\x20\xe6\x6d\xca\x9f\x08\x1f\x76\
+\x4f\x0a\xb4\xc2\xbc\x20\x5b\x04\xaf\xd6\xc1\xdb\x8e\x83\x56\x11\
+\xc5\x08\x45\x74\x82\xa3\x47\x5a\x1c\xfc\xed\x0b\x40\x36\x7d\xfc\
+\xec\xed\xe4\xaf\xe5\x55\xc6\x82\x83\x20\xcf\xda\x64\x67\x33\x74\
+\x9f\x30\x06\x28\x05\x3e\x70\xf2\x5a\x2e\xc4\x03\xba\xb0\x7e\xb8\
+\xd5\xc3\x7f\xbb\x09\xb5\x30\x59\xf2\xfb\x8f\x5d\x61\xa0\x67\x37\
+\xef\x6c\x61\x72\x41\x94\xf2\x78\x59\x63\xd3\xaa\x05\xda\x00\x4a\
+\x8a\x9b\x5b\x98\x7d\xba\x8f\x20\xb0\x7b\xab\x5c\x45\x65\xad\x41\
+\x69\x59\xb9\x65\x6d\x5d\xa3\xa1\x18\x99\xc4\x6c\xef\xe8\x60\x2a\
+\xd1\x69\x19\xba\xda\x1a\x91\x5c\x47\x8d\xec\x1d\xd5\xb0\x85\x29\
+\x8f\x08\x52\xee\x9d\xff\x26\x08\x79\x9f\x49\xe3\x47\xad\x06\xf8\
+\x75\x55\xb0\x4f\x5d\x8d\x9e\xf4\x23\xca\x02\x3c\xe8\x17\x1b\x9f\
+\x72\x36\x3a\x2e\xc5\x1e\xe5\xa8\x70\x7f\x50\xb9\x11\xa3\xc9\xcb\
+\x00\x1a\x56\x40\xd0\x02\x83\x0d\x42\xe8\x17\x8b\x7e\x9b\xca\x66\
+\xb6\xb0\xb2\x2d\xcc\x0c\x4f\x93\x43\x5e\xc6\x1c\x44\x05\x41\x61\
+\x4c\x11\x1a\x83\x5f\xc9\x8f\x28\x40\xa3\xc9\x32\x84\xb5\x0f\x35\
+\x37\xbe\x22\x6a\x0e\x04\x6d\xcd\xdb\xfe\xcf\x62\x21\xf4\x69\xca\
+\xca\x50\xb0\x89\x8e\x36\x9c\xc0\x02\xf0\x11\x4c\xba\x03\x7b\x9f\
+\x94\x91\x99\x99\xcb\xc0\xc0\xbb\x19\x59\x0f\x1b\x84\x2a\x31\x70\
+\x19\x31\x0c\xf2\x37\x42\xf4\x9b\x64\x03\x94\xb0\x90\x01\xa8\xce\
+\x16\x25\x00\xee\x85\xf8\x8f\x1e\x37\xca\xa3\x05\xdb\x1c\xc6\x58\
+\x6d\x03\xc5\x4a\x85\x14\x53\xdc\x01\x18\xfb\xb7\xb6\xb6\x12\x27\
+\x3a\x8e\xc2\x16\xcd\x9b\xc2\xed\x2b\x2e\xfd\x5a\x7d\xf1\xfa\x63\
+\x12\x84\xdf\x4c\x4d\x75\xa5\xf7\x03\x8d\xf5\x13\x60\x21\x57\x5a\
+\x5b\x59\x44\x5e\x1e\xb2\xb2\x14\xe4\x05\xa5\xc8\x4c\x66\xab\x9c\
+\x28\xa5\x1a\x9b\x9a\x95\xe0\x68\xb5\x50\x89\xf6\x7b\xca\xa7\xa4\
+\xe7\xcc\x78\x13\x9f\xea\x2b\xe8\x6e\xd1\x7f\x51\x78\xdb\xaa\xaa\
+\x6b\x4d\x4f\x5d\xbc\x9f\x04\x32\xc9\x0b\x3c\x5d\x51\xb9\x83\xdb\
+\xd7\xda\xda\x86\x9d\xbd\xe2\xff\xa9\xe4\x4b\xb9\xee\x8c\xc9\x8e\
+\xb3\x21\x2b\xe0\x14\xd7\xb2\x73\x0b\xd6\x80\x1e\xc4\xc6\x26\x26\
+\x77\x2c\x93\xc9\x62\x07\x3e\x7b\xdd\x02\x9b\x53\x4b\x36\x33\xd1\
+\xbf\x9f\x94\x9a\xe5\x29\x4a\xb9\xa0\xe7\xd1\x47\x66\x7b\x38\x4d\
+\x13\xd5\x8f\x5c\x2e\x72\xbd\x02\xe5\xe5\xd5\x82\x25\x2d\xff\x27\
+\x61\x31\xef\x92\x3e\x5a\x83\x4b\x85\x14\x71\x24\x1f\x0f\xb0\xeb\
+\xd6\x23\xa7\x6f\x10\x15\x68\x72\x6d\x7b\xb6\xf8\x4a\xe1\x31\x06\
+\xcc\x48\x02\x92\x80\x7d\x80\x17\x61\x43\x0c\x51\x7c\xc2\x9e\x85\
+\xc5\x64\x15\x7d\x2e\xab\xea\x43\x93\x25\x2e\x9e\x3f\xd5\x96\xec\
+\xe1\xee\x38\xa7\xae\xae\x51\x03\xc1\x04\x61\x0a\xa6\x67\xe4\x4e\
+\xdd\x7d\xf8\x62\x29\xda\x15\x3d\x5d\xcd\x70\x3c\x2b\x81\xe8\xbc\
+\x37\x21\x39\x63\x3e\xef\x58\x0d\x35\xe5\x84\x85\x73\xdd\xed\x91\
+\x67\xe2\x75\xcf\xe0\x24\x60\xf3\xeb\x64\xd6\xf8\xce\xc6\x94\xe9\
+\x7d\x04\x61\x39\x1b\x92\xb8\x0f\x06\x7a\x7d\x8b\xe7\xcf\x9c\xe4\
+\xca\xdb\xf7\x34\x34\xe6\x04\x91\x4d\xac\x01\x07\xa3\x04\xe9\x54\
+\x2c\x89\x48\x68\xd7\xd1\xd6\x78\x0d\xf1\xe8\x20\x9e\xc4\x93\x51\
+\xbe\x85\x8a\xad\xd5\x35\xf5\x3a\x37\xee\x3d\x7d\x58\xf2\xa5\xc2\
+\x5c\x08\xf6\x57\x15\xac\xa9\x72\x9d\x24\x81\xd0\x39\x6a\xc4\xe0\
+\x23\xe3\xc7\x8e\xd8\x2c\x18\x71\x51\xd5\x12\x32\xd3\x2a\x29\x49\
+\x71\x99\xcd\x6b\xbc\x31\x2a\x45\x4a\x58\x6d\xbc\x02\xf8\xeb\x6f\
+\x5b\xe7\xd3\xad\x4c\xe4\xea\x64\xbb\x18\xfd\x5a\x5a\x58\x34\xb8\
+\xab\x9b\xe0\xee\x38\x47\x44\xbf\xdb\x12\x9f\x98\xbe\x59\x49\x51\
+\xa1\x91\x4a\x95\x7c\x41\xe6\xa9\x8c\x31\xf0\x92\x10\xda\xb5\xdc\
+\xfc\x22\x7b\xb0\xbf\x09\x5f\xca\x2a\xcd\xea\x1a\x1a\xd5\x11\xce\
+\x41\xee\x52\xb1\x8f\x5c\x9e\x96\x86\xea\x5b\x93\x01\xfd\x02\xe8\
+\x0a\xb4\x9c\xef\xdd\x8d\x07\x4f\xc2\xa2\x60\xeb\x65\x56\x2c\xfe\
+\x43\xa8\xf2\xef\x12\x33\xea\xc0\x5d\xe6\x3a\xd8\x59\xf9\xa1\xd4\
+\x5b\xa0\xc8\xa6\x88\xee\x04\x89\x48\x92\x6d\x61\xb1\x50\xa5\x15\
+\x9b\x3c\x69\x0c\xe6\x39\xdd\x89\xb3\x6f\xc9\x69\xd9\x84\xc4\xd4\
+\x2c\xaa\x50\x2c\x84\x76\x12\x01\xb1\x9f\x01\x63\xb0\xab\x6a\x60\
+\x62\x23\xcd\x4c\x0c\x30\x75\x55\x25\xa1\x63\x5a\x98\x2d\x79\xa8\
+\xbc\xeb\x60\x37\x7c\x3b\x6f\xfb\x97\xaf\x95\x56\xfe\x81\x61\x51\
+\x10\x43\xc4\xa6\xb9\x3a\x60\x00\x5f\xba\xcd\x85\xac\xa4\x05\xa0\
+\xca\x30\xf2\xef\x0a\xf1\xa0\x84\x29\x28\xde\x01\xf7\x86\x24\xba\
+\xb2\x2b\x4e\xfc\x67\x21\x4c\x6e\x09\x13\x4e\x7e\xd6\xbd\x80\x17\
+\x37\x54\x94\x15\x09\x1e\xdf\x92\x7e\x3e\x8a\x4f\xfc\x50\x51\x51\
+\x55\xa3\x04\xa0\x72\xd1\x6f\x5b\x00\x95\x22\x5d\x0e\x2e\x91\x54\
+\x59\x55\x23\x7a\x10\x9b\x68\x0e\xc9\x74\xc9\xe7\xe2\x72\x6b\x22\
+\x81\x44\x09\x7f\x1d\x7f\x1c\x2e\xa7\xfc\xe8\x91\x43\x21\x58\x99\
+\x09\x9d\x82\x3c\xd2\x93\x90\x48\x39\x0d\x35\xa5\x44\x94\x84\xfe\
+\xb6\x05\xa0\x32\x2b\x78\xa5\xcc\x37\xef\xd2\x8c\xc6\xd8\x58\x62\
+\x52\x52\xdd\x63\xe2\xf0\xa1\xc6\x90\x09\x1b\xab\x17\x14\x95\xac\
+\xac\xa9\x6b\xc0\xa6\xbb\x39\x40\x6e\x2f\x0f\x59\xef\x0b\x80\x16\
+\xf5\x9c\xc8\x2c\x48\xb7\x1e\x3c\xfb\x04\xee\x55\x17\xee\xc2\xf4\
+\x5e\xa7\x7c\x3f\x4a\x8b\xe6\x4d\xb6\x3c\xe4\x77\x3d\xef\xf2\xad\
+\xc7\x34\xf0\x26\x62\xb0\x20\x21\x5e\x0c\xc3\x74\xb4\xd5\x31\xc9\
+\xb2\xca\xfa\x9b\xf7\x83\xeb\xcb\x2b\x6b\x38\xb0\x66\xde\x4c\x97\
+\x6e\x63\x23\x5e\xbf\x67\x64\xe5\x16\xf4\x9b\xe6\x6a\xef\xd5\x87\
+\x26\x97\xff\xdb\x17\x00\x36\xde\x00\x09\x8d\x32\xa4\xfc\xce\x90\
+\xa5\x2d\xcf\xce\x2b\x74\xd4\xd3\xd5\xca\x07\x08\x41\x55\x52\xec\
+\x53\x0d\xb0\x41\x16\x14\x56\x42\xa5\x65\x9a\x1c\xb5\xc8\xd5\xc9\
+\x6e\xfd\xad\x07\x21\x21\x14\x8a\x94\xf8\x80\xfe\x3a\xfc\x99\xfe\
+\x87\xdc\xca\xe7\xe1\x6f\x74\x00\x07\x9d\x40\xff\x53\xfe\xa9\xa4\
+\xbb\xa7\x64\x64\xa0\x13\x8c\x7e\x2c\x56\x1b\x35\x22\xfa\xfd\xc5\
+\x9c\xbc\xc2\xc9\x48\x71\x0d\xf0\x4e\x54\xaa\x74\xbe\x32\x5d\x21\
+\x04\xa2\xf7\xca\x97\x91\x6f\xaf\x01\xe2\x14\xf7\x98\xec\x20\x58\
+\x06\xaa\x84\x85\x29\x9a\x0f\xec\x7f\xdb\x65\x82\xed\xca\x1e\xe5\
+\xc4\xbf\x8a\x62\xe3\x53\xd7\x31\x0a\x4b\xf6\xd3\x15\xe4\x89\xbe\
+\x3e\xd3\xb9\x55\xb6\xb6\xb6\x76\xdd\xab\xb7\x83\x7c\x37\xec\x3c\
+\xe9\xdb\x85\xa1\xd0\x82\xb9\xf3\x22\x63\x12\xf2\x42\x5e\xc6\xea\
+\x41\x1c\x38\x0e\x8b\x5c\xd5\xe3\xa4\xfe\x57\xd1\x40\x63\xbd\x1b\
+\x99\xd9\x0c\x97\xe2\xd2\x0a\xd3\x8c\x6c\x86\x9c\xe9\x00\x3d\x3c\
+\x97\xc0\x7c\xe6\xba\xe3\x48\x14\xc3\xef\xc9\xe7\x92\xaf\x99\x37\
+\xee\x05\xcb\x4b\x4b\x4b\x36\x2c\xf5\x9a\x36\xb2\xaf\x96\x5a\x6c\
+\xaf\xaa\x12\xbf\x8a\x64\xa8\x94\x32\xef\x39\x6e\x36\xa8\x26\xfd\
+\x28\xf8\xd5\x19\x00\x81\x86\x60\x52\xb2\x4c\x16\x4b\x16\xb0\x53\
+\x23\x20\x4c\x4e\x8d\x1a\xd5\xaf\xc5\xc4\xc4\x9a\xca\x2b\xaa\x07\
+\xfc\x31\xc5\x71\xa6\x7e\x3f\xad\xf0\xef\xf1\xfd\x2f\x9a\x21\xe5\
+\x2e\x6b\x8c\x93\x5e\x00\x00\x00\x00\x49\x45\x4e\x44\xae\x42\x60\
+\x82\
+"
+
+qt_resource_name = b"\
+\x00\x06\
+\x07\x03\x7d\xc3\
+\x00\x69\
+\x00\x6d\x00\x61\x00\x67\x00\x65\x00\x73\
+\x00\x03\
+\x00\x00\x70\x37\
+\x00\x69\
+\x00\x6d\x00\x67\
+\x00\x07\
+\x05\xd4\x57\xa7\
+\x00\x6f\
+\x00\x67\x00\x61\x00\x2e\x00\x70\x00\x6e\x00\x67\
+"
+
+qt_resource_struct = b"\
+\x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x01\
+\x00\x00\x00\x00\x00\x02\x00\x00\x00\x01\x00\x00\x00\x02\
+\x00\x00\x00\x12\x00\x02\x00\x00\x00\x01\x00\x00\x00\x03\
+\x00\x00\x00\x1e\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\
+"
+
+def qInitResources():
+ QtCore.qRegisterResourceData(0x01, qt_resource_struct, qt_resource_name, qt_resource_data)
+
+def qCleanupResources():
+ QtCore.qUnregisterResourceData(0x01, qt_resource_struct, qt_resource_name, qt_resource_data)
+
+qInitResources()
diff --git a/admin/Sources/Clients/ogagent/src/VERSION b/admin/Sources/Clients/ogagent/src/VERSION
new file mode 100644
index 00000000..9084fa2f
--- /dev/null
+++ b/admin/Sources/Clients/ogagent/src/VERSION
@@ -0,0 +1 @@
+1.1.0
diff --git a/admin/Sources/Clients/ogagent/src/about-dialog.ui b/admin/Sources/Clients/ogagent/src/about-dialog.ui
new file mode 100644
index 00000000..ab0cac1d
--- /dev/null
+++ b/admin/Sources/Clients/ogagent/src/about-dialog.ui
@@ -0,0 +1,244 @@
+
+
+ OGAAboutDialog
+
+
+
+ 0
+ 0
+ 466
+ 402
+
+
+
+
+ Verdana
+ 9
+
+
+
+ About OGAgent
+
+
+
+
+
+ true
+
+
+
+ 9
+
+
+ 9
+
+
+
+
+ <html><head/><body><p><img src=":/images/img/oga.png"/>OpenGnsys Agent Tools</p></body></html>
+
+
+
+
+
+
+ Qt::Vertical
+
+
+ QSizePolicy::Fixed
+
+
+
+ 20
+ 5
+
+
+
+
+
+
+
+ <html><head/><body><p><span style=" font-family:'Sans Serif'; font-size:9pt; font-weight:600;">OpenGnsys Agent</span></p></body></html>
+
+
+
+
+
+
+ Version 1.1.0
+
+
+
+
+
+
+ Qt::Vertical
+
+
+ QSizePolicy::Fixed
+
+
+
+ 20
+ 5
+
+
+
+
+
+
+
+ 0
+
+
+
+ &About
+
+
+
+ 6
+
+
+ 9
+
+
+
+
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
+<html><head><meta name="qrichtext" content="1" /><style type="text/css">
+p, li { white-space: pre-wrap; }
+</style></head><body style=" font-family:'Verdana'; font-size:9pt; font-weight:400; font-style:normal;">
+<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans Serif';"><br /></p>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Sans Serif'; font-weight:600;">OpenGnsys Agent for Operating Systems (OGAgent) is based on UDS Actor from Virtual Cable S.L.U.</span></p>
+<p style=" margin-top:5px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Sans Serif'; font-weight:600;">UDS Actor is (c) 2014, Virtual Cable S.L.U.</span></p>
+<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans Serif'; font-style:italic;"><br /></p>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Sans Serif'; font-size:8pt; color:#000000;">More info:</span></a></p>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:10px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="https://opengnsys.es/"><span style=" font-family:'MS Shell Dlg 2'; font-size:8pt; text-decoration: underline; color:#0000ff;">OpenGnsys Project</span></a></p>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:10px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><a href="https://github.com/dkmstr/openuds/tree/master"><span style=" font-family:'MS Shell Dlg 2'; font-size:8pt; text-decoration: underline; color:#0000ff;">openuds on GitHub</span></a></p>
+<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Sans Serif';"><br /></p></body></html>
+
+
+ true
+
+
+
+
+
+
+
+ A&uthors
+
+
+
+ 6
+
+
+ 9
+
+
+
+
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
+<html><head><meta name="qrichtext" content="1" /><style type="text/css">
+p, li { white-space: pre-wrap; }
+</style></head><body style=" font-family:'Verdana'; font-size:9pt; font-weight:400; font-style:normal;">
+<p style=" margin-top:5px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Sans Serif';">OGAgent developer: Ramón M. Gómez <ramongomez@us.es></span></p>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'Sans Serif';">UDS Actor developer: Adolfo Gómez García <agomez@virtualcable.es></span></p>
+</body></html>
+
+
+ true
+
+
+
+
+
+
+
+ &License Agreement
+
+
+
+ 6
+
+
+ 9
+
+
+
+
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
+<html><head><meta name="qrichtext" content="1" /><style type="text/css">
+p, li { white-space: pre-wrap; }
+</style></head><body style=" font-family:'Verdana'; font-size:9pt; font-weight:400; font-style:normal;">
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'MS Shell Dlg 2'; font-size:8pt;">Copyright (c) 2014 Virtual Cable S.L.</span></p>
+<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'MS Shell Dlg 2'; font-size:8pt;"><br /></p>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'MS Shell Dlg 2'; font-size:8pt;">All rights reserved.</span></p>
+<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'MS Shell Dlg 2'; font-size:8pt;"><br /></p>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'MS Shell Dlg 2'; font-size:8pt;">Redistribution and use in source and binary forms, with or without modification,</span></p>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'MS Shell Dlg 2'; font-size:8pt;">are permitted provided that the following conditions are met:</span></p>
+<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'MS Shell Dlg 2'; font-size:8pt;"><br /></p>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'MS Shell Dlg 2'; font-size:8pt;"> * Redistributions of source code must retain the above copyright notice,</span></p>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'MS Shell Dlg 2'; font-size:8pt;"> this list of conditions and the following disclaimer.</span></p>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'MS Shell Dlg 2'; font-size:8pt;"> * Redistributions in binary form must reproduce the above copyright notice,</span></p>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'MS Shell Dlg 2'; font-size:8pt;"> this list of conditions and the following disclaimer in the documentation</span></p>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'MS Shell Dlg 2'; font-size:8pt;"> and/or other materials provided with the distribution.</span></p>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'MS Shell Dlg 2'; font-size:8pt;"> * Neither the name of Virtual Cable S.L. nor the names of its contributors</span></p>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'MS Shell Dlg 2'; font-size:8pt;"> may be used to endorse or promote products derived from this software</span></p>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'MS Shell Dlg 2'; font-size:8pt;"> without specific prior written permission.</span></p>
+<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'MS Shell Dlg 2'; font-size:8pt;"><br /></p>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'MS Shell Dlg 2'; font-size:8pt;">THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"</span></p>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'MS Shell Dlg 2'; font-size:8pt;">AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE</span></p>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'MS Shell Dlg 2'; font-size:8pt;">IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE</span></p>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'MS Shell Dlg 2'; font-size:8pt;">DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE</span></p>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'MS Shell Dlg 2'; font-size:8pt;">FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL</span></p>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'MS Shell Dlg 2'; font-size:8pt;">DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR</span></p>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'MS Shell Dlg 2'; font-size:8pt;">SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER</span></p>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'MS Shell Dlg 2'; font-size:8pt;">CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,</span></p>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'MS Shell Dlg 2'; font-size:8pt;">OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE</span></p>
+<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'MS Shell Dlg 2'; font-size:8pt;">OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</span></p>
+<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'MS Shell Dlg 2'; font-size:8pt;"><br /></p></body></html>
+
+
+
+
+
+
+
+
+
+
+ Qt::Horizontal
+
+
+ QDialogButtonBox::Close
+
+
+
+
+
+
+
+
+
+
+ buttonBox
+ clicked(QAbstractButton*)
+ OGAAboutDialog
+ closeDialog()
+
+
+ 432
+ 381
+
+
+ 282
+ 362
+
+
+
+
+
+ closeDialog()
+
+
diff --git a/admin/Sources/Clients/ogagent/src/cfg/ogagent.cfg b/admin/Sources/Clients/ogagent/src/cfg/ogagent.cfg
new file mode 100644
index 00000000..8888e88a
--- /dev/null
+++ b/admin/Sources/Clients/ogagent/src/cfg/ogagent.cfg
@@ -0,0 +1,21 @@
+[opengnsys]
+# Listen address & port of REST
+address=0.0.0.0
+port=8000
+
+# This is a comma separated list of paths where to look for modules to load
+path=test_modules/server
+
+# Remote OpenGnsys Service
+remote=https://192.168.2.10/opengnsys/rest
+
+# Log Level, if ommited, will be set to INFO
+log=DEBUG
+
+# Module specific
+# The sections must match the module name
+# This section will be passes on activation to module
+#[Sample1]
+#value1=Mariete
+#value2=Yo
+#remote=https://172.27.0.1:9999/rest
diff --git a/admin/Sources/Clients/ogagent/src/cfg/ogclient.cfg b/admin/Sources/Clients/ogagent/src/cfg/ogclient.cfg
new file mode 100644
index 00000000..d39fc965
--- /dev/null
+++ b/admin/Sources/Clients/ogagent/src/cfg/ogclient.cfg
@@ -0,0 +1,11 @@
+[opengnsys]
+# Log Level, if ommited, will be set to INFO
+log=DEBUG
+
+# Module specific
+# The sections must match the module name
+# This section will be passes on activation to module
+#[Sample1]
+#value1=Mariete
+#value2=Yo
+#remote=https://172.27.0.1:9999/rest
diff --git a/admin/Sources/Clients/ogagent/src/img/oga-48x48.ico b/admin/Sources/Clients/ogagent/src/img/oga-48x48.ico
new file mode 100644
index 00000000..37ded487
Binary files /dev/null and b/admin/Sources/Clients/ogagent/src/img/oga-48x48.ico differ
diff --git a/admin/Sources/Clients/ogagent/src/img/oga-512.png b/admin/Sources/Clients/ogagent/src/img/oga-512.png
new file mode 100644
index 00000000..37a0dbe4
Binary files /dev/null and b/admin/Sources/Clients/ogagent/src/img/oga-512.png differ
diff --git a/admin/Sources/Clients/ogagent/src/img/oga.ico b/admin/Sources/Clients/ogagent/src/img/oga.ico
new file mode 100644
index 00000000..37ded487
Binary files /dev/null and b/admin/Sources/Clients/ogagent/src/img/oga.ico differ
diff --git a/admin/Sources/Clients/ogagent/src/img/oga.png b/admin/Sources/Clients/ogagent/src/img/oga.png
new file mode 100644
index 00000000..70db4564
Binary files /dev/null and b/admin/Sources/Clients/ogagent/src/img/oga.png differ
diff --git a/admin/Sources/Clients/ogagent/src/license.txt b/admin/Sources/Clients/ogagent/src/license.txt
new file mode 100644
index 00000000..bdb7d25d
--- /dev/null
+++ b/admin/Sources/Clients/ogagent/src/license.txt
@@ -0,0 +1,27 @@
+Copyright (c) 2012-2015 Virtual Cable S.L.
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification,
+are permitted provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright notice,
+ this list of conditions and the following disclaimer.
+ * Redistributions in binary form must reproduce the above copyright notice,
+ this list of conditions and the following disclaimer in the documentation
+ and/or other materials provided with the distribution.
+ * Neither the name of Virtual Cable S.L. nor the names of its contributors
+ may be used to endorse or promote products derived from this software
+ without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
+ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGE.
diff --git a/admin/Sources/Clients/ogagent/src/message-dialog.ui b/admin/Sources/Clients/ogagent/src/message-dialog.ui
new file mode 100644
index 00000000..75137037
--- /dev/null
+++ b/admin/Sources/Clients/ogagent/src/message-dialog.ui
@@ -0,0 +1,89 @@
+
+
+ OGAMessageDialog
+
+
+
+ 0
+ 0
+ 339
+ 188
+
+
+
+
+ 0
+ 0
+
+
+
+
+ Verdana
+ 10
+
+
+
+ UDS Actor
+
+
+
+
+ 10
+ 10
+ 321
+ 171
+
+
+
+
+
+
+
+
+
+ Qt::Vertical
+
+
+ QSizePolicy::Fixed
+
+
+
+ 20
+ 15
+
+
+
+
+
+
+
+ QDialogButtonBox::Ok
+
+
+
+
+
+
+
+
+
+ buttonBox
+ clicked(QAbstractButton*)
+ OGAMessageDialog
+ closeDialog()
+
+
+ 203
+ 161
+
+
+ 337
+ 125
+
+
+
+
+
+ closeDialog()
+
+
diff --git a/admin/Sources/Clients/ogagent/src/opengnsys/RESTApi.py b/admin/Sources/Clients/ogagent/src/opengnsys/RESTApi.py
new file mode 100644
index 00000000..5caaf8c4
--- /dev/null
+++ b/admin/Sources/Clients/ogagent/src/opengnsys/RESTApi.py
@@ -0,0 +1,160 @@
+# -*- coding: utf-8 -*-
+#
+# Copyright (c) 201 Virtual Cable S.L.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without modification,
+# are permitted provided that the following conditions are met:
+#
+# * Redistributions of source code must retain the above copyright notice,
+# this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice,
+# this list of conditions and the following disclaimer in the documentation
+# and/or other materials provided with the distribution.
+# * Neither the name of Virtual Cable S.L. nor the names of its contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+'''
+@author: Adolfo Gómez, dkmaster at dkmon dot com
+'''
+
+# pylint: disable-msg=E1101,W0703
+
+from __future__ import unicode_literals
+
+import requests
+import logging
+import json
+import warnings
+
+from .log import logger
+
+from .utils import exceptionToMessage
+
+VERIFY_CERT = False
+
+
+class RESTError(Exception):
+ ERRCODE = 0
+
+
+class ConnectionError(RESTError):
+ ERRCODE = -1
+
+
+# Disable warnings log messages
+try:
+ import urllib3 # @UnusedImport
+except Exception:
+ from requests.packages import urllib3 # @Reimport
+
+try:
+ urllib3.disable_warnings() # @UndefinedVariable
+ warnings.simplefilter("ignore")
+except Exception:
+ pass # In fact, isn't too important, but wil log warns to logging file
+
+class REST(object):
+ '''
+ Simple interface to remote REST apis.
+ The constructor expects the "base url" as parameter, that is, the url that will be common on all REST requests
+ Remember that this is a helper for "easy of use". You can provide your owns using requests lib for example.
+ Examples:
+ v = REST('https://example.com/rest/v1/') (Can omit trailing / if desired)
+ v.sendMessage('hello?param1=1¶m2=2')
+ This will generate a GET message to https://example.com/rest/v1/hello?param1=1¶m2=2, and return the deserialized JSON result or an exception
+ v.sendMessage('hello?param1=1¶m2=2', {'name': 'mario' })
+ This will generate a POST message to https://example.com/rest/v1/hello?param1=1¶m2=2, with json encoded body {'name': 'mario' }, and also returns
+ the deserialized JSON result or raises an exception in case of error
+ '''
+ def __init__(self, url):
+ '''
+ Initializes the REST helper
+ url is the full url of the REST API Base, as for example "https://example.com/rest/v1".
+ @param url The url of the REST API Base. The trailing '/' can be included or omitted, as desired.
+ '''
+ self.endpoint = url
+
+ if self.endpoint[-1] != '/':
+ self.endpoint += '/'
+
+ # Some OSs ships very old python requests lib implementations, workaround them...
+ try:
+ self.newerRequestLib = requests.__version__.split('.')[0] >= '1'
+ except Exception:
+ self.newerRequestLib = False # I no version, guess this must be an old requests
+
+ # Disable logging requests messages except for errors, ...
+ logging.getLogger("requests").setLevel(logging.CRITICAL)
+ # Tries to disable all warnings
+ try:
+ warnings.simplefilter("ignore") # Disables all warnings
+ except Exception:
+ pass
+
+ def _getUrl(self, method):
+ '''
+ Internal method
+ Composes the URL based on "method"
+ @param method: Method to append to base url for composition
+ '''
+ url = self.endpoint + method
+
+ return url
+
+ def _request(self, url, data=None):
+ '''
+ Launches the request
+ @param url: The url to obtain
+ @param data: if None, the request will be sent as a GET request. If != None, the request will be sent as a POST, with data serialized as JSON in the body.
+ '''
+ try:
+ if data is None:
+ logger.debug('Requesting using GET (no data provided) {}'.format(url))
+ # Old requests version does not support verify, but they do not checks ssl certificate by default
+ if self.newerRequestLib:
+ r = requests.get(url, verify=VERIFY_CERT)
+ else:
+ r = requests.get(url)
+ else: # POST
+ logger.debug('Requesting using POST {}, data: {}'.format(url, data))
+ if self.newerRequestLib:
+ r = requests.post(url, data=data, headers={'content-type': 'application/json'}, verify=VERIFY_CERT)
+ else:
+ r = requests.post(url, data=data, headers={'content-type': 'application/json'})
+
+ r = json.loads(r.content) # Using instead of r.json() to make compatible with oooold rquests lib versions
+ except requests.exceptions.RequestException as e:
+ raise ConnectionError(e)
+ except Exception as e:
+ raise ConnectionError(exceptionToMessage(e))
+
+ return r
+
+ def sendMessage(self, msg, data=None, processData=True):
+ '''
+ Sends a message to remote REST server
+ @param data: if None or omitted, message will be a GET, else it will send a POST
+ @param processData: if True, data will be serialized to json before sending, else, data will be sent as "raw"
+ '''
+ logger.debug('Invoking post message {} with data {}'.format(msg, data))
+
+ if processData and data is not None:
+ data = json.dumps(data)
+
+ url = self._getUrl(msg)
+ logger.debug('Requesting {}'.format(url))
+
+ return self._request(url, data)
diff --git a/admin/Sources/Clients/ogagent/src/opengnsys/__init__.py b/admin/Sources/Clients/ogagent/src/opengnsys/__init__.py
new file mode 100644
index 00000000..48453fb7
--- /dev/null
+++ b/admin/Sources/Clients/ogagent/src/opengnsys/__init__.py
@@ -0,0 +1,57 @@
+# -*- coding: utf-8 -*-
+#
+# Copyright (c) 2014 Virtual Cable S.L.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without modification,
+# are permitted provided that the following conditions are met:
+#
+# * Redistributions of source code must retain the above copyright notice,
+# this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice,
+# this list of conditions and the following disclaimer in the documentation
+# and/or other materials provided with the distribution.
+# * Neither the name of Virtual Cable S.L. nor the names of its contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+'''
+@author: Adolfo Gómez, dkmaster at dkmon dot com
+'''
+from __future__ import unicode_literals
+
+# On centos, old six release does not includes byte2int, nor six.PY2
+import six
+
+import modules
+from RESTApi import REST, RESTError
+
+VERSION = '1.1.0'
+
+__title__ = 'OpenGnsys Agent'
+__version__ = VERSION
+__build__ = 0x010750
+__author__ = 'Adolfo Gómez'
+__license__ = "BSD 3-clause"
+__copyright__ = "Copyright VirtualCable S.L.U."
+
+
+if not hasattr(six, 'byte2int'):
+ if six.PY3:
+ import operator
+ six.byte2int = operator.itemgetter(0)
+ else:
+ def _byte2int(bs):
+ return ord(bs[0])
+ six.byte2int = _byte2int
diff --git a/admin/Sources/Clients/ogagent/src/opengnsys/certs.py b/admin/Sources/Clients/ogagent/src/opengnsys/certs.py
new file mode 100644
index 00000000..e4c070e8
--- /dev/null
+++ b/admin/Sources/Clients/ogagent/src/opengnsys/certs.py
@@ -0,0 +1,101 @@
+# -*- coding: utf-8 -*-
+#
+# Copyright (c) 2014 Virtual Cable S.L.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without modification,
+# are permitted provided that the following conditions are met:
+#
+# * Redistributions of source code must retain the above copyright notice,
+# this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice,
+# this list of conditions and the following disclaimer in the documentation
+# and/or other materials provided with the distribution.
+# * Neither the name of Virtual Cable S.L. nor the names of its contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+'''
+@author: Adolfo Gómez, dkmaster at dkmon dot com
+'''
+
+from tempfile import gettempdir
+from os.path import exists, join
+
+CERTFILE = 'OGAgent.pem'
+
+
+def createSelfSignedCert(force=False):
+
+ certFile = join(gettempdir(), CERTFILE)
+
+ if exists(certFile) and not force:
+ return certFile
+
+ certData = '''-----BEGIN PRIVATE KEY-----
+MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCb50K3mIznNklz
+yVAD7xSQOSJQ6+NPXj7U9/4zLZ+TvmbQ7RqUUsxbfxHbeRnoYTWV2nKk4+tHqmvz
+ujLSS/loFhTSMqtrLn7rowSYJoQhKOUkAiQlWkqCfItWgL5pJopDpNHFul9Rn3ds
+PMWQTiGeUNR4Y3RnBhr1Q1BsqAzf4m6zFUmgLPPmVLdF4uJ3Tuz8TSy2gWLs5aSr
+5do4WamwUfYjRSVMJECmwjUM4rQ8SQgg0sHBeBuDUGNBvBQFac1G7qUcMReeu8Zr
+DUtMsXma/l4rA8NB5CRmTrQbTBF4l+jb2BDFebDqDUK1Oqs9X35yOQfDOAFYHiix
+PX0IsXOZAgMBAAECggEBAJi3000RrIUZUp6Ph0gzPMuCjDEEwWiQA7CPNX1gpb8O
+dp0WhkDhUroWIaICYPSXtOwUTtVjRqivMoxPy1Thg3EIoGC/rdeSdlXRHMEGicwJ
+yVyalFnatr5Xzg5wkxVh4XMd0zeDt7e3JD7s0QLo5lm1CEzd77qz6lhzFic5/1KX
+bzdULtTlq60dazg2hEbcS4OmM1UMCtRVDAsOIUIZPL0M9j1C1d1iEdYnh2xshKeG
+/GOfo95xsgdMlGjtv3hUT5ryKVoEsu+36rGb4VfhPfUvvoVbRx5QZpW+QvxaYh5E
+Fi0JEROozFwG31Y++8El7J3yQko8cFBa1lYYUwwpNAECgYEAykT+GiM2YxJ4uVF1
+OoKiE9BD53i0IG5j87lGPnWqzEwYBwnqjEKDTou+uzMGz3MDV56UEFNho7wUWh28
+LpEkjJB9QgbsugjxIBr4JoL/rYk036e/6+U8I95lvYWrzb+rBMIkRDYI7kbQD/mQ
+piYUpuCkTymNAu2RisK6bBzJslkCgYEAxVE23OQvkCeOV8hJNPZGpJ1mDS+TiOow
+oOScMZmZpail181eYbAfMsCr7ri812lSj98NvA2GNVLpddil6LtS1cQ5p36lFBtV
+xQUMZiFz4qVbEak+izL+vPaev/mXXsOcibAIQ+qI/0txFpNhJjpaaSy6vRCBYFmc
+8pgSoBnBI0ECgYAUKCn2atnpp5aWSTLYgNosBU4vDA1PShD14dnJMaqyr0aZtPhF
+v/8b3btFJoGgPMLxgWEZ+2U4ju6sSFhPf7FXvLJu2QfQRkHZRDbEh7t5DLpTK4Fp
+va9vl6Ml7uM/HsGpOLuqfIQJUs87OFCc7iCSvMJDDU37I7ekT2GKkpfbCQKBgBrE
+0NeY0WcSJrp7/oqD2sOcYurpCG/rrZs2SIZmGzUhMxaa0vIXzbO59dlWELB8pmnE
+Tf20K//x9qA5OxDe0PcVPukdQlH+/1zSOYNliG44FqnHtyd1TJ/gKVtMBiAiE4uO
+aSClod5Yosf4SJbCFd/s5Iyfv52NqsAyp1w3Aj/BAoGAVCnEiGUfyHlIR+UH4zZW
+GXJMeqdZLfcEIszMxLePkml4gUQhoq9oIs/Kw+L1DDxUwzkXN4BNTlFbOSu9gzK1
+dhuIUGfS6RPL88U+ivC3A0y2jT43oUMqe3hiRt360UQ1GXzp2dMnR9odSRB1wHoO
+IOjEBZ8341/c9ZHc5PCGAG8=
+-----END PRIVATE KEY-----
+-----BEGIN CERTIFICATE-----
+MIID7zCCAtegAwIBAgIJAIrEIthCfxUCMA0GCSqGSIb3DQEBCwUAMIGNMQswCQYD
+VQQGEwJFUzEPMA0GA1UECAwGTWFkcmlkMREwDwYDVQQHDAhBbGNvcmNvbjEMMAoG
+A1UECgwDVURTMQ4wDAYDVQQLDAVBY3RvcjESMBAGA1UEAwwJVURTIEFjdG9yMSgw
+JgYJKoZIhvcNAQkBFhlzdXBwb3J0QHVkc2VudGVycHJpc2UuY29tMB4XDTE0MTAy
+NjIzNDEyNFoXDTI0MTAyMzIzNDEyNFowgY0xCzAJBgNVBAYTAkVTMQ8wDQYDVQQI
+DAZNYWRyaWQxETAPBgNVBAcMCEFsY29yY29uMQwwCgYDVQQKDANVRFMxDjAMBgNV
+BAsMBUFjdG9yMRIwEAYDVQQDDAlVRFMgQWN0b3IxKDAmBgkqhkiG9w0BCQEWGXN1
+cHBvcnRAdWRzZW50ZXJwcmlzZS5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAw
+ggEKAoIBAQCb50K3mIznNklzyVAD7xSQOSJQ6+NPXj7U9/4zLZ+TvmbQ7RqUUsxb
+fxHbeRnoYTWV2nKk4+tHqmvzujLSS/loFhTSMqtrLn7rowSYJoQhKOUkAiQlWkqC
+fItWgL5pJopDpNHFul9Rn3dsPMWQTiGeUNR4Y3RnBhr1Q1BsqAzf4m6zFUmgLPPm
+VLdF4uJ3Tuz8TSy2gWLs5aSr5do4WamwUfYjRSVMJECmwjUM4rQ8SQgg0sHBeBuD
+UGNBvBQFac1G7qUcMReeu8ZrDUtMsXma/l4rA8NB5CRmTrQbTBF4l+jb2BDFebDq
+DUK1Oqs9X35yOQfDOAFYHiixPX0IsXOZAgMBAAGjUDBOMB0GA1UdDgQWBBRShS90
+5lJTNvYPIEqP3GxWwG5iiDAfBgNVHSMEGDAWgBRShS905lJTNvYPIEqP3GxWwG5i
+iDAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBCwUAA4IBAQAU0Sp4gXhQmRVzq+7+
+vRFUkQuPj4Ga/d9r5Wrbg3hck3+5pwe9/7APoq0P/M0DBhQpiJKjrD6ydUevC+Y/
+43ZOJPhMlNw0o6TdQxOkX6FDwQanLLs7sfvJvqtVzYn3nuRFKT3dvl7Zg44QMw2M
+ay42q59fAcpB4LaDx/i7gOYSS5eca3lYW7j7YSr/+ozXK2KlgUkuCUHN95lOq+dF
+trmV9mjzM4CNPZqKSE7kpHRywgrXGPCO000NvEGSYf82AtgRSFKiU8NWLQSEPdcB
+k//2dsQZw2cRZ8DrC2B6Tb3M+3+CA6wVyqfqZh1SZva3LfGvq/C+u+ItguzPqNpI
+xtvM
+-----END CERTIFICATE-----'''
+ with open(certFile, "wt") as f:
+ f.write(certData)
+
+ return certFile
diff --git a/admin/Sources/Clients/ogagent/src/opengnsys/config.py b/admin/Sources/Clients/ogagent/src/opengnsys/config.py
new file mode 100644
index 00000000..c86c6979
--- /dev/null
+++ b/admin/Sources/Clients/ogagent/src/opengnsys/config.py
@@ -0,0 +1,59 @@
+# -*- coding: utf-8 -*-
+#
+# Copyright (c) 2014 Virtual Cable S.L.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without modification,
+# are permitted provided that the following conditions are met:
+#
+# * Redistributions of source code must retain the above copyright notice,
+# this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice,
+# this list of conditions and the following disclaimer in the documentation
+# and/or other materials provided with the distribution.
+# * Neither the name of Virtual Cable S.L. nor the names of its contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+'''
+@author: Adolfo Gómez, dkmaster at dkmon dot com
+'''
+# pylint: disable=unused-wildcard-import, wildcard-import
+from __future__ import unicode_literals
+
+from ConfigParser import SafeConfigParser
+from .log import logger
+
+config = None
+
+def readConfig(client=False):
+ '''
+ Reads configuration file
+ If client is False, will read ogagent.cfg as configuration
+ If client is True, will read ogclient.cfg as configuration
+
+ This is this way so we can protect ogagent.cfg against reading for non admin users on all platforms.
+ '''
+ cfg = SafeConfigParser()
+ if client is True:
+ fname = 'ogclient.cfg'
+ else:
+ fname = 'ogagent.cfg'
+
+ if len(cfg.read('cfg/{}'.format(fname))) == 0:
+ # No configuration found
+ return None
+
+ return cfg
+
\ No newline at end of file
diff --git a/admin/Sources/Clients/ogagent/src/opengnsys/httpserver.py b/admin/Sources/Clients/ogagent/src/opengnsys/httpserver.py
new file mode 100644
index 00000000..a06ae6bb
--- /dev/null
+++ b/admin/Sources/Clients/ogagent/src/opengnsys/httpserver.py
@@ -0,0 +1,150 @@
+# -*- coding: utf-8 -*-
+#
+# Copyright (c) 2015 Virtual Cable S.L.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without modification,
+# are permitted provided that the following conditions are met:
+#
+# * Redistributions of source code must retain the above copyright notice,
+# this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice,
+# this list of conditions and the following disclaimer in the documentation
+# and/or other materials provided with the distribution.
+# * Neither the name of Virtual Cable S.L. nor the names of its contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+'''
+@author: Adolfo Gómez, dkmaster at dkmon dot com
+'''
+# pylint: disable=unused-wildcard-import,wildcard-import
+from __future__ import unicode_literals, print_function
+
+# Pydev can't parse "six.moves.xxxx" because it is loaded lazy
+import six
+from six.moves.socketserver import ThreadingMixIn # @UnresolvedImport
+from six.moves.BaseHTTPServer import BaseHTTPRequestHandler # @UnresolvedImport
+from six.moves.BaseHTTPServer import HTTPServer # @UnresolvedImport
+from six.moves.urllib.parse import unquote # @UnresolvedImport
+
+import json
+import threading
+import ssl
+
+from .utils import exceptionToMessage
+from .certs import createSelfSignedCert
+from .log import logger
+
+class HTTPServerHandler(BaseHTTPRequestHandler):
+ service = None
+ protocol_version = 'HTTP/1.0'
+ server_version = 'OpenGnsys Agent Server'
+ sys_version = ''
+
+ def sendJsonError(self, code, message):
+ self.send_response(code)
+ self.send_header('Content-type', 'application/json')
+ self.end_headers()
+ self.wfile.write(json.dumps({'error': message}))
+ return
+
+ def sendJsonResponse(self, data):
+ self.send_response(200)
+ data = json.dumps(data)
+ self.send_header('Content-type', 'application/json')
+ self.send_header('Content-Length', len(data))
+ self.end_headers()
+ # Send the html message
+ self.wfile.write(data)
+
+
+ # parseURL
+ def parseUrl(self):
+ # Very simple path & params splitter
+ path = self.path.split('?')[0][1:].split('/')
+
+ try:
+ params = dict((v[0], unquote(v[1])) for v in (v.split('=') for v in self.path.split('?')[1].split('&')))
+ except Exception:
+ params = {}
+
+ for v in self.service.modules:
+ if v.name == path[0]: # Case Sensitive!!!!
+ return (v, path[1:], params)
+
+ return (None, path, params)
+
+ def notifyMessage(self, module, path, getParams, postParams):
+ '''
+ Locates witch module will process the message based on path (first folder on url path)
+ '''
+ try:
+ data = module.processServerMessage(path, getParams, postParams, self)
+ self.sendJsonResponse(data)
+ except Exception as e:
+ logger.exception()
+ self.sendJsonError(500, exceptionToMessage(e))
+
+ def do_GET(self):
+ module, path, params = self.parseUrl()
+
+ self.notifyMessage(module, path, params, None)
+
+ def do_POST(self):
+ module, path, getParams = self.parseUrl()
+
+ # Tries to get JSON content (UTF-8 encoded)
+ try:
+ length = int(self.headers.getheader('content-length'))
+ content = self.rfile.read(length).decode('utf-8')
+ logger.debug('length: {}, content >>{}<<'.format(length, content))
+ postParams = json.loads(content)
+ except Exception as e:
+ self.sendJsonError(500, exceptionToMessage(e))
+
+ self.notifyMessage(module, path, getParams, postParams)
+
+
+ def log_error(self, fmt, *args):
+ logger.error('HTTP ' + fmt % args)
+
+ def log_message(self, fmt, *args):
+ logger.info('HTTP ' + fmt % args)
+
+
+class HTTPThreadingServer(ThreadingMixIn, HTTPServer):
+ pass
+
+class HTTPServerThread(threading.Thread):
+ def __init__(self, address, service):
+ super(self.__class__, self).__init__()
+
+ HTTPServerHandler.service = service # Keep tracking of service so we can intercact with it
+
+ self.certFile = createSelfSignedCert()
+ self.server = HTTPThreadingServer(address, HTTPServerHandler)
+ self.server.socket = ssl.wrap_socket(self.server.socket, certfile=self.certFile, server_side=True)
+
+ logger.debug('Initialized HTTPS Server thread on {}'.format(address))
+
+ def getServerUrl(self):
+ return 'https://{}:{}/'.format(self.server.server_address[0], self.server.server_address[1])
+
+ def stop(self):
+ self.server.shutdown()
+
+ def run(self):
+ self.server.serve_forever()
+
+
diff --git a/admin/Sources/Clients/ogagent/src/opengnsys/ipc.py b/admin/Sources/Clients/ogagent/src/opengnsys/ipc.py
new file mode 100644
index 00000000..dd3663df
--- /dev/null
+++ b/admin/Sources/Clients/ogagent/src/opengnsys/ipc.py
@@ -0,0 +1,423 @@
+# -*- coding: utf-8 -*-
+#
+# Copyright (c) 2014 Virtual Cable S.L.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without modification,
+# are permitted provided that the following conditions are met:
+#
+# * Redistributions of source code must retain the above copyright notice,
+# this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice,
+# this list of conditions and the following disclaimer in the documentation
+# and/or other materials provided with the distribution.
+# * Neither the name of Virtual Cable S.L. nor the names of its contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+'''
+@author: Adolfo Gómez, dkmaster at dkmon dot com
+'''
+from __future__ import unicode_literals
+
+import socket
+import threading
+import six
+import traceback
+import json
+
+from opengnsys.utils import toUnicode
+from opengnsys.log import logger
+
+# The IPC Server will wait for connections from clients
+# Clients will open socket, and wait for data from server
+# The messages sent (from server) will be the following (subject to future changes):
+# Message_id Data Action
+# ------------ -------- --------------------------
+# MSG_LOGOFF None Logout user from session
+# MSG_MESSAGE message,level Display a message with level (INFO, WARN, ERROR, FATAL) # TODO: Include level, right now only has message
+# MSG_POPUP title,message Display a popup box with a title
+# MSG_SCRIPT python script Execute an specific python script INSIDE CLIENT environment (this messages is not sent right now)
+# The messages received (sent from client) will be the following:
+# Message_id Data Action
+# ------------ -------- --------------------------
+# REQ_LOGOUT Logout user from session
+# REQ_INFORMATION None Request information from ipc server (maybe configuration parameters in a near future)
+# REQ_LOGIN python script Execute an specific python script INSIDE CLIENT environment (this messages is not sent right now)
+#
+# All messages are in the form:
+# BYTE
+# 0 1-2 3 4 ...
+# MSG_ID DATA_LENGTH (little endian) Data (can be 0 length)
+# With a previos "MAGIC" header in fron of each message
+
+# Client messages
+MSG_LOGOFF = 0xA1 # Request log off from an user
+MSG_MESSAGE = 0xB2
+MSG_POPUP = 0xB3
+MSG_SCRIPT = 0xC3
+
+# Request messages
+REQ_MESSAGE = 0xD4
+REQ_POPUP = 0xD5
+REQ_LOGIN = 0xE5
+REQ_LOGOUT = 0xF6
+
+# Reverse msgs dict for debugging
+REV_DICT = {
+ MSG_LOGOFF: 'MSG_LOGOFF',
+ MSG_MESSAGE: 'MSG_MESSAGE',
+ MSG_POPUP: 'MSG_POPUP',
+ MSG_SCRIPT: 'MSG_SCRIPT',
+ REQ_LOGIN: 'REQ_LOGIN',
+ REQ_LOGOUT: 'REQ_LOGOUT',
+ REQ_MESSAGE: 'REQ_MESSAGE'
+}
+
+MAGIC = b'\x4F\x47\x41\x00' # OGA in hexa with a padded 0 to the right
+
+
+# States for client processor
+ST_SECOND_BYTE = 0x01
+ST_RECEIVING = 0x02
+ST_PROCESS_MESSAGE = 0x02
+
+
+class ClientProcessor(threading.Thread):
+ def __init__(self, parent, clientSocket):
+ super(self.__class__, self).__init__()
+ self.parent = parent
+ self.clientSocket = clientSocket
+ self.running = False
+ self.messages = six.moves.queue.Queue(32) # @UndefinedVariable
+
+ def stop(self):
+ logger.debug('Stoping client processor')
+ self.running = False
+
+ def processRequest(self, msg, data):
+ logger.debug('Got Client message {}={}'.format(msg, REV_DICT.get(msg)))
+ if self.parent.clientMessageProcessor is not None:
+ self.parent.clientMessageProcessor(msg, data)
+
+ def run(self):
+ self.running = True
+ self.clientSocket.setblocking(0)
+
+ state = None
+ recv_msg = None
+ recv_data = None
+ while self.running:
+ try:
+ counter = 1024
+ while counter > 0: # So we process at least the incoming queue every XX bytes readed
+ counter -= 1
+ b = self.clientSocket.recv(1)
+ if b == b'':
+ # Client disconnected
+ self.running = False
+ break
+ buf = six.byte2int(b) # Empty buffer, this is set as non-blocking
+ if state is None:
+ if buf in (REQ_MESSAGE, REQ_LOGIN, REQ_LOGOUT):
+ logger.debug('State set to {}'.format(buf))
+ state = buf
+ recv_msg = buf
+ continue # Get next byte
+ else:
+ logger.debug('Got unexpected data {}'.format(buf))
+ elif state in (REQ_MESSAGE, REQ_LOGIN, REQ_LOGOUT):
+ logger.debug('First length byte is {}'.format(buf))
+ msg_len = buf
+ state = ST_SECOND_BYTE
+ continue
+ elif state == ST_SECOND_BYTE:
+ msg_len += buf << 8
+ logger.debug('Second length byte is {}, len is {}'.format(buf, msg_len))
+ if msg_len == 0:
+ self.processRequest(recv_msg, None)
+ state = None
+ break
+ state = ST_RECEIVING
+ recv_data = b''
+ continue
+ elif state == ST_RECEIVING:
+ recv_data += six.int2byte(buf)
+ msg_len -= 1
+ if msg_len == 0:
+ self.processRequest(recv_msg, recv_data)
+ recv_data = None
+ state = None
+ break
+ else:
+ logger.debug('Got invalid message from request: {}, state: {}'.format(buf, state))
+ except socket.error as e:
+ # If no data is present, no problem at all, pass to check messages
+ pass
+ except Exception as e:
+ tb = traceback.format_exc()
+ logger.error('Error: {}, trace: {}'.format(e, tb))
+
+ if self.running is False:
+ break
+
+ try:
+ msg = self.messages.get(block=True, timeout=1)
+ except six.moves.queue.Empty: # No message got in time @UndefinedVariable
+ continue
+
+ logger.debug('Got message {}={}'.format(msg, REV_DICT.get(msg[0])))
+
+ try:
+ m = msg[1] if msg[1] is not None else b''
+ l = len(m)
+ data = MAGIC + six.int2byte(msg[0]) + six.int2byte(l & 0xFF) + six.int2byte(l >> 8) + m
+ try:
+ self.clientSocket.sendall(data)
+ except socket.error as e:
+ # Send data error
+ logger.debug('Socket connection is no more available: {}'.format(e.args))
+ self.running = False
+ except Exception as e:
+ logger.error('Invalid message in queue: {}'.format(e))
+
+ logger.debug('Client processor stopped')
+ try:
+ self.clientSocket.close()
+ except Exception:
+ pass # If can't close, nothing happens, just end thread
+
+
+class ServerIPC(threading.Thread):
+
+ def __init__(self, listenPort, clientMessageProcessor=None):
+ super(self.__class__, self).__init__()
+ self.port = listenPort
+ self.running = False
+ self.serverSocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
+ self.serverSocket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
+ self.threads = []
+ self.clientMessageProcessor = clientMessageProcessor
+
+ def stop(self):
+ logger.debug('Stopping Server IPC')
+ self.running = False
+ for t in self.threads:
+ t.stop()
+ socket.socket(socket.AF_INET, socket.SOCK_STREAM).connect(('localhost', self.port))
+ self.serverSocket.close()
+
+ for t in self.threads:
+ t.join()
+
+ def sendMessage(self, msgId, msgData):
+ '''
+ Notify message to all listening threads
+ '''
+ logger.debug('Sending message {}({}),{} to all clients'.format(msgId, REV_DICT.get(msgId), msgData))
+
+ # Convert to bytes so length is correctly calculated
+ if isinstance(msgData, six.text_type):
+ msgData = msgData.encode('utf8')
+
+ for t in self.threads:
+ if t.isAlive():
+ logger.debug('Sending to {}'.format(t))
+ t.messages.put((msgId, msgData))
+
+ def sendLoggofMessage(self):
+ self.sendMessage(MSG_LOGOFF, '')
+
+ def sendMessageMessage(self, message):
+ self.sendMessage(MSG_MESSAGE, message)
+
+ def sendPopupMessage(self, title, message):
+ self.sendMessage(MSG_POPUP, {'title':title, 'message':message})
+
+ def sendScriptMessage(self, script):
+ self.sendMessage(MSG_SCRIPT, script)
+
+ def cleanupFinishedThreads(self):
+ '''
+ Cleans up current threads list
+ '''
+ aliveThreads = []
+ for t in self.threads:
+ if t.isAlive():
+ logger.debug('Thread {} is alive'.format(t))
+ aliveThreads.append(t)
+ self.threads[:] = aliveThreads
+
+ def run(self):
+ self.running = True
+
+ self.serverSocket.bind(('localhost', self.port))
+ self.serverSocket.setblocking(1)
+ self.serverSocket.listen(4)
+
+ while True:
+ try:
+ (clientSocket, address) = self.serverSocket.accept()
+ # Stop processing if thread is mean to stop
+ if self.running is False:
+ break
+ logger.debug('Got connection from {}'.format(address))
+
+ self.cleanupFinishedThreads() # House keeping
+
+ logger.debug('Starting new thread, current: {}'.format(self.threads))
+ t = ClientProcessor(self, clientSocket)
+ self.threads.append(t)
+ t.start()
+ except Exception as e:
+ logger.error('Got an exception on Server ipc thread: {}'.format(e))
+
+
+class ClientIPC(threading.Thread):
+ def __init__(self, listenPort):
+ super(ClientIPC, self).__init__()
+ self.port = listenPort
+ self.running = False
+ self.clientSocket = None
+ self.messages = six.moves.queue.Queue(32) # @UndefinedVariable
+
+ self.connect()
+
+ def stop(self):
+ self.running = False
+
+ def getMessage(self):
+ while self.running:
+ try:
+ return self.messages.get(timeout=1)
+ except six.moves.queue.Empty: # @UndefinedVariable
+ continue
+
+ return None
+
+ def sendRequestMessage(self, msg, data=None):
+ logger.debug('Sending request for msg: {}({}), {}'.format(msg, REV_DICT.get(msg), data))
+ if data is None:
+ data = b''
+
+ if isinstance(data, six.text_type): # Convert to bytes if necessary
+ data = data.encode('utf-8')
+
+ l = len(data)
+ msg = six.int2byte(msg) + six.int2byte(l & 0xFF) + six.int2byte(l >> 8) + data
+ self.clientSocket.sendall(msg)
+
+ def sendLogin(self, username, language):
+ self.sendRequestMessage(REQ_LOGIN, username+','+language)
+
+ def sendLogout(self, username):
+ self.sendRequestMessage(REQ_LOGOUT, username)
+
+ def sendMessage(self, module, message, data=None):
+ '''
+ Sends a message "message" with data (data will be encoded as json, so ensure that it is serializable)
+ @param module: Module that will receive this message
+ @param message: Message to send. This message is "customized", and understand by modules
+ @param data: Data to be send as message companion
+ '''
+ msg = '\0'.join((module, message, json.dumps(data)))
+ self.sendRequestMessage(REQ_MESSAGE, msg)
+
+ def messageReceived(self):
+ '''
+ Override this method to automatically get notified on new message
+ received. Message is at self.messages queue
+ '''
+ pass
+
+ def receiveBytes(self, number):
+ msg = b''
+ while self.running and len(msg) < number:
+ try:
+ buf = self.clientSocket.recv(number - len(msg))
+ if buf == b'':
+ logger.debug('Buf {}, msg {}({})'.format(buf, msg, REV_DICT.get(msg)))
+ self.running = False
+ break
+ msg += buf
+ except socket.timeout:
+ pass
+
+ if self.running is False:
+ logger.debug('Not running, returning None')
+ return None
+ return msg
+
+ def connect(self):
+ self.clientSocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
+ self.clientSocket.connect(('localhost', self.port))
+ self.clientSocket.settimeout(2) # Static, custom socket timeout of 2 seconds for local connection (no network)
+
+ def run(self):
+ self.running = True
+
+ while self.running:
+ try:
+ msg = b''
+ # We look for magic message header
+ while self.running: # Wait for MAGIC
+ try:
+ buf = self.clientSocket.recv(len(MAGIC) - len(msg))
+ if buf == b'':
+ self.running = False
+ break
+ msg += buf
+ if len(msg) != len(MAGIC):
+ continue # Do not have message
+ if msg != MAGIC: # Skip first byte an continue searchong
+ msg = msg[1:]
+ continue
+ break
+ except socket.timeout: # Timeout is here so we can get stop thread
+ continue
+
+ if self.running is False:
+ break
+
+ # Now we get message basic data (msg + datalen)
+ msg = bytearray(self.receiveBytes(3))
+
+ # We have the magic header, here comes the message itself
+ if msg is None:
+ continue
+
+ msgId = msg[0]
+ dataLen = msg[1] + (msg[2] << 8)
+ if msgId not in (MSG_LOGOFF, MSG_MESSAGE, MSG_SCRIPT):
+ raise Exception('Invalid message id: {}'.format(msgId))
+
+ data = self.receiveBytes(dataLen)
+ if data is None:
+ continue
+
+ self.messages.put((msgId, data))
+ self.messageReceived()
+
+ except socket.error as e:
+ logger.error('Communication with server got an error: {}'.format(toUnicode(e.strerror)))
+ self.running = False
+ return
+ except Exception as e:
+ tb = traceback.format_exc()
+ logger.error('Error: {}, trace: {}'.format(e, tb))
+
+ try:
+ self.clientSocket.close()
+ except Exception:
+ pass # If can't close, nothing happens, just end thread
+
diff --git a/admin/Sources/Clients/ogagent/src/opengnsys/linux/OGAgentService.py b/admin/Sources/Clients/ogagent/src/opengnsys/linux/OGAgentService.py
new file mode 100644
index 00000000..29a238da
--- /dev/null
+++ b/admin/Sources/Clients/ogagent/src/opengnsys/linux/OGAgentService.py
@@ -0,0 +1,147 @@
+# -*- coding: utf-8 -*-
+#
+# Copyright (c) 2014 Virtual Cable S.L.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without modification,
+# are permitted provided that the following conditions are met:
+#
+# * Redistributions of source code must retain the above copyright notice,
+# this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice,
+# this list of conditions and the following disclaimer in the documentation
+# and/or other materials provided with the distribution.
+# * Neither the name of Virtual Cable S.L. nor the names of its contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+'''
+@author: Adolfo Gómez, dkmaster at dkmon dot com
+'''
+from __future__ import unicode_literals
+
+from opengnsys.service import CommonService
+from opengnsys.service import IPC_PORT
+from opengnsys import ipc
+
+from opengnsys.log import logger
+
+from opengnsys.linux.daemon import Daemon
+
+import sys
+import signal
+import json
+
+try:
+ from prctl import set_proctitle # @UnresolvedImport
+except Exception: # Platform may not include prctl, so in case it's not available, we let the "name" as is
+ def set_proctitle(_):
+ pass
+
+
+class OGAgentSvc(Daemon, CommonService):
+ def __init__(self, args=None):
+ Daemon.__init__(self, '/var/run/opengnsys-agent.pid')
+ CommonService.__init__(self)
+
+ def run(self):
+ logger.debug('** Running Daemon **')
+ set_proctitle('OGAgent')
+
+ self.initialize()
+
+ # Call modules initialization
+ # They are called in sequence, no threading is done at this point, so ensure modules onActivate always returns
+
+
+ # *********************
+ # * Main Service loop *
+ # *********************
+ # Counter used to check ip changes only once every 10 seconds, for
+ # example
+ try:
+ while self.isAlive:
+ # In milliseconds, will break
+ self.doWait(1000)
+ except (KeyboardInterrupt, SystemExit) as e:
+ logger.error('Requested exit of main loop')
+ except Exception as e:
+ logger.exception()
+ logger.error('Caught exception on main loop: {}'.format(e))
+
+ self.terminate()
+
+ self.notifyStop()
+
+ def signal_handler(self, signal, frame):
+ self.isAlive = False
+ sys.stderr.write("signal handler: {}".format(signal))
+
+
+def usage():
+ sys.stderr.write("usage: {} start|stop|restart|fg|login 'username'|logout 'username'|message 'module' 'message' 'json'\n".format(sys.argv[0]))
+ sys.exit(2)
+
+if __name__ == '__main__':
+ logger.setLevel('INFO')
+
+ if len(sys.argv) == 5 and sys.argv[1] == 'message':
+ logger.debug('Running client opengnsys')
+ client = None
+ try:
+ client = ipc.ClientIPC(IPC_PORT)
+ client.sendMessage(sys.argv[2], sys.argv[3], json.loads(sys.argv[4]))
+ sys.exit(0)
+ except Exception as e:
+ logger.error(e)
+
+
+ if len(sys.argv) == 3 and sys.argv[1] in ('login', 'logout'):
+ logger.debug('Running client opengnsys')
+ client = None
+ try:
+ client = ipc.ClientIPC(IPC_PORT)
+ if 'login' == sys.argv[1]:
+ client.sendLogin(sys.argv[2])
+ sys.exit(0)
+ elif 'logout' == sys.argv[1]:
+ client.sendLogout(sys.argv[2])
+ sys.exit(0)
+ else:
+ usage()
+ except Exception as e:
+ logger.error(e)
+ elif len(sys.argv) != 2:
+ usage()
+
+ logger.debug('Executing actor')
+ daemon = OGAgentSvc()
+
+ signal.signal(signal.SIGTERM, daemon.signal_handler)
+ signal.signal(signal.SIGINT, daemon.signal_handler)
+
+ if len(sys.argv) == 2:
+ if 'start' == sys.argv[1]:
+ daemon.start()
+ elif 'stop' == sys.argv[1]:
+ daemon.stop()
+ elif 'restart' == sys.argv[1]:
+ daemon.restart()
+ elif 'fg' == sys.argv[1]:
+ daemon.run()
+ else:
+ usage()
+ sys.exit(0)
+ else:
+ usage()
diff --git a/admin/Sources/Clients/ogagent/src/opengnsys/linux/__init__.py b/admin/Sources/Clients/ogagent/src/opengnsys/linux/__init__.py
new file mode 100644
index 00000000..3a98c780
--- /dev/null
+++ b/admin/Sources/Clients/ogagent/src/opengnsys/linux/__init__.py
@@ -0,0 +1,32 @@
+# -*- coding: utf-8 -*-
+#
+# Copyright (c) 2014 Virtual Cable S.L.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without modification,
+# are permitted provided that the following conditions are met:
+#
+# * Redistributions of source code must retain the above copyright notice,
+# this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice,
+# this list of conditions and the following disclaimer in the documentation
+# and/or other materials provided with the distribution.
+# * Neither the name of Virtual Cable S.L. nor the names of its contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+'''
+@author: Adolfo Gómez, dkmaster at dkmon dot com
+'''
+from __future__ import unicode_literals
diff --git a/admin/Sources/Clients/ogagent/src/opengnsys/linux/daemon.py b/admin/Sources/Clients/ogagent/src/opengnsys/linux/daemon.py
new file mode 100644
index 00000000..3753808a
--- /dev/null
+++ b/admin/Sources/Clients/ogagent/src/opengnsys/linux/daemon.py
@@ -0,0 +1,182 @@
+# -*- coding: utf-8 -*-
+#
+# Copyright (c) 2014 Virtual Cable S.L.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without modification,
+# are permitted provided that the following conditions are met:
+#
+# * Redistributions of source code must retain the above copyright notice,
+# this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice,
+# this list of conditions and the following disclaimer in the documentation
+# and/or other materials provided with the distribution.
+# * Neither the name of Virtual Cable S.L. nor the names of its contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+'''
+@author: : http://www.jejik.com/authors/sander_marechal/
+@see: : http://www.jejik.com/articles/2007/02/a_simple_unix_linux_daemon_in_python/
+'''
+
+from __future__ import unicode_literals
+import sys
+import os
+import time
+import atexit
+from opengnsys.log import logger
+
+from signal import SIGTERM
+
+
+class Daemon:
+ """
+ A generic daemon class.
+
+ Usage: subclass the Daemon class and override the run() method
+ """
+ def __init__(self, pidfile, stdin='/dev/null', stdout='/dev/null', stderr='/dev/null'):
+ self.stdin = stdin
+ self.stdout = stdout
+ self.stderr = stderr
+ self.pidfile = pidfile
+
+ def daemonize(self):
+ """
+ do the UNIX double-fork magic, see Stevens' "Advanced
+ Programming in the UNIX Environment" for details (ISBN 0201563177)
+ http://www.erlenstar.demon.co.uk/unix/faq_2.html#SEC16
+ """
+ try:
+ pid = os.fork()
+ if pid > 0:
+ # exit first parent
+ sys.exit(0)
+ except OSError as e:
+ logger.error("fork #1 error: {}".format(e))
+ sys.stderr.write("fork #1 failed: {}\n".format(e))
+ sys.exit(1)
+
+ # decouple from parent environment
+ os.chdir("/")
+ os.setsid()
+ os.umask(0)
+
+ # do second fork
+ try:
+ pid = os.fork()
+ if pid > 0:
+ # exit from second parent
+ sys.exit(0)
+ except OSError as e:
+ logger.error("fork #2 error: {}".format(e))
+ sys.stderr.write("fork #2 failed: {}\n".format(e))
+ sys.exit(1)
+
+ # redirect standard file descriptors
+ sys.stdout.flush()
+ sys.stderr.flush()
+ si = open(self.stdin, 'r')
+ so = open(self.stdout, 'a+')
+ se = open(self.stderr, 'a+', 0)
+ os.dup2(si.fileno(), sys.stdin.fileno())
+ os.dup2(so.fileno(), sys.stdout.fileno())
+ os.dup2(se.fileno(), sys.stderr.fileno())
+
+ # write pidfile
+ atexit.register(self.delpid)
+ pid = str(os.getpid())
+ with open(self.pidfile, 'w+') as f:
+ f.write("{}\n".format(pid))
+
+ def delpid(self):
+ try:
+ os.remove(self.pidfile)
+ except Exception:
+ # Not found/not permissions or whatever...
+ pass
+
+ def start(self):
+ """
+ Start the daemon
+ """
+ logger.debug('Starting daemon')
+ # Check for a pidfile to see if the daemon already runs
+ try:
+ pf = open(self.pidfile, 'r')
+ pid = int(pf.read().strip())
+ pf.close()
+ except IOError:
+ pid = None
+
+ if pid:
+ message = "pidfile {} already exist. Daemon already running?\n".format(pid)
+ logger.error(message)
+ sys.stderr.write(message)
+ sys.exit(1)
+
+ # Start the daemon
+ self.daemonize()
+ try:
+ self.run()
+ except Exception as e:
+ logger.error('Exception running process: {}'.format(e))
+
+ if os.path.exists(self.pidfile):
+ os.remove(self.pidfile)
+
+ def stop(self):
+ """
+ Stop the daemon
+ """
+ # Get the pid from the pidfile
+ try:
+ pf = open(self.pidfile, 'r')
+ pid = int(pf.read().strip())
+ pf.close()
+ except IOError:
+ pid = None
+
+ if pid is None:
+ message = "pidfile {} does not exist. Daemon not running?\n".format(self.pidfile)
+ logger.info(message)
+ # sys.stderr.write(message)
+ return # not an error in a restart
+
+ # Try killing the daemon process
+ try:
+ for i in range(10):
+ os.kill(pid, SIGTERM)
+ time.sleep(1)
+ except OSError as err:
+ if err.errno == 3: # No such process
+ if os.path.exists(self.pidfile):
+ os.remove(self.pidfile)
+ else:
+ sys.stderr.write(err)
+ sys.exit(1)
+
+ def restart(self):
+ """
+ Restart the daemon
+ """
+ self.stop()
+ self.start()
+
+ # Overridables
+ def run(self):
+ """
+ You should override this method when you subclass Daemon. It will be called after the process has been
+ daemonized by start() or restart().
+ """
diff --git a/admin/Sources/Clients/ogagent/src/opengnsys/linux/log.py b/admin/Sources/Clients/ogagent/src/opengnsys/linux/log.py
new file mode 100644
index 00000000..dc54e198
--- /dev/null
+++ b/admin/Sources/Clients/ogagent/src/opengnsys/linux/log.py
@@ -0,0 +1,80 @@
+# -*- coding: utf-8 -*-
+#
+# Copyright (c) 2014 Virtual Cable S.L.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without modification,
+# are permitted provided that the following conditions are met:
+#
+# * Redistributions of source code must retain the above copyright notice,
+# this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice,
+# this list of conditions and the following disclaimer in the documentation
+# and/or other materials provided with the distribution.
+# * Neither the name of Virtual Cable S.L. nor the names of its contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+'''
+@author: Adolfo Gómez, dkmaster at dkmon dot com
+'''
+from __future__ import unicode_literals
+
+import logging
+import os
+import tempfile
+import six
+
+# Valid logging levels, from UDS Broker (uds.core.utils.log)
+OTHER, DEBUG, INFO, WARN, ERROR, FATAL = (10000 * (x + 1) for x in six.moves.xrange(6)) # @UndefinedVariable
+
+
+class LocalLogger(object):
+ def __init__(self):
+ # tempdir is different for "user application" and "service"
+ # service wil get c:\windows\temp, while user will get c:\users\XXX\temp
+ # Try to open logger at /var/log path
+ # If it fails (access denied normally), will try to open one at user's home folder, and if
+ # agaim it fails, open it at the tmpPath
+
+ for logDir in ('/var/log', os.path.expanduser('~'), tempfile.gettempdir()):
+ try:
+ fname = os.path.join(logDir, 'opengnsys.log')
+ logging.basicConfig(
+ filename=fname,
+ filemode='a',
+ format='%(levelname)s %(asctime)s %(message)s',
+ level=logging.DEBUG
+ )
+ self.logger = logging.getLogger('opengnsys')
+ os.chmod(fname, 0o0600)
+ return
+ except Exception:
+ pass
+
+ # Logger can't be set
+ self.logger = None
+
+ def log(self, level, message):
+ # Debug messages are logged to a file
+ # our loglevels are 10000 (other), 20000 (debug), ....
+ # logging levels are 10 (debug), 20 (info)
+ # OTHER = logging.NOTSET
+ self.logger.log(int(level / 1000) - 10, message)
+
+ def isWindows(self):
+ return False
+
+ def isLinux(self):
+ return True
diff --git a/admin/Sources/Clients/ogagent/src/opengnsys/linux/operations.py b/admin/Sources/Clients/ogagent/src/opengnsys/linux/operations.py
new file mode 100644
index 00000000..f9534d6a
--- /dev/null
+++ b/admin/Sources/Clients/ogagent/src/opengnsys/linux/operations.py
@@ -0,0 +1,286 @@
+# -*- coding: utf-8 -*-
+#
+# Copyright (c) 2014 Virtual Cable S.L.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without modification,
+# are permitted provided that the following conditions are met:
+#
+# * Redistributions of source code must retain the above copyright notice,
+# this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice,
+# this list of conditions and the following disclaimer in the documentation
+# and/or other materials provided with the distribution.
+# * Neither the name of Virtual Cable S.L. nor the names of its contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+'''
+@author: Adolfo Gómez, dkmaster at dkmon dot com
+'''
+from __future__ import unicode_literals
+
+import socket
+import platform
+import fcntl
+import os
+import locale
+import ctypes # @UnusedImport
+import ctypes.util
+import subprocess
+import struct
+import array
+import six
+from opengnsys import utils
+from .renamer import rename
+
+
+def _getMacAddr(ifname):
+ '''
+ Returns the mac address of an interface
+ Mac is returned as unicode utf-8 encoded
+ '''
+ if isinstance(ifname, list):
+ return dict([(name, _getMacAddr(name)) for name in ifname])
+ if isinstance(ifname, six.text_type):
+ ifname = ifname.encode('utf-8') # If unicode, convert to bytes (or str in python 2.7)
+ try:
+ s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
+ info = bytearray(fcntl.ioctl(s.fileno(), 0x8927, struct.pack(str('256s'), ifname[:15])))
+ return six.text_type(''.join(['%02x:' % char for char in info[18:24]])[:-1])
+ except Exception:
+ return None
+
+
+def _getIpAddr(ifname):
+ '''
+ Returns the ip address of an interface
+ Ip is returned as unicode utf-8 encoded
+ '''
+ if isinstance(ifname, list):
+ return dict([(name, _getIpAddr(name)) for name in ifname])
+ if isinstance(ifname, six.text_type):
+ ifname = ifname.encode('utf-8') # If unicode, convert to bytes (or str in python 2.7)
+ try:
+ s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
+ return six.text_type(socket.inet_ntoa(fcntl.ioctl(
+ s.fileno(),
+ 0x8915, # SIOCGIFADDR
+ struct.pack(str('256s'), ifname[:15])
+ )[20:24]))
+ except Exception:
+ return None
+
+
+def _getInterfaces():
+ '''
+ Returns a list of interfaces names coded in utf-8
+ '''
+ max_possible = 128 # arbitrary. raise if needed.
+ space = max_possible * 16
+ if platform.architecture()[0] == '32bit':
+ offset, length = 32, 32
+ elif platform.architecture()[0] == '64bit':
+ offset, length = 16, 40
+ else:
+ raise OSError('Unknown arquitecture {0}'.format(platform.architecture()[0]))
+
+ s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
+ names = array.array(str('B'), b'\0' * space)
+ outbytes = struct.unpack(str('iL'), fcntl.ioctl(
+ s.fileno(),
+ 0x8912, # SIOCGIFCONF
+ struct.pack(str('iL'), space, names.buffer_info()[0])
+ ))[0]
+ namestr = names.tostring()
+ # return namestr, outbytes
+ return [namestr[i:i + offset].split(b'\0', 1)[0].decode('utf-8') for i in range(0, outbytes, length)]
+
+
+def _getIpAndMac(ifname):
+ ip, mac = _getIpAddr(ifname), _getMacAddr(ifname)
+ return (ip, mac)
+
+
+def getComputerName():
+ '''
+ Returns computer name, with no domain
+ '''
+ return socket.gethostname().split('.')[0]
+
+
+def getNetworkInfo():
+ '''
+ Obtains a list of network interfaces
+ @return: A "generator" of elements, that are dict-as-object, with this elements:
+ name: Name of the interface
+ mac: mac of the interface
+ ip: ip of the interface
+ '''
+ for ifname in _getInterfaces():
+ ip, mac = _getIpAndMac(ifname)
+ if mac != '00:00:00:00:00:00': # Skips local interfaces
+ yield utils.Bunch(name=ifname, mac=mac, ip=ip)
+
+
+def getDomainName():
+ return ''
+
+
+def getLinuxVersion():
+ lv = platform.linux_distribution()
+ return lv[0] + ', ' + lv[1]
+
+
+def reboot(flags=0):
+ '''
+ Simple reboot using os command
+ '''
+ # Workaround for dummy thread
+ if six.PY3 is False:
+ import threading
+ threading._DummyThread._Thread__stop = lambda x: 42
+
+ # Check for OpenGnsys Client or GNU/Linux distribution.
+ if os.path.exists('/scripts/oginit'):
+ subprocess.call('source /opt/opengnsys/etc/preinit/loadenviron.sh; /opt/opengnsys/scripts/reboot', shell=True)
+ else:
+ subprocess.call(['/sbin/reboot'])
+
+
+def poweroff(flags=0):
+ '''
+ Simple poweroff using os command
+ '''
+ # Workaround for dummy thread
+ if six.PY3 is False:
+ import threading
+ threading._DummyThread._Thread__stop = lambda x: 42
+
+ # Check for OpenGnsys Client or GNU/Linux distribution.
+ if os.path.exists('/scripts/oginit'):
+ subprocess.call('source /opt/opengnsys/etc/preinit/loadenviron.sh; /opt/opengnsys/scripts/poweroff', shell=True)
+ else:
+ subprocess.call(['/sbin/poweroff'])
+
+
+def logoff():
+ '''
+ Kills all curent user processes, which must send a logogof
+ caveat: If the user has other sessions, will also disconnect from them
+ '''
+ # Workaround for dummy thread
+ if six.PY3 is False:
+ import threading
+ threading._DummyThread._Thread__stop = lambda x: 42
+
+ subprocess.call(['/usr/bin/pkill', '-u', os.environ['USER']])
+
+
+def renameComputer(newName):
+ rename(newName)
+
+
+def joinDomain(domain, ou, account, password, executeInOneStep=False):
+ pass
+
+
+def changeUserPassword(user, oldPassword, newPassword):
+ '''
+ Simple password change for user using command line
+ '''
+ os.system('echo "{1}\n{1}" | /usr/bin/passwd {0} 2> /dev/null'.format(user, newPassword))
+
+
+class XScreenSaverInfo(ctypes.Structure):
+ _fields_ = [('window', ctypes.c_long),
+ ('state', ctypes.c_int),
+ ('kind', ctypes.c_int),
+ ('til_or_since', ctypes.c_ulong),
+ ('idle', ctypes.c_ulong),
+ ('eventMask', ctypes.c_ulong)]
+
+# Initialize xlib & xss
+try:
+ xlibPath = ctypes.util.find_library('X11')
+ xssPath = ctypes.util.find_library('Xss')
+ xlib = ctypes.cdll.LoadLibrary(xlibPath)
+ xss = ctypes.cdll.LoadLibrary(xssPath)
+
+ # Fix result type to XScreenSaverInfo Structure
+ xss.XScreenSaverQueryExtension.restype = ctypes.c_int
+ xss.XScreenSaverAllocInfo.restype = ctypes.POINTER(XScreenSaverInfo) # Result in a XScreenSaverInfo structure
+except Exception: # Libraries not accesible, not found or whatever..
+ xlib = xss = None
+
+
+def initIdleDuration(atLeastSeconds):
+ '''
+ On linux we set the screensaver to at least required seconds, or we never will get "idle"
+ '''
+ # Workaround for dummy thread
+ if six.PY3 is False:
+ import threading
+ threading._DummyThread._Thread__stop = lambda x: 42
+
+ subprocess.call(['/usr/bin/xset', 's', '{}'.format(atLeastSeconds + 30)])
+ # And now reset it
+ subprocess.call(['/usr/bin/xset', 's', 'reset'])
+
+
+def getIdleDuration():
+ '''
+ Returns idle duration, in seconds
+ '''
+ if xlib is None or xss is None:
+ return 0 # Libraries not available
+
+ # production code might want to not hardcode the offset 16...
+ display = xlib.XOpenDisplay(None)
+
+ event_base = ctypes.c_int()
+ error_base = ctypes.c_int()
+
+ available = xss.XScreenSaverQueryExtension(display, ctypes.byref(event_base), ctypes.byref(error_base))
+ if available != 1:
+ return 0 # No screen saver is available, no way of getting idle
+
+ info = xss.XScreenSaverAllocInfo()
+ xss.XScreenSaverQueryInfo(display, xlib.XDefaultRootWindow(display), info)
+
+ if info.contents.state != 0:
+ return 3600 * 100 * 1000 # If screen saver is active, return a high enough value
+
+ return info.contents.idle / 1000.0
+
+
+def getCurrentUser():
+ '''
+ Returns current logged in user
+ '''
+ return os.environ['USER']
+
+
+def getSessionLanguage():
+ '''
+ Returns the user's session language
+ '''
+ return locale.getdefaultlocale()[0]
+
+
+def showPopup(title, message):
+ '''
+ Displays a message box on user's session (during 1 min).
+ '''
+ return subprocess.call('zenity --info --timeout 60 --title "{}" --text "{}"'.format(title, message), shell=True)
diff --git a/admin/Sources/Clients/ogagent/src/opengnsys/linux/renamer/__init__.py b/admin/Sources/Clients/ogagent/src/opengnsys/linux/renamer/__init__.py
new file mode 100644
index 00000000..27198dcf
--- /dev/null
+++ b/admin/Sources/Clients/ogagent/src/opengnsys/linux/renamer/__init__.py
@@ -0,0 +1,61 @@
+# -*- coding: utf-8 -*-
+#
+# Copyright (c) 2014 Virtual Cable S.L.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without modification,
+# are permitted provided that the following conditions are met:
+#
+# * Redistributions of source code must retain the above copyright notice,
+# this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice,
+# this list of conditions and the following disclaimer in the documentation
+# and/or other materials provided with the distribution.
+# * Neither the name of Virtual Cable S.L. nor the names of its contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+'''
+@author: Adolfo Gómez, dkmaster at dkmon dot com
+'''
+from __future__ import unicode_literals
+
+import platform
+import os
+import sys
+import pkgutil
+
+from opengnsys.log import logger
+
+renamers = {}
+
+
+# Renamers now are for IPv4 only addresses
+def rename(newName):
+ distribution = platform.linux_distribution()[0].lower().strip()
+ if distribution in renamers:
+ return renamers[distribution](newName)
+
+ # Try Debian renamer, simplest one
+ logger.info('Renamer for platform "{0}" not found, tryin debian renamer'.format(distribution))
+ return renamers['debian'](newName)
+
+
+# Do load of packages
+def _init():
+ pkgpath = os.path.dirname(sys.modules[__name__].__file__)
+ for _, name, _ in pkgutil.iter_modules([pkgpath]):
+ __import__(__name__ + '.' + name, globals(), locals())
+
+_init()
\ No newline at end of file
diff --git a/admin/Sources/Clients/ogagent/src/opengnsys/linux/renamer/debian.py b/admin/Sources/Clients/ogagent/src/opengnsys/linux/renamer/debian.py
new file mode 100644
index 00000000..be55e003
--- /dev/null
+++ b/admin/Sources/Clients/ogagent/src/opengnsys/linux/renamer/debian.py
@@ -0,0 +1,68 @@
+# -*- coding: utf-8 -*-
+#
+# Copyright (c) 2014 Virtual Cable S.L.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without modification,
+# are permitted provided that the following conditions are met:
+#
+# * Redistributions of source code must retain the above copyright notice,
+# this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice,
+# this list of conditions and the following disclaimer in the documentation
+# and/or other materials provided with the distribution.
+# * Neither the name of Virtual Cable S.L. nor the names of its contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+'''
+@author: Adolfo Gómez, dkmaster at dkmon dot com
+'''
+from __future__ import unicode_literals
+
+from opengnsys.linux.renamer import renamers
+from opengnsys.log import logger
+
+import os
+
+
+def rename(newName):
+ '''
+ Debian renamer
+ Expects new host name on newName
+ Host does not needs to be rebooted after renaming
+ '''
+ logger.debug('using Debian renamer')
+
+ with open('/etc/hostname', 'w') as hostname:
+ hostname.write(newName)
+
+ # Force system new name
+ os.system('/bin/hostname %s' % newName)
+
+ # add name to "hosts"
+ with open('/etc/hosts', 'r') as hosts:
+ lines = hosts.readlines()
+ with open('/etc/hosts', 'w') as hosts:
+ hosts.write("127.0.1.1\t%s\n" % newName)
+ for l in lines:
+ if l[:9] == '127.0.1.1': # Skips existing 127.0.1.1. if it already exists
+ continue
+ hosts.write(l)
+
+ return True
+
+# All names in lower case
+renamers['debian'] = rename
+renamers['ubuntu'] = rename
diff --git a/admin/Sources/Clients/ogagent/src/opengnsys/linux/renamer/opensuse.py b/admin/Sources/Clients/ogagent/src/opengnsys/linux/renamer/opensuse.py
new file mode 100644
index 00000000..a2d29a5c
--- /dev/null
+++ b/admin/Sources/Clients/ogagent/src/opengnsys/linux/renamer/opensuse.py
@@ -0,0 +1,66 @@
+# -*- coding: utf-8 -*-
+#
+# Copyright (c) 2014 Virtual Cable S.L.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without modification,
+# are permitted provided that the following conditions are met:
+#
+# * Redistributions of source code must retain the above copyright notice,
+# this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice,
+# this list of conditions and the following disclaimer in the documentation
+# and/or other materials provided with the distribution.
+# * Neither the name of Virtual Cable S.L. nor the names of its contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+'''
+@author: Adolfo Gómez, dkmaster at dkmon dot com
+'''
+from __future__ import unicode_literals
+
+from opengnsys.linux.renamer import renamers
+from opengnsys.log import logger
+
+import os
+
+
+def rename(newName):
+ '''
+ RH, Centos, Fedora Renamer
+ Expects new host name on newName
+ Host does not needs to be rebooted after renaming
+ '''
+ logger.debug('using SUSE renamer')
+
+ with open('/etc/hostname', 'w') as hostname:
+ hostname.write(newName)
+
+ # Force system new name
+ os.system('/bin/hostname %s' % newName)
+
+ # add name to "hosts"
+ with open('/etc/hosts', 'r') as hosts:
+ lines = hosts.readlines()
+ with open('/etc/hosts', 'w') as hosts:
+ hosts.write("127.0.1.1\t{}\n".format(newName))
+ for l in lines:
+ if l[:9] != '127.0.1.1': # Skips existing 127.0.1.1. if it already exists
+ hosts.write(l)
+
+ return True
+
+# All names in lower case
+renamers['opensuse'] = rename
+renamers['suse'] = rename
diff --git a/admin/Sources/Clients/ogagent/src/opengnsys/linux/renamer/redhat.py b/admin/Sources/Clients/ogagent/src/opengnsys/linux/renamer/redhat.py
new file mode 100644
index 00000000..8821a81c
--- /dev/null
+++ b/admin/Sources/Clients/ogagent/src/opengnsys/linux/renamer/redhat.py
@@ -0,0 +1,74 @@
+# -*- coding: utf-8 -*-
+#
+# Copyright (c) 2014 Virtual Cable S.L.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without modification,
+# are permitted provided that the following conditions are met:
+#
+# * Redistributions of source code must retain the above copyright notice,
+# this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice,
+# this list of conditions and the following disclaimer in the documentation
+# and/or other materials provided with the distribution.
+# * Neither the name of Virtual Cable S.L. nor the names of its contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+'''
+@author: Adolfo Gómez, dkmaster at dkmon dot com
+'''
+from __future__ import unicode_literals
+
+from opengnsys.linux.renamer import renamers
+from opengnsys.log import logger
+
+import os
+
+
+def rename(newName):
+ '''
+ RH, Centos, Fedora Renamer
+ Expects new host name on newName
+ Host does not needs to be rebooted after renaming
+ '''
+ logger.debug('using RH renamer')
+
+ with open('/etc/hostname', 'w') as hostname:
+ hostname.write(newName)
+
+ # Force system new name
+ os.system('/bin/hostname %s' % newName)
+
+ # add name to "hosts"
+ with open('/etc/hosts', 'r') as hosts:
+ lines = hosts.readlines()
+ with open('/etc/hosts', 'w') as hosts:
+ hosts.write("127.0.1.1\t{}\n".format(newName))
+ for l in lines:
+ if l[:9] != '127.0.1.1': # Skips existing 127.0.1.1. if it already exists
+ hosts.write(l)
+
+ with open('/etc/sysconfig/network', 'r') as net:
+ lines = net.readlines()
+ with open('/etc/sysconfig/network', 'w') as net:
+ net.write('HOSTNAME={}\n'.format(newName))
+ for l in lines:
+ if l[:8] != 'HOSTNAME':
+ net.write(l)
+
+ return True
+
+# All names in lower case
+renamers['centos linux'] = rename
+renamers['fedora'] = rename
diff --git a/admin/Sources/Clients/ogagent/src/opengnsys/loader.py b/admin/Sources/Clients/ogagent/src/opengnsys/loader.py
new file mode 100644
index 00000000..23988fca
--- /dev/null
+++ b/admin/Sources/Clients/ogagent/src/opengnsys/loader.py
@@ -0,0 +1,111 @@
+# -*- coding: utf-8 -*-
+#
+# Copyright (c) 2014 Virtual Cable S.L.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without modification,
+# are permitted provided that the following conditions are met:
+#
+# * Redistributions of source code must retain the above copyright notice,
+# this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice,
+# this list of conditions and the following disclaimer in the documentation
+# and/or other materials provided with the distribution.
+# * Neither the name of Virtual Cable S.L. nor the names of its contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+'''
+@author: Adolfo Gómez, dkmaster at dkmon dot com
+'''
+# pylint: disable=unused-wildcard-import,wildcard-import
+
+# This is a simple module loader, so we can add "external opengnsys" modules as addons
+# Modules under "opengsnsys/modules" are always autoloaded
+from __future__ import unicode_literals
+
+import pkgutil
+import os.path
+
+from opengnsys.workers import ServerWorker
+from opengnsys.workers import ClientWorker
+from .log import logger
+
+
+def loadModules(controller, client=False):
+ '''
+ Load own provided modules plus the modules that are in the configuration path.
+ The loading order is not defined (they are loaded as found, because modules MUST be "standalone" modules
+ @param service: The service that:
+ * Holds the configuration
+ * Will be used to initialize modules.
+ '''
+
+ ogModules = []
+
+ if client is False:
+ from opengnsys.modules.server import OpenGnSys # @UnusedImport
+ from .modules import server # @UnusedImport, just used to ensure opengnsys modules are initialized
+ modPath = 'opengnsys.modules.server'
+ modType = ServerWorker
+ else:
+ from opengnsys.modules.client import OpenGnSys # @UnusedImport @Reimport
+ from .modules import client # @UnusedImport, just used to ensure opengnsys modules are initialized
+ modPath = 'opengnsys.modules.client'
+ modType = ClientWorker
+
+ def addCls(cls):
+ logger.debug('Found module class {}'.format(cls))
+ try:
+ if cls.name is None:
+ # Error, cls has no name
+ # Log the issue and
+ logger.error('Class {} has no name attribute'.format(cls))
+ return
+ ogModules.append(cls(controller))
+ except Exception as e:
+ logger.error('Error loading module {}'.format(e))
+
+ def recursiveAdd(p):
+ subcls = p.__subclasses__()
+
+ if len(subcls) == 0:
+ addCls(p)
+ else:
+ for c in subcls:
+ recursiveAdd(c)
+
+ def doLoad(paths):
+ for (module_loader, name, ispkg) in pkgutil.iter_modules(paths, modPath + '.'):
+ if ispkg:
+ logger.debug('Found module package {}'.format(name))
+ module_loader.find_module(name).load_module(name)
+
+
+ if controller.config.has_option('opengnsys', 'path') is True:
+ paths = tuple(os.path.abspath(v) for v in controller.config.get('opengnsys', 'path').split(','))
+ else:
+ paths = ()
+
+ # paths += (os.path.dirname(sys.modules[modPath].__file__),)
+
+ logger.debug('Loading modules from {}'.format(paths))
+
+ # Load modules
+ doLoad(paths)
+
+ # Add to list of available modules
+ recursiveAdd(modType)
+
+ return ogModules
diff --git a/admin/Sources/Clients/ogagent/src/opengnsys/log.py b/admin/Sources/Clients/ogagent/src/opengnsys/log.py
new file mode 100644
index 00000000..e34c0874
--- /dev/null
+++ b/admin/Sources/Clients/ogagent/src/opengnsys/log.py
@@ -0,0 +1,103 @@
+# -*- coding: utf-8 -*-
+#
+# Copyright (c) 2014 Virtual Cable S.L.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without modification,
+# are permitted provided that the following conditions are met:
+#
+# * Redistributions of source code must retain the above copyright notice,
+# this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice,
+# this list of conditions and the following disclaimer in the documentation
+# and/or other materials provided with the distribution.
+# * Neither the name of Virtual Cable S.L. nor the names of its contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+'''
+@author: Adolfo Gómez, dkmaster at dkmon dot com
+'''
+from __future__ import unicode_literals
+
+import traceback
+import sys
+import six
+
+if sys.platform == 'win32':
+ from opengnsys.windows.log import LocalLogger # @UnusedImport
+else:
+ from opengnsys.linux.log import LocalLogger # @Reimport
+
+# Valid logging levels, from UDS Broker (uds.core.utils.log)
+OTHER, DEBUG, INFO, WARN, ERROR, FATAL = (10000 * (x + 1) for x in six.moves.xrange(6)) # @UndefinedVariable
+
+_levelName = {
+ 'OTHER': OTHER,
+ 'DEBUG': DEBUG,
+ 'INFO': INFO,
+ 'WARN': WARN,
+ 'ERROR': ERROR,
+ 'FATAL': FATAL
+}
+
+class Logger(object):
+ def __init__(self):
+ self.logLevel = INFO
+ self.logger = LocalLogger()
+
+ def setLevel(self, level):
+ '''
+ Sets log level filter (minimum level required for a log message to be processed)
+ :param level: Any message with a level below this will be filtered out
+ '''
+ if isinstance(level, six.string_types):
+ level = _levelName.get(level, INFO)
+
+ self.logLevel = level # Ensures level is an integer or fails
+
+ def log(self, level, message):
+ if level < self.logLevel: # Skip not wanted messages
+ return
+
+ self.logger.log(level, message)
+
+ def debug(self, message):
+ self.log(DEBUG, message)
+
+ def warn(self, message):
+ self.log(WARN, message)
+
+ def info(self, message):
+ self.log(INFO, message)
+
+ def error(self, message):
+ self.log(ERROR, message)
+
+ def fatal(self, message):
+ self.log(FATAL, message)
+
+ def exception(self):
+ try:
+ tb = traceback.format_exc()
+ except Exception:
+ tb = '(could not get traceback!)'
+
+ self.log(DEBUG, tb)
+
+ def flush(self):
+ pass
+
+
+logger = Logger()
diff --git a/admin/Sources/Clients/ogagent/src/opengnsys/macos/__init__.py b/admin/Sources/Clients/ogagent/src/opengnsys/macos/__init__.py
new file mode 100644
index 00000000..ee5ba4c2
--- /dev/null
+++ b/admin/Sources/Clients/ogagent/src/opengnsys/macos/__init__.py
@@ -0,0 +1,32 @@
+# -*- coding: utf-8 -*-
+#
+# Copyright (c) 2014 Virtual Cable S.L.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without modification,
+# are permitted provided that the following conditions are met:
+#
+# * Redistributions of source code must retain the above copyright notice,
+# this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice,
+# this list of conditions and the following disclaimer in the documentation
+# and/or other materials provided with the distribution.
+# * Neither the name of Virtual Cable S.L. nor the names of its contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+'''
+@author: Ramón M. Gómez, ramongomez at us dot es
+'''
+from __future__ import unicode_literals
diff --git a/admin/Sources/Clients/ogagent/src/opengnsys/macos/operations.py b/admin/Sources/Clients/ogagent/src/opengnsys/macos/operations.py
new file mode 100644
index 00000000..ea835cea
--- /dev/null
+++ b/admin/Sources/Clients/ogagent/src/opengnsys/macos/operations.py
@@ -0,0 +1,255 @@
+# -*- coding: utf-8 -*-
+#
+# Copyright (c) 2014 Virtual Cable S.L.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without modification,
+# are permitted provided that the following conditions are met:
+#
+# * Redistributions of source code must retain the above copyright notice,
+# this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice,
+# this list of conditions and the following disclaimer in the documentation
+# and/or other materials provided with the distribution.
+# * Neither the name of Virtual Cable S.L. nor the names of its contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+'''
+@author: Adolfo Gómez, dkmaster at dkmon dot com
+'''
+from __future__ import unicode_literals
+
+import socket
+import platform
+import fcntl
+import os
+import locale
+import ctypes # @UnusedImport
+import ctypes.util
+import subprocess
+import struct
+import array
+import six
+from opengnsys import utils
+import netifaces
+
+
+def _getMacAddr(ifname):
+ '''
+ Returns the mac address of an interface
+ Mac is returned as unicode utf-8 encoded
+ '''
+ if isinstance(ifname, list):
+ return dict([(name, _getMacAddr(name)) for name in ifname])
+ if isinstance(ifname, six.text_type):
+ ifname = ifname.encode('utf-8') # If unicode, convert to bytes (or str in python 2.7)
+ try:
+ return netifaces.ifaddresses(ifname)[18][0]['addr']
+ except Exception:
+ return None
+
+
+def _getIpAddr(ifname):
+ '''
+ Returns the IP address of an interface
+ IP is returned as unicode utf-8 encoded
+ '''
+ if isinstance(ifname, list):
+ return dict([(name, _getIpAddr(name)) for name in ifname])
+ if isinstance(ifname, six.text_type):
+ ifname = ifname.encode('utf-8') # If unicode, convert to bytes (or str in python 2.7)
+ try:
+ return netifaces.ifaddresses(ifname)[2][0]['addr']
+ except Exception:
+ return None
+
+
+def _getInterfaces():
+ '''
+ Returns a list of interfaces names
+ '''
+ return netifaces.interfaces()
+
+
+def _getIpAndMac(ifname):
+ ip, mac = _getIpAddr(ifname), _getMacAddr(ifname)
+ return (ip, mac)
+
+
+def getComputerName():
+ '''
+ Returns computer name, with no domain
+ '''
+ return socket.gethostname().split('.')[0]
+
+
+def getNetworkInfo():
+ '''
+ Obtains a list of network interfaces
+ @return: A "generator" of elements, that are dict-as-object, with this elements:
+ name: Name of the interface
+ mac: mac of the interface
+ ip: ip of the interface
+ '''
+ for ifname in _getInterfaces():
+ ip, mac = _getIpAndMac(ifname)
+ if mac != None and ip != None: # Skips local interfaces
+ yield utils.Bunch(name=ifname, mac=mac, ip=ip)
+
+
+def getDomainName():
+ return ''
+
+
+def getMacosVersion():
+ return 'macOS {}'.format(platform.mac_ver()[0])
+
+
+def reboot(flags=0):
+ '''
+ Simple reboot command
+ '''
+ # Workaround for dummy thread
+ if six.PY3 is False:
+ import threading
+ threading._DummyThread._Thread__stop = lambda x: 42
+
+ # Exec reboot command
+ subprocess.call('/sbin/shutdown -r now', shell=True)
+
+
+def poweroff(flags=0):
+ '''
+ Simple poweroff command
+ '''
+ # Workaround for dummy thread
+ if six.PY3 is False:
+ import threading
+ threading._DummyThread._Thread__stop = lambda x: 42
+
+ # Exec shutdown command
+ subprocess.call('/sbin/shutdown -h now', shell=True)
+
+
+def logoff():
+ '''
+ Simple logout using AppleScript
+ '''
+ # Workaround for dummy thread
+ if six.PY3 is False:
+ import threading
+ threading._DummyThread._Thread__stop = lambda x: 42
+
+ # Exec logout using AppleSctipt
+ subprocess.call('/usr/bin/osascript -e \'tell app "System Events" to «event aevtrlgo»\'', shell=True)
+
+
+def renameComputer(newName):
+ rename(newName)
+
+
+def joinDomain(domain, ou, account, password, executeInOneStep=False):
+ pass
+
+
+def changeUserPassword(user, oldPassword, newPassword):
+ '''
+ Simple password change for user using command line
+ '''
+ os.system('echo "{1}\n{1}" | /usr/bin/passwd {0} 2> /dev/null'.format(user, newPassword))
+
+
+class XScreenSaverInfo(ctypes.Structure):
+ _fields_ = [('window', ctypes.c_long),
+ ('state', ctypes.c_int),
+ ('kind', ctypes.c_int),
+ ('til_or_since', ctypes.c_ulong),
+ ('idle', ctypes.c_ulong),
+ ('eventMask', ctypes.c_ulong)]
+
+# Initialize xlib & xss
+try:
+ xlibPath = ctypes.util.find_library('X11')
+ xssPath = ctypes.util.find_library('Xss')
+ xlib = ctypes.cdll.LoadLibrary(xlibPath)
+ xss = ctypes.cdll.LoadLibrary(xssPath)
+
+ # Fix result type to XScreenSaverInfo Structure
+ xss.XScreenSaverQueryExtension.restype = ctypes.c_int
+ xss.XScreenSaverAllocInfo.restype = ctypes.POINTER(XScreenSaverInfo) # Result in a XScreenSaverInfo structure
+except Exception: # Libraries not accesible, not found or whatever..
+ xlib = xss = None
+
+
+def initIdleDuration(atLeastSeconds):
+ '''
+ On linux we set the screensaver to at least required seconds, or we never will get "idle"
+ '''
+ # Workaround for dummy thread
+ if six.PY3 is False:
+ import threading
+ threading._DummyThread._Thread__stop = lambda x: 42
+
+ subprocess.call(['/usr/bin/xset', 's', '{}'.format(atLeastSeconds + 30)])
+ # And now reset it
+ subprocess.call(['/usr/bin/xset', 's', 'reset'])
+
+
+def getIdleDuration():
+ '''
+ Returns idle duration, in seconds
+ '''
+ if xlib is None or xss is None:
+ return 0 # Libraries not available
+
+ # production code might want to not hardcode the offset 16...
+ display = xlib.XOpenDisplay(None)
+
+ event_base = ctypes.c_int()
+ error_base = ctypes.c_int()
+
+ available = xss.XScreenSaverQueryExtension(display, ctypes.byref(event_base), ctypes.byref(error_base))
+ if available != 1:
+ return 0 # No screen saver is available, no way of getting idle
+
+ info = xss.XScreenSaverAllocInfo()
+ xss.XScreenSaverQueryInfo(display, xlib.XDefaultRootWindow(display), info)
+
+ if info.contents.state != 0:
+ return 3600 * 100 * 1000 # If screen saver is active, return a high enough value
+
+ return info.contents.idle / 1000.0
+
+
+def getCurrentUser():
+ '''
+ Returns current logged in user
+ '''
+ return os.environ['USER']
+
+
+def getSessionLanguage():
+ '''
+ Returns the user's session language
+ '''
+ return locale.getdefaultlocale()[0]
+
+
+def showPopup(title, message):
+ '''
+ Displays a message box on user's session (during 1 min).
+ '''
+ # Show a dialog using AppleSctipt
+ return subprocess.call('/usr/bin/osascript -e \'display notification "{}" with title "{}"\''.format(message, title), shell=True)
diff --git a/admin/Sources/Clients/ogagent/src/opengnsys/modules/__init__.py b/admin/Sources/Clients/ogagent/src/opengnsys/modules/__init__.py
new file mode 100644
index 00000000..e69de29b
diff --git a/admin/Sources/Clients/ogagent/src/opengnsys/modules/client/OpenGnSys/__init__.py b/admin/Sources/Clients/ogagent/src/opengnsys/modules/client/OpenGnSys/__init__.py
new file mode 100644
index 00000000..b840d929
--- /dev/null
+++ b/admin/Sources/Clients/ogagent/src/opengnsys/modules/client/OpenGnSys/__init__.py
@@ -0,0 +1,63 @@
+# -*- coding: utf-8 -*-
+#
+# Copyright (c) 2014 Virtual Cable S.L.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without modification,
+# are permitted provided that the following conditions are met:
+#
+# * Redistributions of source code must retain the above copyright notice,
+# this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice,
+# this list of conditions and the following disclaimer in the documentation
+# and/or other materials provided with the distribution.
+# * Neither the name of Virtual Cable S.L. nor the names of its contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+'''
+@author: Ramón M. Gómez, ramongomez at us dot es
+'''
+from __future__ import unicode_literals
+
+from opengnsys.workers import ClientWorker
+
+from opengnsys import operations
+from opengnsys.log import logger
+from opengnsys.scriptThread import ScriptExecutorThread
+
+class OpenGnSysWorker(ClientWorker):
+ name = 'opengnsys'
+
+ def onActivation(self):
+ logger.debug('Activate invoked')
+
+ def onDeactivation(self):
+ logger.debug('Deactivate invoked')
+
+ # Processes script execution
+ def process_script(self, jsonParams):
+ logger.debug('Processed message: script({})'.format(jsonParams))
+ thr = ScriptExecutorThread(jsonParams['code'])
+ thr.start()
+ #self.sendServerMessage('script', {'op', 'launched'})
+
+ def process_logoff(self, jsonParams):
+ logger.debug('Processed message: logoff({})'.format(jsonParams))
+ operations.logoff()
+
+ def process_popup(self, jsonParams):
+ logger.debug('Processed message: popup({})'.format(jsonParams))
+ ret = operations.showPopup(jsonParams['title'], jsonParams['message'])
+ #self.sendServerMessage('popup', {'op', ret})
+
diff --git a/admin/Sources/Clients/ogagent/src/opengnsys/modules/client/__init__.py b/admin/Sources/Clients/ogagent/src/opengnsys/modules/client/__init__.py
new file mode 100644
index 00000000..e69de29b
diff --git a/admin/Sources/Clients/ogagent/src/opengnsys/modules/server/OpenGnSys/__init__.py b/admin/Sources/Clients/ogagent/src/opengnsys/modules/server/OpenGnSys/__init__.py
new file mode 100644
index 00000000..1438e469
--- /dev/null
+++ b/admin/Sources/Clients/ogagent/src/opengnsys/modules/server/OpenGnSys/__init__.py
@@ -0,0 +1,250 @@
+# -*- coding: utf-8 -*-
+#
+# Copyright (c) 2014 Virtual Cable S.L.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without modification,
+# are permitted provided that the following conditions are met:
+#
+# * Redistributions of source code must retain the above copyright notice,
+# this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice,
+# this list of conditions and the following disclaimer in the documentation
+# and/or other materials provided with the distribution.
+# * Neither the name of Virtual Cable S.L. nor the names of its contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+'''
+@author: Ramón M. Gómez, ramongomez at us dot es
+'''
+from __future__ import unicode_literals
+
+import subprocess
+import threading
+import thread
+import os
+import platform
+import time
+import random
+import string
+import urllib
+
+from opengnsys.workers import ServerWorker
+from opengnsys import REST, RESTError
+from opengnsys import operations
+from opengnsys.log import logger
+from opengnsys.scriptThread import ScriptExecutorThread
+
+# Error handler decorator.
+def catchBackgroundError(fnc):
+ def wrapper(*args, **kwargs):
+ this = args[0]
+ try:
+ fnc(*args, **kwargs)
+ except Exception as e:
+ this.REST.sendMessage('error?id={}'.format(kwargs.get('requestId', 'error')), {'error': '{}'.format(e)})
+ return wrapper
+
+class OpenGnSysWorker(ServerWorker):
+ name = 'opengnsys'
+ interface = None # Binded interface for OpenGnsys
+ loggedin = False # User session flag
+ locked = {}
+ random = None # Random string for secure connections
+ length = 32 # Random string length
+
+ def checkSecret(self, server):
+ '''
+ Checks for received secret key and raise exception if it isn't valid.
+ '''
+ try:
+ if self.random != server.headers['Authorization']:
+ raise Exception('Unauthorized operation')
+ except Exception as e:
+ logger.error(e)
+ raise Exception(e)
+
+ def onActivation(self):
+ '''
+ Sends OGAgent activation notification to OpenGnsys server
+ '''
+ self.cmd = None
+ # Ensure cfg has required configuration variables or an exception will be thrown
+ self.REST = REST(self.service.config.get('opengnsys', 'remote'))
+ # Get network interfaces until they are active or timeout (5 minutes)
+ for t in range(0, 300):
+ try:
+ self.interface = list(operations.getNetworkInfo())[0] # Get first network interface
+ except Exception as e:
+ # Wait 1 sec. and retry
+ time.sleep(1)
+ finally:
+ # Exit loop if interface is active
+ if self.interface:
+ if t > 0:
+ logger.debug("Fetch connection data after {} tries".format(t))
+ break
+ # Raise error after timeout
+ if not self.interface:
+ raise e
+ # Delete marking files
+ for f in ['ogboot.me', 'ogboot.firstboot', 'ogboot.secondboot']:
+ try:
+ os.remove(os.sep + f)
+ except OSError:
+ pass
+ # Generate random secret to send on activation
+ self.random = ''.join(random.choice(string.ascii_lowercase + string.digits) for _ in range(self.length))
+ # Send initalization message
+ self.REST.sendMessage('ogagent/started', {'mac': self.interface.mac, 'ip': self.interface.ip, 'secret': self.random, 'ostype': operations.osType, 'osversion': operations.osVersion})
+
+ def onDeactivation(self):
+ '''
+ Sends OGAgent stopping notification to OpenGnsys server
+ '''
+ logger.debug('onDeactivation')
+ self.REST.sendMessage('ogagent/stopped', {'mac': self.interface.mac, 'ip': self.interface.ip, 'ostype': operations.osType, 'osversion': operations.osVersion})
+
+ def processClientMessage(self, message, data):
+ logger.debug('Got OpenGnsys message from client: {}, data {}'.format(message, data))
+
+ def onLogin(self, userData):
+ '''
+ Sends session login notification to OpenGnsys server
+ '''
+ user, sep, language = userData.partition(',')
+ logger.debug('Received login for {} with language {}'.format(user, language))
+ self.loggedin = True
+ self.REST.sendMessage('ogagent/loggedin', {'ip': self.interface.ip, 'user': user, 'language': language, 'ostype': operations.osType, 'osversion': operations.osVersion})
+
+ def onLogout(self, user):
+ '''
+ Sends session logout notification to OpenGnsys server
+ '''
+ logger.debug('Received logout for {}'.format(user))
+ self.loggedin = False
+ self.REST.sendMessage('ogagent/loggedout', {'ip': self.interface.ip, 'user': user})
+
+ def process_ogclient(self, path, getParams, postParams, server):
+ '''
+ This method can be overriden to provide your own message proccessor, or better you can
+ implement a method that is called exactly as "process_" + path[0] (module name has been removed from path array) and this default processMessage will invoke it
+ * Example:
+ Imagine this invocation url (no matter if GET or POST): http://example.com:9999/Sample/mazinger/Z
+ The HTTP Server will remove "Sample" from path, parse arguments and invoke this method as this:
+ module.processMessage(["mazinger","Z"], getParams, postParams)
+
+ This method will process "mazinger", and look for a "self" method that is called "process_mazinger", and invoke it this way:
+ return self.process_mazinger(["Z"], getParams, postParams)
+
+ In the case path is empty (that is, the path is composed only by the module name, like in "http://example.com/Sample", the "process" method
+ will be invoked directly
+
+ The methods must return data that can be serialized to json (i.e. Ojects are not serializable to json, basic type are)
+ '''
+ if not path:
+ return "ok"
+ try:
+ operation = getattr(self, 'ogclient_' + path[0])
+ except Exception:
+ raise Exception('Message processor for "{}" not found'.format(path[0]))
+ return operation(path[1:], getParams, postParams)
+
+ def process_status(self, path, getParams, postParams, server):
+ '''
+ Returns client status.
+ '''
+ res = {'status': '', 'loggedin': self.loggedin}
+ if platform.system() == 'Linux': # GNU/Linux
+ # Check if it's OpenGnsys Client.
+ if os.path.exists('/scripts/oginit'):
+ # Check if OpenGnsys Client is busy.
+ if self.locked:
+ res['status'] = 'BSY'
+ else:
+ res['status'] = 'OPG'
+ else:
+ # Check if there is an active session.
+ res['status'] = 'LNX'
+ elif platform.system() == 'Windows': # Windows
+ # Check if there is an active session.
+ res['status'] = 'WIN'
+ elif platform.system() == 'Darwin': # Mac OS X ??
+ res['status'] = 'OSX'
+ return res
+
+ def process_reboot(self, path, getParams, postParams, server):
+ '''
+ Launches a system reboot operation.
+ '''
+ logger.debug('Received reboot operation')
+ self.checkSecret(server)
+ # Rebooting thread.
+ def rebt():
+ operations.reboot()
+ threading.Thread(target=rebt).start()
+ return {'op': 'launched'}
+
+ def process_poweroff(self, path, getParams, postParams, server):
+ '''
+ Launches a system power off operation.
+ '''
+ logger.debug('Received poweroff operation')
+ self.checkSecret(server)
+ # Powering off thread.
+ def pwoff():
+ time.sleep(2)
+ operations.poweroff()
+ threading.Thread(target=pwoff).start()
+ return {'op': 'launched'}
+
+ def process_script(self, path, getParams, postParams, server):
+ '''
+ Processes an script execution (script should be encoded in base64)
+ '''
+ logger.debug('Processing script request')
+ self.checkSecret(server)
+ # Decoding script.
+ script = urllib.unquote(postParams.get('script').decode('base64')).decode('utf8')
+ script = 'import subprocess; subprocess.check_output("""{}""",shell=True)'.format(script)
+ # Executing script.
+ if postParams.get('client', 'false') == 'false':
+ thr = ScriptExecutorThread(script)
+ thr.start()
+ else:
+ self.sendClientMessage('script', {'code': script})
+ return {'op': 'launched'}
+
+ def process_logoff(self, path, getParams, postParams, server):
+ '''
+ Closes user session.
+ '''
+ logger.debug('Received logoff operation')
+ self.checkSecret(server)
+ # Sending log off message to OGAgent client.
+ self.sendClientMessage('logoff', {})
+ return {'op': 'sended to client'}
+
+ def process_popup(self, path, getParams, postParams, server):
+ '''
+ Shows a message popup on the user's session.
+ '''
+ logger.debug('Received message operation')
+ self.checkSecret(server)
+ # Sending popup message to OGAgent client.
+ self.sendClientMessage('popup', postParams)
+ return {'op': 'launched'}
+
+ def process_client_popup(self, params):
+ self.REST.sendMessage('popup_done', params)
diff --git a/admin/Sources/Clients/ogagent/src/opengnsys/modules/server/__init__.py b/admin/Sources/Clients/ogagent/src/opengnsys/modules/server/__init__.py
new file mode 100644
index 00000000..e69de29b
diff --git a/admin/Sources/Clients/ogagent/src/opengnsys/operations.py b/admin/Sources/Clients/ogagent/src/opengnsys/operations.py
new file mode 100644
index 00000000..dcfa40cb
--- /dev/null
+++ b/admin/Sources/Clients/ogagent/src/opengnsys/operations.py
@@ -0,0 +1,50 @@
+# -*- coding: utf-8 -*-
+#
+# Copyright (c) 2014 Virtual Cable S.L.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without modification,
+# are permitted provided that the following conditions are met:
+#
+# * Redistributions of source code must retain the above copyright notice,
+# this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice,
+# this list of conditions and the following disclaimer in the documentation
+# and/or other materials provided with the distribution.
+# * Neither the name of Virtual Cable S.L. nor the names of its contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+'''
+@author: Adolfo Gómez, dkmaster at dkmon dot com
+'''
+# pylint: disable=unused-wildcard-import,wildcard-import
+
+from __future__ import unicode_literals
+
+import sys
+# Importing platform operations and getting operating system data.
+if sys.platform == 'win32':
+ from .windows.operations import * # @UnusedWildImport
+ osType = 'Windows'
+ osVersion = getWindowsVersion()
+else:
+ if sys.platform == 'darwin':
+ from .macos.operations import * # @UnusedWildImport
+ osType = 'MacOS'
+ osVersion = getMacosVersion().replace(',','')
+ else:
+ from .linux.operations import * # @UnusedWildImport
+ osType = 'Linux'
+ osVersion = getLinuxVersion().replace(',','')
diff --git a/admin/Sources/Clients/ogagent/src/opengnsys/scriptThread.py b/admin/Sources/Clients/ogagent/src/opengnsys/scriptThread.py
new file mode 100644
index 00000000..2a6779b4
--- /dev/null
+++ b/admin/Sources/Clients/ogagent/src/opengnsys/scriptThread.py
@@ -0,0 +1,51 @@
+# -*- coding: utf-8 -*-
+#
+# Copyright (c) 201 Virtual Cable S.L.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without modification,
+# are permitted provided that the following conditions are met:
+#
+# * Redistributions of source code must retain the above copyright notice,
+# this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice,
+# this list of conditions and the following disclaimer in the documentation
+# and/or other materials provided with the distribution.
+# * Neither the name of Virtual Cable S.L. nor the names of its contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+'''
+@author: Adolfo Gómez, dkmaster at dkmon dot com
+'''
+
+# pylint: disable-msg=E1101,W0703
+
+from opengnsys.log import logger
+
+import threading
+import six
+
+
+class ScriptExecutorThread(threading.Thread):
+ def __init__(self, script):
+ super(ScriptExecutorThread, self).__init__()
+ self.script = script
+
+ def run(self):
+ try:
+ logger.debug('Executing script: {}'.format(self.script))
+ six.exec_(self.script, globals(), None)
+ except Exception as e:
+ logger.error('Error executing script: {}'.format(e))
diff --git a/admin/Sources/Clients/ogagent/src/opengnsys/service.py b/admin/Sources/Clients/ogagent/src/opengnsys/service.py
new file mode 100644
index 00000000..4a44028e
--- /dev/null
+++ b/admin/Sources/Clients/ogagent/src/opengnsys/service.py
@@ -0,0 +1,249 @@
+# -*- coding: utf-8 -*-
+#
+# Copyright (c) 2014 Virtual Cable S.L.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without modification,
+# are permitted provided that the following conditions are met:
+#
+# * Redistributions of source code must retain the above copyright notice,
+# this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice,
+# this list of conditions and the following disclaimer in the documentation
+# and/or other materials provided with the distribution.
+# * Neither the name of Virtual Cable S.L. nor the names of its contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+'''
+@author: Adolfo Gómez, dkmaster at dkmon dot com
+'''
+from __future__ import unicode_literals
+
+from .log import logger
+from .config import readConfig
+from .utils import exceptionToMessage
+
+from . import ipc
+from . import httpserver
+from .loader import loadModules
+
+import socket
+import time
+import json
+import six
+
+IPC_PORT = 10398
+
+
+class CommonService(object):
+ isAlive = True
+ ipc = None
+ httpServer = None
+ modules = None
+
+ def __init__(self):
+ logger.info('----------------------------------------')
+ logger.info('Initializing OpenGnsys Agent')
+
+ # Read configuration file before proceding & ensures minimal config is there
+
+ self.config = readConfig()
+
+ # Get opengnsys section as dict
+ cfg = dict(self.config.items('opengnsys'))
+
+ # Set up log level
+ logger.setLevel(cfg.get('log', 'INFO'))
+
+
+ logger.debug('Loaded configuration from opengnsys.cfg:')
+ for section in self.config.sections():
+ logger.debug('Section {} = {}'.format(section, self.config.items(section)))
+
+
+ if logger.logger.isWindows():
+ # Logs will also go to windows event log for services
+ logger.logger.serviceLogger = True
+
+ self.address = (cfg.get('address', '0.0.0.0'), int(cfg.get('port', '10997')))
+ self.ipcport = int(cfg.get('ipc_port', IPC_PORT))
+
+ self.timeout = int(cfg.get('timeout', '20'))
+
+ logger.debug('Socket timeout: {}'.format(self.timeout))
+ socket.setdefaulttimeout(self.timeout)
+
+ # Now load modules
+ self.modules = loadModules(self)
+ logger.debug('Modules: {}'.format(list(v.name for v in self.modules)))
+
+ def stop(self):
+ '''
+ Requests service termination
+ '''
+ self.isAlive = False
+
+ # ********************************
+ # * Internal messages processors *
+ # ********************************
+ def notifyLogin(self, username):
+ for v in self.modules:
+ try:
+ logger.debug('Notifying login of user {} to module {}'.format(username, v.name))
+ v.onLogin(username)
+ except Exception as e:
+ logger.error('Got exception {} processing login message on {}'.format(e, v.name))
+
+ def notifyLogout(self, username):
+ for v in self.modules:
+ try:
+ logger.debug('Notifying logout of user {} to module {}'.format(username, v.name))
+ v.onLogout(username)
+ except Exception as e:
+ logger.error('Got exception {} processing logout message on {}'.format(e, v.name))
+
+ def notifyMessage(self, data):
+ module, message, data = data.split('\0')
+ for v in self.modules:
+ if v.name == module: # Case Sensitive!!!!
+ try:
+ logger.debug('Notifying message {} to module {} with json data {}'.format(message, v.name, data))
+ v.processClientMessage(message, json.loads(data))
+ return
+ except Exception as e:
+ logger.error('Got exception {} processing generic message on {}'.format(e, v.name))
+
+ logger.error('Module {} not found, messsage {} not sent'.format(module, message))
+
+
+ def clientMessageProcessor(self, msg, data):
+ '''
+ Callback, invoked from IPC, on its own thread (not the main thread).
+ This thread will "block" communication with agent untill finished, but this should be no problem
+ '''
+ logger.debug('Got message {}'.format(msg))
+
+ if msg == ipc.REQ_LOGIN:
+ self.notifyLogin(data)
+ elif msg == ipc.REQ_LOGOUT:
+ self.notifyLogout(data)
+ elif msg == ipc.REQ_MESSAGE:
+ self.notifyMessage(data)
+
+ def initialize(self):
+ # ******************************************
+ # * Initialize listeners, modules, etc...
+ # ******************************************
+
+ if six.PY3 is False:
+ import threading
+ threading._DummyThread._Thread__stop = lambda x: 42
+
+ logger.debug('Starting IPC listener at {}'.format(IPC_PORT))
+ self.ipc = ipc.ServerIPC(self.ipcport, clientMessageProcessor=self.clientMessageProcessor)
+ self.ipc.start()
+
+ # And http threaded server
+ self.httpServer = httpserver.HTTPServerThread(self.address, self)
+ self.httpServer.start()
+
+ # And lastly invoke modules activation
+ validMods = []
+ for mod in self.modules:
+ try:
+ logger.debug('Activating module {}'.format(mod.name))
+ mod.activate()
+ validMods.append(mod)
+ except Exception as e:
+ logger.exception()
+ logger.error("Activation of {} failed: {}".format(mod.name, exceptionToMessage(e)))
+
+ self.modules[:] = validMods # copy instead of assignment
+
+ logger.debug('Modules after activation: {}'.format(list(v.name for v in self.modules)))
+
+ def terminate(self):
+ # First invoke deactivate on modules
+ for mod in reversed(self.modules):
+ try:
+ logger.debug('Deactivating module {}'.format(mod.name))
+ mod.deactivate()
+ except Exception as e:
+ logger.exception()
+ logger.error("Deactivation of {} failed: {}".format(mod.name, exceptionToMessage(e)))
+
+ # Remove IPC threads
+ if self.ipc is not None:
+ try:
+ self.ipc.stop()
+ except Exception:
+ logger.error('Couln\'t stop ipc server')
+
+ if self.httpServer is not None:
+ try:
+ self.httpServer.stop()
+ except Exception:
+ logger.error('Couln\'t stop RESTApi server')
+
+ self.notifyStop()
+
+ # ****************************************
+ # Methods that CAN BE overridden by agents
+ # ****************************************
+ def doWait(self, miliseconds):
+ '''
+ Invoked to wait a bit
+ CAN be OVERRIDDEN
+ '''
+ time.sleep(float(miliseconds) / 1000)
+
+ def notifyStop(self):
+ '''
+ Overridden to log stop
+ '''
+ logger.info('Service is being stopped')
+
+ # ***************************************************
+ # * Helpers, convenient methods to facilitate comms *
+ # ***************************************************
+ def sendClientMessage(self, toModule, message, data):
+ '''
+ Sends a message to the clients using IPC
+ The data is converted to json, so ensure that it is serializable.
+ All IPC is asynchronous, so if you expect a response, this will be sent by client using another message
+
+ @param toModule: Module that will receive this message
+ @param message: Message to send
+ @param data: data to send
+ '''
+ self.ipc.sendMessageMessage('\0'.join((toModule, message, json.dumps(data))))
+
+ def sendScriptMessage(self, script):
+ '''
+ Sends an script to be executed by client
+ '''
+ self.ipc.sendScriptMessage(script)
+
+ def sendLogoffMessage(self):
+ '''
+ Sends a logoff message to client
+ '''
+ self.ipc.sendLoggofMessage()
+
+ def sendPopupMessage(self, title, message):
+ '''
+ Sends a poup box to be displayed by client
+ '''
+ self.ipc.sendPopupMessage(title, message)
diff --git a/admin/Sources/Clients/ogagent/src/opengnsys/utils.py b/admin/Sources/Clients/ogagent/src/opengnsys/utils.py
new file mode 100644
index 00000000..9480a6ab
--- /dev/null
+++ b/admin/Sources/Clients/ogagent/src/opengnsys/utils.py
@@ -0,0 +1,72 @@
+# -*- coding: utf-8 -*-
+#
+# Copyright (c) 2014 Virtual Cable S.L.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without modification,
+# are permitted provided that the following conditions are met:
+#
+# * Redistributions of source code must retain the above copyright notice,
+# this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice,
+# this list of conditions and the following disclaimer in the documentation
+# and/or other materials provided with the distribution.
+# * Neither the name of Virtual Cable S.L. nor the names of its contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+'''
+@author: Adolfo Gómez, dkmaster at dkmon dot com
+'''
+from __future__ import unicode_literals
+
+import sys
+import six
+
+if sys.platform == 'win32':
+ _fromEncoding = 'windows-1250'
+else:
+ _fromEncoding = 'utf-8'
+
+
+def toUnicode(msg):
+ try:
+ if not isinstance(msg, six.text_type):
+ if isinstance(msg, six.binary_type):
+ return msg.decode(_fromEncoding, 'ignore')
+ return six.text_type(msg)
+ else:
+ return msg
+ except Exception:
+ try:
+ return six.text_type(msg)
+ except Exception:
+ return ''
+
+
+def exceptionToMessage(e):
+ msg = ''
+ for arg in e.args:
+ if isinstance(arg, Exception):
+ msg = msg + exceptionToMessage(arg)
+ else:
+ msg = msg + toUnicode(arg) + '. '
+ return msg
+
+
+class Bunch(dict):
+ def __init__(self, **kw):
+ dict.__init__(self, kw)
+ self.__dict__ = self
+
diff --git a/admin/Sources/Clients/ogagent/src/opengnsys/windows/OGAgentService.py b/admin/Sources/Clients/ogagent/src/opengnsys/windows/OGAgentService.py
new file mode 100644
index 00000000..71716d78
--- /dev/null
+++ b/admin/Sources/Clients/ogagent/src/opengnsys/windows/OGAgentService.py
@@ -0,0 +1,124 @@
+# -*- coding: utf-8 -*-
+#
+# Copyright (c) 2014 Virtual Cable S.L.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without modification,
+# are permitted provided that the following conditions are met:
+#
+# * Redistributions of source code must retain the above copyright notice,
+# this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice,
+# this list of conditions and the following disclaimer in the documentation
+# and/or other materials provided with the distribution.
+# * Neither the name of Virtual Cable S.L. nor the names of its contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+'''
+@author: Adolfo Gómez, dkmaster at dkmon dot com
+'''
+from __future__ import unicode_literals
+# pylint: disable=unused-wildcard-import, wildcard-import
+
+import win32serviceutil # @UnresolvedImport, pylint: disable=import-error
+import win32service # @UnresolvedImport, pylint: disable=import-error
+import win32security # @UnresolvedImport, pylint: disable=import-error
+import win32net # @UnresolvedImport, pylint: disable=import-error
+import win32event # @UnresolvedImport, pylint: disable=import-error
+import win32com.client # @UnresolvedImport, @UnusedImport, pylint: disable=import-error
+import pythoncom # @UnresolvedImport, pylint: disable=import-error
+import servicemanager # @UnresolvedImport, pylint: disable=import-error
+import os
+
+from opengnsys import operations
+from opengnsys.service import CommonService
+
+from opengnsys.log import logger
+
+class OGAgentSvc(win32serviceutil.ServiceFramework, CommonService):
+ '''
+ This class represents a Windows Service for managing Agent interactions
+ with OpenGnsys Server
+ '''
+ _svc_name_ = "OGAgent"
+ _svc_display_name_ = "OpenGnsys Agent Service"
+ _svc_description_ = "OpenGnsys Agent for Operating Systems"
+ # 'System Event Notification' is the SENS service
+ _svc_deps_ = ['EventLog']
+
+ def __init__(self, args):
+ win32serviceutil.ServiceFramework.__init__(self, args)
+ CommonService.__init__(self)
+ self.hWaitStop = win32event.CreateEvent(None, 1, 0, None)
+ self._user = None
+
+ def SvcStop(self):
+ self.ReportServiceStatus(win32service.SERVICE_STOP_PENDING)
+ self.isAlive = False
+ win32event.SetEvent(self.hWaitStop)
+
+ SvcShutdown = SvcStop
+
+ def notifyStop(self):
+ servicemanager.LogMsg(servicemanager.EVENTLOG_INFORMATION_TYPE,
+ servicemanager.PYS_SERVICE_STOPPED,
+ (self._svc_name_, ''))
+
+ def doWait(self, miliseconds):
+ win32event.WaitForSingleObject(self.hWaitStop, miliseconds)
+
+ def SvcDoRun(self):
+ '''
+ Main service loop
+ '''
+ try:
+ logger.debug('running SvcDoRun')
+ servicemanager.LogMsg(servicemanager.EVENTLOG_INFORMATION_TYPE,
+ servicemanager.PYS_SERVICE_STARTED,
+ (self._svc_name_, ''))
+
+ # call the CoInitialize to allow the registration to run in an other
+ # thread
+ logger.debug('Initializing com...')
+ pythoncom.CoInitialize()
+
+ # Initialize remaining service data
+ self.initialize()
+ except Exception: # Any init exception wil be caught, service must be then restarted
+ logger.exception()
+ logger.debug('Exiting service with failure status')
+ os._exit(-1) # pylint: disable=protected-access
+
+ # *********************
+ # * Main Service loop *
+ # *********************
+ try:
+ while self.isAlive:
+ # Pumps & processes any waiting messages
+ pythoncom.PumpWaitingMessages()
+ win32event.WaitForSingleObject(self.hWaitStop, 1000)
+ except Exception as e:
+ logger.error('Caught exception on main loop: {}'.format(e))
+
+ logger.debug('Exited main loop, deregistering SENS')
+
+ self.terminate() # Ends IPC servers
+
+ self.notifyStop()
+
+
+if __name__ == '__main__':
+
+ win32serviceutil.HandleCommandLine(OGAgentSvc)
diff --git a/admin/Sources/Clients/ogagent/src/opengnsys/windows/__init__.py b/admin/Sources/Clients/ogagent/src/opengnsys/windows/__init__.py
new file mode 100644
index 00000000..e662942e
--- /dev/null
+++ b/admin/Sources/Clients/ogagent/src/opengnsys/windows/__init__.py
@@ -0,0 +1,39 @@
+# -*- coding: utf-8 -*-
+#
+# Copyright (c) 2014 Virtual Cable S.L.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without modification,
+# are permitted provided that the following conditions are met:
+#
+# * Redistributions of source code must retain the above copyright notice,
+# this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice,
+# this list of conditions and the following disclaimer in the documentation
+# and/or other materials provided with the distribution.
+# * Neither the name of Virtual Cable S.L. nor the names of its contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+'''
+@author: Adolfo Gómez, dkmaster at dkmon dot com
+'''
+from __future__ import unicode_literals
+
+import os
+import sys
+
+# Change to application directory.
+os.chdir(os.path.dirname(sys.argv[0]))
+
diff --git a/admin/Sources/Clients/ogagent/src/opengnsys/windows/log.py b/admin/Sources/Clients/ogagent/src/opengnsys/windows/log.py
new file mode 100644
index 00000000..745fd03f
--- /dev/null
+++ b/admin/Sources/Clients/ogagent/src/opengnsys/windows/log.py
@@ -0,0 +1,77 @@
+# -*- coding: utf-8 -*-
+#
+# Copyright (c) 2014 Virtual Cable S.L.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without modification,
+# are permitted provided that the following conditions are met:
+#
+# * Redistributions of source code must retain the above copyright notice,
+# this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice,
+# this list of conditions and the following disclaimer in the documentation
+# and/or other materials provided with the distribution.
+# * Neither the name of Virtual Cable S.L. nor the names of its contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+'''
+@author: Adolfo Gómez, dkmaster at dkmon dot com
+'''
+from __future__ import unicode_literals
+
+import servicemanager # @UnresolvedImport, pylint: disable=import-error
+import logging
+import os
+import tempfile
+
+# Valid logging levels, from UDS Broker (uds.core.utils.log)
+OTHER, DEBUG, INFO, WARN, ERROR, FATAL = (10000 * (x + 1) for x in range(6))
+
+
+class LocalLogger(object):
+ def __init__(self):
+ # tempdir is different for "user application" and "service"
+ # service wil get c:\windows\temp, while user will get c:\users\XXX\temp
+ logging.basicConfig(
+ filename=os.path.join(tempfile.gettempdir(), 'opengnsys.log'),
+ filemode='a',
+ format='%(levelname)s %(asctime)s %(message)s',
+ level=logging.DEBUG
+ )
+ self.logger = logging.getLogger('opengnsys')
+ self.serviceLogger = False
+
+ def log(self, level, message):
+ # Debug messages are logged to a file
+ # our loglevels are 10000 (other), 20000 (debug), ....
+ # logging levels are 10 (debug), 20 (info)
+ # OTHER = logging.NOTSET
+ self.logger.log(level / 1000 - 10, message)
+
+ if level < INFO or self.serviceLogger is False: # Only information and above will be on event log
+ return
+
+ if level < WARN: # Info
+ servicemanager.LogInfoMsg(message)
+ elif level < ERROR: # WARN
+ servicemanager.LogWarningMsg(message)
+ else: # Error & Fatal
+ servicemanager.LogErrorMsg(message)
+
+ def isWindows(self):
+ return True
+
+ def isLinux(self):
+ return False
diff --git a/admin/Sources/Clients/ogagent/src/opengnsys/windows/operations.py b/admin/Sources/Clients/ogagent/src/opengnsys/windows/operations.py
new file mode 100644
index 00000000..aa83c943
--- /dev/null
+++ b/admin/Sources/Clients/ogagent/src/opengnsys/windows/operations.py
@@ -0,0 +1,261 @@
+# -*- coding: utf-8 -*-
+#
+# Copyright (c) 2014 Virtual Cable S.L.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without modification,
+# are permitted provided that the following conditions are met:
+#
+# * Redistributions of source code must retain the above copyright notice,
+# this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice,
+# this list of conditions and the following disclaimer in the documentation
+# and/or other materials provided with the distribution.
+# * Neither the name of Virtual Cable S.L. nor the names of its contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+'''
+@author: Adolfo Gómez, dkmaster at dkmon dot com
+'''
+from __future__ import unicode_literals
+
+import os
+import locale
+import subprocess
+import ctypes
+from ctypes.wintypes import DWORD, LPCWSTR
+import win32com.client # @UnresolvedImport, pylint: disable=import-error
+import win32net # @UnresolvedImport, pylint: disable=import-error
+import win32security # @UnresolvedImport, pylint: disable=import-error
+import win32api # @UnresolvedImport, pylint: disable=import-error
+import win32con # @UnresolvedImport, pylint: disable=import-error
+
+from opengnsys import utils
+from opengnsys.log import logger
+
+
+def getErrorMessage(res=0):
+ msg = win32api.FormatMessage(res)
+ return msg.decode('windows-1250', 'ignore')
+
+
+def getComputerName():
+ return win32api.GetComputerNameEx(win32con.ComputerNamePhysicalDnsHostname)
+
+
+def getNetworkInfo():
+ '''
+ Obtains a list of network interfaces
+ @return: A "generator" of elements, that are dict-as-object, with this elements:
+ name: Name of the interface
+ mac: mac of the interface
+ ip: ip of the interface
+ '''
+ obj = win32com.client.Dispatch("WbemScripting.SWbemLocator")
+ wmobj = obj.ConnectServer("localhost", "root\cimv2")
+ adapters = wmobj.ExecQuery("Select * from Win32_NetworkAdapterConfiguration where IpEnabled=True")
+ try:
+ for obj in adapters:
+ if obj.DefaultIPGateway is None: # Skip adapters without default router
+ continue
+ for ip in obj.IPAddress:
+ if ':' in ip: # Is IPV6, skip this
+ continue
+ if ip is None or ip == '' or ip.startswith('169.254') or ip.startswith('0.'): # If single link ip, or no ip
+ continue
+ logger.debug('Net config found: {}=({}, {})'.format(obj.Caption, obj.MACAddress, ip))
+ yield utils.Bunch(name=obj.Caption, mac=obj.MACAddress, ip=ip)
+ except Exception:
+ return
+
+
+def getDomainName():
+ '''
+ Will return the domain name if we belong a domain, else None
+ (if part of a network group, will also return None)
+ '''
+ # Status:
+ # 0 = Unknown
+ # 1 = Unjoined
+ # 2 = Workgroup
+ # 3 = Domain
+ domain, status = win32net.NetGetJoinInformation()
+ if status != 3:
+ domain = None
+
+ return domain
+
+
+def getWindowsVersion():
+ '''
+ Returns Windows version.
+ '''
+ import _winreg
+ reg = _winreg.OpenKey(_winreg.HKEY_LOCAL_MACHINE, 'SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion')
+ try:
+ data = '{} {}'.format(_winreg.QueryValueEx(reg, 'ProductName')[0], _winreg.QueryValueEx(reg, 'ReleaseId')[0])
+ except Exception:
+ data = '{} {}'.format(_winreg.QueryValueEx(reg, 'ProductName')[0], _winreg.QueryValueEx(reg, 'CurrentBuildNumber')[0])
+ reg.Close()
+ return data
+
+
+EWX_LOGOFF = 0x00000000
+EWX_SHUTDOWN = 0x00000001
+EWX_REBOOT = 0x00000002
+EWX_FORCE = 0x00000004
+EWX_POWEROFF = 0x00000008
+EWX_FORCEIFHUNG = 0x00000010
+
+
+def reboot(flags=EWX_FORCEIFHUNG | EWX_REBOOT):
+ hproc = win32api.GetCurrentProcess()
+ htok = win32security.OpenProcessToken(hproc, win32security.TOKEN_ADJUST_PRIVILEGES | win32security.TOKEN_QUERY)
+ privs = ((win32security.LookupPrivilegeValue(None, win32security.SE_SHUTDOWN_NAME), win32security.SE_PRIVILEGE_ENABLED),)
+ win32security.AdjustTokenPrivileges(htok, 0, privs)
+ win32api.ExitWindowsEx(flags, 0)
+
+def poweroff(flags=0):
+ '''
+ Simple poweroff command.
+ '''
+ reboot(flags=EWX_FORCEIFHUNG | EWX_SHUTDOWN)
+
+def logoff():
+ win32api.ExitWindowsEx(EWX_LOGOFF)
+
+
+def renameComputer(newName):
+ # Needs admin privileges to work
+ if ctypes.windll.kernel32.SetComputerNameExW(DWORD(win32con.ComputerNamePhysicalDnsHostname), LPCWSTR(newName)) == 0: # @UndefinedVariable
+ # win32api.FormatMessage -> returns error string
+ # win32api.GetLastError -> returns error code
+ # (just put this comment here to remember to log this when logger is available)
+ error = getErrorMessage()
+ computerName = win32api.GetComputerNameEx(win32con.ComputerNamePhysicalDnsHostname)
+ raise Exception('Error renaming computer from {} to {}: {}'.format(computerName, newName, error))
+
+
+NETSETUP_JOIN_DOMAIN = 0x00000001
+NETSETUP_ACCT_CREATE = 0x00000002
+NETSETUP_ACCT_DELETE = 0x00000004
+NETSETUP_WIN9X_UPGRADE = 0x00000010
+NETSETUP_DOMAIN_JOIN_IF_JOINED = 0x00000020
+NETSETUP_JOIN_UNSECURE = 0x00000040
+NETSETUP_MACHINE_PWD_PASSED = 0x00000080
+NETSETUP_JOIN_WITH_NEW_NAME = 0x00000400
+NETSETUP_DEFER_SPN_SET = 0x1000000
+
+
+def joinDomain(domain, ou, account, password, executeInOneStep=False):
+ '''
+ Joins machine to a windows domain
+ :param domain: Domain to join to
+ :param ou: Ou that will hold machine
+ :param account: Account used to join domain
+ :param password: Password of account used to join domain
+ :param executeInOneStep: If true, means that this machine has been renamed and wants to add NETSETUP_JOIN_WITH_NEW_NAME to request so we can do rename/join in one step.
+ '''
+ # If account do not have domain, include it
+ if '@' not in account and '\\' not in account:
+ if '.' in domain:
+ account = account + '@' + domain
+ else:
+ account = domain + '\\' + account
+
+ # Do log
+ flags = NETSETUP_ACCT_CREATE | NETSETUP_DOMAIN_JOIN_IF_JOINED | NETSETUP_JOIN_DOMAIN
+
+ if executeInOneStep:
+ flags |= NETSETUP_JOIN_WITH_NEW_NAME
+
+ flags = DWORD(flags)
+
+ domain = LPCWSTR(domain)
+
+ # Must be in format "ou=.., ..., dc=...,"
+ ou = LPCWSTR(ou) if ou is not None and ou != '' else None
+ account = LPCWSTR(account)
+ password = LPCWSTR(password)
+
+ res = ctypes.windll.netapi32.NetJoinDomain(None, domain, ou, account, password, flags)
+ # Machine found in another ou, use it and warn this on log
+ if res == 2224:
+ flags = DWORD(NETSETUP_DOMAIN_JOIN_IF_JOINED | NETSETUP_JOIN_DOMAIN)
+ res = ctypes.windll.netapi32.NetJoinDomain(None, domain, None, account, password, flags)
+ if res != 0:
+ # Log the error
+ error = getErrorMessage(res)
+ if res == 1355:
+ error = "DC Is not reachable"
+ print('{} {}'.format(res, error))
+ raise Exception('Error joining domain {}, with credentials {}/*****{}: {}, {}'.format(domain.value, account.value, ', under OU {}'.format(ou.value) if ou.value is not None else '', res, error))
+
+
+def changeUserPassword(user, oldPassword, newPassword):
+ computerName = LPCWSTR(getComputerName())
+ user = LPCWSTR(user)
+ oldPassword = LPCWSTR(oldPassword)
+ newPassword = LPCWSTR(newPassword)
+
+ res = ctypes.windll.netapi32.NetUserChangePassword(computerName, user, oldPassword, newPassword)
+
+ if res != 0:
+ # Log the error, and raise exception to parent
+ error = getErrorMessage()
+ raise Exception('Error changing password for user {}: {}'.format(user.value, error))
+
+
+class LASTINPUTINFO(ctypes.Structure):
+ _fields_ = [
+ ('cbSize', ctypes.c_uint),
+ ('dwTime', ctypes.c_uint),
+ ]
+
+
+def initIdleDuration(atLeastSeconds):
+ '''
+ In windows, there is no need to set screensaver
+ '''
+ pass
+
+
+def getIdleDuration():
+ lastInputInfo = LASTINPUTINFO()
+ lastInputInfo.cbSize = ctypes.sizeof(lastInputInfo)
+ ctypes.windll.user32.GetLastInputInfo(ctypes.byref(lastInputInfo))
+ millis = ctypes.windll.kernel32.GetTickCount() - lastInputInfo.dwTime # @UndefinedVariable
+ return millis / 1000.0
+
+
+def getCurrentUser():
+ '''
+ Returns current logged in username
+ '''
+ return os.environ['USERNAME']
+
+
+def getSessionLanguage():
+ '''
+ Returns the user's session language
+ '''
+ return locale.getdefaultlocale()[0]
+
+
+def showPopup(title, message):
+ '''
+ Displays a message box on user's session (during 1 min).
+ '''
+ return subprocess.call('mshta "javascript:var sh=new ActiveXObject(\'WScript.Shell\'); sh.Popup( \'{}\', 60, \'{}\', 64); close()"'.format(message.encode('unicode_escape'), title.encode('unicode_escape')), shell=True)
diff --git a/admin/Sources/Clients/ogagent/src/opengnsys/workers/__init__.py b/admin/Sources/Clients/ogagent/src/opengnsys/workers/__init__.py
new file mode 100644
index 00000000..f2bcd7d2
--- /dev/null
+++ b/admin/Sources/Clients/ogagent/src/opengnsys/workers/__init__.py
@@ -0,0 +1,2 @@
+from .server_worker import ServerWorker
+from .client_worker import ClientWorker
diff --git a/admin/Sources/Clients/ogagent/src/opengnsys/workers/client_worker.py b/admin/Sources/Clients/ogagent/src/opengnsys/workers/client_worker.py
new file mode 100644
index 00000000..6a083804
--- /dev/null
+++ b/admin/Sources/Clients/ogagent/src/opengnsys/workers/client_worker.py
@@ -0,0 +1,114 @@
+# -*- coding: utf-8 -*-
+#
+# Copyright (c) 2014 Virtual Cable S.L.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without modification,
+# are permitted provided that the following conditions are met:
+#
+# * Redistributions of source code must retain the above copyright notice,
+# this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice,
+# this list of conditions and the following disclaimer in the documentation
+# and/or other materials provided with the distribution.
+# * Neither the name of Virtual Cable S.L. nor the names of its contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+'''
+@author: Adolfo Gómez, dkmaster at dkmon dot com
+'''
+# pylint: disable=unused-wildcard-import,wildcard-import
+from __future__ import unicode_literals
+
+class ClientWorker(object):
+ '''
+ A ServerWorker is a server module that "works" for service
+ Most method are invoked inside their own thread, except onActivation & onDeactivation.
+ This two methods are invoked inside main service thread, take that into account when creating them
+
+ * You must provide a module name (override name on your class), so we can identify the module by a "valid" name.
+ A valid name is like a valid python variable (do not use spaces, etc...)
+ * The name of the module is used as REST message destination id:
+ https://sampleserver:8888/[name]/....
+ Remember that module names and REST path are case sensitive!!!
+
+ '''
+ name = None
+ service = None
+
+ def __init__(self, service):
+ self.service = service
+
+ def activate(self):
+ '''
+ Convenient method to wrap onActivation, so we can include easyly custom common logic for activation in a future
+ '''
+ self.onActivation()
+
+ def deactivate(self):
+ '''
+ Convenient method to wrap onActivation, so we can include easyly custom common logic for deactivation in a future
+ '''
+ self.onDeactivation()
+
+ def processMessage(self, message, params):
+ '''
+ This method can be overriden to provide your own message proccessor, or better you can
+ implement a method that is called "process_" + message and this default processMessage will invoke it
+ * Example:
+ We got a message from OGAgent "Mazinger", with json params
+ module.processMessage("mazinger", jsonParams)
+
+ This method will process "mazinguer", and look for a "self" method that is called "process_mazinger", and invoke it this way:
+ return self.process_mazinger(jsonParams)
+
+ The methods must return data that can be serialized to json (i.e. Ojects are not serializable to json, basic type are)
+ '''
+ try:
+ operation = getattr(self, 'process_' + message)
+ except Exception:
+ raise Exception('Message processor for "{}" not found'.format(message))
+
+ return operation(params)
+
+ def onActivation(self):
+ '''
+ Invoked by Service for activation.
+ This MUST be overridden by modules!
+ This method is invoked inside main thread, so if it "hangs", complete service will hang
+ This should be no problem, but be advised about this
+ '''
+ pass
+
+ def onDeactivation(self):
+ '''
+ Invoked by Service before unloading service
+ This MUST be overridden by modules!
+ This method is invoked inside main thread, so if it "hangs", complete service will hang
+ This should be no problem, but be advised about this
+ '''
+ pass
+
+ # *************************************
+ # * Helper, convenient helper methods *
+ # *************************************
+ def sendServerMessage(self, message, data):
+ '''
+ Sends a message to connected ipc clients
+ By convenience, it uses the "current" moduel name as destination module name also.
+ If you need to send a message to a different module, you can use self.service.sendClientMessage(module, message, data) instead
+ og this helmer
+ '''
+ self.service.ipc.sendMessage(self.name, message, data)
+
\ No newline at end of file
diff --git a/admin/Sources/Clients/ogagent/src/opengnsys/workers/server_worker.py b/admin/Sources/Clients/ogagent/src/opengnsys/workers/server_worker.py
new file mode 100644
index 00000000..141d657c
--- /dev/null
+++ b/admin/Sources/Clients/ogagent/src/opengnsys/workers/server_worker.py
@@ -0,0 +1,186 @@
+# -*- coding: utf-8 -*-
+#
+# Copyright (c) 2014 Virtual Cable S.L.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without modification,
+# are permitted provided that the following conditions are met:
+#
+# * Redistributions of source code must retain the above copyright notice,
+# this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice,
+# this list of conditions and the following disclaimer in the documentation
+# and/or other materials provided with the distribution.
+# * Neither the name of Virtual Cable S.L. nor the names of its contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+'''
+@author: Adolfo Gómez, dkmaster at dkmon dot com
+'''
+# pylint: disable=unused-wildcard-import,wildcard-import
+from __future__ import unicode_literals
+
+class ServerWorker(object):
+ '''
+ A ServerWorker is a server module that "works" for service
+ Most method are invoked inside their own thread, except onActivation & onDeactivation.
+ This two methods are invoked inside main service thread, take that into account when creating them
+
+ * You must provide a module name (override name on your class), so we can identify the module by a "valid" name.
+ A valid name is like a valid python variable (do not use spaces, etc...)
+ * The name of the module is used as REST message destination id:
+ https://sampleserver:8888/[name]/....
+ Remember that module names and REST path are case sensitive!!!
+
+ '''
+ name = None
+ service = None
+ locked = False
+
+ def __init__(self, service):
+ self.service = service
+
+ def activate(self):
+ '''
+ Convenient method to wrap onActivation, so we can include easyly custom common logic for activation in a future
+ '''
+ self.onActivation()
+
+ def deactivate(self):
+ '''
+ Convenient method to wrap onActivation, so we can include easyly custom common logic for deactivation in a future
+ '''
+ self.onDeactivation()
+
+ def process(self, getParams, postParams, server):
+ '''
+ This method is invoked on a message received with an empty path (that means a message with only the module name, like in "http://example.com/Sample"
+ Override it if you expect messages with that pattern
+
+ Overriden method must return data that can be serialized to json (i.e. Ojects are not serializable to json, basic type are)
+ '''
+ raise NotImplementedError('Generic message processor is not supported')
+
+ def processServerMessage(self, path, getParams, postParams, server):
+ '''
+ This method can be overriden to provide your own message proccessor, or better you can
+ implement a method that is called exactly as "process_" + path[0] (module name has been removed from path array) and this default processMessage will invoke it
+ * Example:
+ Imagine this invocation url (no matter if GET or POST): http://example.com:9999/Sample/mazinger/Z
+ The HTTP Server will remove "Sample" from path, parse arguments and invoke this method as this:
+ module.processMessage(["mazinger","Z"], getParams, postParams)
+
+ This method will process "mazinguer", and look for a "self" method that is called "process_mazinger", and invoke it this way:
+ return self.process_mazinger(["Z"], getParams, postParams)
+
+ In the case path is empty (that is, the path is composed only by the module name, like in "http://example.com/Sample", the "process" method
+ will be invoked directly
+
+ The methods must return data that can be serialized to json (i.e. Ojects are not serializable to json, basic type are)
+ '''
+ if self.locked is True:
+ raise Exception('system is busy')
+
+ if len(path) == 0:
+ return self.process(getParams, postParams, server)
+ try:
+ operation = getattr(self, 'process_' + path[0])
+ except Exception:
+ raise Exception('Message processor for "{}" not found'.format(path[0]))
+
+ return operation(path[1:], getParams, postParams, server)
+
+
+ def processClientMessage(self, message, data):
+ '''
+ Invoked by Service when a client message is received (A message from user space Agent)
+
+ This method can be overriden to provide your own message proccessor, or better you can
+ implement a method that is called exactly "process_client_" + message (module name has been removed from path) and this default processMessage will invoke it
+ * Example:
+ We got a message from OGAgent "Mazinger", with json params
+ module.processClientMessage("mazinger", jsonParams)
+
+ This method will process "mazinguer", and look for a "self" method that is called "process_client_mazinger", and invoke it this way:
+ self.process_client_mazinger(jsonParams)
+
+ The methods returns nothing (client communications are done asynchronously)
+ '''
+ try:
+ operation = getattr(self, 'process_client_' + message)
+ except Exception:
+ raise Exception('Message processor for "{}" not found'.format(message))
+
+ operation(data)
+
+ # raise NotImplementedError('Got a client message but no proccessor is implemented')
+
+
+ def onActivation(self):
+ '''
+ Invoked by Service for activation.
+ This MUST be overridden by modules!
+ This method is invoked inside main thread, so if it "hangs", complete service will hang
+ This should be no problem, but be advised about this
+ '''
+ pass
+
+ def onDeactivation(self):
+ '''
+ Invoked by Service before unloading service
+ This MUST be overridden by modules!
+ This method is invoked inside main thread, so if it "hangs", complete service will hang
+ This should be no problem, but be advised about this
+ '''
+ pass
+
+
+ def onLogin(self, user):
+ '''
+ Invoked by Service when an user login is detected
+ This CAN be overridden by modules
+ This method is invoked whenever the client (user space agent) notifies the server (Service) that a user has logged in.
+ This method is run on its own thread
+ '''
+ pass
+
+ def onLogout(self, user):
+ '''
+ Invoked by Service when an user login is detected
+ This CAN be overridden by modules
+ This method is invoked whenever the client (user space agent) notifies the server (Service) that a user has logged in.
+ This method is run on its own thread
+ '''
+ pass
+
+ # *************************************
+ # * Helper, convenient helper methods *
+ # *************************************
+ def sendClientMessage(self, message, data):
+ '''
+ Sends a message to connected ipc clients
+ By convenience, it uses the "current" moduel name as destination module name also.
+ If you need to send a message to a different module, you can use self.service.sendClientMessage(module, message, data) instead
+ og this helmer
+ '''
+ self.service.sendClientMessage(self.name, message, data)
+
+ def sendScriptMessage(self, script):
+ self.service.sendScriptMessage(script)
+
+ def sendLogoffMessage(self):
+ self.service.sendLogoffMessage()
+
+ def sendPopupMessage(self):
+ self.service.sendPopupMessage()
diff --git a/admin/Sources/Clients/ogagent/src/prototypes/threaded_server.py b/admin/Sources/Clients/ogagent/src/prototypes/threaded_server.py
new file mode 100644
index 00000000..ed5583bf
--- /dev/null
+++ b/admin/Sources/Clients/ogagent/src/prototypes/threaded_server.py
@@ -0,0 +1,170 @@
+'''
+Created on Jul 9, 2015
+
+@author: dkmaster
+'''
+from __future__ import unicode_literals, print_function
+
+# Pydev can't parse "six.moves.xxxx" because it is loaded lazy
+from six.moves.socketserver import ThreadingMixIn # @UnresolvedImport
+from six.moves.SimpleHTTPServer import SimpleHTTPRequestHandler # @UnresolvedImport
+from six.moves.BaseHTTPServer import HTTPServer # @UnresolvedImport
+from six.moves.urllib.parse import unquote # @UnresolvedImport
+
+import json
+import threading
+import ssl
+
+import os.path
+import tempfile
+
+# For testing
+# --------------------
+CERTFILE = 'UDSActor.pem'
+
+
+def createSelfSignedCert(force=False):
+
+ certFile = os.path.join(tempfile.gettempdir(), CERTFILE)
+
+ if os.path.exists(certFile) and not force:
+ return certFile
+
+ certData = '''-----BEGIN PRIVATE KEY-----
+MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCb50K3mIznNklz
+yVAD7xSQOSJQ6+NPXj7U9/4zLZ+TvmbQ7RqUUsxbfxHbeRnoYTWV2nKk4+tHqmvz
+ujLSS/loFhTSMqtrLn7rowSYJoQhKOUkAiQlWkqCfItWgL5pJopDpNHFul9Rn3ds
+PMWQTiGeUNR4Y3RnBhr1Q1BsqAzf4m6zFUmgLPPmVLdF4uJ3Tuz8TSy2gWLs5aSr
+5do4WamwUfYjRSVMJECmwjUM4rQ8SQgg0sHBeBuDUGNBvBQFac1G7qUcMReeu8Zr
+DUtMsXma/l4rA8NB5CRmTrQbTBF4l+jb2BDFebDqDUK1Oqs9X35yOQfDOAFYHiix
+PX0IsXOZAgMBAAECggEBAJi3000RrIUZUp6Ph0gzPMuCjDEEwWiQA7CPNX1gpb8O
+dp0WhkDhUroWIaICYPSXtOwUTtVjRqivMoxPy1Thg3EIoGC/rdeSdlXRHMEGicwJ
+yVyalFnatr5Xzg5wkxVh4XMd0zeDt7e3JD7s0QLo5lm1CEzd77qz6lhzFic5/1KX
+bzdULtTlq60dazg2hEbcS4OmM1UMCtRVDAsOIUIZPL0M9j1C1d1iEdYnh2xshKeG
+/GOfo95xsgdMlGjtv3hUT5ryKVoEsu+36rGb4VfhPfUvvoVbRx5QZpW+QvxaYh5E
+Fi0JEROozFwG31Y++8El7J3yQko8cFBa1lYYUwwpNAECgYEAykT+GiM2YxJ4uVF1
+OoKiE9BD53i0IG5j87lGPnWqzEwYBwnqjEKDTou+uzMGz3MDV56UEFNho7wUWh28
+LpEkjJB9QgbsugjxIBr4JoL/rYk036e/6+U8I95lvYWrzb+rBMIkRDYI7kbQD/mQ
+piYUpuCkTymNAu2RisK6bBzJslkCgYEAxVE23OQvkCeOV8hJNPZGpJ1mDS+TiOow
+oOScMZmZpail181eYbAfMsCr7ri812lSj98NvA2GNVLpddil6LtS1cQ5p36lFBtV
+xQUMZiFz4qVbEak+izL+vPaev/mXXsOcibAIQ+qI/0txFpNhJjpaaSy6vRCBYFmc
+8pgSoBnBI0ECgYAUKCn2atnpp5aWSTLYgNosBU4vDA1PShD14dnJMaqyr0aZtPhF
+v/8b3btFJoGgPMLxgWEZ+2U4ju6sSFhPf7FXvLJu2QfQRkHZRDbEh7t5DLpTK4Fp
+va9vl6Ml7uM/HsGpOLuqfIQJUs87OFCc7iCSvMJDDU37I7ekT2GKkpfbCQKBgBrE
+0NeY0WcSJrp7/oqD2sOcYurpCG/rrZs2SIZmGzUhMxaa0vIXzbO59dlWELB8pmnE
+Tf20K//x9qA5OxDe0PcVPukdQlH+/1zSOYNliG44FqnHtyd1TJ/gKVtMBiAiE4uO
+aSClod5Yosf4SJbCFd/s5Iyfv52NqsAyp1w3Aj/BAoGAVCnEiGUfyHlIR+UH4zZW
+GXJMeqdZLfcEIszMxLePkml4gUQhoq9oIs/Kw+L1DDxUwzkXN4BNTlFbOSu9gzK1
+dhuIUGfS6RPL88U+ivC3A0y2jT43oUMqe3hiRt360UQ1GXzp2dMnR9odSRB1wHoO
+IOjEBZ8341/c9ZHc5PCGAG8=
+-----END PRIVATE KEY-----
+-----BEGIN CERTIFICATE-----
+MIID7zCCAtegAwIBAgIJAIrEIthCfxUCMA0GCSqGSIb3DQEBCwUAMIGNMQswCQYD
+VQQGEwJFUzEPMA0GA1UECAwGTWFkcmlkMREwDwYDVQQHDAhBbGNvcmNvbjEMMAoG
+A1UECgwDVURTMQ4wDAYDVQQLDAVBY3RvcjESMBAGA1UEAwwJVURTIEFjdG9yMSgw
+JgYJKoZIhvcNAQkBFhlzdXBwb3J0QHVkc2VudGVycHJpc2UuY29tMB4XDTE0MTAy
+NjIzNDEyNFoXDTI0MTAyMzIzNDEyNFowgY0xCzAJBgNVBAYTAkVTMQ8wDQYDVQQI
+DAZNYWRyaWQxETAPBgNVBAcMCEFsY29yY29uMQwwCgYDVQQKDANVRFMxDjAMBgNV
+BAsMBUFjdG9yMRIwEAYDVQQDDAlVRFMgQWN0b3IxKDAmBgkqhkiG9w0BCQEWGXN1
+cHBvcnRAdWRzZW50ZXJwcmlzZS5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAw
+ggEKAoIBAQCb50K3mIznNklzyVAD7xSQOSJQ6+NPXj7U9/4zLZ+TvmbQ7RqUUsxb
+fxHbeRnoYTWV2nKk4+tHqmvzujLSS/loFhTSMqtrLn7rowSYJoQhKOUkAiQlWkqC
+fItWgL5pJopDpNHFul9Rn3dsPMWQTiGeUNR4Y3RnBhr1Q1BsqAzf4m6zFUmgLPPm
+VLdF4uJ3Tuz8TSy2gWLs5aSr5do4WamwUfYjRSVMJECmwjUM4rQ8SQgg0sHBeBuD
+UGNBvBQFac1G7qUcMReeu8ZrDUtMsXma/l4rA8NB5CRmTrQbTBF4l+jb2BDFebDq
+DUK1Oqs9X35yOQfDOAFYHiixPX0IsXOZAgMBAAGjUDBOMB0GA1UdDgQWBBRShS90
+5lJTNvYPIEqP3GxWwG5iiDAfBgNVHSMEGDAWgBRShS905lJTNvYPIEqP3GxWwG5i
+iDAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBCwUAA4IBAQAU0Sp4gXhQmRVzq+7+
+vRFUkQuPj4Ga/d9r5Wrbg3hck3+5pwe9/7APoq0P/M0DBhQpiJKjrD6ydUevC+Y/
+43ZOJPhMlNw0o6TdQxOkX6FDwQanLLs7sfvJvqtVzYn3nuRFKT3dvl7Zg44QMw2M
+ay42q59fAcpB4LaDx/i7gOYSS5eca3lYW7j7YSr/+ozXK2KlgUkuCUHN95lOq+dF
+trmV9mjzM4CNPZqKSE7kpHRywgrXGPCO000NvEGSYf82AtgRSFKiU8NWLQSEPdcB
+k//2dsQZw2cRZ8DrC2B6Tb3M+3+CA6wVyqfqZh1SZva3LfGvq/C+u+ItguzPqNpI
+xtvM
+-----END CERTIFICATE-----'''
+ with open(certFile, "wt") as f:
+ f.write(certData)
+
+ return certFile
+# --------------
+
+
+class HTTPServerHandler(SimpleHTTPRequestHandler):
+ service = None
+ protocol_version = 'HTTP/1.1'
+ server_version = 'OpenGnsys Agent Server'
+ sys_version = ''
+
+ def sendJsonError(self, code, message):
+ self.send_response(code)
+ self.send_header('Content-type', 'application/json')
+ self.end_headers()
+ self.wfile.write(json.dumps({'error': message}))
+ return
+
+ def sendJsonResponse(self, data):
+ self.send_response(200)
+ data = json.dumps(data)
+ self.send_header('Content-type', 'application/json')
+ self.send_header('Content-Length', len(data))
+ self.end_headers()
+ # Send the html message
+ self.wfile.write(data)
+
+
+ # parseURL
+ def parseUrl(self):
+ # Very simple path & params splitter
+ path = self.path.split('?')[0][1:].split('/')
+
+ try:
+ params = dict((v[0], unquote(v[1])) for v in (v.split('=') for v in self.path.split('?')[1].split('&')))
+ except Exception:
+ params = {}
+
+ return (path, params)
+
+
+ def do_GET(self):
+ path, params = self.parseUrl()
+
+ self.sendJsonResponse({'path': path, 'params': params})
+
+ def do_POST(self):
+ path, getParams = self.parseUrl()
+
+ # Now post parameters, that are in JSON format
+
+
+
+
+
+class HTTPThreadingServer(ThreadingMixIn, HTTPServer):
+ pass
+
+class HTTPServerThread(threading.Thread):
+ def __init__(self, address, service):
+ super(self.__class__, self).__init__()
+
+ HTTPServerHandler.service = service
+
+ self.certFile = createSelfSignedCert()
+ self.server = HTTPThreadingServer(address, HTTPServerHandler)
+ self.server.socket = ssl.wrap_socket(self.server.socket, certfile=self.certFile, server_side=True)
+
+ def getServerUrl(self):
+ return 'https://{}:{}/{}'.format(self.server.server_address[0], self.server.server_address[1], HTTPServerHandler.uuid)
+
+ def stop(self):
+ self.server.shutdown()
+
+ def run(self):
+ self.server.serve_forever()
+
+
+if __name__ == '__main__':
+ thr = HTTPServerThread(('0.0.0.0', 8000), None)
+ print('Server started: {}'.format(thr))
+ thr.start()
+
+
\ No newline at end of file
diff --git a/admin/Sources/Clients/ogagent/src/setup.py b/admin/Sources/Clients/ogagent/src/setup.py
new file mode 100644
index 00000000..f80bf33b
--- /dev/null
+++ b/admin/Sources/Clients/ogagent/src/setup.py
@@ -0,0 +1,136 @@
+# -*- coding: utf-8 -*-
+#
+# Copyright (c) 2014 Virtual Cable S.L.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without modification,
+# are permitted provided that the following conditions are met:
+#
+# * Redistributions of source code must retain the above copyright notice,
+# this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice,
+# this list of conditions and the following disclaimer in the documentation
+# and/or other materials provided with the distribution.
+# * Neither the name of Virtual Cable S.L. nor the names of its contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+'''
+@author: Adolfo Gómez, dkmaster at dkmon dot com
+@author: Ramón M. Gómez, ramongomez at us dot es
+'''
+
+VERSION = '1.1.0'
+
+# ModuleFinder can't handle runtime changes to __path__, but win32com uses them
+try:
+ # py2exe 0.6.4 introduced a replacement modulefinder.
+ # This means we have to add package paths there, not to the built-in
+ # one. If this new modulefinder gets integrated into Python, then
+ # we might be able to revert this some day.
+ # if this doesn't work, try import modulefinder
+ try:
+ import py2exe.mf as modulefinder
+ except ImportError:
+ import modulefinder
+ import win32com, sys
+ for p in win32com.__path__[1:]:
+ modulefinder.AddPackagePath("win32com", p)
+ for extra in ["win32com.shell"]: # ,"win32com.mapi"
+ __import__(extra)
+ m = sys.modules[extra]
+ for p in m.__path__[1:]:
+ modulefinder.AddPackagePath(extra, p)
+except ImportError:
+ # no build path setup, no worries.
+ pass
+
+from distutils.core import setup
+import py2exe
+import sys
+import os
+
+sys.argv.append('py2exe')
+
+def get_requests_cert_file():
+ """Add Python requests or certifi .pem file for installers."""
+ import requests
+ f = os.path.join(os.path.dirname(requests.__file__), 'cacert.pem')
+ if not os.path.exists(f):
+ import certifi
+ f = os.path.join(os.path.dirname(certifi.__file__), 'cacert.pem')
+ return f
+
+
+class Target:
+
+ def __init__(self, **kw):
+ self.__dict__.update(kw)
+ # for the versioninfo resources
+ self.version = VERSION
+ self.name = 'OGAgentService'
+ self.description = 'OpenGnsys Agent Service'
+ self.author = 'Adolfo Gomez'
+ self.url = 'https://opengnsys.es/'
+ self.company_name = "OpenGnsys Project"
+ self.copyright = "(c) 2014 VirtualCable S.L.U."
+ self.name = "OpenGnsys Agent"
+
+# Now you need to pass arguments to setup
+# windows is a list of scripts that have their own UI and
+# thus don't need to run in a console.
+
+
+udsservice = Target(
+ description='OpenGnsys Agent Service',
+ modules=['opengnsys.windows.OGAgentService'],
+ icon_resources=[(0, 'img\\oga.ico'), (1, 'img\\oga.ico')],
+ cmdline_style='pywin32'
+)
+
+# Some test_modules are hidden to py2exe by six, we ensure that they appear on "includes"
+HIDDEN_BY_SIX = ['SocketServer', 'SimpleHTTPServer', 'urllib']
+
+setup(
+ windows=[
+ {
+ 'script': 'OGAgentUser.py',
+ 'icon_resources': [(0, 'img\\oga.ico'), (1, 'img\\oga.ico')]
+ },
+ ],
+ console=[
+ {
+ 'script': 'OGAServiceHelper.py'
+ }
+ ],
+ service=[udsservice],
+ data_files=[('', [get_requests_cert_file()]),('cfg', ['cfg/ogagent.cfg', 'cfg/ogclient.cfg'])],
+ options={
+ 'py2exe': {
+ 'bundle_files': 3,
+ 'compressed': True,
+ 'optimize': 2,
+ 'includes': ['sip', 'PyQt4', 'win32com.shell', 'requests', 'encodings', 'encodings.utf_8'] + HIDDEN_BY_SIX,
+ 'excludes': ['doctest', 'unittest'],
+ 'dll_excludes': ['msvcp90.dll'],
+ 'dist_dir': '..\\bin',
+ }
+ },
+ name='OpenGnsys Agent',
+ version=VERSION,
+ description='OpenGnsys Agent',
+ author='Adolfo Gomez',
+ author_email='agomez@virtualcable.es',
+ zipfile='OGAgent.zip',
+)
diff --git a/admin/Sources/Clients/ogagent/src/test_modules/__init__.py b/admin/Sources/Clients/ogagent/src/test_modules/__init__.py
new file mode 100644
index 00000000..e69de29b
diff --git a/admin/Sources/Clients/ogagent/src/test_modules/client/Sample1/__init__.py b/admin/Sources/Clients/ogagent/src/test_modules/client/Sample1/__init__.py
new file mode 100644
index 00000000..db174f0e
--- /dev/null
+++ b/admin/Sources/Clients/ogagent/src/test_modules/client/Sample1/__init__.py
@@ -0,0 +1,38 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+#
+# Copyright (c) 2014 Virtual Cable S.L.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without modification,
+# are permitted provided that the following conditions are met:
+#
+# * Redistributions of source code must retain the above copyright notice,
+# this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice,
+# this list of conditions and the following disclaimer in the documentation
+# and/or other materials provided with the distribution.
+# * Neither the name of Virtual Cable S.L. nor the names of its contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+'''
+@author: Adolfo Gómez, dkmaster at dkmon dot com
+'''
+from __future__ import unicode_literals
+
+from opengnsys.workers import ClientWorker
+
+class Sample1(ClientWorker):
+ name = 'Sample1'
+
diff --git a/admin/Sources/Clients/ogagent/src/test_modules/client/__init__.py b/admin/Sources/Clients/ogagent/src/test_modules/client/__init__.py
new file mode 100644
index 00000000..e69de29b
diff --git a/admin/Sources/Clients/ogagent/src/test_modules/server/Sample1/__init__.py b/admin/Sources/Clients/ogagent/src/test_modules/server/Sample1/__init__.py
new file mode 100644
index 00000000..189957e6
--- /dev/null
+++ b/admin/Sources/Clients/ogagent/src/test_modules/server/Sample1/__init__.py
@@ -0,0 +1,2 @@
+# Module must be imported on package, so we can initialize and load it
+from sample1 import Sample1
\ No newline at end of file
diff --git a/admin/Sources/Clients/ogagent/src/test_modules/server/Sample1/sample1.py b/admin/Sources/Clients/ogagent/src/test_modules/server/Sample1/sample1.py
new file mode 100644
index 00000000..61e405ec
--- /dev/null
+++ b/admin/Sources/Clients/ogagent/src/test_modules/server/Sample1/sample1.py
@@ -0,0 +1,40 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+#
+# Copyright (c) 2014 Virtual Cable S.L.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without modification,
+# are permitted provided that the following conditions are met:
+#
+# * Redistributions of source code must retain the above copyright notice,
+# this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice,
+# this list of conditions and the following disclaimer in the documentation
+# and/or other materials provided with the distribution.
+# * Neither the name of Virtual Cable S.L. nor the names of its contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+'''
+@author: Adolfo Gómez, dkmaster at dkmon dot com
+'''
+from __future__ import unicode_literals
+
+from opengnsys.workers import ServerWorker
+
+from .sample_pkg import test
+
+class Sample1(ServerWorker):
+ name='Sample1'
+
diff --git a/admin/Sources/Clients/ogagent/src/test_modules/server/Sample1/sample_pkg/__init__.py b/admin/Sources/Clients/ogagent/src/test_modules/server/Sample1/sample_pkg/__init__.py
new file mode 100644
index 00000000..19365721
--- /dev/null
+++ b/admin/Sources/Clients/ogagent/src/test_modules/server/Sample1/sample_pkg/__init__.py
@@ -0,0 +1,36 @@
+#!/usr/bin/env python
+# -*- coding: utf-8 -*-
+#
+# Copyright (c) 2014 Virtual Cable S.L.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without modification,
+# are permitted provided that the following conditions are met:
+#
+# * Redistributions of source code must retain the above copyright notice,
+# this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice,
+# this list of conditions and the following disclaimer in the documentation
+# and/or other materials provided with the distribution.
+# * Neither the name of Virtual Cable S.L. nor the names of its contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+'''
+@author: Adolfo Gómez, dkmaster at dkmon dot com
+'''
+from __future__ import unicode_literals
+
+
+def test():
+ return 'Test'
\ No newline at end of file
diff --git a/admin/Sources/Clients/ogagent/src/test_modules/server/__init__.py b/admin/Sources/Clients/ogagent/src/test_modules/server/__init__.py
new file mode 100644
index 00000000..e69de29b
diff --git a/admin/Sources/Clients/ogagent/src/test_rest_server.py b/admin/Sources/Clients/ogagent/src/test_rest_server.py
new file mode 100644
index 00000000..ad1aede6
--- /dev/null
+++ b/admin/Sources/Clients/ogagent/src/test_rest_server.py
@@ -0,0 +1,210 @@
+# -*- coding: utf-8 -*-
+#
+# Copyright (c) 2015 Virtual Cable S.L.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without modification,
+# are permitted provided that the following conditions are met:
+#
+# * Redistributions of source code must retain the above copyright notice,
+# this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice,
+# this list of conditions and the following disclaimer in the documentation
+# and/or other materials provided with the distribution.
+# * Neither the name of Virtual Cable S.L. nor the names of its contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+'''
+@author: Adolfo Gómez, dkmaster at dkmon dot com
+'''
+# pylint: disable=unused-wildcard-import,wildcard-import
+from __future__ import unicode_literals, print_function
+
+# Pydev can't parse "six.moves.xxxx" because it is loaded lazy
+from six.moves.socketserver import ThreadingMixIn # @UnresolvedImport
+from six.moves.BaseHTTPServer import BaseHTTPRequestHandler # @UnresolvedImport
+from six.moves.BaseHTTPServer import HTTPServer # @UnresolvedImport
+from six.moves.urllib.parse import unquote # @UnresolvedImport
+
+import json
+import threading
+import ssl
+
+import logging
+from tempfile import gettempdir
+from os.path import exists, join
+
+logger = logging.getLogger(__name__)
+
+
+CERTFILE = 'OGTestServer.pem'
+
+
+def createSelfSignedCert(force=False):
+
+ certFile = join(gettempdir(), CERTFILE)
+
+ if exists(certFile) and not force:
+ return certFile
+
+ certData = '''-----BEGIN PRIVATE KEY-----
+MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCb50K3mIznNklz
+yVAD7xSQOSJQ6+NPXj7U9/4zLZ+TvmbQ7RqUUsxbfxHbeRnoYTWV2nKk4+tHqmvz
+ujLSS/loFhTSMqtrLn7rowSYJoQhKOUkAiQlWkqCfItWgL5pJopDpNHFul9Rn3ds
+PMWQTiGeUNR4Y3RnBhr1Q1BsqAzf4m6zFUmgLPPmVLdF4uJ3Tuz8TSy2gWLs5aSr
+5do4WamwUfYjRSVMJECmwjUM4rQ8SQgg0sHBeBuDUGNBvBQFac1G7qUcMReeu8Zr
+DUtMsXma/l4rA8NB5CRmTrQbTBF4l+jb2BDFebDqDUK1Oqs9X35yOQfDOAFYHiix
+PX0IsXOZAgMBAAECggEBAJi3000RrIUZUp6Ph0gzPMuCjDEEwWiQA7CPNX1gpb8O
+dp0WhkDhUroWIaICYPSXtOwUTtVjRqivMoxPy1Thg3EIoGC/rdeSdlXRHMEGicwJ
+yVyalFnatr5Xzg5wkxVh4XMd0zeDt7e3JD7s0QLo5lm1CEzd77qz6lhzFic5/1KX
+bzdULtTlq60dazg2hEbcS4OmM1UMCtRVDAsOIUIZPL0M9j1C1d1iEdYnh2xshKeG
+/GOfo95xsgdMlGjtv3hUT5ryKVoEsu+36rGb4VfhPfUvvoVbRx5QZpW+QvxaYh5E
+Fi0JEROozFwG31Y++8El7J3yQko8cFBa1lYYUwwpNAECgYEAykT+GiM2YxJ4uVF1
+OoKiE9BD53i0IG5j87lGPnWqzEwYBwnqjEKDTou+uzMGz3MDV56UEFNho7wUWh28
+LpEkjJB9QgbsugjxIBr4JoL/rYk036e/6+U8I95lvYWrzb+rBMIkRDYI7kbQD/mQ
+piYUpuCkTymNAu2RisK6bBzJslkCgYEAxVE23OQvkCeOV8hJNPZGpJ1mDS+TiOow
+oOScMZmZpail181eYbAfMsCr7ri812lSj98NvA2GNVLpddil6LtS1cQ5p36lFBtV
+xQUMZiFz4qVbEak+izL+vPaev/mXXsOcibAIQ+qI/0txFpNhJjpaaSy6vRCBYFmc
+8pgSoBnBI0ECgYAUKCn2atnpp5aWSTLYgNosBU4vDA1PShD14dnJMaqyr0aZtPhF
+v/8b3btFJoGgPMLxgWEZ+2U4ju6sSFhPf7FXvLJu2QfQRkHZRDbEh7t5DLpTK4Fp
+va9vl6Ml7uM/HsGpOLuqfIQJUs87OFCc7iCSvMJDDU37I7ekT2GKkpfbCQKBgBrE
+0NeY0WcSJrp7/oqD2sOcYurpCG/rrZs2SIZmGzUhMxaa0vIXzbO59dlWELB8pmnE
+Tf20K//x9qA5OxDe0PcVPukdQlH+/1zSOYNliG44FqnHtyd1TJ/gKVtMBiAiE4uO
+aSClod5Yosf4SJbCFd/s5Iyfv52NqsAyp1w3Aj/BAoGAVCnEiGUfyHlIR+UH4zZW
+GXJMeqdZLfcEIszMxLePkml4gUQhoq9oIs/Kw+L1DDxUwzkXN4BNTlFbOSu9gzK1
+dhuIUGfS6RPL88U+ivC3A0y2jT43oUMqe3hiRt360UQ1GXzp2dMnR9odSRB1wHoO
+IOjEBZ8341/c9ZHc5PCGAG8=
+-----END PRIVATE KEY-----
+-----BEGIN CERTIFICATE-----
+MIID7zCCAtegAwIBAgIJAIrEIthCfxUCMA0GCSqGSIb3DQEBCwUAMIGNMQswCQYD
+VQQGEwJFUzEPMA0GA1UECAwGTWFkcmlkMREwDwYDVQQHDAhBbGNvcmNvbjEMMAoG
+A1UECgwDVURTMQ4wDAYDVQQLDAVBY3RvcjESMBAGA1UEAwwJVURTIEFjdG9yMSgw
+JgYJKoZIhvcNAQkBFhlzdXBwb3J0QHVkc2VudGVycHJpc2UuY29tMB4XDTE0MTAy
+NjIzNDEyNFoXDTI0MTAyMzIzNDEyNFowgY0xCzAJBgNVBAYTAkVTMQ8wDQYDVQQI
+DAZNYWRyaWQxETAPBgNVBAcMCEFsY29yY29uMQwwCgYDVQQKDANVRFMxDjAMBgNV
+BAsMBUFjdG9yMRIwEAYDVQQDDAlVRFMgQWN0b3IxKDAmBgkqhkiG9w0BCQEWGXN1
+cHBvcnRAdWRzZW50ZXJwcmlzZS5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAw
+ggEKAoIBAQCb50K3mIznNklzyVAD7xSQOSJQ6+NPXj7U9/4zLZ+TvmbQ7RqUUsxb
+fxHbeRnoYTWV2nKk4+tHqmvzujLSS/loFhTSMqtrLn7rowSYJoQhKOUkAiQlWkqC
+fItWgL5pJopDpNHFul9Rn3dsPMWQTiGeUNR4Y3RnBhr1Q1BsqAzf4m6zFUmgLPPm
+VLdF4uJ3Tuz8TSy2gWLs5aSr5do4WamwUfYjRSVMJECmwjUM4rQ8SQgg0sHBeBuD
+UGNBvBQFac1G7qUcMReeu8ZrDUtMsXma/l4rA8NB5CRmTrQbTBF4l+jb2BDFebDq
+DUK1Oqs9X35yOQfDOAFYHiixPX0IsXOZAgMBAAGjUDBOMB0GA1UdDgQWBBRShS90
+5lJTNvYPIEqP3GxWwG5iiDAfBgNVHSMEGDAWgBRShS905lJTNvYPIEqP3GxWwG5i
+iDAMBgNVHRMEBTADAQH/MA0GCSqGSIb3DQEBCwUAA4IBAQAU0Sp4gXhQmRVzq+7+
+vRFUkQuPj4Ga/d9r5Wrbg3hck3+5pwe9/7APoq0P/M0DBhQpiJKjrD6ydUevC+Y/
+43ZOJPhMlNw0o6TdQxOkX6FDwQanLLs7sfvJvqtVzYn3nuRFKT3dvl7Zg44QMw2M
+ay42q59fAcpB4LaDx/i7gOYSS5eca3lYW7j7YSr/+ozXK2KlgUkuCUHN95lOq+dF
+trmV9mjzM4CNPZqKSE7kpHRywgrXGPCO000NvEGSYf82AtgRSFKiU8NWLQSEPdcB
+k//2dsQZw2cRZ8DrC2B6Tb3M+3+CA6wVyqfqZh1SZva3LfGvq/C+u+ItguzPqNpI
+xtvM
+-----END CERTIFICATE-----'''
+ with open(certFile, "wt") as f:
+ f.write(certData)
+
+ return certFile
+
+class HTTPServerHandler(BaseHTTPRequestHandler):
+ service = None
+ protocol_version = 'HTTP/1.0'
+ server_version = 'OpenGnsys Test REST Server'
+ sys_version = ''
+
+ def sendJsonError(self, code, message):
+ self.send_response(code)
+ self.send_header('Content-type', 'application/json')
+ self.end_headers()
+ self.wfile.write(json.dumps({'error': message}))
+ return
+
+ def sendJsonResponse(self, data):
+ self.send_response(200)
+ data = json.dumps(data)
+ self.send_header('Content-type', 'application/json')
+ self.send_header('Content-Length', len(data))
+ self.end_headers()
+ # Send the html message
+ self.wfile.write(data)
+
+
+ # parseURL
+ def parseUrl(self):
+ # Very simple path & params splitter
+ path = self.path.split('?')[0][1:].split('/')
+
+ try:
+ params = dict((v[0], unquote(v[1])) for v in (v.split('=') for v in self.path.split('?')[1].split('&')))
+ except Exception:
+ params = {}
+
+ return (path, params)
+
+
+ def do_GET(self):
+ path, params = self.parseUrl()
+
+ self.sendJsonResponse({'path': path, 'params': params})
+
+ def do_POST(self):
+ path, getParams = self.parseUrl()
+
+ # Now post parameters, that are in JSON format
+ self.sendJsonResponse({'path': path, 'params': getParams})
+
+ def log_error(self, fmt, *args):
+ logger.error('HTTP ' + fmt % args)
+
+ def log_message(self, fmt, *args):
+ logger.info('HTTP ' + fmt % args)
+
+
+class HTTPThreadingServer(ThreadingMixIn, HTTPServer):
+ pass
+
+class HTTPServerThread(threading.Thread):
+ def __init__(self, address, service):
+ super(self.__class__, self).__init__()
+
+ HTTPServerHandler.service = service
+
+ self.certFile = createSelfSignedCert()
+ self.server = HTTPThreadingServer(address, HTTPServerHandler)
+ self.server.socket = ssl.wrap_socket(self.server.socket, certfile=self.certFile, server_side=True)
+
+ logger.info('Initialized HTTPS Server thread on {}'.format(address))
+
+ def getServerUrl(self):
+ return 'https://{}:{}/{}'.format(self.server.server_address[0], self.server.server_address[1], HTTPServerHandler.uuid)
+
+ def stop(self):
+ self.server.shutdown()
+
+ def run(self):
+ self.server.serve_forever()
+
+
+
+if __name__ == '__main__':
+ logging.basicConfig(
+ filename='/tmp/restserver.log',
+ filemode='w',
+ format='%(levelname)s %(asctime)s %(message)s',
+ level=logging.DEBUG
+ )
+
+ thr = HTTPServerThread(('0.0.0.0', 9999), None)
+ print('Server started: {}'.format(thr))
+ thr.run()
+
\ No newline at end of file
diff --git a/admin/Sources/Clients/ogagent/src/update.sh b/admin/Sources/Clients/ogagent/src/update.sh
new file mode 100755
index 00000000..1019ea85
--- /dev/null
+++ b/admin/Sources/Clients/ogagent/src/update.sh
@@ -0,0 +1,41 @@
+#!/bin/bash
+#
+# Copyright (c) 2014 Virtual Cable S.L.
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without modification,
+# are permitted provided that the following conditions are met:
+#
+# * Redistributions of source code must retain the above copyright notice,
+# this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright notice,
+# this list of conditions and the following disclaimer in the documentation
+# and/or other materials provided with the distribution.
+# * Neither the name of Virtual Cable S.L. nor the names of its contributors
+# may be used to endorse or promote products derived from this software
+# without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+function process {
+ pyuic4 about-dialog.ui -o about_dialog_ui.py -x
+ pyuic4 message-dialog.ui -o message_dialog_ui.py -x
+}
+
+cd $(dirname "$0")
+pyrcc4 -py3 OGAgent.qrc -o OGAgent_rc.py
+
+
+# process current directory ui's
+process
+
diff --git a/admin/Sources/Clients/ogagent/windows/build-windows.sh b/admin/Sources/Clients/ogagent/windows/build-windows.sh
new file mode 100755
index 00000000..d7248ab7
--- /dev/null
+++ b/admin/Sources/Clients/ogagent/windows/build-windows.sh
@@ -0,0 +1,5 @@
+#!/bin/bash
+export WINEARCH=win32
+export WINEPREFIX=$(realpath $(dirname $0)/wine)
+wine cmd /c c:\\ogagent\\build.bat
+chmod -x $(dirname $0)/../OGAgentSetup*.exe
diff --git a/admin/Sources/Clients/ogagent/windows/build.bat b/admin/Sources/Clients/ogagent/windows/build.bat
new file mode 100644
index 00000000..2c444741
--- /dev/null
+++ b/admin/Sources/Clients/ogagent/windows/build.bat
@@ -0,0 +1,6 @@
+C:
+CD \ogagent\src
+python setup.py
+CD ..
+"C:\Program Files\NSIS\makensis.exe" ogagent.nsi
+
diff --git a/admin/Sources/Clients/ogagent/windows/ogagent.nsi b/admin/Sources/Clients/ogagent/windows/ogagent.nsi
new file mode 100644
index 00000000..88c9ab2f
--- /dev/null
+++ b/admin/Sources/Clients/ogagent/windows/ogagent.nsi
@@ -0,0 +1,192 @@
+# We need http://nsis.sourceforge.net/NSIS_Simple_Firewall_Plugin
+# Copy inside the two x86_xxxxx folders inside nsis plugins folder
+Name "OpenGnsys Agent"
+
+# OpenGnsys Actor version
+!define /file OGA_VERSION "src\VERSION"
+
+# General Symbol Definitions
+!define REGKEY "SOFTWARE\OGAgent"
+!define VERSION ${OGA_VERSION}.0
+!define COMPANY "OpenGnsys Project"
+!define URL https://opengnsys.es
+
+# MultiUser Symbol Definitions
+!define MULTIUSER_EXECUTIONLEVEL Admin
+#!define MULTIUSER_INSTALLMODE_DEFAULT_CURRENTUSER
+!define MULTIUSER_INSTALLMODE_COMMANDLINE
+!define MULTIUSER_INSTALLMODE_INSTDIR OGAgent
+!define MULTIUSER_INSTALLMODE_INSTDIR_REGISTRY_KEY "${REGKEY}"
+!define MULTIUSER_INSTALLMODE_INSTDIR_REGISTRY_VALUE "Path"
+
+# MUI Symbol Definitions
+!define MUI_ICON "src\img\oga.ico"
+!define MUI_FINISHPAGE_NOAUTOCLOSE
+!define MUI_UNICON "src\img\oga.ico"
+!define MUI_UNFINISHPAGE_NOAUTOCLOSE
+!define MUI_LANGDLL_REGISTRY_ROOT HKLM
+!define MUI_LANGDLL_REGISTRY_KEY ${REGKEY}
+!define MUI_LANGDLL_REGISTRY_VALUENAME InstallerLanguage
+
+# Included files
+!include MultiUser.nsh
+!include Sections.nsh
+!include MUI2.nsh
+
+# Reserved Files
+!insertmacro MUI_RESERVEFILE_LANGDLL
+
+# Variables
+Var StartMenuGroup
+
+# Installer pages
+!insertmacro MUI_PAGE_WELCOME
+!insertmacro MUI_PAGE_LICENSE src\license.txt
+!insertmacro MUI_PAGE_DIRECTORY
+!insertmacro MUI_PAGE_INSTFILES
+!insertmacro MUI_PAGE_FINISH
+!insertmacro MUI_UNPAGE_CONFIRM
+!insertmacro MUI_UNPAGE_INSTFILES
+
+# Installer languages
+!insertmacro MUI_LANGUAGE English
+!insertmacro MUI_LANGUAGE Spanish
+!insertmacro MUI_LANGUAGE French
+!insertmacro MUI_LANGUAGE German
+
+# Installer attributes
+BrandingText "OpenGnsys"
+OutFile OGAgentSetup-${OGA_VERSION}.exe
+InstallDir OGAgent
+CRCCheck on
+XPStyle on
+ShowInstDetails hide
+VIProductVersion "${VERSION}.0.0"
+VIAddVersionKey /LANG=${LANG_ENGLISH} ProductName "OGAgent"
+VIAddVersionKey /LANG=${LANG_ENGLISH} ProductVersion "${VERSION}"
+VIAddVersionKey /LANG=${LANG_ENGLISH} CompanyName "${COMPANY}"
+VIAddVersionKey /LANG=${LANG_ENGLISH} CompanyWebsite "${URL}"
+VIAddVersionKey /LANG=${LANG_ENGLISH} FileVersion "${VERSION}"
+VIAddVersionKey /LANG=${LANG_ENGLISH} FileDescription "OpenGnsys Agent installer"
+VIAddVersionKey /LANG=${LANG_ENGLISH} LegalCopyright "(c) 2015 Virtual Cable S.L.U."
+InstallDirRegKey HKLM "${REGKEY}" Path
+ShowUninstDetails show
+
+# Installer sections
+Section -Main SEC0000
+ SetShellVarContext all
+ SetOutPath $INSTDIR
+ SetOverwrite on
+ File /r bin\*.*
+ File vcredist_x86.exe
+ WriteRegStr HKLM "${REGKEY}\Components" Main 1
+SectionEnd
+
+Section -post SEC0001
+ SetShellVarContext current
+ WriteRegStr HKLM "${REGKEY}" Path $INSTDIR
+ SetOutPath $INSTDIR
+ WriteUninstaller $INSTDIR\OGAgentUninstaller.exe
+ SetOutPath $SMPROGRAMS\$StartMenuGroup
+ CreateShortcut "$SMPROGRAMS\$StartMenuGroup\$(^UninstallLink).lnk" $INSTDIR\OGAgentUninstaller.exe
+ WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" DisplayName "$(^Name)"
+ WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" DisplayVersion "${VERSION}"
+ WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" Publisher "${COMPANY}"
+ WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" URLInfoAbout "${URL}"
+ WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" DisplayIcon $INSTDIR\OGAgentUninstaller.exe
+ WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" UninstallString $INSTDIR\OGAgentUninstaller.exe
+ WriteRegStr HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Run" OGAgentTool $INSTDIR\OGAgentUser.exe
+ WriteRegDWORD HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" NoModify 1
+ WriteRegDWORD HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)" NoRepair 1
+ ExecWait '"$INSTDIR\vcredist_x86.exe" /passive /norestart'
+ # Add the application to the firewall exception list - All Networks - All IP Version - Enabled
+ # SimpleFC::AddApplication "OpenGnsys Agent Service" "$INSTDIR\OGAgentService.exe" 0 2 "" 1
+ # SimpleFC::AdvAddRule [name] [description] [protocol] [direction]
+ # [status] [profile] [action] [application] [service_name] [icmp_types_and_codes]
+ # [group] [local_ports] [remote_ports] [local_address] [remote_address]
+ #
+ SimpleFC::AdvAddRule "OpenGnsys Agent Firewall rules" "Firewall rules for OpenGnsys Agent interaction with broker." "6" "1" \
+ "1" "7" "1" "$INSTDIR\OGAgentService.exe" "" "" \
+ "" "" "" "" ""
+ Pop $0 ; return error(1)/success(0)
+ # Disable fast boot on Windows 10, if registry key exists.
+ ReadRegDWORD $0 HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Power" HiberbootEnabled
+ IfErrors 0 +2
+ WriteRegDWORD HKLM "SYSTEM\CurrentControlSet\Control\Session Manager\Power" HiberbootEnabled 0
+ # Install service
+ nsExec::Exec /OEM "$INSTDIR\OGAgentService.exe --startup auto install" # Add service after installation
+ # Update recovery options
+ nsExec::Exec /OEM "$INSTDIR\OGAServiceHelper.exe"
+SectionEnd
+
+# Macro for selecting uninstaller sections
+!macro SELECT_UNSECTION SECTION_NAME UNSECTION_ID
+ Push $R0
+ ReadRegStr $R0 HKLM "${REGKEY}\Components" "${SECTION_NAME}"
+ StrCmp $R0 1 0 next${UNSECTION_ID}
+ !insertmacro SelectSection "${UNSECTION_ID}"
+ GoTo done${UNSECTION_ID}
+next${UNSECTION_ID}:
+ !insertmacro UnselectSection "${UNSECTION_ID}"
+done${UNSECTION_ID}:
+ Pop $R0
+!macroend
+
+# Uninstaller sections
+Section /o -un.Main UNSEC0000
+ nsExec::Exec /OEM "$INSTDIR\OGAgentService.exe stop" # Stops the service prior uninstall
+ nsExec::Exec /OEM "$INSTDIR\OGAgentService.exe remove" # Removes the service prior uninstall
+ Delete /REBOOTOK "$INSTDIR\*.*"
+ DeleteRegValue HKLM "${REGKEY}\Components" Main
+ DeleteRegValue HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Run" OGAgentTool
+SectionEnd
+
+Section -un.post UNSEC0001
+ # Remove application from the firewall exception list
+ # SimpleFC::RemoveApplication "$INSTDIR\OGAgentService.exe"
+ SimpleFC::AdvRemoveRule "OpenGnsys Agent Firewall rules"
+ Pop $0 ; return error(1)/success(0)
+
+ SetShellVarContext current
+ StrCpy $StartMenuGroup "OpenGnsys Agent"
+ DeleteRegKey HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\$(^Name)"
+ Delete /REBOOTOK "$SMPROGRAMS\$StartMenuGroup\$(^UninstallLink).lnk"
+ Delete /REBOOTOK $INSTDIR\OGAgentUninstaller.exe
+ DeleteRegValue HKLM "${REGKEY}" Path
+ DeleteRegKey /IfEmpty HKLM "${REGKEY}\Components"
+ DeleteRegKey /IfEmpty HKLM "${REGKEY}"
+ RmDir /REBOOTOK $SMPROGRAMS\$StartMenuGroup
+ SetShellVarContext all
+ RmDir /REBOOTOK $INSTDIR
+ SetRebootFlag true
+ MessageBox MB_YESNO "$(^RebootMessage)" IDNO donotreboot
+ Reboot # Reboot is needed after uninstalling, so new installs works fine
+ donotreboot:
+SectionEnd
+
+# Installer functions
+Function .onInit
+ InitPluginsDir
+ StrCpy $StartMenuGroup "OpenGnsys Agent"
+
+ !insertmacro MUI_LANGDLL_DISPLAY
+ !insertmacro MULTIUSER_INIT
+FunctionEnd
+
+# Uninstaller functions
+Function un.onInit
+ StrCpy $StartMenuGroup "OpenGnsys Agent"
+ !insertmacro MUI_UNGETLANGUAGE
+ !insertmacro MULTIUSER_UNINIT
+ !insertmacro SELECT_UNSECTION Main ${UNSEC0000}
+FunctionEnd
+
+# Installer Language Strings
+LangString ^UninstallLink ${LANG_ENGLISH} "Uninstall $(^Name)"
+LangString ^UninstallLink ${LANG_SPANISH} "Desinstalar $(^Name)"
+LangString ^UninstallLink ${LANG_FRENCH} "D�sinstaller $(^Name)"
+LangString ^UninstallLink ${LANG_GERMAN} "deinstallieren $(^Name)"
+LangString ^RebootMessage ${LANG_ENGLISH} "Reboot the system to complete uninstall process?$\nNote: for a new $(^Name) installation, you will need to reboot."
+LangString ^RebootMessage ${LANG_SPANISH} "¿Reiniciar el sistema para completar el proceso?$\nNota: es necesario reiniciar para instalar un nuevo $(^Name)."
+LangString ^RebootMessage ${LANG_FRENCH} "Reboot the system to complete uninstall process?$\nNote: for a new $(^Name) installation, you will ned to reboot."
+LangString ^RebootMessage ${LANG_GERMAN} "Reboot the system to complete uninstall process?$\nNote: for a new $(^Name) installation, you will ned to reboot."
diff --git a/admin/Sources/Clients/ogagent/windows/py2exe-wine-linux.sh b/admin/Sources/Clients/ogagent/windows/py2exe-wine-linux.sh
new file mode 100755
index 00000000..17fbbbc7
--- /dev/null
+++ b/admin/Sources/Clients/ogagent/windows/py2exe-wine-linux.sh
@@ -0,0 +1,71 @@
+#!/bin/sh
+
+# We need:
+# * Wine (32 bit)
+# * winetricks (in some distributions)
+
+export WINEARCH=win32 WINEPREFIX=$PWD/wine WINEDEBUG=fixme-all
+WINE=wine
+
+download() {
+ mkdir downloads
+ # Get needed software
+ cd downloads
+ wget -nd https://www.python.org/ftp/python/2.7.14/python-2.7.14.msi -O python-2.7.msi
+ wget -nd http://download.microsoft.com/download/7/9/6/796EF2E4-801B-4FC4-AB28-B59FBF6D907B/VCForPython27.msi
+ wget -nd https://bootstrap.pypa.io/get-pip.py
+ wget -nd http://sourceforge.net/projects/pywin32/files/pywin32/Build%20221/pywin32-221.win32-py2.7.exe/download -O pywin32-install.exe
+ wget -nd http://sourceforge.net/projects/py2exe/files/py2exe/0.6.9/py2exe-0.6.9.win32-py2.7.exe/download -O py2exe-install.exe
+ wget -nd http://prdownloads.sourceforge.net/nsis/nsis-3.0rc1-setup.exe?download -O nsis-install.exe
+ wget -nd http://sourceforge.net/projects/pyqt/files/PyQt4/PyQt-4.11.4/PyQt4-4.11.4-gpl-Py2.7-Qt4.8.7-x32.exe/download -O pyqt-install.exe
+ wget -nd http://nsis.sourceforge.net/mediawiki/images/d/d7/NSIS_Simple_Firewall_Plugin_1.20.zip
+ cd ..
+}
+
+install_python() {
+ if which winetricks &>/dev/null; then
+ echo "Setting up wine prefix (using winetricks)"
+ winetricks
+ fi
+
+ cd downloads
+ echo "Installing python"
+ $WINE msiexec /qn /i python-2.7.msi
+ echo "Installing vc for python"
+ $WINE msiexec /qn /i VCForPython27.msi
+
+ echo "Installing pywin32 (needs X)"
+ $WINE pywin32-install.exe
+ echo "Installing py2exe (needs X)"
+ $WINE py2exe-install.exe
+ echo "Installing pyqt"
+ $WINE pyqt-install.exe
+ echo "Installing nsis (needs X?)"
+ $WINE nsis-install.exe
+
+ cd ..
+}
+
+setup_pip() {
+ echo "Seting up pip..."
+ $WINE C:\\Python27\\python -m pip install --upgrade pip
+}
+
+install_packages() {
+ echo "Installing required packages"
+ $WINE C:\\Python27\\python -m pip install requests
+ $WINE C:\\Python27\\python -m pip install six
+ # Using easy_install instead of pip to install pycrypto
+ $WINE C:\\Python27\\Scripts\\easy_install http://www.voidspace.org.uk/python/pycrypto-2.6.1/pycrypto-2.6.1.win32-py2.7.exe
+ # Copy nsis required NSIS_Simple_Firewall_Plugin_1
+ echo "Copying simple firewall plugin for nsis installer"
+ unzip -o downloads/NSIS_Simple_Firewall_Plugin_1.20.zip SimpleFC.dll -d $WINEPREFIX/drive_c/Program\ Files/NSIS/Plugins/x86-ansi/
+ unzip -o downloads/NSIS_Simple_Firewall_Plugin_1.20.zip SimpleFC.dll -d $WINEPREFIX/drive_c/Program\ Files/NSIS/Plugins/x86-unicode/
+}
+
+download
+install_python
+setup_pip
+install_packages
+
+
diff --git a/admin/Sources/Includes/Database.cpp b/admin/Sources/Includes/Database.cpp
index 0d1ddcc5..84add9ce 100644
--- a/admin/Sources/Includes/Database.cpp
+++ b/admin/Sources/Includes/Database.cpp
@@ -106,6 +106,11 @@ bool Database::Execute(char* CmdStr, Table& Tbl)
return (true);
}
// __________________________________________________________________________
+void Database::liberaResult (Table& Tbl) {
+ //Free resources after mysql_store_result
+ mysql_free_result(Tbl.m_Rec);
+}
+// __________________________________________________________________________
Table::Table()
{
m_Rec=NULL;
diff --git a/admin/Sources/Includes/Database.h b/admin/Sources/Includes/Database.h
index 0af1561b..ae318bdb 100644
--- a/admin/Sources/Includes/Database.h
+++ b/admin/Sources/Includes/Database.h
@@ -25,6 +25,7 @@ public:
bool Close(void);
bool Execute(char* CmdStr);
bool Execute(char* CmdStr, Table& Tbl);
+ void liberaResult(Table& Tbl);
void GetErrorErrStr(char* ErrStr);
};
// __________________________________________________________________________
diff --git a/admin/Sources/Services/ogAdmAgent/sources/ogAdmAgent.h b/admin/Sources/Services/ogAdmAgent/sources/ogAdmAgent.h
index a2f7deef..b1c429bb 100644
--- a/admin/Sources/Services/ogAdmAgent/sources/ogAdmAgent.h
+++ b/admin/Sources/Services/ogAdmAgent/sources/ogAdmAgent.h
@@ -27,7 +27,7 @@
// Valores hexadecimales para consultas
// ________________________________________________________________________________________________________
-BYTE HEX_annos[]={0,0x01,0x02,0x04,0x08,0x10,0x20,0x40,0x80};
+WORD HEX_annos[]={0,0x0001,0x0002,0x0004,0x0008,0x0010,0x0020,0x0040,0x0080,0x0100,0x0200,0x0400,0x0800,0x1000,0x2000,0x4000,0x8000};
WORD HEX_meses[]={0,0x0001,0x0002,0x0004,0x0008,0x0010,0x0020,0x0040,0x0080,0x0100,0x0200,0x0400,0x0800};
int HEX_dias[]={0,0x00000001,0x00000002,0x00000004,0x00000008,0x00000010,0x00000020,0x00000040,0x00000080,0x00000100,0x00000200,
0x00000400,0x00000800,0x00001000,0x00002000,0x00004000,0x00008000,0x00010000,0x00020000,0x00040000,0x00080000,
diff --git a/admin/Sources/Services/ogAdmRepo/ogAdmRepo.cfg b/admin/Sources/Services/ogAdmRepo/ogAdmRepo.cfg
index b916411d..1a8f289d 100644
--- a/admin/Sources/Services/ogAdmRepo/ogAdmRepo.cfg
+++ b/admin/Sources/Services/ogAdmRepo/ogAdmRepo.cfg
@@ -1,2 +1,3 @@
IPlocal=SERVERIP
Puerto=2002
+ApiToken=REPOKEY
diff --git a/admin/Sources/Services/ogAdmServer/sources/ogAdmServer.cpp b/admin/Sources/Services/ogAdmServer/sources/ogAdmServer.cpp
index 19503065..6b6b7d72 100644
--- a/admin/Sources/Services/ogAdmServer/sources/ogAdmServer.cpp
+++ b/admin/Sources/Services/ogAdmServer/sources/ogAdmServer.cpp
@@ -147,11 +147,14 @@ BOOLEAN gestionaTrama(SOCKET *socket_c)
if (res == 0) { // Encontrada la función que procesa el mensaje
liberaMemoria(nfn);
res=tbfuncionesServer[i].fptr(socket_c, ptrTrama); // Invoca la función
- liberaMemoria((char*)ptrTrama);
+ liberaMemoria(ptrTrama->parametros);
+ liberaMemoria(ptrTrama);
return(res);
}
}
-
+ liberaMemoria(nfn);
+ liberaMemoria(ptrTrama->parametros);
+ liberaMemoria(ptrTrama);
/*
Sólo puede ser un comando personalizado o su notificación
if (ptrTrama->tipo == MSG_COMANDO)
@@ -215,6 +218,7 @@ BOOLEAN respuestaSondeo(SOCKET *socket_c, TRAMA* ptrTrama) {
lSize = strlen(iph); // Calcula longitud de la cadena de direccion/es IPE/S
Ipes = (char*) reservaMemoria(lSize + 1);
if (Ipes == NULL) {
+ liberaMemoria(iph);
errorLog(modulo, 3, FALSE);
return (FALSE);
}
@@ -348,6 +352,7 @@ BOOLEAN EcoConsola(SOCKET *socket_c, TRAMA* ptrTrama)
// Lee archivo de eco de consola
iph = copiaParametro("iph",ptrTrama); // Toma dirección ip del cliente
sprintf(fileco,"/tmp/_Seconsola_%s",iph); // Nombre del archivo en el Servidor
+ liberaMemoria(iph);
lSize=lonArchivo(fileco);
if(lSize>0){ // Si el fichero tiene contenido...
initParametros(ptrTrama,lSize+LONGITUD_PARAMETROS);
@@ -504,6 +509,7 @@ BOOLEAN procesoInclusionClienteWinLnx(SOCKET *socket_c, TRAMA *ptrTrama,int *ido
iph = copiaParametro("iph",ptrTrama); // Toma ip
if (!db.Open(usuario, pasguor, datasource, catalog)) { // Error de conexión con la BD
+ liberaMemoria(iph);
errorLog(modulo, 20, FALSE);
db.GetErrorErrStr(msglog);
errorInfo(modulo, msglog);
@@ -516,14 +522,19 @@ BOOLEAN procesoInclusionClienteWinLnx(SOCKET *socket_c, TRAMA *ptrTrama,int *ido
" WHERE ordenadores.ip = '%s'", iph);
if (!db.Execute(sqlstr, tbl)) { // Error al recuperar los datos
+ liberaMemoria(iph);
errorLog(modulo, 21, FALSE);
db.GetErrorErrStr(msglog);
errorInfo(modulo, msglog);
+ db.Close();
return (21);
}
if (tbl.ISEOF()) { // Si no existe el cliente
+ liberaMemoria(iph);
errorLog(modulo, 22, FALSE);
+ db.liberaResult(tbl);
+ db.Close();
return (22);
}
@@ -532,15 +543,22 @@ BOOLEAN procesoInclusionClienteWinLnx(SOCKET *socket_c, TRAMA *ptrTrama,int *ido
infoDebug(msglog);
}
if (!tbl.Get("idordenador", *idordenador)) {
+ liberaMemoria(iph);
+ db.liberaResult(tbl);
tbl.GetErrorErrStr(msglog);
errorInfo(modulo, msglog);
+ db.Close();
return (FALSE);
}
if (!tbl.Get("nombreordenador", nombreordenador)) {
+ liberaMemoria(iph);
+ db.liberaResult(tbl);
tbl.GetErrorErrStr(msglog);
errorInfo(modulo, msglog);
+ db.Close();
return (FALSE);
}
+ db.liberaResult(tbl);
db.Close();
if (!registraCliente(iph)) { // Incluyendo al cliente en la tabla de sokets
@@ -604,6 +622,8 @@ BOOLEAN procesoInclusionCliente(SOCKET *socket_c, TRAMA *ptrTrama) {
cfg = copiaParametro("cfg",ptrTrama); // Toma configuracion
if (!db.Open(usuario, pasguor, datasource, catalog)) { // Error de conexión con la BD
+ liberaMemoria(iph);
+ liberaMemoria(cfg);
errorLog(modulo, 20, FALSE);
db.GetErrorErrStr(msglog);
errorInfo(modulo, msglog);
@@ -732,14 +752,35 @@ BOOLEAN actualizaConfiguracion(Database db, Table tbl, char* cfg, int ido)
char msglog[LONSTD], sqlstr[LONSQL];
int lon, p, c,i, dato, swu, idsoi, idsfi,k;
char *ptrPar[MAXPAR], *ptrCfg[6], *ptrDual[2], tbPar[LONSTD];
- char *disk, *par, *cpt, *sfi, *soi, *tam; // Parametros que definen una partición
+ char *ser, *disk, *par, *cpt, *sfi, *soi, *tam, *uso; // Parametros de configuración.
char modulo[] = "actualizaConfiguracion()";
lon = 0;
p = splitCadena(ptrPar, cfg, '\n');
for (i = 0; i < p; i++) {
c = splitCadena(ptrCfg, ptrPar[i], '\t');
- disk = par = cpt = sfi = soi = tam = NULL;
+
+ // Si la 1ª línea solo incluye el número de serie del equipo; actualizar BD.
+ if (i == 0 && c == 1) {
+ splitCadena(ptrDual, ptrCfg[0], '=');
+ ser = ptrDual[1];
+ if (strlen(ser) > 0) {
+ // Solo actualizar si número de serie no existía.
+ sprintf(sqlstr, "UPDATE ordenadores SET numserie='%s'"
+ " WHERE idordenador=%d AND numserie IS NULL",
+ ser, ido);
+ if (!db.Execute(sqlstr, tbl)) { // Error al insertar
+ db.GetErrorErrStr(msglog);
+ errorInfo(modulo, msglog);
+ return (FALSE);
+ }
+ }
+ continue;
+ }
+
+ // Distribución de particionado.
+ disk = par = cpt = sfi = soi = tam = uso = NULL;
+
splitCadena(ptrDual, ptrCfg[0], '=');
disk = ptrDual[1]; // Número de disco
@@ -750,7 +791,7 @@ BOOLEAN actualizaConfiguracion(Database db, Table tbl, char* cfg, int ido)
if(k==2){
cpt = ptrDual[1]; // Código de partición
}else{
- cpt = "0";
+ cpt = (char*)"0";
}
k=splitCadena(ptrDual, ptrCfg[3], '=');
@@ -774,10 +815,14 @@ BOOLEAN actualizaConfiguracion(Database db, Table tbl, char* cfg, int ido)
splitCadena(ptrDual, ptrCfg[5], '=');
tam = ptrDual[1]; // Tamaño de la partición
+ splitCadena(ptrDual, ptrCfg[6], '=');
+ uso = ptrDual[1]; // Porcentaje de uso del S.F.
+
lon += sprintf(tbPar + lon, "(%s, %s),", disk, par);
- sprintf(sqlstr, "SELECT numdisk,numpar,codpar,tamano,idsistemafichero,idnombreso"
- " FROM ordenadores_particiones WHERE idordenador=%d AND numdisk=%s AND numpar=%s",
+ sprintf(sqlstr, "SELECT numdisk, numpar, codpar, tamano, uso, idsistemafichero, idnombreso"
+ " FROM ordenadores_particiones"
+ " WHERE idordenador=%d AND numdisk=%s AND numpar=%s",
ido, disk, par);
@@ -788,9 +833,9 @@ BOOLEAN actualizaConfiguracion(Database db, Table tbl, char* cfg, int ido)
return (FALSE);
}
if (tbl.ISEOF()) { // Si no existe el registro
- sprintf(sqlstr, "INSERT INTO ordenadores_particiones(idordenador,numdisk,numpar,codpar,tamano,idsistemafichero,idnombreso,idimagen)"
- " VALUES(%d,%s,%s,0x%s,%s,%d,%d,0)",
- ido, disk, par, cpt, tam, idsfi, idsoi);
+ sprintf(sqlstr, "INSERT INTO ordenadores_particiones(idordenador,numdisk,numpar,codpar,tamano,uso,idsistemafichero,idnombreso,idimagen)"
+ " VALUES(%d,%s,%s,0x%s,%s,%s,%d,%d,0)",
+ ido, disk, par, cpt, tam, uso, idsfi, idsoi);
if (!db.Execute(sqlstr, tbl)) { // Error al insertar
@@ -833,19 +878,25 @@ BOOLEAN actualizaConfiguracion(Database db, Table tbl, char* cfg, int ido)
sprintf(sqlstr, "UPDATE ordenadores_particiones SET "
" codpar=0x%s,"
" tamano=%s,"
+ " uso=%s,"
" idsistemafichero=%d,"
" idnombreso=%d,"
" idimagen=0,"
" idperfilsoft=0,"
" fechadespliegue=NULL"
" WHERE idordenador=%d AND numdisk=%s AND numpar=%s",
- cpt, tam, idsfi, idsoi, ido, disk, par);
- if (!db.Execute(sqlstr, tbl)) { // Error al recuperar los datos
- errorLog(modulo, 21, FALSE);
- db.GetErrorErrStr(msglog);
- errorInfo(modulo, msglog);
- return (FALSE);
- }
+ cpt, tam, uso, idsfi, idsoi, ido, disk, par);
+ } else { // Actualizar porcentaje de uso.
+ sprintf(sqlstr, "UPDATE ordenadores_particiones SET "
+ " uso=%s"
+ " WHERE idordenador=%d AND numdisk=%s AND numpar=%s",
+ uso, ido, disk, par);
+ }
+ if (!db.Execute(sqlstr, tbl)) { // Error al recuperar los datos
+ errorLog(modulo, 21, FALSE);
+ db.GetErrorErrStr(msglog);
+ errorInfo(modulo, msglog);
+ return (FALSE);
}
}
}
@@ -2033,9 +2084,11 @@ BOOLEAN actualizaCreacionImagen(Database db, Table tbl, char* idi, char* dsk,
/* Actualizar los datos de la imagen */
snprintf(sqlstr, LONSQL,
- "UPDATE imagenes"
- " SET idordenador=%s, numdisk=%s, numpar=%s, codpar=%s, idperfilsoft=%d, idrepositorio=%d, fechacreacion=NOW()"
- " WHERE idimagen=%s", ido, dsk, par, cpt, ifs, idr, idi);
+ "UPDATE imagenes"
+ " SET idordenador=%s, numdisk=%s, numpar=%s, codpar=%s,"
+ " idperfilsoft=%d, idrepositorio=%d,"
+ " fechacreacion=NOW(), revision=revision+1"
+ " WHERE idimagen=%s", ido, dsk, par, cpt, ifs, idr, idi);
if (!db.Execute(sqlstr, tbl)) { // Error al recuperar los datos
errorLog(modulo, 21, FALSE);
@@ -2043,6 +2096,19 @@ BOOLEAN actualizaCreacionImagen(Database db, Table tbl, char* idi, char* dsk,
errorInfo(modulo, msglog);
return (FALSE);
}
+ /* Actualizar los datos en el cliente */
+ snprintf(sqlstr, LONSQL,
+ "UPDATE ordenadores_particiones"
+ " SET idimagen=%s, revision=(SELECT revision FROM imagenes WHERE idimagen=%s),"
+ " fechadespliegue=NOW()"
+ " WHERE idordenador=%s AND numdisk=%s AND numpar=%s",
+ idi, idi, ido, dsk, par);
+ if (!db.Execute(sqlstr, tbl)) { // Error al recuperar los datos
+ errorLog(modulo, 21, FALSE);
+ db.GetErrorErrStr(msglog);
+ errorInfo(modulo, msglog);
+ return (FALSE);
+ }
return (TRUE);
}
// ________________________________________________________________________________________________________
@@ -2321,7 +2387,7 @@ BOOLEAN RESPUESTA_RestaurarImagen(SOCKET *socket_c, TRAMA* ptrTrama)
Database db;
Table tbl;
BOOLEAN res;
- char *iph, *ido, *idi, *dsk, *par, *ifs;
+ char *iph, *ido, *idi, *dsk, *par, *ifs, *cfg;
char modulo[] = "RESPUESTA_RestaurarImagen()";
if (!db.Open(usuario, pasguor, datasource, catalog)) { // Error de conexion
@@ -2346,11 +2412,15 @@ BOOLEAN RESPUESTA_RestaurarImagen(SOCKET *socket_c, TRAMA* ptrTrama)
dsk = copiaParametro("dsk",ptrTrama); // Número de disco
par = copiaParametro("par",ptrTrama); // Número de partición
ifs = copiaParametro("ifs",ptrTrama); // Identificador del perfil software contenido
-
+ cfg = copiaParametro("cfg",ptrTrama); // Configuración de discos
+ if(cfg){
+ actualizaConfiguracion(db, tbl, cfg, atoi(ido)); // Actualiza la configuración del ordenador
+ liberaMemoria(cfg);
+ }
res=actualizaRestauracionImagen(db, tbl, idi, dsk, par, ido, ifs);
liberaMemoria(iph);
- liberaMemoria(ido);
+ liberaMemoria(ido);
liberaMemoria(idi);
liberaMemoria(par);
liberaMemoria(ifs);
@@ -2421,8 +2491,10 @@ BOOLEAN actualizaRestauracionImagen(Database db, Table tbl, char* idi,
/* Actualizar los datos de la imagen */
snprintf(sqlstr, LONSQL,
"UPDATE ordenadores_particiones"
- " SET idimagen=%s, idperfilsoft=%s, fechadespliegue=NOW()"
- " WHERE idordenador=%s AND numdisk=%s AND numpar=%s", idi, ifs, ido, dsk, par);
+ " SET idimagen=%s, idperfilsoft=%s, fechadespliegue=NOW(),"
+ " revision=(SELECT revision FROM imagenes WHERE idimagen=%s),"
+ " idnombreso=(SELECT idnombreso FROM perfilessoft WHERE idperfilsoft=%s)"
+ " WHERE idordenador=%s AND numdisk=%s AND numpar=%s", idi, ifs, idi, ifs, ido, dsk, par);
if (!db.Execute(sqlstr, tbl)) { // Error al recuperar los datos
errorLog(modulo, 21, FALSE);
@@ -2554,7 +2626,6 @@ BOOLEAN RESPUESTA_EjecutarScript(SOCKET *socket_c, TRAMA* ptrTrama)
Database db;
Table tbl;
char *iph, *ido,*cfg;
- int res;
char modulo[] = "RESPUESTA_EjecutarScript()";
@@ -2576,9 +2647,8 @@ BOOLEAN RESPUESTA_EjecutarScript(SOCKET *socket_c, TRAMA* ptrTrama)
}
cfg = copiaParametro("cfg",ptrTrama); // Toma configuración de particiones
-
if(cfg){
- res=actualizaConfiguracion(db, tbl, cfg, atoi(ido)); // Actualiza la configuración del ordenador
+ actualizaConfiguracion(db, tbl, cfg, atoi(ido)); // Actualiza la configuración del ordenador
liberaMemoria(cfg);
}
@@ -3070,10 +3140,12 @@ BOOLEAN RESPUESTA_InventarioSoftware(SOCKET *socket_c, TRAMA* ptrTrama) {
// Devuelve:
// TRUE: Si el proceso es correcto
// FALSE: En caso de ocurrir algún error
+//
+// Versión 1.1.0: Se incluye el sistema operativo. Autora: Irina Gómez - ETSII Universidad Sevilla
// ________________________________________________________________________________________________________
BOOLEAN actualizaSoftware(Database db, Table tbl, char* sft, char* par,char* ido, char* npc, char* idc)
{
- int i, j, lon, aux, idperfilsoft;
+ int i, j, lon, aux, idperfilsoft, idnombreso;
bool retval;
char *wsft;
int tbidsoftware[MAXSOFTWARE];
@@ -3121,6 +3193,12 @@ BOOLEAN actualizaSoftware(Database db, Table tbl, char* sft, char* par,char* ido
lon = MAXSOFTWARE; // Limita el número de componentes software
for (i = 0; i < lon; i++) {
+ // Primera línea es el sistema operativo: se obtiene identificador
+ if (i == 0) {
+ idnombreso = checkDato(db, tbl, rTrim(tbSoftware[i]), "nombresos", "nombreso", "idnombreso");
+ continue;
+ }
+
sprintf(sqlstr,
"SELECT idsoftware FROM softwares WHERE descripcion ='%s'",
rTrim(tbSoftware[i]));
@@ -3189,7 +3267,7 @@ BOOLEAN actualizaSoftware(Database db, Table tbl, char* sft, char* par,char* ido
aux += sprintf(idsoftwares + aux, ",%d", tbidsoftware[i]);
// Comprueba existencia de perfil software y actualización de éste para el ordenador
- if (!cuestionPerfilSoftware(db, tbl, idc, ido, idperfilsoft, idsoftwares,
+ if (!cuestionPerfilSoftware(db, tbl, idc, ido, idperfilsoft, idnombreso, idsoftwares,
npc, par, tbidsoftware, lon)) {
errorLog(modulo, 83, FALSE);
errorInfo(modulo, msglog);
@@ -3210,6 +3288,7 @@ BOOLEAN actualizaSoftware(Database db, Table tbl, char* sft, char* par,char* ido
// - tbl: Objeto tabla
// - idcentro: Identificador del centro en la tabla
// - ido: Identificador del ordenador del cliente en la tabla
+// - idnombreso: Identificador del sistema operativo
// - idsoftwares: Cadena con los identificadores de componentes software separados por comas
// - npc: Nombre del ordenador del cliente
// - particion: Número de la partición
@@ -3218,9 +3297,11 @@ BOOLEAN actualizaSoftware(Database db, Table tbl, char* sft, char* par,char* ido
// Devuelve:
// TRUE: Si el proceso es correcto
// FALSE: En caso de ocurrir algún error
-//________________________________________________________________________________________________________/
+//
+// Versión 1.1.0: Se incluye el sistema operativo. Autora: Irina Gómez - ETSII Universidad Sevilla
+//_________________________________________________________________________________________________________
BOOLEAN cuestionPerfilSoftware(Database db, Table tbl, char* idc, char* ido,
- int idperfilsoftware, char *idsoftwares, char *npc, char *par,
+ int idperfilsoftware, int idnombreso, char *idsoftwares, char *npc, char *par,
int *tbidsoftware, int lon) {
char *sqlstr, msglog[LONSTD];
int i, nwidperfilsoft;
@@ -3248,8 +3329,8 @@ BOOLEAN cuestionPerfilSoftware(Database db, Table tbl, char* idc, char* ido,
return (false);
}
if (tbl.ISEOF()) { // No existe un perfil software con esos componentes de componentes software, lo crea
- sprintf(sqlstr, "INSERT perfilessoft (descripcion,idcentro,grupoid)"
- " VALUES('Perfil Software (%s, Part:%s) ',%s,0)", npc, par, idc);
+ sprintf(sqlstr, "INSERT perfilessoft (descripcion, idcentro, grupoid, idnombreso)"
+ " VALUES('Perfil Software (%s, Part:%s) ',%s,0,%i)", npc, par, idc,idnombreso);
if (!db.Execute(sqlstr, tbl)) { // Error al insertar
db.GetErrorErrStr(msglog);
errorInfo(modulo, msglog);
@@ -3409,7 +3490,7 @@ BOOLEAN recibeArchivo(SOCKET *socket_c, TRAMA *ptrTrama) {
BOOLEAN envioProgramacion(SOCKET *socket_c, TRAMA *ptrTrama)
{
char sqlstr[LONSQL], msglog[LONSTD];
- char *idp,*mar,iph[LONIP],mac[LONMAC];
+ char *idp,iph[LONIP],mac[LONMAC];
Database db;
Table tbl;
int idx,idcomando;
@@ -3464,24 +3545,19 @@ BOOLEAN envioProgramacion(SOCKET *socket_c, TRAMA *ptrTrama)
return (FALSE);
}
- //mar = copiaParametro("mar",ptrTrama); // Toma modo de arranque si el comando es Arrancar
-
// Se manda por broadcast y por unicast
- if (!Levanta(iph,mac,"1")) {
+ if (!Levanta(iph, mac, (char*)"1")) {
sprintf(msglog, "%s:%s", tbErrores[32], modulo);
errorInfo(modulo, msglog);
- liberaMemoria(mar);
return (FALSE);
}
- if (!Levanta(iph,mac,"2")) {
+ if (!Levanta(iph, mac, (char*)"2")) {
sprintf(msglog, "%s:%s", tbErrores[32], modulo);
errorInfo(modulo, msglog);
- liberaMemoria(mar);
return (FALSE);
}
- liberaMemoria(mar);
}
if (clienteDisponible(iph, &idx)) { // Si el cliente puede recibir comandos
strcpy(tbsockets[idx].estado, CLIENTE_OCUPADO); // Actualiza el estado del cliente
@@ -3505,6 +3581,7 @@ int main(int argc, char *argv[]) {
socklen_t iAddrSize;
struct sockaddr_in local, cliente;
char modulo[] = "main()";
+ int activo=1;
/*--------------------------------------------------------------------------------------------------------
Validación de parámetros de ejecución y lectura del fichero de configuración del servicio
@@ -3642,6 +3719,7 @@ int main(int argc, char *argv[]) {
Creación y configuración del socket del servicio
---------------------------------------------------------------------------------------------------------*/
socket_s = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); // Crea socket del servicio
+ setsockopt(socket_s, SOL_SOCKET, SO_REUSEPORT, &activo, sizeof(int));
if (socket_s == SOCKET_ERROR) { // Error al crear el socket del servicio
errorLog(modulo, 13, TRUE);
exit(EXIT_FAILURE);
diff --git a/admin/Sources/Services/ogAdmServer/sources/ogAdmServer.h b/admin/Sources/Services/ogAdmServer/sources/ogAdmServer.h
index cf2930a8..48f0be3a 100644
--- a/admin/Sources/Services/ogAdmServer/sources/ogAdmServer.h
+++ b/admin/Sources/Services/ogAdmServer/sources/ogAdmServer.h
@@ -117,7 +117,7 @@ BOOLEAN RESPUESTA_InventarioHardware(SOCKET *,TRAMA *);
BOOLEAN actualizaHardware(Database, Table,char* ,char*,char*,char*);
BOOLEAN cuestionPerfilHardware(Database,Table,char*,char*,int,char*,char*,int *,int);
BOOLEAN actualizaSoftware(Database , Table , char* , char* , char*,char*,char*);
-BOOLEAN cuestionPerfilSoftware(Database, Table, char*, char*,int,char*,char*,char*,int *,int);
+BOOLEAN cuestionPerfilSoftware(Database, Table, char*, char*,int,int,char*,char*,char*,int *,int);
BOOLEAN enviaArchivo(SOCKET *, TRAMA *);
BOOLEAN recibeArchivo(SOCKET *, TRAMA *);
diff --git a/admin/Sources/Services/ogAdmServerAux b/admin/Sources/Services/ogAdmServerAux
index fdc98bf2..65bea5cb 100755
--- a/admin/Sources/Services/ogAdmServerAux
+++ b/admin/Sources/Services/ogAdmServerAux
@@ -28,10 +28,15 @@ case "$PARM1" in
#1 SET_CLIENTMODE
#2 template
#3 pc_name o group_pc
+#4 modo temporal o permanente
+
TEMPLATE="$PARM2"
PC="$PARM3"
+#incluyo parametro de MODO
+ MODO="$PARM4"
echolog "Ejecutar $(which setclientmode) $FILE $MCASTOPT"
- setclientmode $TEMPLATE $PC &>> $SERVERLOG
+#incluyo parametro de MODO
+ setclientmode $TEMPLATE $PC $MODO &>> $SERVERLOG
exit $?
;;
default)
diff --git a/admin/Sources/Services/opengnsys.default b/admin/Sources/Services/opengnsys.default
index f998ccfb..644f516a 100644
--- a/admin/Sources/Services/opengnsys.default
+++ b/admin/Sources/Services/opengnsys.default
@@ -1,5 +1,5 @@
-# RUN_OGADMSERVER run OpenGnSys Admin service.
-# RUN_OGADMREPO run OpenGnSys Repository Manager service.
+# RUN_OGADMSERVER run OpenGnsys Admin service.
+# RUN_OGADMREPO run OpenGnsys Repository Manager service.
# RUN_BTTRACKER run Bittorrent Tracker
# RUN_BTSEEDER starts seeding of selected torrent files
# RUN_CRON run Cron script to check started processes
diff --git a/admin/Sources/Services/opengnsys.init b/admin/Sources/Services/opengnsys.init
index 2912811e..548843fa 100755
--- a/admin/Sources/Services/opengnsys.init
+++ b/admin/Sources/Services/opengnsys.init
@@ -6,8 +6,8 @@
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 1
-# Short-Description: Servicios del sistema OpenGnSys
-# Description: Servicios del sistema OpenGnSys
+# Short-Description: Servicios del sistema OpenGnsys
+# Description: Servicios del sistema OpenGnsys
### END INIT INFO
#
@@ -19,7 +19,7 @@ IMAGEDIR=$BASEDIR/images
CLIENTLOGDIR=$BASEDIR/log/clients
#
-# Servidor de OpenGnSys
+# Servidor de OpenGnsys
#
SERVERNAME=ogAdmServer
SERVERDAEMON=$BASEDIR/sbin/$SERVERNAME
@@ -126,7 +126,7 @@ config() {
}
arranca_demonios() {
- # Comprobar que está instalado OpenGnSys.
+ # Comprobar que está instalado OpenGnsys.
if [ ! -d $BASEDIR ]; then
$ACTIONMSG "ERROR: No existe el directorio $BASEDIR"
$FAILMSG
diff --git a/admin/WebConsole/asistentes/AsistenteCloneRemotePartition.php b/admin/WebConsole/asistentes/AsistenteCloneRemotePartition.php
index 5bef96ea..f0481d5b 100644
--- a/admin/WebConsole/asistentes/AsistenteCloneRemotePartition.php
+++ b/admin/WebConsole/asistentes/AsistenteCloneRemotePartition.php
@@ -40,8 +40,8 @@ if (!$cmd)
- echo ''?>
- echo ''?>
+ '?>
+ '?>
printJavascript('../xajax/');
@@ -50,7 +50,7 @@ $xajax->printJavascript('../xajax/');
-
+
-
+
@@ -93,13 +93,13 @@ switch($ambito){
diff --git a/admin/WebConsole/asistentes/AsistenteParticionado.php b/admin/WebConsole/asistentes/AsistenteParticionado.php
index 917b832e..f1ecc803 100644
--- a/admin/WebConsole/asistentes/AsistenteParticionado.php
+++ b/admin/WebConsole/asistentes/AsistenteParticionado.php
@@ -4,6 +4,9 @@
// Autor: Antonio J. Doblas Viso
// Baso en Codigo Comando.php de : Jose Manuel Alonso (E.T.S.I.I.) Universidad de Sevilla
// Xajax
+// version 1.1: Se incluye aviso para particiones GTP.
+// autor: Irina Gomez, ETSII Universidad de Sevilla
+// fecha: 2016-06-21
// *************************************************************************************************************************************************
@@ -52,6 +55,7 @@ if (!$cmd)
'?>
'?>
+ '?>
printJavascript('../xajax/');
@@ -97,7 +102,7 @@ function doOnload(){
echo ' '.$TbMsg[1].'
: '.$textambito.'
';
- $sws=0x11111; // Mostrar todas las configuraciones diferentes.
+ $sws=bindec('0x11111'); // Mostrar todas las configuraciones diferentes.
$configuraciones = pintaConfiguraciones($cmd,$idambito,$ambito,7,$sws,false);
global $tbKeys; // Tabla contenedora de claves de configuración
global $conKeys; // Contador de claves de configuración
@@ -154,6 +159,9 @@ function doOnload(){
+
+
+
diff --git a/admin/WebConsole/asistentes/AsistenteUpdateCache.php b/admin/WebConsole/asistentes/AsistenteUpdateCache.php
index 86a867b1..4d6d0f61 100644
--- a/admin/WebConsole/asistentes/AsistenteUpdateCache.php
+++ b/admin/WebConsole/asistentes/AsistenteUpdateCache.php
@@ -50,8 +50,8 @@ if (!$cmd)
- echo ''?>
- echo ''?>
+ '?>
+ '?>
printJavascript('../xajax/');
-
+aulas 16->ordenadores
# idambito: id de los elementos en su correspondiente tabla-ambito (aulas, ordenadores...)
# nombreambito: nombre del elemento.
@@ -108,7 +108,7 @@ switch($ambito){
-
+
@@ -119,7 +119,7 @@ switch($ambito){
-
+
'?>
-
+texto='SELECT aulas.pormul,aulas.ipmul,aulas.modomul,aulas.velmul,aulas.modp2p,aulas.timep2p FROM aulas where aulas.idaula=' . $idambito ;
-}
-
-if ($ambito == 8)
-{
-$cmd->texto='SELECT aulas.pormul,aulas.ipmul,aulas.modomul,aulas.velmul,aulas.modp2p,aulas.timep2p FROM aulas JOIN gruposordenadores ON aulas.idaula=gruposordenadores.idaula where gruposordenadores.idgrupo=' . $idambito ;
-}
-
-if ($ambito == 16)
-{
-$cmd->texto='SELECT aulas.pormul,aulas.ipmul,aulas.modomul,aulas.velmul,aulas.modp2p,aulas.timep2p FROM aulas JOIN ordenadores ON ordenadores.idaula=aulas.idaula where ordenadores.idordenador=' . $idambito ;
-}
-
- $rs=new Recordset;
- $rs->Comando=&$cmd;
-if ($rs->Abrir()){
- $rs->Primero();
- $SelectHtml = $TbMsg["WDI24"] . ': ';
- $rs->Siguiente();
- $SelectHtml.= $TbMsg["WDI25"] . ': ';
- $rs->Siguiente();
- switch ($rs->campos["modomul"])
- {
- case 1:
- $modomulticast="half-duplex";
- break;
- default:
- $modomulticast="full-duplex";
- break;
- }
- $SelectHtml.= $TbMsg["WDI26"] . ': ';
- $rs->Siguiente();
- $SelectHtml.= $TbMsg["WDI27"] . ': ';
-
- $rs->Cerrar();
- }
- $SelectHtml.= $TbMsg["WDI28"] . ': ';
- $SelectHtml.= $TbMsg["WDI29"] . ' : ';
-
- return($SelectHtml);
-}
-
-
-#devuelve los elementos [texto] p2p para un formulario.
-#$ambito (aula=4 y ordenadores=16)
-function htmlForm_p2p($cmd,$ambito,$idambito)
-{
-global $TbMsg;
-//if (isset($_GET["idambito"])) $idambito=$_GET["idambito"];
-if ($ambito == 4)
-{
-$cmd->texto='SELECT aulas.modp2p,aulas.timep2p FROM aulas where aulas.idaula=' . $idambito ;
-}
-if ($ambito == 8)
-{
-$cmd->texto='SELECT aulas.modp2p,aulas.timep2p FROM aulas JOIN gruposordenadores ON aulas.idaula=gruposordenadores.idaula where gruposordenadores.idgrupo=' . $idambito ;
-}
-
-
-if ($ambito == 16)
-{
-$cmd->texto='SELECT aulas.modp2p,aulas.timep2p FROM aulas JOIN ordenadores ON ordenadores.idaula=aulas.idaula where ordenadores.idordenador=' . $idambito ;
-}
-
- $SelectHtml="";
- $rs=new Recordset;
- $rs->Comando=&$cmd;
- if ($rs->Abrir()){
- $rs->Primero();
- $SelectHtml.= $TbMsg["WDI26"] . ' : ';
- $rs->Siguiente();
- $SelectHtml.= $TbMsg["WDI30"] . ' : ';
- $rs->Siguiente();
- $rs->Cerrar();
- }
-
-return($SelectHtml);
-}
-
-
-function htmlForm_unicast($cmd,$ambito,$idambito)
-{
-global $TbMsg;
-//if (isset($_GET["idambito"])) $idambito=$_GET["idambito"];
-if ($ambito == 4)
-{
-$cmd->texto='SELECT nombreordenador,idordenador,ip FROM ordenadores where idaula=' . $idambito ;
-}
-
-if ($ambito == 8)
-{
-$cmd->texto='SELECT nombreordenador,idordenador,ip FROM ordenadores where grupoid=' . $idambito ;
-}
-if ($ambito == 16)
-{
-$cmd->texto='SELECT nombreordenador,idordenador,ip FROM ordenadores where idaula=' . $idambito ;
-}
-
- $SelectHtml="";
- $rs=new Recordset;
- $rs->Comando=&$cmd;
-
- if ($rs->Abrir()){
- $rs->Primero();
- $ucastclient="";
- while (!$rs->EOF){
- $ucastclient.= $rs->campos["ip"] . ":" ;
- $rs->Siguiente();
- }
- $rs->Cerrar();
- }
- $SelectHtml.= $TbMsg["WDI24"] . ' : ';
- $SelectHtml.= $TbMsg["WDI28"] . ' : ';
-
- return($SelectHtml);
-}
-
-
-
-function htmlOPTION_equipos($cmd,$ambito,$idambito)
-{
-
-//if (isset($_GET["idambito"])) $idambito=$_GET["idambito"];
-if ($ambito == 4)
-{
-$cmd->texto='SELECT nombreordenador,idordenador,ip FROM ordenadores where idaula=' . $idambito ;
-}
-
-if ($ambito == 8)
-{
-$cmd->texto='SELECT nombreordenador,idordenador,ip FROM ordenadores where grupoid=' . $idambito ;
-}
-if ($ambito == 16)
-{
-$cmd->texto='SELECT nombreordenador,idordenador,ip FROM ordenadores where idaula=' . $idambito ;
-}
-
- $SelectHtml="";
- $rs=new Recordset;
- $rs->Comando=&$cmd;
-
- if ($rs->Abrir()){
- $rs->Primero();
- while (!$rs->EOF){
- $SelectHtml.='';
- $rs->Siguiente();
- }
- $rs->Cerrar();
- }
- //$SelectHtml.= '';
- return($SelectHtml);
-}
-
-
-
-
-
-
-function htmlOPTION_images($cmd,$ambito,$idambito)
-{
-if ($ambito == 4)
-{
-$subconsultarepo='SELECT DISTINCT idrepositorio from ordenadores where idaula=' . $idambito ;
-}
-if ($ambito == 8)
-{
-$subconsultarepo='SELECT DISTINCT idrepositorio FROM ordenadores where grupoid=' . $idambito ;
-}
-if ($ambito == 16)
-{
-$subconsultarepo='SELECT idrepositorio FROM ordenadores where idordenador=' . $idambito ;
-}
-
-
- $SelectHtml="";
- // 1.0.5 imagenes.tipo =1 para que solo muestre las monoloticas.
- $cmd->texto="SELECT *,repositorios.ip as iprepositorio FROM imagenes
- INNER JOIN repositorios ON repositorios.idrepositorio=imagenes.idrepositorio AND repositorios.idrepositorio=(" . $subconsultarepo . ") WHERE imagenes.tipo=1";
- $rs=new Recordset;
- $rs->Comando=&$cmd;
-
- if ($rs->Abrir()){
- $rs->Primero();
- while (!$rs->EOF){
- $SelectHtml.='';
- $rs->Siguiente();
- }
- $rs->Cerrar();
- }
- else
- {
- $SelectHtml.='';
-
- }
- return($SelectHtml);
-}
-
-
-
-function HTMLSELECT_imagenes($cmd,$idimagen,$numpar,$codpar,$icp,$sw)
-{
- $SelectHtml="";
- $cmd->texto="SELECT *,repositorios.ip as iprepositorio FROM imagenes
- INNER JOIN repositorios ON repositorios.idrepositorio=imagenes.idrepositorio";
- if($sw) // Imágenes con el mismo tipo de partición
- $cmd->texto.= " WHERE imagenes.codpar=".$codpar;
- else
- $cmd->texto.= " WHERE imagenes.codpar<>".$codpar;
-
- $cmd->texto.=" AND imagenes.numpar>0 AND imagenes.codpar>0 AND imagenes.idrepositorio>0"; // La imagene debe existir y estar creada
- $rs=new Recordset;
- $rs->Comando=&$cmd;
- if($sw) $des=1; else $des=0;
- $SelectHtml.= '';
- return($SelectHtml);
-}
-
-
-
-function htmlOPTION_typepartnotcache($cmd)
-{
- $SelectHtml="";
- $cmd->texto='SELECT tipopar FROM tipospar WHERE NOT tipopar = "CACHE"';
- $rs=new Recordset;
- $rs->Comando=&$cmd;
- //$SelectHtml.= '';
- return($SelectHtml);
-}
-
-
-function htmlForm_typepart($cmd,$numpar)
-{
- $SelectHtml="";
- $cmd->texto='SELECT DISTINCT tipopar FROM tipospar
- JOIN ordenadores_particiones ON ordenadores_particiones.codpar = tipospar.codpar
- WHERE numpar = ' .$numpar;
- $rs=new Recordset;
- $rs->Comando=&$cmd;
-
- if ($rs->Abrir()){
- $rs->Primero();
- while (!$rs->EOF){
- $valor=$rs->campos["tipopar"];
- $SelectHtml.='';
- $rs->Siguiente();
- }
- $rs->Cerrar();
- }
- return($SelectHtml);
-}
-
-
-function htmlForm_typepartnotcacheEngine10($npart)
-{
-$SelectHtml="";
-if ($npart == 4) {
- $SelectHtml.='';
-}
-$SelectHtml.='';
-$SelectHtml.='';
-$SelectHtml.='';
-$SelectHtml.='';
-$SelectHtml.='';
-$SelectHtml.='';
-$SelectHtml.='';
-$SelectHtml.='';
-$SelectHtml.='';
-$SelectHtml.='';
-$SelectHtml.='';
-$SelectHtml.='';
-$SelectHtml.='';
-$SelectHtml.='';
-$SelectHtml.='';
-$SelectHtml.='';
-$SelectHtml.='';
-$SelectHtml.='';
-$SelectHtml.='';
-$SelectHtml.='';
-$SelectHtml.='';
-if ($npart <= 4) {
- $SelectHtml.='';
-}
-return($SelectHtml);
-}
-
-function htmlForm_typepartnotcacheGPT($npart)
-{
-$SelectHtml="";
-if ($npart == 4) {
- $SelectHtml.='';
-}
-$SelectHtml.='';
-$SelectHtml.='';
-$SelectHtml.='';
-$SelectHtml.='';
-$SelectHtml.='';
-$SelectHtml.='';
-$SelectHtml.='';
-$SelectHtml.='';
-$SelectHtml.='';
-$SelectHtml.='';
-$SelectHtml.='';
-$SelectHtml.='';
-$SelectHtml.='';
-$SelectHtml.='';
-$SelectHtml.='';
-$SelectHtml.='';
-$SelectHtml.='';
-$SelectHtml.='';
-$SelectHtml.='';
-$SelectHtml.='';
-$SelectHtml.='';
-$SelectHtml.='';
-$SelectHtml.='';
-$SelectHtml.='';
-return($SelectHtml);
-}
-
-function htmlForm_sizepart($cmd,$numpar)
-{
- $SelectHtml="";
- $cmd->texto='SELECT DISTINCT tamano FROM ordenadores_particiones WHERE numpar = ' .$numpar . ' AND NOT tamano = 0';
- $rs=new Recordset;
- $rs->Comando=&$cmd;
-
- if ($rs->Abrir()){
- $rs->Primero();
- while (!$rs->EOF){
- $SelectHtml.='';
- $rs->Siguiente();
- }
- $rs->Cerrar();
- }
- return($SelectHtml);
-}
-
-
-function pintaParticionesAsistenteDeployImage($cmd,$configuraciones,$idordenadores,$cc)
-{
- global $tbKeys; // Tabla contenedora de claves de configuración
- global $conKeys; // Contador de claves de configuración
- global $TbMsg;
-
- $colums=7;
- echo '
';
- echo '
'.$TbMsg[20].'
'; // Número de partición
- echo '
'.$TbMsg[24].'
'; // Tipo de partición
- echo '
'.$TbMsg[27].'
'; // Sistema de ficheros
- echo '
'.$TbMsg[21].'
'; // Sistema Operativo Instalado
- echo '
'.$TbMsg[22].'
'; // Tamaño
- echo '
'.$TbMsg[25].'
'; // Imagen instalada
- echo '
'.$TbMsg[26].'
'; // Perfil software
- echo '
';
-
- $auxCfg=split("@",$configuraciones); // Crea lista de particiones
- for($i=0;$i0)
- echo'