Exemplo n.º 1
0
 function __construct()
 {
     require_once 'libs/config.php';
     $this->_system = System::singleton();
     $this->_hat = new Hat();
     $this->_shoe = new Shoe();
     $data["baseHref"] = $this->_system->GetBaseRef();
     $data["skin"] = $this->_system->get('skin');
     $data['env'] = $this->_system->getEnviroment();
     $data['token'] = session_id();
     //token for cross site injection
     $this->_hat->pintaHat('login');
     $array_bg = array();
     $directory = $this->_system->get('background');
     $dirint = dir($directory);
     while (($archivo = $dirint->read()) !== false) {
         if (eregi("gif", $archivo) || eregi("jpg", $archivo) || eregi("png", $archivo)) {
             array_push($array_bg, $directory . $archivo);
         }
     }
     $dirint->close();
     $data['background'] = $array_bg;
     $this->_system->fShow($this->_system->get('skin') . "/tpl_login.php", $data);
     $this->_shoe->pintaShoe();
 }
Exemplo n.º 2
0
 function __construct()
 {
     require_once 'libs/config.php';
     $this->_system = System::singleton();
     new Check();
     $this->_hat = new Hat();
     $this->_shoe = new Shoe();
     $data["baseHref"] = $this->_system->GetBaseRef();
     $data["skin"] = $this->_system->get('skin');
     $data['env'] = $this->_system->getEnviroment();
     $data['dbconsumer'] = $_SESSION['consumerdb'];
     $data['dbmanager'] = $_SESSION['dbmanager'];
     $data['dbquality'] = $_SESSION['dbquality'];
     $data['dbwater'] = $_SESSION['dbwater'];
     $data['dbenergy'] = $_SESSION['dbbnergy'];
     $data['dbsmartmeter'] = false;
     $this->_hat->pintaHat('home');
     $array_bg = array();
     $directory = $this->_system->get('background');
     $dirint = dir($directory);
     while (($archivo = $dirint->read()) !== false) {
         if (eregi("gif", $archivo) || eregi("jpg", $archivo) || eregi("png", $archivo)) {
             array_push($array_bg, $directory . $archivo);
         }
     }
     $dirint->close();
     $data['background'] = $array_bg;
     $this->_system->fShow($this->_system->get('skin') . "/tpl_mhome.php", $data);
     $this->_shoe->pintaShoe();
 }
Exemplo n.º 3
0
 function __construct()
 {
     $this->_system = System::singleton();
     //contiene objeto system
     $this->_ruta = $this->_system->GetBaseRef();
     $this->_detect = new Mobile_Detect();
 }
Exemplo n.º 4
0
 function __construct()
 {
     require_once 'libs/config.php';
     //Archivo con configuraciones.
     $this->_system = System::singleton();
     //contiene objeto system
     echo "render error page";
 }
Exemplo n.º 5
0
 function __construct()
 {
     require_once 'libs/config.php';
     $this->_system = System::singleton();
     $this->_hat = new Hat();
     $this->_shoe = new Shoe();
     $data["baseHref"] = $this->_system->GetBaseRef();
     $data["skin"] = $this->_system->get('skin');
     $data['env'] = $this->_system->getEnviroment();
     $data['token'] = session_id();
     //token for cross site injection
     $pwd1 = empty($_POST['pwd1']) ? null : $this->_system->nohacker($_POST['pwd1']);
     $pwd2 = empty($_POST['pwd2']) ? null : $this->_system->nohacker($_POST['pwd2']);
     $hash = empty($_GET['h']) ? null : $this->_system->nohacker($_GET['h']);
     $token = empty($_POST['token']) ? null : $this->_system->nohacker($_POST['token']);
     $this->_hat->pintaHat('login');
     $array_bg = array();
     $directory = $this->_system->get('background');
     $dirint = dir($directory);
     while (($archivo = $dirint->read()) !== false) {
         if (eregi("gif", $archivo) || eregi("jpg", $archivo) || eregi("png", $archivo)) {
             array_push($array_bg, $directory . $archivo);
         }
     }
     $dirint->close();
     $data['background'] = $array_bg;
     if ($pwd1) {
         if ($token === session_id()) {
             $id = empty($_POST['id']) ? null : $this->_system->nohacker($_POST['id']);
             require_once 'libs/apps/users/class.users.php';
             $users = new Users();
             $request = $users->resetPwd($id, $pwd1);
             $this->_system->fShow($this->_system->get('skin') . "/tpl_pwd_recovery_4.php", $data);
         } else {
             echo "Cross site injection detected";
         }
     } else {
         if ($hash) {
             require_once 'libs/apps/users/class.users.php';
             $users = new Users();
             $request = $users->validateRecoveryHash($hash);
             /*
             echo "<pre>";
             print_r($request);
             echo "</pre>";
             */
             if ($request['status'] === "Accepted") {
                 $data['id'] = $request['message']['users_id'];
                 $this->_system->fShow($this->_system->get('skin') . "/tpl_pwd_recovery_3.php", $data);
             } else {
                 $this->_system->fShow($this->_system->get('skin') . "/tpl_pwd_recovery_5.php", $data);
             }
         } else {
             $this->_system->fShow($this->_system->get('skin') . "/tpl_pwd_recovery_5.php", $data);
         }
     }
     $this->_shoe->pintaShoe();
 }
Exemplo n.º 6
0
 function __construct()
 {
     require_once 'libs/config.php';
     $this->_system = System::singleton();
     $data["baseHref"] = $this->_system->GetBaseRef();
     $data["skin"] = $this->_system->get('skin');
     $data['env'] = $this->_system->getEnviroment();
     $this->_system->fShow($this->_system->get('skin') . "/tpl_index.php", $data);
 }
Exemplo n.º 7
0
 function __construct()
 {
     require_once 'libs/config.php';
     $this->_system = System::singleton();
     $this->_hat = new Hat();
     $this->_shoe = new Shoe();
     $data["baseHref"] = $this->_system->GetBaseRef();
     $data["skin"] = $this->_system->get('skin');
     $data["env"] = $this->_system->getEnviroment();
     $this->_hat->pintaHat();
     $this->_system->fShow($this->_system->get('skin') . "/tpl_maqueta.php", $data);
     $this->_shoe->pintaShoe();
 }
Exemplo n.º 8
0
 function __construct()
 {
     require_once 'libs/config.php';
     $this->_system = System::singleton();
     if ($_SESSION['consumerdb']) {
         $data["baseHref"] = $this->_system->GetBaseRef();
         $data["skin"] = $this->_system->get('skin');
         $data['env'] = $this->_system->getEnviroment();
         $this->_system->fShow($this->_system->get('skin') . "/tpl_demo_map.php", $data);
     } else {
         echo "No access to this page";
     }
 }
Exemplo n.º 9
0
 function __construct()
 {
     require_once 'libs/config.php';
     $this->_system = System::singleton();
     $data["baseHref"] = $this->_system->GetBaseRef();
     $data["skin"] = $this->_system->get('skin');
     $data['env'] = $this->_system->getEnviroment();
     $data['urlWMS'] = $this->_system->get('urlWMS');
     $data['token'] = session_id();
     $data['update'] = 1;
     //$data['update']		= $_SESSION['update'];
     $detect = new Mobile_Detect();
     $data['isMobile'] = $detect->isMobile() === true && $detect->isTablet() === false ? '1' : '0';
     $this->_system->fShow($this->_system->get('skin') . "/tpl_dbwater.php", $data);
 }
Exemplo n.º 10
0
 function __construct()
 {
     require_once 'libs/config.php';
     $this->_system = System::singleton();
     $this->_hat = new Hat();
     $this->_shoe = new Shoe();
     $data["baseHref"] = $this->_system->GetBaseRef();
     $data["skin"] = $this->_system->get('skin');
     $data['env'] = $this->_system->getEnviroment();
     $data['token'] = session_id();
     //token for cross site injection
     $email = empty($_POST['email']) ? null : $this->_system->nohacker($_POST['email']);
     $token = empty($_POST['token']) ? null : $this->_system->nohacker($_POST['token']);
     $type = empty($_GET['t']) ? null : $this->_system->nohacker($_GET['t']);
     $this->_hat->pintaHat('login');
     $array_bg = array();
     $directory = $this->_system->get('background');
     $dirint = dir($directory);
     while (($archivo = $dirint->read()) !== false) {
         if (eregi("gif", $archivo) || eregi("jpg", $archivo) || eregi("png", $archivo)) {
             array_push($array_bg, $directory . $archivo);
         }
     }
     $dirint->close();
     $data['background'] = $array_bg;
     if ($email) {
         if ($token === session_id()) {
             require_once 'libs/apps/users/class.users.php';
             $users = new Users();
             $request = $users->recoveryRequest($email);
             if ($request['status'] === "Accepted") {
                 $data['ok'] = true;
                 $this->_system->fShow($this->_system->get('skin') . "/tpl_pwd_recovery_2.php", $data);
             } else {
                 $data['ok'] = false;
                 $this->_system->fShow($this->_system->get('skin') . "/tpl_pwd_recovery_2.php", $data);
             }
         } else {
             echo "Cross site injection detected";
         }
     } else {
         $data['type'] = $type;
         $this->_system->fShow($this->_system->get('skin') . "/tpl_pwd_recovery_1.php", $data);
     }
     $this->_shoe->pintaShoe();
 }
Exemplo n.º 11
0
 function __construct()
 {
     require_once 'libs/config.php';
     //Archivo con configuraciones.
     $this->_system = System::singleton();
     //contiene objeto system
     if ($_POST['token'] != session_id()) {
         header('location: error.php');
     } else {
         require_once 'libs/apps/users/class.users.php';
         //Archivo con configuraciones.
         $users = new Users();
         $user = $this->_system->nohacker($_POST['user']);
         $pwd = $this->_system->nohacker($_POST['pwd']);
         $login = $users->login($user, $pwd);
         /*echo "<pre>";
         			print_r($login);
         			echo "</pre>";
         	*/
         if ($login['status'] === "Accepted") {
             $_SESSION['logged'] = true;
             $_SESSION['id'] = $login['message']['id'];
             $_SESSION['nick'] = $_POST['user'];
             $_SESSION['consumerdb'] = $login['message']['consumerdb'];
             $_SESSION['dbmanager'] = $login['message']['dbmanager'];
             $_SESSION['dbquality'] = $login['message']['dbquality'];
             $_SESSION['dbwater'] = $login['message']['dbwater'];
             $_SESSION['dbbnergy'] = $login['message']['dbbnergy'];
             $_SESSION['update'] = (int) $login['message']['update'];
             /*echo "<pre>";
             		print_r($_SESSION);
             		echo "</pre>";*/
             header('location: home.php');
         } else {
             if ($login['code'] === 412) {
                 //code 412 password must be regenerated
                 header('location: pwd_recovery.php?t=regenerate');
             } else {
                 header('location: index.php?e=login_error');
             }
         }
     }
 }
Exemplo n.º 12
0
 function __construct()
 {
     $host = "localhost";
     $name = "test";
     $user = "******";
     $pwd = "";
     require_once 'libs/config.php';
     //Archivo con configuraciones.
     $this->_system = System::singleton();
     //contiene objeto system
     $dbconn = pg_connect("host=localhost dbname=test user=llopez password="******"INSERT INTO testtable(name) 
       VALUES('pedo');");*/
     $result = pg_query($dbconn, "SELECT * FROM testtable");
     //dump the result object
     var_dump($result);
     // Closing connection
     pg_close($dbconn);
     echo "<br>PDO<br>";
     $pdo = new PDOdbp(PDO_PGSQL, $host, $name, $user, $pwd, $dbids);
     echo "<br>Insert:<br>";
     $pdo->prepare_insert("testtable", "id,name");
     $last_id = $pdo->insert(array(2, "algo"));
     echo "lastId: " . $last_id . "<br>";
     echo "<br>Update:<br>";
     $pdo->prepare_update("testtable", "name", null, "id=1");
     $pdo->update(array('ogtro', 2));
     echo "<br>Select:<br>";
     $query = "SELECT * FROM testtable";
     $select = $pdo->prepare_select($query);
     $rs = $pdo->select();
     var_dump($rs);
     echo "<br><br>Select con bind:<br>";
     $query = "SELECT * FROM testtable WHERE id= :v1";
     $pdo->prepare_select($query);
     $pdo->bind(":v1", 2);
     $rs = $pdo->select();
     var_dump($rs);
 }
Exemplo n.º 13
0
 function __construct()
 {
     header('Content-Type: application/json');
     require_once 'libs/config.php';
     //Archivo con configuraciones.
     $this->_system = System::singleton();
     //contiene objeto system
     $_POST = json_decode(file_get_contents('php://input'), true);
     require_once 'libs/apps/alerts/class.alerts.php';
     $alerts = new Alerts();
     $what = empty($_POST['what']) ? null : $_POST['what'];
     $token = empty($_POST['token']) ? null : $_POST['token'];
     if ($token === session_id()) {
         if ($what === "LIST_ALERTS") {
             $period = empty($_POST['period']) ? null : $_POST['period'];
             $type = empty($_POST['type']) ? null : $_POST['type'];
             $data = array('period' => $period, 'type' => $type);
             $current_alerts = $alerts->listAlerts($data);
             echo json_encode($current_alerts);
         }
     } else {
         echo json_encode(array("status" => "Failed", "message" => "Cross site injection detected", "code" => 501));
     }
 }
Exemplo n.º 14
0
 function __construct()
 {
     $this->_system = System::singleton();
     //contiene objeto system
 }
Exemplo n.º 15
0
 function __construct()
 {
     $system = System::singleton();
 }
Exemplo n.º 16
0
<?php

require_once 'libs/config.php';
//Archivo con configuraciones.
$system = System::singleton();
$filename = $system->get('basedirContenidos') . "csv/" . $_GET['fileName'];
// of course find the exact filename....
header('Pragma: public');
header('Expires: 0');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
header('Cache-Control: private', false);
// required for certain browsers
header('Content-Disposition: attachment; filename="' . basename($_GET['fileName']) . '";');
header('Content-Transfer-Encoding: binary');
header('Content-Length: ' . filesize($filename));
readfile($filename);
exit;
Exemplo n.º 17
0
 function __construct()
 {
     $this->_system = System::singleton();
     $ObFecha = new Fecha();
     $this->_fecha = $ObFecha->soloFecha();
 }
Exemplo n.º 18
0
 function __construct()
 {
     header('Content-Type: application/json');
     require_once 'libs/config.php';
     //Archivo con configuraciones.
     $this->_system = System::singleton();
     //contiene objeto system
     $_POST = json_decode(file_get_contents('php://input'), true);
     require_once 'libs/apps/places/class.places.php';
     $places = new Places();
     $what = empty($_POST['what']) ? null : $_POST['what'];
     $token = empty($_POST['token']) ? null : $_POST['token'];
     if ($token === session_id()) {
         if ($what === "LIST_PROVINCES") {
             $data = array();
             $provinces = $places->listProvinces($data);
             echo json_encode($provinces);
         } else {
             if ($what === "LIST_TOWNS") {
                 $id_province = empty($_POST['id']) ? 0 : $this->_system->nohacker($_POST['id']);
                 $towns = $places->listTowns($id_province);
                 echo json_encode($towns);
             } else {
                 if ($what === "LIST_TOWNS_FROM_NAME") {
                     $town_name = empty($_POST['town_name']) ? null : $this->_system->nohacker($_POST['town_name']);
                     $section = empty($_POST['section']) ? null : $this->_system->nohacker($_POST['section']);
                     $towns = $places->listTownsFromName($town_name, $section);
                     echo json_encode($towns);
                 } else {
                     if ($what === "TOWN_INFO") {
                         $id_town = empty($_POST['id']) ? 0 : $this->_system->nohacker($_POST['id']);
                         $town_name = empty($_POST['town_name']) ? null : $this->_system->nohacker($_POST['town_name']);
                         $town = $places->getTownInfo($id_town, $town_name);
                         echo json_encode($town);
                     } else {
                         if ($what === "UPDATE_TOWN") {
                             if ((int) $_SESSION['update'] === 1) {
                                 $id_town = empty($_POST['id_town']) ? null : $this->_system->nohacker($_POST['id_town']);
                                 $town_water_provider = empty($_POST['town_water_provider']) ? null : $this->_system->nohacker($_POST['town_water_provider']);
                                 $town_w_contract_init = empty($_POST['town_w_contract_init']) ? null : $this->_system->nohacker($_POST['town_w_contract_init']);
                                 $town_w_contract_end = empty($_POST['town_w_contract_end']) ? null : $this->_system->nohacker($_POST['town_w_contract_end']);
                                 $town_sanity_provider = empty($_POST['town_sanity_provider']) ? null : $this->_system->nohacker($_POST['town_sanity_provider']);
                                 $town_s_contract_init = empty($_POST['town_s_contract_init']) ? null : $this->_system->nohacker($_POST['town_s_contract_init']);
                                 $town_s_contract_end = empty($_POST['town_s_contract_end']) ? null : $this->_system->nohacker($_POST['town_s_contract_end']);
                                 $town_observations = empty($_POST['town_observations']) ? null : $this->_system->nohacker($_POST['town_observations']);
                                 $town_govern = empty($_POST['town_govern']) ? null : $this->_system->nohacker($_POST['town_govern']);
                                 $prox_prorroga = empty($_POST['prox_prorroga']) ? null : $this->_system->nohacker($_POST['prox_prorroga']);
                                 $prox_concurso = empty($_POST['prox_concurso']) ? null : $this->_system->nohacker($_POST['prox_concurso']);
                                 $fut_prorroga = empty($_POST['fut_prorroga']) ? null : $this->_system->nohacker($_POST['fut_prorroga']);
                                 $cartera = empty($_POST['cartera']) ? null : $this->_system->nohacker($_POST['cartera']);
                                 $neg_2016 = empty($_POST['neg_2016']) ? null : $this->_system->nohacker($_POST['neg_2016']);
                                 $neg_2017 = empty($_POST['neg_2017']) ? null : $this->_system->nohacker($_POST['neg_2017']);
                                 $neg_2018 = empty($_POST['neg_2018']) ? null : $this->_system->nohacker($_POST['neg_2018']);
                                 $inv_2016 = empty($_POST['inv_2016']) ? null : $this->_system->nohacker($_POST['inv_2016']);
                                 $inv_2017 = empty($_POST['inv_2017']) ? null : $this->_system->nohacker($_POST['inv_2017']);
                                 $inv_2018 = empty($_POST['inv_2018']) ? null : $this->_system->nohacker($_POST['inv_2018']);
                                 $inv_resto = empty($_POST['inv_resto']) ? null : $this->_system->nohacker($_POST['inv_resto']);
                                 $neg_resto = empty($_POST['neg_resto']) ? null : $this->_system->nohacker($_POST['neg_resto']);
                                 $inv_total = empty($_POST['inv_total']) ? null : $this->_system->nohacker($_POST['inv_total']);
                                 $cmun5_ine = empty($_POST['cmun5_ine']) ? null : $this->_system->nohacker($_POST['cmun5_ine']);
                                 $data = array('sub_aqp' => $town_water_provider, 'sub_cla' => $town_sanity_provider, 'gobierno' => $town_govern, 'observaciones' => $town_observations);
                                 $dataConcesion = array('prox_prorroga' => $prox_prorroga, 'prox_concurso' => $prox_concurso, 'fut_prorroga' => $fut_prorroga, 'cartera' => $cartera, 'neg_2016' => $neg_2016, 'neg_2017' => $neg_2017, 'neg_2018' => $neg_2018, 'inv_2016' => $inv_2016, 'inv_2017' => $inv_2017, 'inv_2018' => $inv_2018, 'inv_resto' => $inv_resto, 'neg_resto' => $neg_resto, 'inv_total' => $inv_total);
                                 if ($town_w_contract_init) {
                                     $data['ap_data_ini'] = $town_w_contract_init;
                                 }
                                 if ($town_w_contract_end) {
                                     $data['ap_data_fi'] = $town_w_contract_end;
                                 }
                                 if ($town_s_contract_init) {
                                     $data['cla_data_ini'] = $town_s_contract_init;
                                 }
                                 if ($town_s_contract_end) {
                                     $data['cla_data_fi'] = $town_s_contract_end;
                                 }
                                 if ($id_town) {
                                     $town = $places->updateTown($data, $id_town);
                                     $concesion = $places->updateConcesion($dataConcesion, $cmun5_ine);
                                     echo json_encode($town);
                                 } else {
                                     echo json_encode(array("status" => "Failed", "message" => "id_town can't be null", "code" => 501));
                                 }
                             } else {
                                 echo json_encode(array("status" => "Failed", "message" => "Permission denied. User can't update", "code" => 501));
                             }
                         } else {
                             if ($what === "PREVIEW_REPORT") {
                                 $cpro_dgc = empty($_POST['cpro_dgc']) ? null : $this->_system->nohacker($_POST['cpro_dgc']);
                                 $area_km2 = empty($_POST['area_km2']) ? null : $this->_system->nohacker($_POST['area_km2']);
                                 $habitantes = empty($_POST['habitantes']) ? null : $this->_system->nohacker($_POST['habitantes']);
                                 $sub_aqp = empty($_POST['sub_aqp']) ? null : $this->_system->nohacker($_POST['sub_aqp']);
                                 $ap_data_ini = empty($_POST['ap_data_ini']) ? null : $this->_system->nohacker($_POST['ap_data_ini']);
                                 $ap_data_fi = empty($_POST['ap_data_fi']) ? null : $this->_system->nohacker($_POST['ap_data_fi']);
                                 $sub_cla = empty($_POST['sub_cla']) ? null : $this->_system->nohacker($_POST['sub_cla']);
                                 $cla_data_ini = empty($_POST['cla_data_ini']) ? null : $this->_system->nohacker($_POST['cla_data_ini']);
                                 $cla_data_fi = empty($_POST['cla_data_fi']) ? null : $this->_system->nohacker($_POST['cla_data_fi']);
                                 $prox_concurso = empty($_POST['prox_concurso']) ? null : $this->_system->nohacker($_POST['prox_concurso']);
                                 $fut_prorroga = empty($_POST['fut_prorroga']) ? null : $this->_system->nohacker($_POST['fut_prorroga']);
                                 $cartera = empty($_POST['cartera']) ? null : $this->_system->nohacker($_POST['cartera']);
                                 $neg_2016 = empty($_POST['neg_2016']) ? null : $this->_system->nohacker($_POST['neg_2016']);
                                 $neg_2017 = empty($_POST['neg_2017']) ? null : $this->_system->nohacker($_POST['neg_2017']);
                                 $neg_2018 = empty($_POST['neg_2018']) ? null : $this->_system->nohacker($_POST['neg_2018']);
                                 $neg_resto = empty($_POST['neg_resto']) ? null : $this->_system->nohacker($_POST['neg_resto']);
                                 $inv_2016 = empty($_POST['inv_2016']) ? null : $this->_system->nohacker($_POST['inv_2016']);
                                 $inv_2017 = empty($_POST['inv_2017']) ? null : $this->_system->nohacker($_POST['inv_2017']);
                                 $inv_2018 = empty($_POST['inv_2018']) ? null : $this->_system->nohacker($_POST['inv_2018']);
                                 $inv_resto = empty($_POST['inv_resto']) ? null : $this->_system->nohacker($_POST['inv_resto']);
                                 $inv_total = empty($_POST['inv_total']) ? null : $this->_system->nohacker($_POST['inv_total']);
                                 $createFile = empty($_POST['createFile']) ? null : $this->_system->nohacker($_POST['createFile']);
                                 $limit = empty($_POST['limit']) ? null : $this->_system->nohacker($_POST['limit']);
                                 $data = array('cpro_dgc' => $cpro_dgc, 'habitantes' => $habitantes, 'area_km2' => $area_km2, 'sub_aqp' => $sub_aqp, 'ap_data_ini' => $ap_data_ini, 'ap_data_fi' => $ap_data_fi, 'sub_cla' => $sub_cla, 'cla_data_ini' => $cla_data_ini, 'cla_data_fi' => $cla_data_fi, 'prox_concurso' => $prox_concurso, 'fut_prorroga' => $fut_prorroga, 'cartera' => $cartera, 'neg_2016' => $neg_2016, 'neg_2017' => $neg_2017, 'neg_2018' => $neg_2018, 'neg_resto' => $neg_resto, 'inv_2016' => $inv_2016, 'inv_2017' => $inv_2017, 'inv_2018' => $inv_2018, 'inv_resto' => $inv_resto, 'inv_total' => $inv_total);
                                 $report = $places->previewReport($data, $createFile, $limit);
                                 echo json_encode($report);
                             } else {
                                 if ($what === "CREATE_REPORT") {
                                     //				$id_province     	= (empty($_POST['province_id'])) 			? 0 	: $this->_system->nohacker($_POST['province_id']);
                                     //				$report				= $places->createReport($id_province);
                                     //				echo json_encode($report);
                                 } else {
                                     if ($what === "GET_TOWN_EXTRA_INFO") {
                                         $cmun5_ine = empty($_POST['cmun5_ine']) ? null : $this->_system->nohacker($_POST['cmun5_ine']);
                                         $extra = $places->getExtraInfoFromTown($cmun5_ine);
                                         echo json_encode($extra);
                                     } else {
                                         if ($what === "ADD_NOTE") {
                                             $municipio_id = empty($_POST['municipio_id']) ? 0 : $this->_system->nohacker($_POST['municipio_id']);
                                             $mensaje = empty($_POST['mensaje']) ? 0 : $this->_system->nohacker($_POST['mensaje']);
                                             $data = array("mensaje" => $mensaje, "municipio_id" => $municipio_id, "user_id" => $_SESSION['id']);
                                             $extra = $places->addNote($data);
                                             echo json_encode($extra);
                                         }
                                     }
                                 }
                             }
                         }
                     }
                 }
             }
         }
     } else {
         echo json_encode(array("status" => "Failed", "message" => "Cross site injection detected", "code" => 501));
     }
 }
Exemplo n.º 19
0
 public function __construct()
 {
     $this->_system = System::singleton();
 }
Exemplo n.º 20
0
<?php

date_default_timezone_set('Europe/Andorra');
require_once 'utils/class.System.php';
$config = System::singleton();
$config->set('carpetaTpl', 'tpl/');
//carpeta de las plantillas
$config->set('carpetaLogs', 'logs/');
//carpeta de los logs
$config->set('carpetaIncludes', 'includes/');
//carpeta de los includes
$config->set('basedirContenidos', 'contenidos/');
//carpeta para los contenidos generados por los usuarios
$config->set('skin', 'default');
//carpeta tpl que usa el proyecto
$env = 'dev';
//$env = 'prod';
$config->set('environment', $env);
//entorno dev (desarrollo) o prod (producción)
$config->set('path', $_SERVER['DOCUMENT_ROOT']);
$config->SetbaseRef("host");
$config->set('_servidor_bd1', 'localhost');
//url mysql del servidor 1
$config->set('_database_bd1', 'bd');
//bd del servidor 1
$config->set('_user_bd1', 'us');
//user mysql del servidor 1
$config->set('_password_bd1', 'pwd');
//passw del servidor 1
$config->set('_servidor_bd2', 'localhost');
//url mysql del servidor 2