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