$serveiestudis = new stdClass();
//
if (!isset($pg))
{$pg = "";}
if ($pg == "mtse" or $pg == "mtno" or $pg == "ieie")
{
//no fem comprovacio
}
else
{
require("../scripts/libs/phprotector/PhProtector.php");
//
/* TESTING environment (show all PHP errors!) */
//
$prot= new PhProtector("../scripts/libs/phprotector/log.xml", true);
//
/* FINAL environment (do not show PHP errors!) */
//
//$prot = new PhProtector("../scripts/libs/phprotector/log.xml", false);
//
if($prot->isMalicious())
{
header("location: ../atac.html"); //if an atack is found, it will be redirected to this page :)
die();
}
}
require_once ("../scripts/codi/funcio_crea_link.php");
require_once ("../scripts/codi/funcio_imatge.php");
require_once ("../scripts/codi/funcio_usuaris.php");
require_once ("../scripts/codi/funcio_thumbnail.php");
require_once ("../scripts/codi/funcio_bytes.php");
require_once ("../scripts/codi/funcio_valida.php");
//
$web_segura = "";
if (isset($_SERVER['HTTPS']))
{
$web_segura = "si";
}
if (!isset($web_sortida))
{$web_sortida = "";}
$posa_link_noticies="";
#$idioma="";
#$pg="";
#$DataControl="";
# deprecated
#set_magic_quotes_runtime(0);
setlocale(LC_ALL, 'es_ES');
#
while(list($key, $val) = each($_GET))
{
$key_org = $key . "_org";
$$key_org = $val;
//
if (is_array($$key_org))
{
$$key = $val;
foreach ($$key as $clau => $valor)
{
# print ("
x $$key - $clau - $valor ");
if ($valor <> strip_tags($valor) )
{
# echo "detectat un problema get amb array $key
";
unset($$key);
}
}
# echo "
";
# print_r ($anys_entrats);
# echo "
";
# print ("no $anys_entrats");
# echo "
";
# print_r ($anys_entrats_org);
# echo "
";
}
else
{
$$key = strip_tags($val);
if ($$key <> $$key_org)
{
# echo "detectat un problema get amb $key
";
# print_r ($anys_entrats);
# echo "
";
# print ($anys_entrats);
# echo "
";
# print_r ($anys_entrats_org);
# echo "
";
unset($$key);
}
}
}
#print ("
despres de tots els gets pg $pg idioma $idioma idioma_org $idioma_org llibre $llibre");
//
while(list($key, $val) = each($_POST))
{
$key_org = $key . "_org";
$$key_org = $val;
//
if (is_array($$key_org))
{
$$key = $val;
foreach ($$key as $clau => $valor)
{
# print ("
x $$key - $clau - $valor ");
if ($valor <> strip_tags($valor) )
{
# echo "detectat un problema post amb array $key
";
unset($$key);
}
}
# echo "
";
# print_r ($anys_entrats);
# echo "
";
# print ("no $anys_entrats");
# echo "
";
# print_r ($anys_entrats_org);
# echo "
";
}
else
{
#
# ATENCI !!!!
#
# noms pel cas POST d'aquestes dues variables no es fa control
# ---> afegim tres variables del manteniment de noticies
# sn variables del programa de manteniment
#
if ($key == "wp_abstract" or $key == "wp_resum" or $key == "wp_autor"
or $key == "wp_txt" or $key == "wp_title" or $key == "wp_sots"
)
{
$$key = $val;
}
else
{
$$key = strip_tags($val);
if ($$key <> $$key_org)
{
# echo "detectat un problema post amb $key
";
# print_r ($anys_entrats);
# echo "
";
# print ($anys_entrats);
# echo "
";
# print_r ($anys_entrats_org);
# echo "
";
unset($$key);
}
}
}
}
#print ("
despres de tots els post pg $pg idioma $idioma llibre $llibre");
#
# si intenten fer-nos la pirula amb la cookie el posem en angles
#
if (!isset($idioma) or !$idioma or !preg_match("/cat|esp|eng/",$idioma) or strlen($idioma) <> 3 )
{
if ($_COOKIE['idioma'])
{
$temporal =$_COOKIE['idioma'];
if (preg_match("/cat|esp|eng/",$temporal) and strlen($temporal) == 3)
{
$idioma = $temporal;
}
else
{
$idioma = "eng";
}
}
else
{
$idioma = "eng";
}
}
#
if (!isset($web_sortida) or !$web_sortida or !preg_match("/mobi|ebook/",$web_sortida) )
{
$web_sortida = "";
}
if (isset($pg))
{
if ($pg=="home")
{
require_once "../scripts/codi/galetes.php";
$caducitat=time()+24*60*60*30;
set_cookie_fix_domain('idioma', $idioma, $caducitat, '/' );
}
}
#
//
if (isset($DataControl))
{
if ($DataControl == $DataControl_org)
{
list($yr,$mn,$dt) = split('-',$DataControl);
if ( checkdate($mn, $dt, $yr) and ($yr <= date("Y")) and ($yr >= (date("Y") - 1)) )
{
$DataAvui = $DataControl;
}
else
{
# echo "no es una data correcta";
$DataAvui = date("Y-m-d");
}
}
else
{
# echo "tenim un problema amb datacontrol";
$DataAvui = date("Y-m-d");
}
}
else
{
$DataAvui = date("Y-m-d");
}
$DataAvuiDMA = date("j-n-y");
// controlem el llibre
if (isset($llibre))
{
if ( !validateAlphanum ( $llibre ) )
{
// echo "tenim un problema llibre $llibre";
unset($llibre);
}
else
{
// echo Welcome to our site!;
}
}
// controlem el cpn - codi numeric de l'im
if (isset($cpn))
{
if ( strlen ($cpn) <> 7 )
{
// echo "tenim un problema amb cpn $cpn";
unset($cpn);
}
else
if ( !validateNum ( substr($cpn,0,6) ) )
{
// echo "tenim un problema amb cpn $cpn";
unset($cpn);
}
else
if ( substr($cpn,6,1) <> "s" and substr($cpn,6,1) <> "c" )
{
// echo "tenim un problema amb cpn $cpn";
unset($cpn);
}
else
{
// echo Welcome to our site!;
}
}
// controlem el any
if (isset($any))
{
if ( !validateNum ( $any ) )
{
// echo "tenim un problema amb any $any";
unset($any);
}
else
{
// echo Welcome to our site!;
}
}
// controlem el any de la variable pgdet
if (isset($pgdet))
{
if ( !validateNum ( $pgdet ) )
{
// echo "tenim un problema amb pgdet $pgdet";
unset($pgdet);
}
else
{
// echo Welcome to our site!;
}
}
// controlem el any de la variable pgdt2
if (isset($pgdt2))
{
if ( !validateNum ( $pgdt2 ) )
{
// echo "tenim un problema amb pgdt2 $pgdt2";
unset($pgdt2);
}
else
{
// echo Welcome to our site!;
}
}
// controlem la variable resum
if (!isset($resum) or !preg_match("/si|no/",$resum) )
{
// echo "tenim un problema amb resum $resum";
unset($resum);
}
else
{
// echo Welcome to our site!;
}
// controlem la variable pg_llibre per videos de moment nomes pot ser ct pero preveiem cm per magistrals
// els altres programes la fan servir aixi que afegim valors a la variable
if (!isset($pg_llibre) or !preg_match("/ap|ca|cm|cn|ct|de|di|ee|ep|gl|im|ra|rt|wp/",$pg_llibre) )
{
// echo "tenim un problema amb pg_llibre $pg_llibre";
unset($pg_llibre);
}
else
{
// echo Welcome to our site!;
}
//
require_once "../config.inc.php";
//$myDevice = new tera_wurfl();
#$myDevice = new TeraWurfl();
#$myDevice->GetDeviceCapabilitiesFromAgent($_SERVER["HTTP_USER_AGENT"]);
#$capab = $myDevice->capabilities;
$capab['product_info']['is_wireless_device']=0;
//
if ($web_sortida=="mobi") {require_once "../dc/literals_".$idioma.".php";}
require_once "literals.php";
require_once "literals_".$idioma.".php";
#
$punt_decimal = ",";
$sep_milers = ".";
if ($idioma == "eng")
{
$punt_decimal = ".";
$sep_milers = ",";
}
#
$mysqli = mysqli_connect("localhost",$db_user,$db_password,$database) or die($mysqli_connect_errno());
#$serveiestudis->dbcon = mysqli_connect("localhost",$db_user,$db_password,$database) or die($mysqli_connect_errno());
#@mysql_select_db($database,$serveiestudis->dbcon) or die($err_mysql_select_db);
?>
$query = "SELECT * FROM pivot WHERE pivot_key = '$pg' AND pivot_id = '$idioma' ";
$result = mysqli_query($mysqli,$query);
$row_count = mysqli_num_rows($result);
$title = "";
if ($row_count == 1)
{
$row = mysqli_fetch_array($result);
$title = $row['pivot_title'];
}
include ("../scripts/codi/estadistiques.php");
#
#
# ATENCIO si tenim un arxiu de sortida deixem una capalera molt reduda
#
$vt_sortida="";
if (isset($arxiu_sortida))
{
if ($web_sortida=="mobi" or $web_sortida=="ebook")
{
$link_css = crea_link("sphp/scripts/css/estils_mb.css",$servidors,$web_sortida);
}
else
{
$link_css = crea_link("sphp/scripts/css/site2.css",$servidors,$web_sortida);
}
$vt_sortida.="\n";
$vt_sortida.="\n";
$vt_sortida.="\n";
$vt_sortida.="
|
||||||||
$track_lacaixa![]() |
|
|
|
|
|
||||||||
|