├── .gitmodules ├── LICENSE ├── api ├── browse.php ├── list.php ├── mirror.php ├── purge.php ├── remove.php ├── update_profile.php └── upload.php ├── assets ├── css │ ├── main.css │ └── materialize.css ├── fonts │ ├── neou │ │ ├── Neou-Bold.eot │ │ ├── Neou-Bold.ttf │ │ ├── Neou-Bold.woff │ │ ├── Neou-Bold.woff2 │ │ ├── Neou-Thin.eot │ │ ├── Neou-Thin.ttf │ │ ├── Neou-Thin.woff │ │ └── Neou-Thin.woff2 │ ├── roboto │ │ ├── Roboto-Bold.eot │ │ ├── Roboto-Bold.ttf │ │ ├── Roboto-Bold.woff │ │ ├── Roboto-Bold.woff2 │ │ ├── Roboto-Light.eot │ │ ├── Roboto-Light.ttf │ │ ├── Roboto-Light.woff │ │ ├── Roboto-Light.woff2 │ │ ├── Roboto-Medium.eot │ │ ├── Roboto-Medium.ttf │ │ ├── Roboto-Medium.woff │ │ ├── Roboto-Medium.woff2 │ │ ├── Roboto-Regular.eot │ │ ├── Roboto-Regular.ttf │ │ ├── Roboto-Regular.woff │ │ ├── Roboto-Regular.woff2 │ │ ├── Roboto-Thin.eot │ │ ├── Roboto-Thin.ttf │ │ ├── Roboto-Thin.woff │ │ └── Roboto-Thin.woff2 │ └── ubuntu_mono │ │ ├── UbuntuMono-Regular.eot │ │ ├── UbuntuMono-Regular.ttf │ │ ├── UbuntuMono-Regular.woff │ │ └── UbuntuMono-Regular.woff2 ├── js │ ├── materialize.js │ └── sorttable.js └── json │ ├── footer.json │ └── navbar.json ├── browse └── index.php ├── database.sql ├── func.php ├── index.php ├── manage └── index.php ├── profile └── index.php └── session.php /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "google-api-php-client"] 2 | path = google-api-php-client 3 | url = https://github.com/googleapis/google-api-php-client 4 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 ꦧꦭ꧀ 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /api/browse.php: -------------------------------------------------------------------------------- 1 | setAccessToken($_SESSION["token"]); 7 | $oauth = new Google_Service_Oauth2($client); 8 | $dump = $oauth->userinfo->get(); 9 | $list_options = array(); 10 | $return_val = array(); 11 | $return_val["status"] = 1; 12 | $return_val["content"] = array(); 13 | $return_val["content"]["count"] = 0; 14 | $return_val["content"]["files"] = array(); 15 | if (isset($_GET["index"])) { 16 | if (ctype_digit($_GET["index"])) { 17 | $index = intval($_GET["index"]) - 1; 18 | if ($index < 0) { 19 | die("{\"status\":0,\"content\":\"Invalid index\"}"); 20 | } 21 | $items_per_page = 10; 22 | $limit_lower = strval($index * $items_per_page); 23 | $rows = $db->query("SELECT * FROM files WHERE active=1 ORDER BY name LIMIT $limit_lower, ".strval($items_per_page)); 24 | while ($row = $rows->fetch_assoc()) { 25 | $new_item = array(); 26 | $new_item["name"] = htmlentities($row["name"]); 27 | $id = $row["prime_key"]; 28 | $new_item["id"] = $id; 29 | $owner = $row["owner"]; 30 | $new_item["mirrors"] = mysqli_num_rows($db->query("SELECT * FROM mirrors WHERE parent='$id' AND failures<$fail_max")); 31 | $owner_info = $db->query("SELECT * FROM users WHERE prime_key='$owner'")->fetch_assoc(); 32 | $new_item["owner"] = htmlentities($owner_info["alias"]); 33 | array_push($return_val["content"]["files"], $new_item); 34 | } 35 | $return_val["content"]["count"] = count($return_val["content"]["files"]); 36 | die(json_encode($return_val)); 37 | } else { 38 | die("{\"status\":0,\"content\":\"Invalid index\"}"); 39 | } 40 | } else { 41 | die("{\"status\":0,\"content\":\"Invalid index\"}"); 42 | } 43 | } catch (Exception $e) { 44 | die("{\"status\":0,\"content\":\"Failed to start session\"}"); 45 | } 46 | ?> -------------------------------------------------------------------------------- /api/list.php: -------------------------------------------------------------------------------- 1 | setAccessToken($_SESSION["token"]); 7 | $oauth = new Google_Service_Oauth2($client); 8 | $drive = new Google_Service_Drive($client); 9 | $dump = $oauth->userinfo->get(); 10 | $list_options = array(); 11 | $list_options["fields"] = "files(id,md5Checksum,name,permissions(emailAddress,id,role),size,trashed,webContentLink,webViewLink)"; 12 | $files_list = $drive->files->listFiles($list_options)->getFiles(); 13 | $return_val = array(); 14 | $return_val["status"] = 1; 15 | $return_val["content"] = array(); 16 | $return_val["content"]["available"] = array(); 17 | $return_val["content"]["available"]["count"] = 0; 18 | $return_val["content"]["available"]["files"] = array(); 19 | $return_val["content"]["uploaded"] = array(); 20 | $return_val["content"]["uploaded"]["count"] = 0; 21 | $return_val["content"]["uploaded"]["files"] = array(); 22 | $user_id = $dump->id; 23 | $user_check = $db->query("SELECT * FROM users WHERE prime_key='$user_id'"); 24 | $user_row = $user_check->fetch_assoc(); 25 | $show_private = false; 26 | if ($user_row["show_private"] == 1) { 27 | $show_private = true; 28 | } 29 | // echo $show_private; 30 | foreach ($files_list as $file) { 31 | if ($file->trashed) { 32 | continue; 33 | } 34 | $hash = $file->md5Checksum; 35 | if (is_null($hash) || strlen($hash) < 1) { 36 | continue; 37 | } 38 | if (substr($file->name, 0, strlen($file_prefix)) === $file_prefix) { 39 | continue; 40 | } 41 | $file_key = substr(str_replace("+", "_", str_replace("/", "_", str_replace("=", "-", base64_encode(md5($file->id, true))))), 0, -2); 42 | $key_check = $db->query("SELECT * FROM files WHERE prime_key='$file_key'"); 43 | if (mysqli_num_rows($key_check) > 0) { 44 | continue; 45 | } 46 | $is_owned = false; 47 | $is_public = false; 48 | foreach ($file->permissions as $permission) { 49 | if ($permission->id == "anyoneWithLink") { 50 | $is_public = true; 51 | continue; 52 | } 53 | if ($permission->role == "owner") { 54 | // echo $permission->email; 55 | // echo $dump->email; 56 | if ($permission->emailAddress == $dump->email) { 57 | $is_owned = true; 58 | } 59 | // if ($is_owned) { 60 | // echo "owned"; 61 | // } else { 62 | // echo "no"; 63 | // } 64 | } 65 | } 66 | if ($is_public || $is_owned) { 67 | $single_file = array(); 68 | $single_file["id"] = $file->id; 69 | $single_file["name"] = $file->name; 70 | $single_file["size"] = $file->size; 71 | // $single_file["public"] = $is_public; 72 | if ($is_public || ($show_private && $is_owned)) { 73 | array_push($return_val["content"]["available"]["files"], $single_file); 74 | } 75 | } 76 | } 77 | $result = $db->query("SELECT * FROM files WHERE owner='$user_id'"); 78 | while ($row = $result->fetch_assoc()) { 79 | $row_info = array(); 80 | $row_info["name"] = $row["name"]; 81 | $row_info["id"] = $row["prime_key"]; 82 | array_push($return_val["content"]["uploaded"]["files"], $row_info); 83 | } 84 | $return_val["content"]["available"]["count"] = count($return_val["content"]["available"]["files"]); 85 | $return_val["content"]["uploaded"]["count"] = count($return_val["content"]["uploaded"]["files"]); 86 | die(json_encode($return_val)); 87 | } catch (Exception $e) { 88 | die("{\"status\":0,\"content\":\"Failed to start session\"}"); 89 | } 90 | ?> 91 | -------------------------------------------------------------------------------- /api/mirror.php: -------------------------------------------------------------------------------- 1 | setAccessToken($_SESSION["token"]); 7 | $oauth = new Google_Service_Oauth2($client); 8 | $drive = new Google_Service_Drive($client); 9 | $dump = $oauth->userinfo->get(); 10 | if (isset($_GET["id"])) { 11 | $search_id = $db->real_escape_string($_GET["id"]); 12 | $file_check = $db->query("SELECT * FROM files WHERE prime_key='$search_id'"); 13 | if (mysqli_num_rows($file_check) == 0) { 14 | die("{\"status\":0,\"content\":\"Invalid file ID\"}"); 15 | } else { 16 | $mirror_check = $db->query("SELECT * FROM mirrors WHERE parent='$search_id' AND failures<$fail_max ORDER BY prime_key DESC"); 17 | if (mysqli_num_rows($mirror_check) == 0) { 18 | die("{\"status\":0,\"content\":\"No mirrors available\"}"); 19 | } else { 20 | $list_options = array(); 21 | $list_options["fields"] = "id,md5Checksum,name,permissions(emailAddress,id,role),size,trashed,webContentLink,webViewLink"; 22 | $mirrored = false; 23 | $found_id = ""; 24 | while ($row = $mirror_check->fetch_assoc()) { 25 | $drop_row = false; 26 | try { 27 | $found_file = $drive->files->get($row["id"], $list_options); 28 | if ($found_file->trashed) { 29 | $drop_row = true; 30 | } else { 31 | $is_public = true; // Was going to check if it was public or not 32 | if (!($is_public)) { 33 | $drop_row = true; 34 | } else { 35 | $hash = $found_file->md5Checksum; 36 | $parent_row = $file_check->fetch_assoc(); 37 | if ($hash != $parent_row["hash"]) { 38 | $drop_row = true; 39 | } else { 40 | $name = $parent_row["name"]; 41 | $copied = new Google_Service_Drive_DriveFile(); 42 | $copied->setName($file_prefix.$name); 43 | $found_id = $found_file->id; 44 | $new_file = $drive->files->copy($found_file->id, $copied); 45 | $permission = new Google_Service_Drive_Permission(); 46 | $permission->setRole("reader"); 47 | $permission->setType("anyone"); 48 | $drive->permissions->create($new_file->id, $permission); 49 | $new_id = $new_file->id; 50 | $owner = $dump->id; 51 | $db->query("DELETE FROM mirrors WHERE owner='$owner' AND parent='$search_id'"); 52 | $db->query("INSERT INTO mirrors (owner, parent, id, failures) VALUES ('$owner', '$search_id', '$new_id', 0)"); 53 | $mirrored = true; 54 | } 55 | } 56 | } 57 | } catch (Exception $f) { 58 | $drop_row = true; 59 | } 60 | if ($drop_row) { 61 | $prime_key = strval($row["prime_key"]); 62 | $fail_count = strval($row["failures"] + 1); 63 | $db->query("UPDATE mirrors SET failures=$fail_count WHERE prime_key='$prime_key'"); 64 | } 65 | if ($mirrored) { 66 | break; 67 | } 68 | } 69 | if ($mirrored) { 70 | die("{\"status\":1,\"content\":\"https://drive.google.com/open?id=$found_id\"}"); 71 | } else { 72 | die("{\"status\":0,\"content\":\"Mirror failed\"}"); 73 | } 74 | } 75 | } 76 | } else { 77 | die("{\"status\":0,\"content\":\"Invalid file ID\"}"); 78 | } 79 | } catch (Exception $e) { 80 | die("{\"status\":0,\"content\":\"Failed to start session\"}"); 81 | } 82 | ?> 83 | -------------------------------------------------------------------------------- /api/purge.php: -------------------------------------------------------------------------------- 1 | setAccessToken($_SESSION["token"]); 7 | $oauth = new Google_Service_Oauth2($client); 8 | $drive = new Google_Service_Drive($client); 9 | $dump = $oauth->userinfo->get(); 10 | $user_id = $dump->id; 11 | $user_check = $db->query("SELECT * FROM users WHERE prime_key='$user_id'"); 12 | $user_row = $user_check->fetch_assoc(); 13 | $list_options["fields"] = "id,md5Checksum,name,permissions/id,size,trashed,webContentLink,webViewLink"; 14 | if ($user_row["permission"] < 90) { 15 | die("{\"status\":0,\"content\":\"Insufficient permissions\"}"); 16 | } else { 17 | if (isset($_GET["mirror"])) { 18 | $mirror_check = $db->query("SELECT * FROM mirrors"); 19 | while ($mirror_row = $mirror_check->fetch_assoc()) { 20 | $increment_row = false; 21 | try { 22 | $found_file = $drive->files->get($mirror_row["id"], $list_options); 23 | if ($found_file->trashed) { 24 | $increment_row = true; 25 | } else { 26 | $is_public = true; // Was going to check if it was public or not 27 | if (!($is_public)) { 28 | $increment_row = true; 29 | } 30 | } 31 | } catch (Exception $f) { 32 | $increment_row = true; 33 | } 34 | if ($increment_row) { 35 | $prime_key = strval($mirror_row["prime_key"]); 36 | $fail_count = strval($mirror_row["failures"] + 1); 37 | $db->query("UPDATE mirrors SET failures=$fail_count WHERE prime_key='$prime_key'"); 38 | } 39 | } 40 | } 41 | $db->query("DELETE FROM mirrors WHERE failures>=$fail_max"); 42 | $check_all = $db->query("SELECT * FROM files"); 43 | while ($row = $check_all->fetch_assoc()) { 44 | $search_key = $row["prime_key"]; 45 | $mirror_count = $db->query("SELECT * FROM mirrors WHERE parent='$search_key'"); 46 | if (mysqli_num_rows($mirror_count) == 0) { 47 | $db->query("DELETE FROM files WHERE prime_key='$search_key'"); 48 | } 49 | } 50 | die("{\"status\":1,\"content\":\"Deleted failed mirrors\"}"); 51 | } 52 | } catch (Exception $e) { 53 | die("{\"status\":0,\"content\":\"Failed to start session\"}"); 54 | } 55 | ?> 56 | -------------------------------------------------------------------------------- /api/remove.php: -------------------------------------------------------------------------------- 1 | setAccessToken($_SESSION["token"]); 7 | $oauth = new Google_Service_Oauth2($client); 8 | $drive = new Google_Service_Drive($client); 9 | $dump = $oauth->userinfo->get(); 10 | if (isset($_GET["id"])) { 11 | $search_key = $db->real_escape_string($_GET["id"]); 12 | $check = $db->query("SELECT * FROM files WHERE prime_key='$search_key'"); 13 | if (mysqli_num_rows($check) == 0) { 14 | die("{\"status\":0,\"content\":\"Invalid file ID\"}"); 15 | } else { 16 | $result = $db->query("DELETE FROM files WHERE prime_key='$search_key'"); 17 | die("{\"status\":1,\"content\":\"File removed\"}"); 18 | } 19 | } else { 20 | die("{\"status\":0,\"content\":\"Invalid file ID\"}"); 21 | } 22 | } catch (Exception $e) { 23 | die("{\"status\":0,\"content\":\"Failed to start session\"}"); 24 | } 25 | ?> 26 | -------------------------------------------------------------------------------- /api/update_profile.php: -------------------------------------------------------------------------------- 1 | setAccessToken($_SESSION["token"]); 7 | $oauth = new Google_Service_Oauth2($client); 8 | $dump = $oauth->userinfo->get(); 9 | $show_private = "0"; 10 | if (!(isset($_GET["show_private"]))) { 11 | die("{\"status\":0,\"content\":\"Please fill in all parameters!\"}"); 12 | } else { 13 | if ($_GET["show_private"] == "1") { 14 | $show_private = "1"; 15 | } 16 | } 17 | if (!(isset($_GET["alias"])) || (strlen($_GET["alias"]) < 1)) { 18 | die("{\"status\":0,\"content\":\"Please fill in all parameters!\"}"); 19 | } 20 | $alias = urldecode($_GET["alias"]); 21 | $alias = $db->real_escape_string($alias); 22 | // echo $alias; 23 | $user_id = $dump->id; 24 | $db->query("UPDATE users SET alias='$alias', show_private=$show_private WHERE prime_key='$user_id'") or die("{\"status\":0,\"content\":\"Failed to update profile\"}"); 25 | die("{\"status\":1,\"content\":\"Profile updated\"}"); 26 | } catch (Exception $e) { 27 | die("{\"status\":0,\"content\":\"Failed to start session\"}"); 28 | } 29 | ?> 30 | -------------------------------------------------------------------------------- /api/upload.php: -------------------------------------------------------------------------------- 1 | setAccessToken($_SESSION["token"]); 7 | $oauth = new Google_Service_Oauth2($client); 8 | $drive = new Google_Service_Drive($client); 9 | $dump = $oauth->userinfo->get(); 10 | if (isset($_GET["id"])) { 11 | try { 12 | $list_options = array(); 13 | $list_options["fields"] = "id,md5Checksum,name,permissions(emailAddress,id,role),size,trashed,webContentLink,webViewLink"; 14 | $found_file = $drive->files->get($_GET["id"], $list_options); 15 | $is_public = false; 16 | $change_publicity = false; 17 | foreach ($found_file->permissions as $permission) { 18 | if ($permission->id == "anyoneWithLink") { 19 | $is_public = true; 20 | break; 21 | } 22 | } 23 | if (!($is_public)) { 24 | try { 25 | $permission = new Google_Service_Drive_Permission(); 26 | $permission->setRole("reader"); 27 | $permission->setType("anyone"); 28 | $drive->permissions->create($found_file->id, $permission); 29 | } catch (Exception $k) { 30 | die("{\"status\":0,\"content\":\"File is not public\"}"); 31 | } 32 | } 33 | $old_id = $found_file->id; 34 | $file_key = substr(str_replace("+", "_", str_replace("/", "_", str_replace("=", "-", base64_encode(md5($old_id, true))))), 0, -2); 35 | $key_check = $db->query("SELECT * FROM files WHERE prime_key='$file_key'"); 36 | $do_insert = true; 37 | if (mysqli_num_rows($key_check) > 0) { 38 | $do_insert = false; 39 | } 40 | $size = strval($found_file->size); 41 | $owner = $dump->id; 42 | $hash = $found_file->md5Checksum; 43 | $listed = "0"; 44 | $name = $db->real_escape_string($found_file->name); 45 | if ($do_insert) { 46 | if ($size == "") { 47 | $size = "0"; 48 | } 49 | if (is_null($hash)) { 50 | $hash = ""; 51 | } 52 | $db->query("INSERT INTO files (prime_key, owner, hash, name, size, listed, active) VALUES ('$file_key', '$owner', '$hash', '$name', $size, $listed, 1)") or die("{\"status\":0,\"content\":\"Failed to add file to database\"}"); 53 | } 54 | $db->query("DELETE FROM mirrors WHERE owner='$owner' AND parent='$file_key'"); 55 | $db->query("INSERT INTO mirrors (owner, parent, id) VALUES ('$owner', '$file_key', '$old_id')") or die("{\"status\":0,\"content\":\"Failed to mirror file to database\"}"); 56 | die("{\"status\":1,\"content\":\"$file_key\"}"); 57 | } catch (Exception $f) { 58 | die("{\"status\":0,\"content\":\"Invalid file ID\"}"); 59 | } 60 | } else { 61 | die("{\"status\":0,\"content\":\"Invalid file ID\"}"); 62 | } 63 | } catch (Exception $e) { 64 | die("{\"status\":0,\"content\":\"Failed to start session\"}"); 65 | } 66 | ?> 67 | -------------------------------------------------------------------------------- /assets/css/main.css: -------------------------------------------------------------------------------- 1 | @font-face { 2 | font-family: "Ubuntu"; 3 | src: url("../fonts/ubuntu_mono/UbuntuMono-Regular.eot"); 4 | src: url("../fonts/ubuntu_mono/UbuntuMono-Regular.eot?#iefix") format("embedded-opentype"), url("../fonts/ubuntu_mono/UbuntuMono-Regular.woff2") format("woff2"), url("../fonts/ubuntu_mono/UbuntuMono-Regular.woff") format("woff"), url("../fonts/ubuntu_mono/UbuntuMono-Regular.ttf") format("truetype"); 5 | } 6 | 7 | @font-face { 8 | font-family: "Neou-Bold"; 9 | src: url("../fonts/neou/Neou-Bold.eot"); 10 | src: url("../fonts/neou/Neou-Bold.eot?#iefix") format("embedded-opentype"), url("../fonts/neou/Neou-Bold.woff2") format("woff2"), url("../fonts/neou/Neou-Bold.woff") format("woff"), url("../fonts/neou/Neou-Bold.ttf") format("truetype") 11 | } 12 | 13 | @font-face { 14 | font-family: "Neou-Thin"; 15 | src: url("../fonts/neou/Neou-Thin.eot"); 16 | src: url("../fonts/neou/Neou-Thin.eot?#iefix") format("embedded-opentype"), url("../fonts/neou/Neou-Thin.woff2") format("woff2"), url("../fonts/neou/Neou-Thin.woff") format("woff"), url("../fonts/neou/Neou-Thin.ttf") format("truetype") 17 | } 18 | 19 | body { 20 | max-width: 100%; 21 | display: flex; 22 | min-height: 100vh; 23 | flex-direction: column; 24 | } 25 | 26 | main { 27 | flex: 1 0 auto; 28 | } 29 | 30 | .parallax-container { 31 | height: 300px; 32 | } 33 | 34 | ::-webkit-scrollbar { 35 | width: 8px; 36 | height: 8px; 37 | } 38 | 39 | ::-webkit-scrollbar-track { 40 | background-color: #272727; 41 | } 42 | 43 | ::-webkit-scrollbar-thumb { 44 | border-radius: 10px; 45 | background-color: #4D4D4D; 46 | } 47 | 48 | blink { 49 | animation: blink-animation 1s steps(5, start) infinite; 50 | -webkit-animation: blink-animation 1s steps(5, start) infinite; 51 | } 52 | 53 | @keyframes blink-animation { 54 | to { 55 | visibility: hidden; 56 | } 57 | } 58 | 59 | @-webkit-keyframes blink-animation { 60 | to { 61 | visibility: hidden; 62 | } 63 | } 64 | 65 | .ubuntu { 66 | font-family: "Ubuntu", monospace !important; 67 | } 68 | 69 | .neou { 70 | font-family: "Neou-Bold" !important; 71 | } 72 | 73 | .preloader { 74 | background: #272727; 75 | display: inline; 76 | position: fixed; 77 | top: 0px; 78 | left: 0px; 79 | width: 100%; 80 | height: 100%; 81 | z-index: 1000; 82 | } 83 | -------------------------------------------------------------------------------- /assets/fonts/neou/Neou-Bold.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/py7hon/gdsrr/bfc06cbe1c8020908cf3bdb7887d884006f06b19/assets/fonts/neou/Neou-Bold.eot -------------------------------------------------------------------------------- /assets/fonts/neou/Neou-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/py7hon/gdsrr/bfc06cbe1c8020908cf3bdb7887d884006f06b19/assets/fonts/neou/Neou-Bold.ttf -------------------------------------------------------------------------------- /assets/fonts/neou/Neou-Bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/py7hon/gdsrr/bfc06cbe1c8020908cf3bdb7887d884006f06b19/assets/fonts/neou/Neou-Bold.woff -------------------------------------------------------------------------------- /assets/fonts/neou/Neou-Bold.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/py7hon/gdsrr/bfc06cbe1c8020908cf3bdb7887d884006f06b19/assets/fonts/neou/Neou-Bold.woff2 -------------------------------------------------------------------------------- /assets/fonts/neou/Neou-Thin.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/py7hon/gdsrr/bfc06cbe1c8020908cf3bdb7887d884006f06b19/assets/fonts/neou/Neou-Thin.eot -------------------------------------------------------------------------------- /assets/fonts/neou/Neou-Thin.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/py7hon/gdsrr/bfc06cbe1c8020908cf3bdb7887d884006f06b19/assets/fonts/neou/Neou-Thin.ttf -------------------------------------------------------------------------------- /assets/fonts/neou/Neou-Thin.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/py7hon/gdsrr/bfc06cbe1c8020908cf3bdb7887d884006f06b19/assets/fonts/neou/Neou-Thin.woff -------------------------------------------------------------------------------- /assets/fonts/neou/Neou-Thin.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/py7hon/gdsrr/bfc06cbe1c8020908cf3bdb7887d884006f06b19/assets/fonts/neou/Neou-Thin.woff2 -------------------------------------------------------------------------------- /assets/fonts/roboto/Roboto-Bold.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/py7hon/gdsrr/bfc06cbe1c8020908cf3bdb7887d884006f06b19/assets/fonts/roboto/Roboto-Bold.eot -------------------------------------------------------------------------------- /assets/fonts/roboto/Roboto-Bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/py7hon/gdsrr/bfc06cbe1c8020908cf3bdb7887d884006f06b19/assets/fonts/roboto/Roboto-Bold.ttf -------------------------------------------------------------------------------- /assets/fonts/roboto/Roboto-Bold.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/py7hon/gdsrr/bfc06cbe1c8020908cf3bdb7887d884006f06b19/assets/fonts/roboto/Roboto-Bold.woff -------------------------------------------------------------------------------- /assets/fonts/roboto/Roboto-Bold.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/py7hon/gdsrr/bfc06cbe1c8020908cf3bdb7887d884006f06b19/assets/fonts/roboto/Roboto-Bold.woff2 -------------------------------------------------------------------------------- /assets/fonts/roboto/Roboto-Light.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/py7hon/gdsrr/bfc06cbe1c8020908cf3bdb7887d884006f06b19/assets/fonts/roboto/Roboto-Light.eot -------------------------------------------------------------------------------- /assets/fonts/roboto/Roboto-Light.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/py7hon/gdsrr/bfc06cbe1c8020908cf3bdb7887d884006f06b19/assets/fonts/roboto/Roboto-Light.ttf -------------------------------------------------------------------------------- /assets/fonts/roboto/Roboto-Light.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/py7hon/gdsrr/bfc06cbe1c8020908cf3bdb7887d884006f06b19/assets/fonts/roboto/Roboto-Light.woff -------------------------------------------------------------------------------- /assets/fonts/roboto/Roboto-Light.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/py7hon/gdsrr/bfc06cbe1c8020908cf3bdb7887d884006f06b19/assets/fonts/roboto/Roboto-Light.woff2 -------------------------------------------------------------------------------- /assets/fonts/roboto/Roboto-Medium.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/py7hon/gdsrr/bfc06cbe1c8020908cf3bdb7887d884006f06b19/assets/fonts/roboto/Roboto-Medium.eot -------------------------------------------------------------------------------- /assets/fonts/roboto/Roboto-Medium.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/py7hon/gdsrr/bfc06cbe1c8020908cf3bdb7887d884006f06b19/assets/fonts/roboto/Roboto-Medium.ttf -------------------------------------------------------------------------------- /assets/fonts/roboto/Roboto-Medium.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/py7hon/gdsrr/bfc06cbe1c8020908cf3bdb7887d884006f06b19/assets/fonts/roboto/Roboto-Medium.woff -------------------------------------------------------------------------------- /assets/fonts/roboto/Roboto-Medium.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/py7hon/gdsrr/bfc06cbe1c8020908cf3bdb7887d884006f06b19/assets/fonts/roboto/Roboto-Medium.woff2 -------------------------------------------------------------------------------- /assets/fonts/roboto/Roboto-Regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/py7hon/gdsrr/bfc06cbe1c8020908cf3bdb7887d884006f06b19/assets/fonts/roboto/Roboto-Regular.eot -------------------------------------------------------------------------------- /assets/fonts/roboto/Roboto-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/py7hon/gdsrr/bfc06cbe1c8020908cf3bdb7887d884006f06b19/assets/fonts/roboto/Roboto-Regular.ttf -------------------------------------------------------------------------------- /assets/fonts/roboto/Roboto-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/py7hon/gdsrr/bfc06cbe1c8020908cf3bdb7887d884006f06b19/assets/fonts/roboto/Roboto-Regular.woff -------------------------------------------------------------------------------- /assets/fonts/roboto/Roboto-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/py7hon/gdsrr/bfc06cbe1c8020908cf3bdb7887d884006f06b19/assets/fonts/roboto/Roboto-Regular.woff2 -------------------------------------------------------------------------------- /assets/fonts/roboto/Roboto-Thin.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/py7hon/gdsrr/bfc06cbe1c8020908cf3bdb7887d884006f06b19/assets/fonts/roboto/Roboto-Thin.eot -------------------------------------------------------------------------------- /assets/fonts/roboto/Roboto-Thin.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/py7hon/gdsrr/bfc06cbe1c8020908cf3bdb7887d884006f06b19/assets/fonts/roboto/Roboto-Thin.ttf -------------------------------------------------------------------------------- /assets/fonts/roboto/Roboto-Thin.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/py7hon/gdsrr/bfc06cbe1c8020908cf3bdb7887d884006f06b19/assets/fonts/roboto/Roboto-Thin.woff -------------------------------------------------------------------------------- /assets/fonts/roboto/Roboto-Thin.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/py7hon/gdsrr/bfc06cbe1c8020908cf3bdb7887d884006f06b19/assets/fonts/roboto/Roboto-Thin.woff2 -------------------------------------------------------------------------------- /assets/fonts/ubuntu_mono/UbuntuMono-Regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/py7hon/gdsrr/bfc06cbe1c8020908cf3bdb7887d884006f06b19/assets/fonts/ubuntu_mono/UbuntuMono-Regular.eot -------------------------------------------------------------------------------- /assets/fonts/ubuntu_mono/UbuntuMono-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/py7hon/gdsrr/bfc06cbe1c8020908cf3bdb7887d884006f06b19/assets/fonts/ubuntu_mono/UbuntuMono-Regular.ttf -------------------------------------------------------------------------------- /assets/fonts/ubuntu_mono/UbuntuMono-Regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/py7hon/gdsrr/bfc06cbe1c8020908cf3bdb7887d884006f06b19/assets/fonts/ubuntu_mono/UbuntuMono-Regular.woff -------------------------------------------------------------------------------- /assets/fonts/ubuntu_mono/UbuntuMono-Regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/py7hon/gdsrr/bfc06cbe1c8020908cf3bdb7887d884006f06b19/assets/fonts/ubuntu_mono/UbuntuMono-Regular.woff2 -------------------------------------------------------------------------------- /assets/js/sorttable.js: -------------------------------------------------------------------------------- 1 | /* 2 | SortTable 3 | version 2 4 | 7th April 2007 5 | Stuart Langridge, http://www.kryogenix.org/code/browser/sorttable/ 6 | 7 | Instructions: 8 | Download this file 9 | Add to your HTML 10 | Add class="sortable" to any table you'd like to make sortable 11 | Click on the headers to sort 12 | 13 | Thanks to many, many people for contributions and suggestions. 14 | Licenced as X11: http://www.kryogenix.org/code/browser/licence.html 15 | This basically means: do what you want with it. 16 | */ 17 | 18 | 19 | var stIsIE = /*@cc_on!@*/false; 20 | 21 | sorttable = { 22 | init: function() { 23 | // quit if this function has already been called 24 | if (arguments.callee.done) return; 25 | // flag this function so we don't do the same thing twice 26 | arguments.callee.done = true; 27 | // kill the timer 28 | if (_timer) clearInterval(_timer); 29 | 30 | if (!document.createElement || !document.getElementsByTagName) return; 31 | 32 | sorttable.DATE_RE = /^(\d\d?)[\/\.-](\d\d?)[\/\.-]((\d\d)?\d\d)$/; 33 | 34 | forEach(document.getElementsByTagName('table'), function(table) { 35 | if (table.className.search(/\bsortable\b/) != -1) { 36 | sorttable.makeSortable(table); 37 | } 38 | }); 39 | 40 | }, 41 | 42 | makeSortable: function(table) { 43 | if (table.getElementsByTagName('thead').length == 0) { 44 | // table doesn't have a tHead. Since it should have, create one and 45 | // put the first table row in it. 46 | the = document.createElement('thead'); 47 | the.appendChild(table.rows[0]); 48 | table.insertBefore(the,table.firstChild); 49 | } 50 | // Safari doesn't support table.tHead, sigh 51 | if (table.tHead == null) table.tHead = table.getElementsByTagName('thead')[0]; 52 | 53 | if (table.tHead.rows.length != 1) return; // can't cope with two header rows 54 | 55 | // Sorttable v1 put rows with a class of "sortbottom" at the bottom (as 56 | // "total" rows, for example). This is B&R, since what you're supposed 57 | // to do is put them in a tfoot. So, if there are sortbottom rows, 58 | // for backwards compatibility, move them to tfoot (creating it if needed). 59 | sortbottomrows = []; 60 | for (var i=0; i5' : ' ▴'; 104 | this.appendChild(sortrevind); 105 | return; 106 | } 107 | if (this.className.search(/\bsorttable_sorted_reverse\b/) != -1) { 108 | // if we're already sorted by this column in reverse, just 109 | // re-reverse the table, which is quicker 110 | sorttable.reverse(this.sorttable_tbody); 111 | this.className = this.className.replace('sorttable_sorted_reverse', 112 | 'sorttable_sorted'); 113 | this.removeChild(document.getElementById('sorttable_sortrevind')); 114 | sortfwdind = document.createElement('span'); 115 | sortfwdind.id = "sorttable_sortfwdind"; 116 | sortfwdind.innerHTML = stIsIE ? ' 6' : ' ▾'; 117 | this.appendChild(sortfwdind); 118 | return; 119 | } 120 | 121 | // remove sorttable_sorted classes 122 | theadrow = this.parentNode; 123 | forEach(theadrow.childNodes, function(cell) { 124 | if (cell.nodeType == 1) { // an element 125 | cell.className = cell.className.replace('sorttable_sorted_reverse',''); 126 | cell.className = cell.className.replace('sorttable_sorted',''); 127 | } 128 | }); 129 | sortfwdind = document.getElementById('sorttable_sortfwdind'); 130 | if (sortfwdind) { sortfwdind.parentNode.removeChild(sortfwdind); } 131 | sortrevind = document.getElementById('sorttable_sortrevind'); 132 | if (sortrevind) { sortrevind.parentNode.removeChild(sortrevind); } 133 | 134 | this.className += ' sorttable_sorted'; 135 | sortfwdind = document.createElement('span'); 136 | sortfwdind.id = "sorttable_sortfwdind"; 137 | sortfwdind.innerHTML = stIsIE ? ' 6' : ' ▾'; 138 | this.appendChild(sortfwdind); 139 | 140 | // build an array to sort. This is a Schwartzian transform thing, 141 | // i.e., we "decorate" each row with the actual sort key, 142 | // sort based on the sort keys, and then put the rows back in order 143 | // which is a lot faster because you only do getInnerText once per row 144 | row_array = []; 145 | col = this.sorttable_columnindex; 146 | rows = this.sorttable_tbody.rows; 147 | for (var j=0; j 12) { 184 | // definitely dd/mm 185 | return sorttable.sort_ddmm; 186 | } else if (second > 12) { 187 | return sorttable.sort_mmdd; 188 | } else { 189 | // looks like a date, but we can't tell which, so assume 190 | // that it's dd/mm (English imperialism!) and keep looking 191 | sortfn = sorttable.sort_ddmm; 192 | } 193 | } 194 | } 195 | } 196 | return sortfn; 197 | }, 198 | 199 | getInnerText: function(node) { 200 | // gets the text we want to use for sorting for a cell. 201 | // strips leading and trailing whitespace. 202 | // this is *not* a generic getInnerText function; it's special to sorttable. 203 | // for example, you can override the cell text with a customkey attribute. 204 | // it also gets .value for fields. 205 | 206 | if (!node) return ""; 207 | 208 | hasInputs = (typeof node.getElementsByTagName == 'function') && 209 | node.getElementsByTagName('input').length; 210 | 211 | if (node.getAttribute("sorttable_customkey") != null) { 212 | return node.getAttribute("sorttable_customkey"); 213 | } 214 | else if (typeof node.textContent != 'undefined' && !hasInputs) { 215 | return node.textContent.replace(/^\s+|\s+$/g, ''); 216 | } 217 | else if (typeof node.innerText != 'undefined' && !hasInputs) { 218 | return node.innerText.replace(/^\s+|\s+$/g, ''); 219 | } 220 | else if (typeof node.text != 'undefined' && !hasInputs) { 221 | return node.text.replace(/^\s+|\s+$/g, ''); 222 | } 223 | else { 224 | switch (node.nodeType) { 225 | case 3: 226 | if (node.nodeName.toLowerCase() == 'input') { 227 | return node.value.replace(/^\s+|\s+$/g, ''); 228 | } 229 | case 4: 230 | return node.nodeValue.replace(/^\s+|\s+$/g, ''); 231 | break; 232 | case 1: 233 | case 11: 234 | var innerText = ''; 235 | for (var i = 0; i < node.childNodes.length; i++) { 236 | innerText += sorttable.getInnerText(node.childNodes[i]); 237 | } 238 | return innerText.replace(/^\s+|\s+$/g, ''); 239 | break; 240 | default: 241 | return ''; 242 | } 243 | } 244 | }, 245 | 246 | reverse: function(tbody) { 247 | // reverse the rows in a tbody 248 | newrows = []; 249 | for (var i=0; i=0; i--) { 253 | tbody.appendChild(newrows[i]); 254 | } 255 | delete newrows; 256 | }, 257 | 258 | /* sort functions 259 | each sort function takes two parameters, a and b 260 | you are comparing a[0] and b[0] */ 261 | sort_numeric: function(a,b) { 262 | aa = parseFloat(a[0].replace(/[^0-9.-]/g,'')); 263 | if (isNaN(aa)) aa = 0; 264 | bb = parseFloat(b[0].replace(/[^0-9.-]/g,'')); 265 | if (isNaN(bb)) bb = 0; 266 | return aa-bb; 267 | }, 268 | sort_alpha: function(a,b) { 269 | if (a[0]==b[0]) return 0; 270 | if (a[0] 0 ) { 316 | var q = list[i]; list[i] = list[i+1]; list[i+1] = q; 317 | swap = true; 318 | } 319 | } // for 320 | t--; 321 | 322 | if (!swap) break; 323 | 324 | for(var i = t; i > b; --i) { 325 | if ( comp_func(list[i], list[i-1]) < 0 ) { 326 | var q = list[i]; list[i] = list[i-1]; list[i-1] = q; 327 | swap = true; 328 | } 329 | } // for 330 | b++; 331 | 332 | } // while(swap) 333 | } 334 | } 335 | 336 | /* ****************************************************************** 337 | Supporting functions: bundled here to avoid depending on a library 338 | ****************************************************************** */ 339 | 340 | // Dean Edwards/Matthias Miller/John Resig 341 | 342 | /* for Mozilla/Opera9 */ 343 | if (document.addEventListener) { 344 | document.addEventListener("DOMContentLoaded", sorttable.init, false); 345 | } 346 | 347 | /* for Internet Explorer */ 348 | /*@cc_on @*/ 349 | /*@if (@_win32) 350 | document.write(" 40 | 41 | 42 | 43 | 44 | 45 | 92 |
93 | 156 |
157 |
158 | 165 |

File Browser

166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 |
NameOwnerMirrorsAction
178 |
    179 | query("SELECT * FROM files WHERE active=1"); 182 | $row_count = mysqli_num_rows($result); 183 | $items_per_page = 10; 184 | $page_count = ceil($row_count / $items_per_page); 185 | for ($i = 1; $i <= $page_count; $i++) { 186 | echo $pagination_padding."
  • ".strval($i)."
  • \n"; 191 | } 192 | ?> 193 |
194 |
195 |
196 |
197 | title; 202 | $footer_desc = $decoded_footer->description; 203 | $footer_copyright = $decoded_footer->copyright; 204 | $footer_made = $decoded_footer->madewith; 205 | foreach ($decoded_footer->links as $single_link) { 206 | if ($single_link->hide) { 207 | continue; 208 | } 209 | $link_name = $single_link->name; 210 | $link_fa = $single_link->fa; 211 | $link_url = $single_link->link; 212 | array_push($footer_links, "
  •   $link_name
  • "); 213 | } 214 | ?> 215 |
    216 |
    217 |
    218 |
    219 |

    220 |
    221 |
    222 |
    Links
    223 |
      224 | 230 |
    231 |
    232 |
    233 |
    234 | 244 |
    245 | 246 | 247 | -------------------------------------------------------------------------------- /database.sql: -------------------------------------------------------------------------------- 1 | -- phpMyAdmin SQL Dump 2 | -- version 4.0.10deb1 3 | -- http://www.phpmyadmin.net 4 | -- 5 | -- Host: localhost 6 | -- Generation Time: Nov 26, 2018 at 07:15 PM 7 | -- Server version: 5.5.47-0ubuntu0.14.04.1 8 | -- PHP Version: 5.5.9-1ubuntu4.14 9 | 10 | SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; 11 | SET time_zone = "+00:00"; 12 | 13 | 14 | /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; 15 | /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; 16 | /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; 17 | /*!40101 SET NAMES utf8 */; 18 | 19 | -- 20 | -- Database: `google` 21 | -- 22 | 23 | -- -------------------------------------------------------- 24 | 25 | -- 26 | -- Table structure for table `files` 27 | -- 28 | 29 | CREATE TABLE IF NOT EXISTS `files` ( 30 | `prime_key` varchar(24) NOT NULL, 31 | `owner` text NOT NULL, 32 | `hash` text NOT NULL, 33 | `name` text NOT NULL, 34 | `size` bigint(20) NOT NULL, 35 | `listed` int(11) NOT NULL, 36 | `active` int(11) NOT NULL, 37 | PRIMARY KEY (`prime_key`) 38 | ) ENGINE=InnoDB DEFAULT CHARSET=latin1; 39 | 40 | -- -------------------------------------------------------- 41 | 42 | -- 43 | -- Table structure for table `mirrors` 44 | -- 45 | 46 | CREATE TABLE IF NOT EXISTS `mirrors` ( 47 | `prime_key` int(11) NOT NULL AUTO_INCREMENT, 48 | `owner` text NOT NULL, 49 | `parent` text NOT NULL, 50 | `id` text NOT NULL, 51 | `failures` int(11) NOT NULL, 52 | PRIMARY KEY (`prime_key`) 53 | ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=133 ; 54 | 55 | -- -------------------------------------------------------- 56 | 57 | -- 58 | -- Table structure for table `users` 59 | -- 60 | 61 | CREATE TABLE IF NOT EXISTS `users` ( 62 | `prime_key` varchar(21) NOT NULL, 63 | `name` text NOT NULL, 64 | `email` text NOT NULL, 65 | `permission` int(11) NOT NULL, 66 | `joined` int(11) NOT NULL, 67 | `updated` int(11) NOT NULL, 68 | `join_ip` text NOT NULL, 69 | `last_ip` text NOT NULL, 70 | `alias` text NOT NULL, 71 | `show_private` int(11) NOT NULL, 72 | PRIMARY KEY (`prime_key`), 73 | UNIQUE KEY `prime_key` (`prime_key`), 74 | UNIQUE KEY `prime_key_2` (`prime_key`), 75 | UNIQUE KEY `prime_key_3` (`prime_key`) 76 | ) ENGINE=InnoDB DEFAULT CHARSET=latin1; 77 | 78 | /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; 79 | /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; 80 | /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; 81 | -------------------------------------------------------------------------------- /func.php: -------------------------------------------------------------------------------- 1 | "User", 9 | 90 => "Admin", 10 | 100 => "Owner" 11 | ); 12 | $file_prefix = " "; 13 | $fail_max = strval(10); 14 | $site_name = ""; 15 | 16 | $test_file = "FILE ID"; 17 | 18 | // DATABASE SETTINGS 19 | $db_username = 'root'; // MySQL username 20 | $db_password = ''; // MySQL password 21 | $db_hostname = 'localhost'; // MySQL host 22 | $db_name = 'db'; 23 | $db = mysqli_connect($db_hostname, $db_username, $db_password, $db_name) or die("{\"status\":0,\"content\":\"Failed to connect to database\"}"); 24 | 25 | // GOOGLE API 26 | $google_primary = ""; 27 | $oauth_client = ""; 28 | $oauth_secret = ""; 29 | $scopes = array( 30 | "https://www.googleapis.com/auth/drive", 31 | "https://www.googleapis.com/auth/userinfo.profile", 32 | "https://www.googleapis.com/auth/userinfo.email" 33 | ); 34 | 35 | $client = new Google_Client(); 36 | foreach ($scopes as $scope) { 37 | $client->addScope($scope); 38 | } 39 | $client->setClientId($oauth_client); 40 | $client->setClientSecret($oauth_secret); 41 | $client->setDeveloperKey($google_primary); 42 | $client->setRedirectUri($host_name."session.php"); 43 | ?> 44 | -------------------------------------------------------------------------------- /index.php: -------------------------------------------------------------------------------- 1 | verifyIdToken($_SESSION["token"]["id_token"]); 11 | if ($ticket) { 12 | $client->setAccessToken($_SESSION["token"]); 13 | $oauth = new Google_Service_Oauth2($client); 14 | $dump = $oauth->userinfo->get(); 15 | } else { 16 | $has_session = false; 17 | } 18 | } catch (Exception $e) { 19 | try { 20 | if ($client->isAccessTokenExpired()) { 21 | $client->fetchAccessTokenWithRefreshToken($client->getRefreshToken()); 22 | $_SESSION["token"] = $client->getAccessToken(); 23 | } 24 | } catch (Exception $f) { 25 | $has_session = false; 26 | } 27 | } 28 | } 29 | ?> 30 | 31 | 32 | Home - <?php echo $site_title; ?> 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 53 |
    54 | 117 |
    118 |
    119 |

    Hello, givenName; } else { echo "world"; } ?>!

    120 |

    This is the home of a new project, that uses Google Drive for decentralized file sharing. Any files you copy or upload, you MUST have the right to distribute, since they may be listed publicly, and as such - they WILL be removed if the author / creator of the file contacts us. Other than that - please do not submit anything that violates any laws - our servers are located in the Indonesian, and will be subject to local laws. Due to the decentralized nature of this site; we cannot guarantee the full removal of any file. We are able to remove it from public listing, but any mirrored copies are simply out of our control. Please be aware of this before anything is shared - we cannot be held responsible for any consequences of your actions.

    121 |
    122 |
    123 |
    124 | title; 129 | $footer_desc = $decoded_footer->description; 130 | $footer_copyright = $decoded_footer->copyright; 131 | $footer_made = $decoded_footer->madewith; 132 | foreach ($decoded_footer->links as $single_link) { 133 | if ($single_link->hide) { 134 | continue; 135 | } 136 | $link_name = $single_link->name; 137 | $link_fa = $single_link->fa; 138 | $link_url = $single_link->link; 139 | array_push($footer_links, "
  •   $link_name
  • "); 140 | } 141 | ?> 142 |
    143 |
    144 |
    145 |
    146 |

    147 |
    148 |
    149 |
    Links
    150 |
      151 | 157 |
    158 |
    159 |
    160 |
    161 | 171 |
    172 | 173 | 174 | -------------------------------------------------------------------------------- /manage/index.php: -------------------------------------------------------------------------------- 1 | verifyIdToken($_SESSION["token"]["id_token"]); 11 | if ($ticket) { 12 | $client->setAccessToken($_SESSION["token"]); 13 | $oauth = new Google_Service_Oauth2($client); 14 | $dump = $oauth->userinfo->get(); 15 | } else { 16 | $has_session = false; 17 | } 18 | } catch (Exception $e) { 19 | try { 20 | if ($client->isAccessTokenExpired()) { 21 | $client->fetchAccessTokenWithRefreshToken($client->getRefreshToken()); 22 | $_SESSION["token"] = $client->getAccessToken(); 23 | } 24 | } catch (Exception $f) { 25 | $has_session = false; 26 | } 27 | } 28 | } 29 | if (!($has_session)) { 30 | header("Location: ".$host_name); 31 | } 32 | ?> 33 | 34 | 35 | Manage Files - <?php echo $site_title; ?> 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 107 |
    108 | 171 |
    172 |
    173 |

    File Manager

    174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 |
    NameAction
    184 |
    185 |
    186 |
    187 | title; 192 | $footer_desc = $decoded_footer->description; 193 | $footer_copyright = $decoded_footer->copyright; 194 | $footer_made = $decoded_footer->madewith; 195 | foreach ($decoded_footer->links as $single_link) { 196 | if ($single_link->hide) { 197 | continue; 198 | } 199 | $link_name = $single_link->name; 200 | $link_fa = $single_link->fa; 201 | $link_url = $single_link->link; 202 | array_push($footer_links, "
  •   $link_name
  • "); 203 | } 204 | ?> 205 |
    206 |
    207 |
    208 |
    209 |

    210 |
    211 |
    212 |
    Links
    213 |
      214 | 220 |
    221 |
    222 |
    223 |
    224 | 234 |
    235 | 236 | 237 | -------------------------------------------------------------------------------- /profile/index.php: -------------------------------------------------------------------------------- 1 | verifyIdToken($_SESSION["token"]["id_token"]); 11 | if ($ticket) { 12 | $client->setAccessToken($_SESSION["token"]); 13 | $oauth = new Google_Service_Oauth2($client); 14 | $dump = $oauth->userinfo->get(); 15 | } else { 16 | $has_session = false; 17 | } 18 | } catch (Exception $e) { 19 | try { 20 | if ($client->isAccessTokenExpired()) { 21 | $client->fetchAccessTokenWithRefreshToken($client->getRefreshToken()); 22 | $_SESSION["token"] = $client->getAccessToken(); 23 | } 24 | } catch (Exception $f) { 25 | $has_session = false; 26 | } 27 | } 28 | } 29 | if (!($has_session)) { 30 | header("Location: ".$host_name); 31 | } else { 32 | $user_id = $dump->id; 33 | $result = $db->query("SELECT * FROM users WHERE prime_key='$user_id'"); 34 | $row = $result->fetch_assoc(); 35 | $user_info = array(); 36 | $user_info["role"] = $permissions[intval($row["permission"])]; 37 | $user_info["name"] = $row["name"]; 38 | $user_info["id"] = $user_id; 39 | $user_info["email"] = $row["email"]; 40 | $user_info["alias"] = $row["alias"]; 41 | $user_info["private"] = ""; 42 | if ($row["show_private"] == 1) { 43 | $user_info["private"] = " checked=\"checked\""; 44 | } 45 | } 46 | ?> 47 | 48 | 49 | Profile - <?php echo $site_title; ?> 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 90 |
    91 | 154 |
    155 |
    156 |

    Profile

    157 |
    158 |
    159 |
    160 | " id="name" type="text"> 161 | 162 |
    163 |
    164 | " id="role" type="text"> 165 | 166 |
    167 |
    168 |
    169 |
    170 | " id="email" type="text"> 171 | 172 |
    173 |
    174 |
    175 |
    176 | " id="alias" type="text"> 177 | 178 |
    179 |
    180 |
    181 | > 182 | 183 |
    184 |
    185 |
    186 |
    187 |
    188 | Update Profile 189 |
    190 |
    191 |
    192 |
    193 |
    194 |
    195 | title; 200 | $footer_desc = $decoded_footer->description; 201 | $footer_copyright = $decoded_footer->copyright; 202 | $footer_made = $decoded_footer->madewith; 203 | foreach ($decoded_footer->links as $single_link) { 204 | if ($single_link->hide) { 205 | continue; 206 | } 207 | $link_name = $single_link->name; 208 | $link_fa = $single_link->fa; 209 | $link_url = $single_link->link; 210 | array_push($footer_links, "
  •   $link_name
  • "); 211 | } 212 | ?> 213 |
    214 |
    215 |
    216 |
    217 |

    218 |
    219 |
    220 |
    Links
    221 |
      222 | 228 |
    229 |
    230 |
    231 |
    232 | 242 |
    243 | 244 | 245 | -------------------------------------------------------------------------------- /session.php: -------------------------------------------------------------------------------- 1 | fetchAccessTokenWithAuthCode($_GET['code']); 9 | $client->setAccessToken($token); 10 | $_SESSION["token"] = $token; 11 | $oauth = new Google_Service_Oauth2($client); 12 | $dump = $oauth->userinfo->get(); 13 | $user_id = $db->real_escape_string($dump->id); 14 | $email = $db->real_escape_string($dump->email); 15 | $name = $db->real_escape_string($dump->name); 16 | $user_check = $db->query("SELECT * FROM users WHERE prime_key='$user_id'"); 17 | $time_now = strval(time()); 18 | $ip_hash = hash("sha256", $_SERVER['REMOTE_ADDR']); // I don't even want to know your IP. 19 | if (mysqli_num_rows($user_check) == 0) { 20 | $db->query("INSERT INTO users (prime_key, name, email, permission, joined, updated, join_ip, last_ip, alias) VALUES ('$user_id', '$name', '$email', 0, $time_now, $time_now, '$ip_hash', '$ip_hash', 'Anonymous')"); 21 | } else { 22 | $db->query("UPDATE users SET name='$name', email='$email', updated=$time_now, last_ip='$ip_hash' WHERE prime_key='$user_id'"); 23 | } 24 | } catch (Exception $e) { } 25 | if ($debug_mode) { 26 | var_dump($token); 27 | $home = false; 28 | } 29 | } else if (isset($_GET['login'])) { 30 | $auth_url = $client->createAuthUrl(); 31 | $home = false; 32 | header("Location: ".filter_var($auth_url, FILTER_SANITIZE_URL)); 33 | } else if (isset($_GET['logout'])) { 34 | session_destroy(); 35 | } 36 | if ($home) { 37 | header("Location: ".$host_name); 38 | } 39 | ?> 40 | --------------------------------------------------------------------------------