forked from pr3ss/WebProject-MyNetwork
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapi-profilo.php
More file actions
23 lines (19 loc) · 761 Bytes
/
api-profilo.php
File metadata and controls
23 lines (19 loc) · 761 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<?php
require_once 'bootstrap.php';
$templateParams["title"] = "PROFILO";
if ($dbh->login_check()) {
$templateParams["username"] = $_SESSION["username"];
$id_current_user = $_SESSION["user_id"];
$templateParams["posts"] = $dbh->get_user_posts($id_current_user);
$templateParams["info"] = $dbh->get_user_info($id_current_user);
$templateParams["seguiti"] = $dbh->get_user_seguiti($id_current_user);
$templateParams["follower"] = $dbh->get_user_follower(($id_current_user));
if ($templateParams["info"] != null) {
require 'template/profilo.php';
} else {
require './template/page_404.php';
}
} else { //non autorizzato
header('Content-Type: application/json');
echo json_encode("Accesso negato.");
}