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