source: admin/WebConsole/nada.php @ 2c1b0cf

918-git-images-111dconfigfileconfigure-oglivegit-imageslgromero-new-oglivemainmaint-cronmount-efivarfsmultivmmultivm-ogboot-installerogClonningEngineogboot-installer-jenkinsoglive-ipv6test-python-scriptsticket-301ticket-50ticket-50-oldticket-577ticket-585ticket-611ticket-612ticket-693ticket-700ubu24tplunification2use-local-agent-oglivevarios-instalacion
Last change on this file since 2c1b0cf was c1bee01a, checked in by Irina Gómez <irinagomez@…>, 6 years ago

#858 Messages and images for tip of the day are included.

  • Property mode set to 100644
File size: 12.6 KB
Line 
1<?php
2/**
3 * @file    nada.php
4 * @brief   Muestra el marco derecho "por defecto" cuando no se ejecuta un comando.
5 * @version 1.1.1 - Se incluyen consejos del día la primera vez que se entra.
6 * @date    2019-09-06
7 */
8
9include_once("./includes/ctrlacc.php");
10include_once("./idiomas/php/".$idioma."/nada_".$idioma.".php");
11
12// ################### Consejo del día ################# //
13// Elijo el consejo de hoy aleatoriamente.
14$numTip=rand(0,count($TipOfDay)-1);
15$tipMessage=$TipOfDay[$numTip];
16$tipImage=is_file("images/tipOfDay_$numTip.png") ? "images/tipOfDay_$numTip.png" : "images/blanco.png";
17
18// ##########################################################################################################
19// ###############  PARA SABER QUE IP TIENE EL DISPOSITIVO QUE ESTA UTILIZANDO OPENGNSYS  ###################
20// ##########################################################################################################
21//Para saber la IP con Proxy o sin el
22
23function getRemoteInfo () {
24   $proxy="";
25   if (isSet($_SERVER)) {
26       if (isSet($_SERVER["HTTP_X_FORWARDED_FOR"])) {
27           $IP = $_SERVER["HTTP_X_FORWARDED_FOR"];
28           $proxy  = $_SERVER["REMOTE_ADDR"];
29       } elseif (isSet($_SERVER["HTTP_CLIENT_IP"])) {
30           $IP = $_SERVER["HTTP_CLIENT_IP"];
31       } else {
32           $IP = $_SERVER["REMOTE_ADDR"];
33       }
34   } else {
35       if ( getenv( 'HTTP_X_FORWARDED_FOR' ) ) {
36           $IP = getenv( 'HTTP_X_FORWARDED_FOR' );
37           $proxy = getenv( 'REMOTE_ADDR' );
38       } elseif ( getenv( 'HTTP_CLIENT_IP' ) ) {
39           $IP = getenv( 'HTTP_CLIENT_IP' );
40       } else {
41           $IP = getenv( 'REMOTE_ADDR' );
42       }
43   }
44   if (strstr($IP, ',')) {
45       $ips = explode(',', $IP);
46       $IP = $ips[0];
47   }
48   $RemoteInfo[0]=$IP;
49   $RemoteInfo[1]=@GetHostByAddr($IP);
50   $RemoteInfo[2]=$proxy;
51
52        return $RemoteInfo[0];
53}
54
55/////////////////////////////////////////////////////////////////////////////////////////////////////////////
56
57// ##########################################################################################################
58// ###############  PARA SABER QUE TIPO DISPOSITIVO ESTA UTILIZANDO OPENGNSYS  ##############################
59// ##########################################################################################################
60$device="";
61$device = strtolower($_SERVER['HTTP_USER_AGENT']);
62if(stripos($device,'iphone') == TRUE ){$device="iphone";$tipodevice="Iphone / Ipad";$ipreal=getRemoteInfo();$_SESSION["ipdevice"]=$ipreal;}
63elseif  (stripos($device,'ipad') == TRUE) {$device="ipad";$tipodevice="Ipad / Iphone";$ipreal=getRemoteInfo();$_SESSION["ipdevice"]=$ipreal;}
64elseif (stripos($device,'android') == TRUE) {$device="android";$tipodevice="Movil / Tablet";$ipreal=getRemoteInfo();$_SESSION["ipdevice"]=$ipreal;}
65elseif (stripos($device,'linux') == TRUE) {$device="linux";$tipodevice="Linux";$ipreal=getRemoteInfo();$_SESSION["ipdevice"]=$ipreal;}
66elseif (stripos($device,'macintosh') == TRUE) {$device="macintosh";$tipodevice="Macintosh";$ipreal=getRemoteInfo();$_SESSION["ipdevice"]=$ipreal;}
67else{$device="0";$tipodevice="PC";}
68/////////////////////////////////////////////////////////////////////////////////////////////////////////////
69
70// ##########################################################################################################
71// ################################  PARA SABER QUE SISTEMA DEL DISPOSITIVO  ################################
72// ##########################################################################################################
73$sistem="";
74$buscasistem=strtolower($_SERVER['HTTP_USER_AGENT']);
75//////////////////////////////////////////////////////////////////////////////////////////////////////////////
76//      SISTEMAS WINDOWS //
77//////////////////////////////////////////////////////////////////////////////////////////////////////////////
78if(stripos($buscasistem,'windows nt 10.0') == TRUE ){$sistem="Windows 10";}
79if(stripos($buscasistem,'windows nt 6.2') == TRUE ){$sistem="Windows 8";}
80if(stripos($buscasistem,'windows nt 6.1') == TRUE ){$sistem="Windows 7";}
81if(stripos($buscasistem,'windows nt 6.0') == TRUE ){$sistem="Windows Vista/Server 2008";}
82if(stripos($buscasistem,'windows nt 5.2') == TRUE ){$sistem="Windows Server 2003";}
83if(stripos($buscasistem,'windows nt 5.1') == TRUE ){$sistem="Windows XP";}
84if(stripos($buscasistem,'windows nt 5.0') == TRUE ){$sistem="Windows 2000";}
85
86//////////////////////////////////////////////////////////////////////////////////////////////////////////////
87//      SISTEMAS APPLE //
88//////////////////////////////////////////////////////////////////////////////////////////////////////////////
89if(stripos($buscasistem,'ipad') == TRUE ){$sistem="iOS";}
90if(stripos($buscasistem,'iphone') == TRUE ){$sistem="iOS";}
91if ($device == "macintosh" ){$sistem="Mac OSX";}
92
93//////////////////////////////////////////////////////////////////////////////////////////////////////////////
94//      SISTEMAS LINUX //
95//////////////////////////////////////////////////////////////////////////////////////////////////////////////
96if(stripos($buscasistem,'ubuntu') == TRUE ){$sistem="Ubuntu";}
97if(stripos($buscasistem,'red hat') == TRUE ){$sistem="Red Hat";}
98if(stripos($buscasistem,'centos') == TRUE ){$sistem="CentOS";}
99if(stripos($buscasistem,'suse') == TRUE ){$sistem="openSUSE";}
100if(stripos($buscasistem,'mandriva') == TRUE ){$sistem="Mandriva";}
101
102//////////////////////////////////////////////////////////////////////////////////////////////////////////////
103//      SISTEMAS ANDROID //
104//////////////////////////////////////////////////////////////////////////////////////////////////////////////
105if(stripos($buscasistem,'android') == TRUE ){$sistem="Android";}
106
107/////////////////////////////////////////////////////////////////////////////////////////////////////////////
108// ##########################################################################################################
109// ##########################  PARA SABER QUE VERSION DEL SISTEMA DEL DISPOSITIVO  ##########################
110// ##########################################################################################################
111$buscaversistem=strtolower($_SERVER['HTTP_USER_AGENT']);
112
113//////////////////////////////////////////////////////////////////////////////////////////////////////////////
114//      VERSION WINDOWS //
115//////////////////////////////////////////////////////////////////////////////////////////////////////////////
116if(stripos($buscaversistem,'windows nt') == TRUE ){$versistem="-";}
117//////////////////////////////////////////////////////////////////////////////////////////////////////////////
118
119//////////////////////////////////////////////////////////////////////////////////////////////////////////////
120//      VERSION APPLE //
121//////////////////////////////////////////////////////////////////////////////////////////////////////////////
122if(stripos($buscaversistem,'os x') == TRUE ){
123$buscaversistemapple=$_SERVER['HTTP_USER_AGENT'];
124$buscaversistemapple=str_replace("OS","OS:",$buscaversistemapple);
125$buscaversistemapple=str_replace("like",":like",$buscaversistemapple);
126$buscaversistemapple=explode(":",$buscaversistemapple);
127$versistem=$buscaversistemapple[1];}
128
129/////////////////////////////////////////////////////////////////////////////////////////////////////////////
130
131//////////////////////////////////////////////////////////////////////////////////////////////////////////////
132//      VERSION LINUX //
133//////////////////////////////////////////////////////////////////////////////////////////////////////////////
134if(stripos($buscaversistem,'linux') == TRUE ){$versistem="-";}
135
136//////////////////////////////////////////////////////////////////////////////////////////////////////////////
137//      VERSION ANDROID //
138//////////////////////////////////////////////////////////////////////////////////////////////////////////////
139if(stripos($buscaversistem,'android') == TRUE ){
140$buscaversistemandroid=str_replace(")",";",$buscaversistem);
141$buscaversistemandroid=explode(";",$buscaversistemandroid);
142$versistem=$buscaversistemandroid[2];
143}
144/////////////////////////////////////////////////////////////////////////////////////////////////////////////
145// ##########################################################################################################
146// ##########################  PARA SABER QUE NAVEGADOR DEL SISTEMA DEL DISPOSITIVO  ########################
147// ##########################################################################################################
148$buscanav=strtolower($_SERVER['HTTP_USER_AGENT']);
149if(stripos($buscanav,'firefox') == TRUE ){$nav="Firefox";}
150if(stripos($buscanav,'safari') == TRUE ){$nav="Safari";}
151if(stripos($buscanav,'msie') == TRUE ){$nav="Internet Explorer";}
152if(stripos($buscanav,'chrome') == TRUE ){$nav="Google Chrome";}
153if(stripos($buscanav,'opera') == TRUE ){$nav="Opera";}
154if(stripos($buscanav,'qtembedded') == TRUE ){$nav="OpenGnsys Browser";}
155//////////////////////////////////////////////////////////////////////////////////////////////////////////////
156
157/////////////////////////////////////////////////////////////////////////////////////////////////////////////
158// ##########################################################################################################
159// ##########################  PARA SABER VERSION DEL NAVEGADOR DEL DISPOSITIVO  ############################
160// ##########################################################################################################
161$buscavernav=explode("/", strtolower($_SERVER['HTTP_USER_AGENT']));
162$vernav=end($buscavernav);
163
164//////////////////////////////////////////////////////////////////////////////////////////////////////////////
165
166
167if ($device == "ipad" || $device == "iphone" || $device == "android" )
168{
169$data = json_decode(@file_get_contents(__DIR__ . '/../doc/VERSION.json'));
170if (empty($data->project)) {
171    $version = "OpenGnsys";
172} else {
173    $version = @$data->project.' ' . @$data->version.' '
174             . (isset($data->codename) ? '('.$data->codename.') ' : '') . @$data->release;
175}
176?>
177<html>
178<head>
179  <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
180  <link rel="stylesheet" type="text/css" href="./estilos.css">
181</head>
182<body>
183
184<table width="100%" border="0">
185  <tr>
186    <td colspan="3" align="center">&nbsp;</td>
187  </tr>
188  <tr>
189    <td colspan="3" align="center"><SPAN align=center class=cabeceras><font size="4"><?php echo $TbMsg[0] ;?></font></SPAN></td>
190  </tr>
191  <tr>
192    <td colspan="3" align="center"><SPAN align=center class=cabeceras><font size="4"><?php echo $version; ?></font></SPAN></td>
193  </tr>
194  <tr>
195    <td colspan="3" align="center">&nbsp;</td>
196  </tr>
197  <tr>
198    <td width="23%">&nbsp;</td>
199    <td width="28%"><SPAN align=center class=subcabeceras><font size="3"><?php echo $TbMsg[1] ;?></font></SPAN></td>
200    <td width="49%"><SPAN align=center class=sobrecabeceras><font size="3"><?php echo $_SESSION['ipdevice']; ?></font></SPAN></td>
201  </tr>
202  <tr>
203    <td>&nbsp;</td>
204    <td><SPAN align=center class=subcabeceras><font size="3"><?php echo $TbMsg[2] ;?></font></SPAN></td>
205    <td><SPAN align=center class=sobrecabeceras><font size="3"><?php echo $tipodevice; ?></font></SPAN></td>
206  </tr>
207  <tr>
208    <td>&nbsp;</td>
209    <td><SPAN align=center class=subcabeceras><font size="3"><?php echo $TbMsg[3] ;?></font></SPAN></td>
210    <td><SPAN align=center class=sobrecabeceras><font size="3"><?php echo $sistem; ?></font></SPAN></td>
211  </tr>
212  <tr>
213    <td>&nbsp;</td>
214    <td><SPAN align=center class=subcabeceras><font size="3"><?php echo $TbMsg[4] ;?></font></SPAN></td>
215    <td><SPAN align=center class=sobrecabeceras><font size="3"><?php echo $versistem; ?></font></SPAN></td>
216  </tr>
217  <tr>
218    <td>&nbsp;</td>
219    <td><SPAN align=center class=subcabeceras><font size="3"><?php echo $TbMsg[5] ;?></font></SPAN></td>
220    <td><SPAN align=center class=sobrecabeceras><font size="3"><?php echo $nav; ?></font></SPAN></td>
221  </tr>
222  <tr>
223    <td>&nbsp;</td>
224    <td><SPAN align=center class=subcabeceras><font size="3"><?php echo $TbMsg[6] ;?></font></SPAN></td>
225    <td><SPAN align=center class=sobrecabeceras><font size="3"><?php echo $vernav; ?></font></SPAN></td>
226  </tr>
227  <tr>
228    <td>&nbsp;</td>
229    <td>&nbsp;</td>
230    <td>&nbsp;</td>
231  </tr>
232</table>
233
234
235</body>
236</html>
237
238<?php } else { ?>
239
240<html>
241<head>
242  <meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
243  <link rel="stylesheet" type="text/css" href="./estilos.css">
244</head>
245<body>
246
247<div>
248    <p align=center class=cabeceras><img  border=0 nod="aulas-1" value="Sala Virtual" style="cursor:pointer" src="images/iconos/logocirculos.png" >&nbsp;&nbsp;<?php echo $TbMsg["TIP"]; ?></p>
249    <div class="tipOfDay">
250        <p class="subcabeceras help_menu"> <?php echo $tipMessage ?></p>
251        <img src="<?php echo $tipImage ?>">
252    </div>
253</div>
254
255</body>
256</html>
257
258<?php } ?>
259
Note: See TracBrowser for help on using the repository browser.