diff --git a/app/controllers/api/account.php b/app/controllers/api/account.php index 3b3d3fe5ff..bf80f1932f 100644 --- a/app/controllers/api/account.php +++ b/app/controllers/api/account.php @@ -161,7 +161,7 @@ App::post('/v1/account/sessions') if (!$profile || !Auth::passwordVerify($password, $profile->getAttribute('password'))) { $audits //->setParam('userId', $profile->getId()) - ->setParam('event', 'account.sesssions.failed') + ->setParam('event', 'account.sessions.failed') ->setParam('resource', 'users/'.($profile ? $profile->getId() : '')) ; @@ -268,13 +268,13 @@ App::get('/v1/account/sessions/oauth2/:provider') throw new Exception('This provider is disabled. Please configure the provider app ID and app secret key from your '.APP_NAME.' console to continue.', 412); } - $classname = 'Appwrite\\Auth\\OAuth2\\'.\ucfirst($provider); + $className = 'Appwrite\\Auth\\OAuth2\\'.\ucfirst($provider); - if (!\class_exists($classname)) { + if (!\class_exists($className)) { throw new Exception('Provider is not supported', 501); } - $oauth2 = new $classname($appId, $appSecret, $callback, ['success' => $success, 'failure' => $failure], $scopes); + $oauth2 = new $className($appId, $appSecret, $callback, ['success' => $success, 'failure' => $failure], $scopes); $response ->addHeader('Cache-Control', 'no-store, no-cache, must-revalidate, max-age=0') @@ -377,13 +377,13 @@ App::get('/v1/account/sessions/oauth2/:provider/redirect') $appSecret = OpenSSL::decrypt($appSecret['data'], $appSecret['method'], $key, 0, \hex2bin($appSecret['iv']), \hex2bin($appSecret['tag'])); } - $classname = 'Appwrite\\Auth\\OAuth2\\'.\ucfirst($provider); + $className = 'Appwrite\\Auth\\OAuth2\\'.\ucfirst($provider); - if (!\class_exists($classname)) { + if (!\class_exists($className)) { throw new Exception('Provider is not supported', 501); } - $oauth2 = new $classname($appId, $appSecret, $callback); + $oauth2 = new $className($appId, $appSecret, $callback); if (!empty($state)) { try { diff --git a/app/controllers/mock.php b/app/controllers/mock.php index 9e1996dbda..6207aae969 100644 --- a/app/controllers/mock.php +++ b/app/controllers/mock.php @@ -523,7 +523,7 @@ App::shutdown(function($utopia, $response, $request) { $tests = \array_merge($tests, $result); if (!\file_put_contents($path, \json_encode($tests), LOCK_EX)) { - throw new Exception('Failed to save resutls', 500); + throw new Exception('Failed to save results', 500); } $response->dynamic(new Document(['result' => $route->getMethod() . ':' . $route->getURL() . ':passed']), Response::MODEL_MOCK); diff --git a/app/controllers/shared/api.php b/app/controllers/shared/api.php index 654192d59a..35e48ea46b 100644 --- a/app/controllers/shared/api.php +++ b/app/controllers/shared/api.php @@ -115,18 +115,10 @@ App::init(function ($utopia, $request, $response, $project, $user, $register, $e ; }, ['utopia', 'request', 'response', 'project', 'user', 'register', 'events', 'audits', 'usage', 'deletes', 'database', 'dbForInternal'], 'api'); -App::init(function ($utopia, $request, $response, $project, $user) { +App::init(function ($utopia, $request, $project) { /** @var Utopia\App $utopia */ /** @var Utopia\Swoole\Request $request */ - /** @var Appwrite\Utopia\Response $response */ /** @var Utopia\Database\Document $project */ - /** @var Utopia\Database\Document $user */ - /** @var Utopia\Registry\Registry $register */ - /** @var Appwrite\Event\Event $events */ - /** @var Appwrite\Event\Event $audits */ - /** @var Appwrite\Event\Event $usage */ - /** @var Appwrite\Event\Event $deletes */ - /** @var Appwrite\Event\Event $functions */ $route = $utopia->match($request); @@ -167,7 +159,7 @@ App::init(function ($utopia, $request, $response, $project, $user) { break; } -}, ['utopia', 'request', 'response', 'project', 'user'], 'auth'); +}, ['utopia', 'request', 'project'], 'auth'); App::shutdown(function ($utopia, $request, $response, $project, $events, $audits, $usage, $deletes, $database, $mode) { /** @var Utopia\App $utopia */ diff --git a/app/views/console/home/index.phtml b/app/views/console/home/index.phtml index ef9374b237..631400489b 100644 --- a/app/views/console/home/index.phtml +++ b/app/views/console/home/index.phtml @@ -36,6 +36,7 @@ $usageStatsEnabled = $this->getParam('usageStatsEnabled',true); data-analytics-label="Usage 24h" data-service="projects.getUsage" data-event="submit" + data-scope="console" data-name="usage" data-param-project-id="{{router.params.project}}" data-param-range="24h"> @@ -51,6 +52,7 @@ $usageStatsEnabled = $this->getParam('usageStatsEnabled',true); data-analytics-label="Usage 30d" data-service="projects.getUsage" data-event="submit" + data-scope="console" data-name="usage" data-param-project-id="{{router.params.project}}"> @@ -65,6 +67,7 @@ $usageStatsEnabled = $this->getParam('usageStatsEnabled',true); data-analytics-label="Usage 90d" data-service="projects.getUsage" data-event="submit" + data-scope="console" data-name="usage" data-param-project-id="{{router.params.project}}" data-param-range="90d">