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 | |
---|
9 | include_once("./includes/ctrlacc.php"); |
---|
10 | include_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 | |
---|
23 | function 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']); |
---|
62 | if(stripos($device,'iphone') == TRUE ){$device="iphone";$tipodevice="Iphone / Ipad";$ipreal=getRemoteInfo();$_SESSION["ipdevice"]=$ipreal;} |
---|
63 | elseif (stripos($device,'ipad') == TRUE) {$device="ipad";$tipodevice="Ipad / Iphone";$ipreal=getRemoteInfo();$_SESSION["ipdevice"]=$ipreal;} |
---|
64 | elseif (stripos($device,'android') == TRUE) {$device="android";$tipodevice="Movil / Tablet";$ipreal=getRemoteInfo();$_SESSION["ipdevice"]=$ipreal;} |
---|
65 | elseif (stripos($device,'linux') == TRUE) {$device="linux";$tipodevice="Linux";$ipreal=getRemoteInfo();$_SESSION["ipdevice"]=$ipreal;} |
---|
66 | elseif (stripos($device,'macintosh') == TRUE) {$device="macintosh";$tipodevice="Macintosh";$ipreal=getRemoteInfo();$_SESSION["ipdevice"]=$ipreal;} |
---|
67 | else{$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 | ////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
---|
78 | if(stripos($buscasistem,'windows nt 10.0') == TRUE ){$sistem="Windows 10";} |
---|
79 | if(stripos($buscasistem,'windows nt 6.2') == TRUE ){$sistem="Windows 8";} |
---|
80 | if(stripos($buscasistem,'windows nt 6.1') == TRUE ){$sistem="Windows 7";} |
---|
81 | if(stripos($buscasistem,'windows nt 6.0') == TRUE ){$sistem="Windows Vista/Server 2008";} |
---|
82 | if(stripos($buscasistem,'windows nt 5.2') == TRUE ){$sistem="Windows Server 2003";} |
---|
83 | if(stripos($buscasistem,'windows nt 5.1') == TRUE ){$sistem="Windows XP";} |
---|
84 | if(stripos($buscasistem,'windows nt 5.0') == TRUE ){$sistem="Windows 2000";} |
---|
85 | |
---|
86 | ////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
---|
87 | // SISTEMAS APPLE // |
---|
88 | ////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
---|
89 | if(stripos($buscasistem,'ipad') == TRUE ){$sistem="iOS";} |
---|
90 | if(stripos($buscasistem,'iphone') == TRUE ){$sistem="iOS";} |
---|
91 | if ($device == "macintosh" ){$sistem="Mac OSX";} |
---|
92 | |
---|
93 | ////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
---|
94 | // SISTEMAS LINUX // |
---|
95 | ////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
---|
96 | if(stripos($buscasistem,'ubuntu') == TRUE ){$sistem="Ubuntu";} |
---|
97 | if(stripos($buscasistem,'red hat') == TRUE ){$sistem="Red Hat";} |
---|
98 | if(stripos($buscasistem,'centos') == TRUE ){$sistem="CentOS";} |
---|
99 | if(stripos($buscasistem,'suse') == TRUE ){$sistem="openSUSE";} |
---|
100 | if(stripos($buscasistem,'mandriva') == TRUE ){$sistem="Mandriva";} |
---|
101 | |
---|
102 | ////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
---|
103 | // SISTEMAS ANDROID // |
---|
104 | ////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
---|
105 | if(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 | ////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
---|
116 | if(stripos($buscaversistem,'windows nt') == TRUE ){$versistem="-";} |
---|
117 | ////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
---|
118 | |
---|
119 | ////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
---|
120 | // VERSION APPLE // |
---|
121 | ////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
---|
122 | if(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 | ////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
---|
134 | if(stripos($buscaversistem,'linux') == TRUE ){$versistem="-";} |
---|
135 | |
---|
136 | ////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
---|
137 | // VERSION ANDROID // |
---|
138 | ////////////////////////////////////////////////////////////////////////////////////////////////////////////// |
---|
139 | if(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']); |
---|
149 | if(stripos($buscanav,'firefox') == TRUE ){$nav="Firefox";} |
---|
150 | if(stripos($buscanav,'safari') == TRUE ){$nav="Safari";} |
---|
151 | if(stripos($buscanav,'msie') == TRUE ){$nav="Internet Explorer";} |
---|
152 | if(stripos($buscanav,'chrome') == TRUE ){$nav="Google Chrome";} |
---|
153 | if(stripos($buscanav,'opera') == TRUE ){$nav="Opera";} |
---|
154 | if(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 | |
---|
167 | if ($device == "ipad" || $device == "iphone" || $device == "android" ) |
---|
168 | { |
---|
169 | $data = json_decode(@file_get_contents(__DIR__ . '/../doc/VERSION.json')); |
---|
170 | if (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"> </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"> </td> |
---|
196 | </tr> |
---|
197 | <tr> |
---|
198 | <td width="23%"> </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> </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> </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> </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> </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> </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> </td> |
---|
229 | <td> </td> |
---|
230 | <td> </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" > <?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 | |
---|