-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgetFileContents.php
More file actions
32 lines (30 loc) · 803 Bytes
/
getFileContents.php
File metadata and controls
32 lines (30 loc) · 803 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?
$ssid = 0;
if (isset($_REQUEST['ssid']) && ($_REQUEST['ssid'] != "0")){
$ssid=$_REQUEST['ssid'];
session_id($ssid);
$ssidLink_continuing = "&ssid=".$ssid;
$ssidLink_starting = "?ssid=".$ssid;
}
session_start();
$vpc = new vendorsClass('vendorList.xml');
$username = "";
$isAdmin = false;
$vendor = NULL;
if (isset($_SESSION['username'])){
$username = $_SESSION['username'];
$vendor = $vpc->findVendorWithEmail($username);
if (!is_null($vendor)){
$isAdmin = $vendor->isAdmin();
}
}
if ($isAdmin){
$fileToGet = $_REQUEST['fileToGet'];
//$fileContents = urlencode(file_get_contents($fileToGet));
$fileContents = file_get_contents($fileToGet);
echo $fileContents;
//echo json_encode($fileContents);
}else{
echo "You don't have permission to do this.";
}
?>