mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-03 14:10:57 +08:00
add-filesystem-google-drive
This commit is contained in:
@@ -55,3 +55,8 @@ USE_CRON_TRIGGER_CLEANUP=false
|
||||
LOG_FILE=/tmp/nexus.log
|
||||
|
||||
TIMEZONE=PRC
|
||||
|
||||
GOOGLE_DRIVE_CLIENT_ID=
|
||||
GOOGLE_DRIVE_CLIENT_SECRET=
|
||||
GOOGLE_DRIVE_REFRESH_TOKEN=
|
||||
GOOGLE_DRIVE_FOLDER_ID=
|
||||
|
||||
@@ -11,6 +11,7 @@ use Carbon\Carbon;
|
||||
use Illuminate\Console\Command;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
|
||||
class Test extends Command
|
||||
{
|
||||
@@ -55,7 +56,9 @@ class Test extends Command
|
||||
// ]);
|
||||
// dd($r);
|
||||
// $rep->assignCronjob();
|
||||
$r = $rep->cronjobCheckout();
|
||||
// $r = $rep->cronjobCheckout();
|
||||
$disk = Storage::disk('google_dirve');
|
||||
$r = $disk->files();
|
||||
dd($r);
|
||||
}
|
||||
|
||||
|
||||
30
app/Http/Resources/InviteResource.php
Normal file
30
app/Http/Resources/InviteResource.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Resources;
|
||||
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
|
||||
class InviteResource extends JsonResource
|
||||
{
|
||||
/**
|
||||
* Transform the resource into an array.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return array
|
||||
*/
|
||||
public function toArray($request)
|
||||
{
|
||||
return [
|
||||
'id' => $this->id,
|
||||
'inviter' => $this->inviter,
|
||||
'invitee' => $this->inviter,
|
||||
'hash' => $this->hash,
|
||||
'time_invited' => $this->time_invited,
|
||||
'valid' => $this->valid,
|
||||
'valid_text' => $this->valid_text,
|
||||
'invitee_register_uid' => $this->invitee_register_uid,
|
||||
'invitee_register_email' => $this->invitee_register_email,
|
||||
'invitee_register_username' => $this->invitee_register_username,
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -32,6 +32,7 @@ class UserResource extends JsonResource
|
||||
'seedtime_text' => mkprettytime($this->seedtime),
|
||||
'leechtime' => $this->leechtime,
|
||||
'leechtime_text' => mkprettytime($this->leechtime),
|
||||
'invitee_code' => new InviteResource($this->whenLoaded('invitee_code')),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,21 @@ class Invite extends NexusModel
|
||||
{
|
||||
protected $table = 'invites';
|
||||
|
||||
protected $fillable = [
|
||||
'inviter', 'invitee', 'hash', 'time_invited',
|
||||
const VALID_YES = 1;
|
||||
const VALID_NO = 0;
|
||||
|
||||
public static $validInfo = [
|
||||
self::VALID_NO => ['text' => 'No'],
|
||||
self::VALID_YES => ['text' => 'Yes'],
|
||||
];
|
||||
|
||||
protected $fillable = [
|
||||
'inviter', 'invitee', 'hash', 'time_invited', 'valid', 'invitee_register_uid', 'invitee_register_email', 'invitee_register_username'
|
||||
];
|
||||
|
||||
public function getValidTextAttribute()
|
||||
{
|
||||
return self::$validInfo[$this->valid]['text'] ?? '';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -134,4 +134,9 @@ class User extends Authenticatable
|
||||
return $this->belongsTo(Language::class, 'lang');
|
||||
}
|
||||
|
||||
public function invitee_code()
|
||||
{
|
||||
return $this->hasOne(Invite::class, 'invitee_register_uid');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
11
app/Providers/GoogleDriveAdapter.php
Normal file
11
app/Providers/GoogleDriveAdapter.php
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
class GoogleDriveAdapter extends \Hypweb\Flysystem\GoogleDrive\GoogleDriveAdapter
|
||||
{
|
||||
public function getService()
|
||||
{
|
||||
return $this->service;
|
||||
}
|
||||
}
|
||||
44
app/Providers/GoogleDriveServiceProvider.php
Normal file
44
app/Providers/GoogleDriveServiceProvider.php
Normal file
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
|
||||
class GoogleDriveServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* Bootstrap the application services.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function boot()
|
||||
{
|
||||
Storage::extend('google_dirve', function($app, $config) {
|
||||
$client = new \Google_Client();
|
||||
$client->setClientId($config['clientId']);
|
||||
$client->setClientSecret($config['clientSecret']);
|
||||
$client->refreshToken($config['refreshToken']);
|
||||
$service = new \Google_Service_Drive($client);
|
||||
|
||||
$options = [];
|
||||
if(isset($config['teamDriveId'])) {
|
||||
$options['teamDriveId'] = $config['teamDriveId'];
|
||||
}
|
||||
|
||||
$adapter = new GoogleDriveAdapter($service, $config['folderId'], $options);
|
||||
|
||||
return new \League\Flysystem\Filesystem($adapter);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Register the application services.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function register()
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
@@ -25,7 +25,7 @@ class UserRepository extends BaseRepository
|
||||
|
||||
public function getDetail($id)
|
||||
{
|
||||
$user = User::query()->findOrFail($id, User::$commonFields);
|
||||
$user = User::query()->with(['invitee_code'])->findOrFail($id, User::$commonFields);
|
||||
$userResource = new UserResource($user);
|
||||
$baseInfo = $userResource->response()->getData(true)['data'];
|
||||
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
"laravel/framework": "^8.12",
|
||||
"laravel/sanctum": "^2.10",
|
||||
"laravel/tinker": "^2.5",
|
||||
"nao-pon/flysystem-google-drive": "^1.1",
|
||||
"swiftmailer/swiftmailer": "^6.2"
|
||||
},
|
||||
"require-dev": {
|
||||
|
||||
718
composer.lock
generated
718
composer.lock
generated
@@ -4,7 +4,7 @@
|
||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"content-hash": "b775c2bbc9ad07b2efffe1afb30de056",
|
||||
"content-hash": "3cdb39d9cebc22389a2d4654a240149e",
|
||||
"packages": [
|
||||
{
|
||||
"name": "asm89/stack-cors",
|
||||
@@ -533,6 +533,66 @@
|
||||
],
|
||||
"time": "2020-10-22T13:48:01+00:00"
|
||||
},
|
||||
{
|
||||
"name": "firebase/php-jwt",
|
||||
"version": "v5.2.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/firebase/php-jwt.git",
|
||||
"reference": "f42c9110abe98dd6cfe9053c49bc86acc70b2d23"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/firebase/php-jwt/zipball/f42c9110abe98dd6cfe9053c49bc86acc70b2d23",
|
||||
"reference": "f42c9110abe98dd6cfe9053c49bc86acc70b2d23",
|
||||
"shasum": "",
|
||||
"mirrors": [
|
||||
{
|
||||
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
|
||||
"preferred": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.3.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": ">=4.8 <=9"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Firebase\\JWT\\": "src"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"BSD-3-Clause"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Neuman Vong",
|
||||
"email": "neuman+pear@twilio.com",
|
||||
"role": "Developer"
|
||||
},
|
||||
{
|
||||
"name": "Anant Narayanan",
|
||||
"email": "anant@php.net",
|
||||
"role": "Developer"
|
||||
}
|
||||
],
|
||||
"description": "A simple library to encode and decode JSON Web Tokens (JWT) in PHP. Should conform to the current spec.",
|
||||
"homepage": "https://github.com/firebase/php-jwt",
|
||||
"keywords": [
|
||||
"jwt",
|
||||
"php"
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/firebase/php-jwt/issues",
|
||||
"source": "https://github.com/firebase/php-jwt/tree/v5.2.1"
|
||||
},
|
||||
"time": "2021-02-12T00:02:00+00:00"
|
||||
},
|
||||
{
|
||||
"name": "fruitcake/laravel-cors",
|
||||
"version": "v2.0.3",
|
||||
@@ -612,6 +672,191 @@
|
||||
],
|
||||
"time": "2020-10-22T13:57:20+00:00"
|
||||
},
|
||||
{
|
||||
"name": "google/apiclient",
|
||||
"version": "v2.9.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/googleapis/google-api-php-client.git",
|
||||
"reference": "2fb6e702aca5d68203fa737f89f6f774022494c6"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/googleapis/google-api-php-client/zipball/2fb6e702aca5d68203fa737f89f6f774022494c6",
|
||||
"reference": "2fb6e702aca5d68203fa737f89f6f774022494c6",
|
||||
"shasum": "",
|
||||
"mirrors": [
|
||||
{
|
||||
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
|
||||
"preferred": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"require": {
|
||||
"firebase/php-jwt": "~2.0||~3.0||~4.0||~5.0",
|
||||
"google/apiclient-services": "~0.13",
|
||||
"google/auth": "^1.10",
|
||||
"guzzlehttp/guzzle": "~5.3.3||~6.0||~7.0",
|
||||
"guzzlehttp/psr7": "^1.2",
|
||||
"monolog/monolog": "^1.17|^2.0",
|
||||
"php": "^5.6|^7.0|^8.0",
|
||||
"phpseclib/phpseclib": "~2.0||^3.0.2"
|
||||
},
|
||||
"require-dev": {
|
||||
"cache/filesystem-adapter": "^0.3.2|^1.1",
|
||||
"composer/composer": "^1.10",
|
||||
"dealerdirect/phpcodesniffer-composer-installer": "^0.7",
|
||||
"phpcompatibility/php-compatibility": "^9.2",
|
||||
"phpunit/phpunit": "^5.7||^8.5.13",
|
||||
"squizlabs/php_codesniffer": "~2.3",
|
||||
"symfony/css-selector": "~2.1",
|
||||
"symfony/dom-crawler": "~2.1"
|
||||
},
|
||||
"suggest": {
|
||||
"cache/filesystem-adapter": "For caching certs and tokens (using Google\\Client::setCache)"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "2.x-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Google\\": "src/"
|
||||
},
|
||||
"files": [
|
||||
"src/aliases.php"
|
||||
],
|
||||
"classmap": [
|
||||
"src/aliases.php"
|
||||
]
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"Apache-2.0"
|
||||
],
|
||||
"description": "Client library for Google APIs",
|
||||
"homepage": "http://developers.google.com/api-client-library/php",
|
||||
"keywords": [
|
||||
"google"
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/googleapis/google-api-php-client/issues",
|
||||
"source": "https://github.com/googleapis/google-api-php-client/tree/v2.9.1"
|
||||
},
|
||||
"time": "2021-01-19T17:48:59+00:00"
|
||||
},
|
||||
{
|
||||
"name": "google/apiclient-services",
|
||||
"version": "v0.174.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/googleapis/google-api-php-client-services.git",
|
||||
"reference": "004c5280f5a26a8acbb6f6af6a792e4872b7648a"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/googleapis/google-api-php-client-services/zipball/004c5280f5a26a8acbb6f6af6a792e4872b7648a",
|
||||
"reference": "004c5280f5a26a8acbb6f6af6a792e4872b7648a",
|
||||
"shasum": "",
|
||||
"mirrors": [
|
||||
{
|
||||
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
|
||||
"preferred": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.4"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "^4.8|^5"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"psr-0": {
|
||||
"Google_Service_": "src"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"Apache-2.0"
|
||||
],
|
||||
"description": "Client library for Google APIs",
|
||||
"homepage": "http://developers.google.com/api-client-library/php",
|
||||
"keywords": [
|
||||
"google"
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/googleapis/google-api-php-client-services/issues",
|
||||
"source": "https://github.com/googleapis/google-api-php-client-services/tree/v0.174.0"
|
||||
},
|
||||
"time": "2021-05-08T11:20:03+00:00"
|
||||
},
|
||||
{
|
||||
"name": "google/auth",
|
||||
"version": "v1.15.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/googleapis/google-auth-library-php.git",
|
||||
"reference": "4e0c9367719df9703e96f5ad613041b87742471c"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/googleapis/google-auth-library-php/zipball/4e0c9367719df9703e96f5ad613041b87742471c",
|
||||
"reference": "4e0c9367719df9703e96f5ad613041b87742471c",
|
||||
"shasum": "",
|
||||
"mirrors": [
|
||||
{
|
||||
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
|
||||
"preferred": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"require": {
|
||||
"firebase/php-jwt": "~2.0|~3.0|~4.0|~5.0",
|
||||
"guzzlehttp/guzzle": "^5.3.1|^6.2.1|^7.0",
|
||||
"guzzlehttp/psr7": "^1.2",
|
||||
"php": ">=5.4",
|
||||
"psr/cache": "^1.0",
|
||||
"psr/http-message": "^1.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"guzzlehttp/promises": "0.1.1|^1.3",
|
||||
"kelvinmo/simplejwt": "^0.2.5|^0.5.1",
|
||||
"phpseclib/phpseclib": "^2.0.31",
|
||||
"phpunit/phpunit": "^4.8.36|^5.7",
|
||||
"sebastian/comparator": ">=1.2.3",
|
||||
"squizlabs/php_codesniffer": "^3.5"
|
||||
},
|
||||
"suggest": {
|
||||
"phpseclib/phpseclib": "May be used in place of OpenSSL for signing strings or for token management. Please require version ^2."
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Google\\Auth\\": "src"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"Apache-2.0"
|
||||
],
|
||||
"description": "Google Auth Library for PHP",
|
||||
"homepage": "http://github.com/google/google-auth-library-php",
|
||||
"keywords": [
|
||||
"Authentication",
|
||||
"google",
|
||||
"oauth2"
|
||||
],
|
||||
"support": {
|
||||
"docs": "https://googleapis.github.io/google-auth-library-php/master/",
|
||||
"issues": "https://github.com/googleapis/google-auth-library-php/issues",
|
||||
"source": "https://github.com/googleapis/google-auth-library-php/tree/v1.15.1"
|
||||
},
|
||||
"time": "2021-04-21T17:42:05+00:00"
|
||||
},
|
||||
{
|
||||
"name": "graham-campbell/result-type",
|
||||
"version": "v1.0.1",
|
||||
@@ -1497,6 +1742,63 @@
|
||||
],
|
||||
"time": "2020-08-23T07:39:11+00:00"
|
||||
},
|
||||
{
|
||||
"name": "league/flysystem-cached-adapter",
|
||||
"version": "1.1.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/thephpleague/flysystem-cached-adapter.git",
|
||||
"reference": "d1925efb2207ac4be3ad0c40b8277175f99ffaff"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/thephpleague/flysystem-cached-adapter/zipball/d1925efb2207ac4be3ad0c40b8277175f99ffaff",
|
||||
"reference": "d1925efb2207ac4be3ad0c40b8277175f99ffaff",
|
||||
"shasum": "",
|
||||
"mirrors": [
|
||||
{
|
||||
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
|
||||
"preferred": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"require": {
|
||||
"league/flysystem": "~1.0",
|
||||
"psr/cache": "^1.0.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"mockery/mockery": "~0.9",
|
||||
"phpspec/phpspec": "^3.4",
|
||||
"phpunit/phpunit": "^5.7",
|
||||
"predis/predis": "~1.0",
|
||||
"tedivm/stash": "~0.12"
|
||||
},
|
||||
"suggest": {
|
||||
"ext-phpredis": "Pure C implemented extension for PHP"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"League\\Flysystem\\Cached\\": "src/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "frankdejonge",
|
||||
"email": "info@frenky.net"
|
||||
}
|
||||
],
|
||||
"description": "An adapter decorator to enable meta-data caching.",
|
||||
"support": {
|
||||
"issues": "https://github.com/thephpleague/flysystem-cached-adapter/issues",
|
||||
"source": "https://github.com/thephpleague/flysystem-cached-adapter/tree/master"
|
||||
},
|
||||
"time": "2020-07-25T15:56:04+00:00"
|
||||
},
|
||||
{
|
||||
"name": "league/mime-type-detection",
|
||||
"version": "1.7.0",
|
||||
@@ -1653,6 +1955,116 @@
|
||||
],
|
||||
"time": "2020-12-14T13:15:25+00:00"
|
||||
},
|
||||
{
|
||||
"name": "nao-pon/flysystem-cached-extra",
|
||||
"version": "1.0.3",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/nao-pon/flysystem-cached-extra.git",
|
||||
"reference": "189abdafa0a86d92781e148ee8740ef80f4c5859"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/nao-pon/flysystem-cached-extra/zipball/189abdafa0a86d92781e148ee8740ef80f4c5859",
|
||||
"reference": "189abdafa0a86d92781e148ee8740ef80f4c5859",
|
||||
"shasum": "",
|
||||
"mirrors": [
|
||||
{
|
||||
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
|
||||
"preferred": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"require": {
|
||||
"league/flysystem-cached-adapter": "~1.0"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "1.0-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Hypweb\\Flysystem\\Cached\\Extra\\": "src/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Naoki Sawada",
|
||||
"email": "hypweb@gmail.com"
|
||||
}
|
||||
],
|
||||
"description": "Extra traits for Flysystem cached adapter",
|
||||
"support": {
|
||||
"issues": "https://github.com/nao-pon/flysystem-cached-extra/issues",
|
||||
"source": "https://github.com/nao-pon/flysystem-cached-extra/tree/master"
|
||||
},
|
||||
"time": "2018-02-16T01:44:38+00:00"
|
||||
},
|
||||
{
|
||||
"name": "nao-pon/flysystem-google-drive",
|
||||
"version": "1.1.13",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/nao-pon/flysystem-google-drive.git",
|
||||
"reference": "bb812339ecf06540ed096f71403f10fcbcc590f3"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/nao-pon/flysystem-google-drive/zipball/bb812339ecf06540ed096f71403f10fcbcc590f3",
|
||||
"reference": "bb812339ecf06540ed096f71403f10fcbcc590f3",
|
||||
"shasum": "",
|
||||
"mirrors": [
|
||||
{
|
||||
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
|
||||
"preferred": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"require": {
|
||||
"google/apiclient": "^2.0",
|
||||
"league/flysystem": "~1.0",
|
||||
"nao-pon/flysystem-cached-extra": "~1.0",
|
||||
"php": ">=5.4.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"mockery/mockery": "0.9.*",
|
||||
"phpunit/phpunit": "~4.0"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-api_v2": "1.0.x-dev",
|
||||
"dev-master": "1.1.x-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Hypweb\\Flysystem\\GoogleDrive\\": "src/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Naoki Sawada",
|
||||
"email": "hypweb@gmail.com"
|
||||
}
|
||||
],
|
||||
"description": "Flysystem adapter for Google Drive",
|
||||
"support": {
|
||||
"issues": "https://github.com/nao-pon/flysystem-google-drive/issues",
|
||||
"source": "https://github.com/nao-pon/flysystem-google-drive/tree/1.1.13"
|
||||
},
|
||||
"time": "2020-07-30T01:26:26+00:00"
|
||||
},
|
||||
{
|
||||
"name": "nesbot/carbon",
|
||||
"version": "2.46.0",
|
||||
@@ -1873,6 +2285,135 @@
|
||||
],
|
||||
"time": "2020-11-07T02:01:34+00:00"
|
||||
},
|
||||
{
|
||||
"name": "paragonie/constant_time_encoding",
|
||||
"version": "v2.4.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/paragonie/constant_time_encoding.git",
|
||||
"reference": "f34c2b11eb9d2c9318e13540a1dbc2a3afbd939c"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/paragonie/constant_time_encoding/zipball/f34c2b11eb9d2c9318e13540a1dbc2a3afbd939c",
|
||||
"reference": "f34c2b11eb9d2c9318e13540a1dbc2a3afbd939c",
|
||||
"shasum": "",
|
||||
"mirrors": [
|
||||
{
|
||||
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
|
||||
"preferred": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"require": {
|
||||
"php": "^7|^8"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "^6|^7|^8|^9",
|
||||
"vimeo/psalm": "^1|^2|^3|^4"
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"ParagonIE\\ConstantTime\\": "src/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Paragon Initiative Enterprises",
|
||||
"email": "security@paragonie.com",
|
||||
"homepage": "https://paragonie.com",
|
||||
"role": "Maintainer"
|
||||
},
|
||||
{
|
||||
"name": "Steve 'Sc00bz' Thomas",
|
||||
"email": "steve@tobtu.com",
|
||||
"homepage": "https://www.tobtu.com",
|
||||
"role": "Original Developer"
|
||||
}
|
||||
],
|
||||
"description": "Constant-time Implementations of RFC 4648 Encoding (Base-64, Base-32, Base-16)",
|
||||
"keywords": [
|
||||
"base16",
|
||||
"base32",
|
||||
"base32_decode",
|
||||
"base32_encode",
|
||||
"base64",
|
||||
"base64_decode",
|
||||
"base64_encode",
|
||||
"bin2hex",
|
||||
"encoding",
|
||||
"hex",
|
||||
"hex2bin",
|
||||
"rfc4648"
|
||||
],
|
||||
"support": {
|
||||
"email": "info@paragonie.com",
|
||||
"issues": "https://github.com/paragonie/constant_time_encoding/issues",
|
||||
"source": "https://github.com/paragonie/constant_time_encoding"
|
||||
},
|
||||
"time": "2020-12-06T15:14:20+00:00"
|
||||
},
|
||||
{
|
||||
"name": "paragonie/random_compat",
|
||||
"version": "v9.99.100",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/paragonie/random_compat.git",
|
||||
"reference": "996434e5492cb4c3edcb9168db6fbb1359ef965a"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/paragonie/random_compat/zipball/996434e5492cb4c3edcb9168db6fbb1359ef965a",
|
||||
"reference": "996434e5492cb4c3edcb9168db6fbb1359ef965a",
|
||||
"shasum": "",
|
||||
"mirrors": [
|
||||
{
|
||||
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
|
||||
"preferred": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"require": {
|
||||
"php": ">= 7"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "4.*|5.*",
|
||||
"vimeo/psalm": "^1"
|
||||
},
|
||||
"suggest": {
|
||||
"ext-libsodium": "Provides a modern crypto API that can be used to generate random bytes."
|
||||
},
|
||||
"type": "library",
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Paragon Initiative Enterprises",
|
||||
"email": "security@paragonie.com",
|
||||
"homepage": "https://paragonie.com"
|
||||
}
|
||||
],
|
||||
"description": "PHP 5.x polyfill for random_bytes() and random_int() from PHP 7",
|
||||
"keywords": [
|
||||
"csprng",
|
||||
"polyfill",
|
||||
"pseudorandom",
|
||||
"random"
|
||||
],
|
||||
"support": {
|
||||
"email": "info@paragonie.com",
|
||||
"issues": "https://github.com/paragonie/random_compat/issues",
|
||||
"source": "https://github.com/paragonie/random_compat"
|
||||
},
|
||||
"time": "2020-10-15T08:29:30+00:00"
|
||||
},
|
||||
{
|
||||
"name": "phpoption/phpoption",
|
||||
"version": "1.7.5",
|
||||
@@ -1944,6 +2485,178 @@
|
||||
],
|
||||
"time": "2020-07-20T17:29:33+00:00"
|
||||
},
|
||||
{
|
||||
"name": "phpseclib/phpseclib",
|
||||
"version": "3.0.8",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/phpseclib/phpseclib.git",
|
||||
"reference": "d9615a6fb970d9933866ca8b4036ec3407b020b6"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/d9615a6fb970d9933866ca8b4036ec3407b020b6",
|
||||
"reference": "d9615a6fb970d9933866ca8b4036ec3407b020b6",
|
||||
"shasum": "",
|
||||
"mirrors": [
|
||||
{
|
||||
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
|
||||
"preferred": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"require": {
|
||||
"paragonie/constant_time_encoding": "^1|^2",
|
||||
"paragonie/random_compat": "^1.4|^2.0|^9.99.99",
|
||||
"php": ">=5.6.1"
|
||||
},
|
||||
"require-dev": {
|
||||
"phing/phing": "~2.7",
|
||||
"phpunit/phpunit": "^5.7|^6.0|^9.4",
|
||||
"squizlabs/php_codesniffer": "~2.0"
|
||||
},
|
||||
"suggest": {
|
||||
"ext-gmp": "Install the GMP (GNU Multiple Precision) extension in order to speed up arbitrary precision integer arithmetic operations.",
|
||||
"ext-libsodium": "SSH2/SFTP can make use of some algorithms provided by the libsodium-php extension.",
|
||||
"ext-mcrypt": "Install the Mcrypt extension in order to speed up a few other cryptographic operations.",
|
||||
"ext-openssl": "Install the OpenSSL extension in order to speed up a wide variety of cryptographic operations."
|
||||
},
|
||||
"type": "library",
|
||||
"autoload": {
|
||||
"files": [
|
||||
"phpseclib/bootstrap.php"
|
||||
],
|
||||
"psr-4": {
|
||||
"phpseclib3\\": "phpseclib/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Jim Wigginton",
|
||||
"email": "terrafrost@php.net",
|
||||
"role": "Lead Developer"
|
||||
},
|
||||
{
|
||||
"name": "Patrick Monnerat",
|
||||
"email": "pm@datasphere.ch",
|
||||
"role": "Developer"
|
||||
},
|
||||
{
|
||||
"name": "Andreas Fischer",
|
||||
"email": "bantu@phpbb.com",
|
||||
"role": "Developer"
|
||||
},
|
||||
{
|
||||
"name": "Hans-Jürgen Petrich",
|
||||
"email": "petrich@tronic-media.com",
|
||||
"role": "Developer"
|
||||
},
|
||||
{
|
||||
"name": "Graham Campbell",
|
||||
"email": "graham@alt-three.com",
|
||||
"role": "Developer"
|
||||
}
|
||||
],
|
||||
"description": "PHP Secure Communications Library - Pure-PHP implementations of RSA, AES, SSH2, SFTP, X.509 etc.",
|
||||
"homepage": "http://phpseclib.sourceforge.net",
|
||||
"keywords": [
|
||||
"BigInteger",
|
||||
"aes",
|
||||
"asn.1",
|
||||
"asn1",
|
||||
"blowfish",
|
||||
"crypto",
|
||||
"cryptography",
|
||||
"encryption",
|
||||
"rsa",
|
||||
"security",
|
||||
"sftp",
|
||||
"signature",
|
||||
"signing",
|
||||
"ssh",
|
||||
"twofish",
|
||||
"x.509",
|
||||
"x509"
|
||||
],
|
||||
"support": {
|
||||
"issues": "https://github.com/phpseclib/phpseclib/issues",
|
||||
"source": "https://github.com/phpseclib/phpseclib/tree/3.0.8"
|
||||
},
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://github.com/terrafrost",
|
||||
"type": "github"
|
||||
},
|
||||
{
|
||||
"url": "https://www.patreon.com/phpseclib",
|
||||
"type": "patreon"
|
||||
},
|
||||
{
|
||||
"url": "https://tidelift.com/funding/github/packagist/phpseclib/phpseclib",
|
||||
"type": "tidelift"
|
||||
}
|
||||
],
|
||||
"time": "2021-04-19T03:20:48+00:00"
|
||||
},
|
||||
{
|
||||
"name": "psr/cache",
|
||||
"version": "1.0.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/php-fig/cache.git",
|
||||
"reference": "d11b50ad223250cf17b86e38383413f5a6764bf8"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/php-fig/cache/zipball/d11b50ad223250cf17b86e38383413f5a6764bf8",
|
||||
"reference": "d11b50ad223250cf17b86e38383413f5a6764bf8",
|
||||
"shasum": "",
|
||||
"mirrors": [
|
||||
{
|
||||
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
|
||||
"preferred": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.3.0"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "1.0.x-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Psr\\Cache\\": "src/"
|
||||
}
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "PHP-FIG",
|
||||
"homepage": "http://www.php-fig.org/"
|
||||
}
|
||||
],
|
||||
"description": "Common interface for caching libraries",
|
||||
"keywords": [
|
||||
"cache",
|
||||
"psr",
|
||||
"psr-6"
|
||||
],
|
||||
"support": {
|
||||
"source": "https://github.com/php-fig/cache/tree/master"
|
||||
},
|
||||
"time": "2016-08-06T20:24:11+00:00"
|
||||
},
|
||||
{
|
||||
"name": "psr/container",
|
||||
"version": "1.1.1",
|
||||
@@ -7699,7 +8412,8 @@
|
||||
"ext-gd": "*",
|
||||
"ext-json": "*",
|
||||
"ext-mbstring": "*",
|
||||
"ext-mysqli": "*"
|
||||
"ext-mysqli": "*",
|
||||
"ext-xml": "*"
|
||||
},
|
||||
"platform-dev": [],
|
||||
"plugin-api-version": "2.0.0"
|
||||
|
||||
@@ -175,6 +175,8 @@ return [
|
||||
App\Providers\EventServiceProvider::class,
|
||||
App\Providers\RouteServiceProvider::class,
|
||||
|
||||
App\Providers\GoogleDriveServiceProvider::class,
|
||||
|
||||
],
|
||||
|
||||
/*
|
||||
|
||||
@@ -51,6 +51,13 @@ return [
|
||||
'url' => env('AWS_URL'),
|
||||
'endpoint' => env('AWS_ENDPOINT'),
|
||||
],
|
||||
'google_dirve' => [
|
||||
'driver' => 'google_dirve',
|
||||
'clientId' => env('GOOGLE_DRIVE_CLIENT_ID'),
|
||||
'clientSecret' => env('GOOGLE_DRIVE_CLIENT_SECRET'),
|
||||
'refreshToken' => env('GOOGLE_DRIVE_REFRESH_TOKEN'),
|
||||
'folderId' => env('GOOGLE_DRIVE_FOLDER_ID'),
|
||||
],
|
||||
|
||||
],
|
||||
|
||||
|
||||
@@ -53,13 +53,13 @@ $inviter = $_POST["inviter"];
|
||||
$code = unesc($_POST["hash"]);
|
||||
|
||||
//check invite code
|
||||
$sq = sprintf("SELECT id, inviter FROM invites WHERE hash ='%s'",mysql_real_escape_string($code));
|
||||
$sq = sprintf("SELECT id, inviter FROM invites WHERE valid = %s and hash ='%s'", \App\Models\Invite::VALID_YES, mysql_real_escape_string($code));
|
||||
$res = sql_query($sq) or sqlerr(__FILE__, __LINE__);
|
||||
$inv = mysql_fetch_assoc($res);
|
||||
if (!$inv)
|
||||
bark('invalid invite code');
|
||||
if ($inv['inviter'] != $inviter) {
|
||||
\App\Models\Invite::query()->where('id', $inv['id'])->delete();
|
||||
\App\Models\Invite::query()->where('id', $inv['id'])->update(['valid' => \App\Models\Invite::VALID_NO]);
|
||||
stderr(nexus_trans('nexus.invalid_argument'), nexus_trans('invite.invalid_inviter'));
|
||||
exit();
|
||||
}
|
||||
@@ -192,15 +192,23 @@ EOD;
|
||||
|
||||
if ($type == 'invite')
|
||||
{
|
||||
//don't forget to delete confirmed invitee's hash code from table invites
|
||||
sql_query("DELETE FROM invites WHERE hash = '".mysql_real_escape_string($code)."'");
|
||||
$dt = sqlesc(date("Y-m-d H:i:s"));
|
||||
$subject = sqlesc($lang_takesignup_target[get_user_lang($inviter)]['msg_invited_user_has_registered']);
|
||||
$msg = sqlesc($lang_takesignup_target[get_user_lang($inviter)]['msg_user_you_invited'].$usern.$lang_takesignup_target[get_user_lang($inviter)]['msg_has_registered']);
|
||||
//sql_query("UPDATE users SET uploaded = uploaded + 10737418240 WHERE id = $inviter"); //add 10GB to invitor's uploading credit
|
||||
sql_query("INSERT INTO messages (sender, receiver, subject, added, msg) VALUES(0, $inviter, $subject, $dt, $msg)") or sqlerr(__FILE__, __LINE__);
|
||||
$Cache->delete_value('user_'.$inviter.'_unread_message_count');
|
||||
$Cache->delete_value('user_'.$inviter.'_inbox_count');
|
||||
//don't forget to delete confirmed invitee's hash code from table invites
|
||||
//sql_query("DELETE FROM invites WHERE hash = '".mysql_real_escape_string($code)."'");
|
||||
// set invalid
|
||||
$update = [
|
||||
'valid' => \App\Models\Invite::VALID_NO,
|
||||
'invitee_register_uid' => $id,
|
||||
'invitee_register_email' => $email,
|
||||
];
|
||||
\App\Models\Invite::query()->where('id', $inv['id'])->update($update);
|
||||
|
||||
$dt = sqlesc(date("Y-m-d H:i:s"));
|
||||
$subject = sqlesc($lang_takesignup_target[get_user_lang($inviter)]['msg_invited_user_has_registered']);
|
||||
$msg = sqlesc($lang_takesignup_target[get_user_lang($inviter)]['msg_user_you_invited'].$usern.$lang_takesignup_target[get_user_lang($inviter)]['msg_has_registered']);
|
||||
//sql_query("UPDATE users SET uploaded = uploaded + 10737418240 WHERE id = $inviter"); //add 10GB to invitor's uploading credit
|
||||
sql_query("INSERT INTO messages (sender, receiver, subject, added, msg) VALUES(0, $inviter, $subject, $dt, $msg)") or sqlerr(__FILE__, __LINE__);
|
||||
$Cache->delete_value('user_'.$inviter.'_unread_message_count');
|
||||
$Cache->delete_value('user_'.$inviter.'_inbox_count');
|
||||
}
|
||||
|
||||
if ($verification == 'admin'){
|
||||
|
||||
Reference in New Issue
Block a user