From a6038acda7c9a481aecd8ce1a5e820b0ed52d089 Mon Sep 17 00:00:00 2001 From: root Date: Wed, 27 Dec 2023 14:11:38 +0000 Subject: [PATCH] =?UTF-8?q?=D0=B3=D0=BE=D1=82=D0=BE=D0=B2=D0=BD=D0=BE?= =?UTF-8?q?=D1=81=D1=82=D1=8C=20=D0=BA=20=D0=B4=D1=83=D0=B1=D0=BB=D0=B8?= =?UTF-8?q?=D1=80=D0=BE=D0=B2=D0=B0=D0=BD=D0=B8=D1=8E=20=D0=BF=D1=80=D0=BE?= =?UTF-8?q?=D0=B5=D0=BA=D1=82=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- composer.json | 2 +- composer.lock | 14 +++++++------- mirzaev/marina/system/controllers/index.php | 2 +- mirzaev/marina/system/models/core.php | 4 ++-- mirzaev/marina/system/settings/arangodb.php.sample | 7 ++++--- .../system/settings/discord/robot.php.sample | 7 +++---- .../system/settings/discord/scope.php.sample | 8 -------- .../system/settings/discord/settings.php.sample | 6 ++++++ 9 files changed, 25 insertions(+), 27 deletions(-) delete mode 100644 mirzaev/marina/system/settings/discord/scope.php.sample create mode 100644 mirzaev/marina/system/settings/discord/settings.php.sample diff --git a/README.md b/README.md index b9fe249..125864f 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ # Marina ### Discord chat-robot -For our server BEBRA DREAMERS +For our server **BEBRA DREAMERS** diff --git a/composer.json b/composer.json index de34ae5..97d4654 100644 --- a/composer.json +++ b/composer.json @@ -33,7 +33,7 @@ "php": "~8.2", "mirzaev/minimal": "^2.2", "mirzaev/arangodb": "^1.3.0", - "triagens/arangodb": "~3.9.x-dev", + "triagens/arangodb": "~3.10.x-dev", "guzzlehttp/guzzle": "^7.5", "wohali/oauth2-discord-new": "^1.2" }, diff --git a/composer.lock b/composer.lock index ee90b4d..697e681 100644 --- a/composer.lock +++ b/composer.lock @@ -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": "b0b28e01189100f963205a827c33bc7c", + "content-hash": "35a83d010513f763290f92c01c2102aa", "packages": [ { "name": "guzzlehttp/guzzle", @@ -817,16 +817,16 @@ }, { "name": "triagens/arangodb", - "version": "3.9.x-dev", + "version": "3.10.x-dev", "source": { "type": "git", "url": "https://github.com/arangodb/arangodb-php.git", - "reference": "21c460dbbd75eb5c066f9abcc3a9adf4487d6e48" + "reference": "a378f9595b54ff16c9533b264e8d0709a2432da0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/arangodb/arangodb-php/zipball/21c460dbbd75eb5c066f9abcc3a9adf4487d6e48", - "reference": "21c460dbbd75eb5c066f9abcc3a9adf4487d6e48", + "url": "https://api.github.com/repos/arangodb/arangodb-php/zipball/a378f9595b54ff16c9533b264e8d0709a2432da0", + "reference": "a378f9595b54ff16c9533b264e8d0709a2432da0", "shasum": "" }, "require": { @@ -872,9 +872,9 @@ ], "support": { "issues": "https://github.com/arangodb/arangodb-php/issues", - "source": "https://github.com/arangodb/arangodb-php/tree/3.9" + "source": "https://github.com/arangodb/arangodb-php/tree/3.10" }, - "time": "2022-10-21T15:30:53+00:00" + "time": "2022-10-21T15:30:45+00:00" }, { "name": "wohali/oauth2-discord-new", diff --git a/mirzaev/marina/system/controllers/index.php b/mirzaev/marina/system/controllers/index.php index a3ae7df..913c5dd 100644 --- a/mirzaev/marina/system/controllers/index.php +++ b/mirzaev/marina/system/controllers/index.php @@ -29,7 +29,7 @@ final class index extends core // Step 1. Get authorization code $_SESSION['oauth2state'] = $this->provider->getState(); - header('Location: ' . $this->provider->getAuthorizationUrl()); + header('Location: ' . $this->provider->getAuthorizationUrl(require '../settings/discord/settings.php')); // Check given state against previously stored one to mitigate CSRF attack } elseif (empty($parameters['state']) || ($parameters['state'] !== $_SESSION['oauth2state'])) { diff --git a/mirzaev/marina/system/models/core.php b/mirzaev/marina/system/models/core.php index 3904e53..f7e0804 100644 --- a/mirzaev/marina/system/models/core.php +++ b/mirzaev/marina/system/models/core.php @@ -57,7 +57,7 @@ class core extends model { parent::__construct($initialize); - /* if ($initialize) { + if ($initialize) { // Запрошена инициализация if (isset($arangodb)) { @@ -71,7 +71,7 @@ class core extends model // Инициализация соединения с базой данных по умолчанию $this->__get('arangodb'); } - } */ + } } /** diff --git a/mirzaev/marina/system/settings/arangodb.php.sample b/mirzaev/marina/system/settings/arangodb.php.sample index e9eb917..e52f456 100644 --- a/mirzaev/marina/system/settings/arangodb.php.sample +++ b/mirzaev/marina/system/settings/arangodb.php.sample @@ -1,7 +1,8 @@ '', - 'clientSecret' => '', - 'redirectUri' => '' + 'endpoint' => 'unix:///var/run/arangodb3/arango.sock', + 'database' => '', + 'name' => '', + 'password' => '' ]; diff --git a/mirzaev/marina/system/settings/discord/robot.php.sample b/mirzaev/marina/system/settings/discord/robot.php.sample index fc1c2d1..73aa790 100644 --- a/mirzaev/marina/system/settings/discord/robot.php.sample +++ b/mirzaev/marina/system/settings/discord/robot.php.sample @@ -1,8 +1,7 @@ 'unix:///var/run/arangodb3/arango.sock', - 'database' => '', - 'name' => '', - 'password' => '' + 'clientId' => '', + 'clientSecret' => '', + 'redirectUri' => '' ]; diff --git a/mirzaev/marina/system/settings/discord/scope.php.sample b/mirzaev/marina/system/settings/discord/scope.php.sample deleted file mode 100644 index fc1c2d1..0000000 --- a/mirzaev/marina/system/settings/discord/scope.php.sample +++ /dev/null @@ -1,8 +0,0 @@ - 'unix:///var/run/arangodb3/arango.sock', - 'database' => '', - 'name' => '', - 'password' => '' -]; diff --git a/mirzaev/marina/system/settings/discord/settings.php.sample b/mirzaev/marina/system/settings/discord/settings.php.sample new file mode 100644 index 0000000..3f1e8f3 --- /dev/null +++ b/mirzaev/marina/system/settings/discord/settings.php.sample @@ -0,0 +1,6 @@ + 'OPTIONAL_CUSTOM_CONFIGURED_STATE', + 'scope' => ['identify', 'email'] +];