-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdrive_client.php
More file actions
58 lines (49 loc) · 1.24 KB
/
drive_client.php
File metadata and controls
58 lines (49 loc) · 1.24 KB
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<?php
include_once "drive_client_classdef.php";
function redirectDriveClient($drive_code)
{
unset($_GET['store_code']);
switch($drive_code)
{
case 'GOOG':
{
header( 'Location: google_drive.php?' . http_build_query($_GET));
break;
}
case 'MSOD':
{
header( 'Location: ms_onedrive.php?' . http_build_query($_GET));
break;
}
case 'AMZN':
{
header( 'Location: amazon_cloud.php?' . http_build_query($_GET));
break;
}
case 'BOX':
{
header( 'Location: box_drive.php?' . http_build_query($_GET));
break;
}
case 'PCLD':
{
header( 'Location: pcloud_drive.php?' . http_build_query($_GET));
break;
}
default:
throw new \Exception('Unknown code for store: ' . $drive_code);
}
}
session_start();
if(isset($_GET['action']) && isset($_GET['store_code']))
{
try{
redirectDriveClient($_GET['store_code']);
}
catch(\Exception $e)
{
http_send_status(400);
echo $e->getMessage();
}
}
?>