Файловый менеджер - Редактировать - /home/wuectly/www/03cbe/Model.zip
Назад
PK [Y!]L�J�� � index.htmlnu &1i� <!--~ ~ @package akeebabackup ~ @copyright Copyright (c)2006-2023 Nicholas K. Dionysopoulos / Akeeba Ltd ~ @license GNU General Public License version 3, or later --> <html><head><title></title></head><body></body></html>PK [Y!]�4$t t Updates.phpnu &1i� <?php /** * @package akeebabackup * @copyright Copyright (c)2006-2023 Nicholas K. Dionysopoulos / Akeeba Ltd * @license GNU General Public License version 3, or later */ namespace Akeeba\Backup\Site\Model; // Protect from unauthorized access defined('_JEXEC') || die(); use Akeeba\Backup\Admin\Model\Updates as AdminModel; class Updates extends AdminModel { } PK [Y!]Gj�v v Profiles.phpnu &1i� <?php /** * @package akeebabackup * @copyright Copyright (c)2006-2023 Nicholas K. Dionysopoulos / Akeeba Ltd * @license GNU General Public License version 3, or later */ namespace Akeeba\Backup\Site\Model; // Protect from unauthorized access defined('_JEXEC') || die(); use Akeeba\Backup\Admin\Model\Profiles as AdminModel; class Profiles extends AdminModel { } PK [Y!]ǩF�0 0 Oauth2/BoxEngine.phpnu &1i� <?php /** * @package akeebabackup * @copyright Copyright (c)2006-2023 Nicholas K. Dionysopoulos / Akeeba Ltd * @license GNU General Public License version 3, or later */ namespace Akeeba\Backup\Site\Model\Oauth2; defined('_JEXEC') || die; class BoxEngine extends AbstractProvider implements ProviderInterface { /** @var string */ protected $tokenEndpoint = 'https://api.box.com/oauth2/token'; /** @var string */ protected $engineNameForHumans = 'Box.com'; public function getAuthenticationUrl(): string { $this->checkConfiguration(); [$id, $secret] = $this->getIdAndSecret(); $params = [ 'response_type' => 'code', 'client_id' => $id, 'redirect_uri' => $this->getUri('step2'), ]; return 'https://account.box.com/api/oauth2/authorize?' . http_build_query($params); } }PK [Y!]�h Oauth2/DropboxEngine.phpnu &1i� <?php /** * @package akeebabackup * @copyright Copyright (c)2006-2023 Nicholas K. Dionysopoulos / Akeeba Ltd * @license GNU General Public License version 3, or later */ namespace Akeeba\Backup\Site\Model\Oauth2; defined('_JEXEC') || die; use FOF40\Input\Input; class DropboxEngine extends AbstractProvider implements ProviderInterface { /** @var string */ protected $tokenEndpoint = 'https://api.dropboxapi.com/1/oauth2/token'; /** @var string */ protected $engineNameForHumans = 'Dropbox'; public function getAuthenticationUrl(): string { $this->checkConfiguration(); [$id, $secret] = $this->getIdAndSecret(); $params = [ 'client_id' => $id, 'response_type' => 'code', 'redirect_uri' => $this->getUri('step2'), 'scope' => implode( ' ', [ 'account_info.read', 'files.metadata.read', 'files.content.write', 'files.content.read', 'team_data.member', ] ), 'token_access_type' => 'offline', ]; return 'https://www.dropbox.com/1/oauth2/authorize?' . http_build_query($params); } protected function getResponseCustomFields(Input $input): array { $fields = parent::getResponseCustomFields($input); unset($fields['client_id']); unset($fields['client_secret']); $fields['redirect_uri'] = $this->getUri('step2'); return $fields; } protected function getRefreshCustomFields(Input $input): array { $fields = parent::getRefreshCustomFields($input); unset($fields['client_id']); unset($fields['client_secret']); return $fields; } }PK [Y!]�4Jo_ _ Oauth2/ProviderInterface.phpnu &1i� <?php /** * @package akeebabackup * @copyright Copyright (c)2006-2023 Nicholas K. Dionysopoulos / Akeeba Ltd * @license GNU General Public License version 3, or later */ namespace Akeeba\Backup\Site\Model\Oauth2; defined('_JEXEC') || die; use FOF40\Input\Input; /** * OAuth2 Helper provider interface * * @since 8.2.2 */ interface ProviderInterface { /** * Get the URL to redirect to for the first authentication step (consent screen). * * @return string * @since 8.4.0 */ public function getAuthenticationUrl(): string; /** * Handles the second step of the authentication (exchange code for tokens) * * @param Input $input The raw application input object * * @return TokenResponse * @since 8.4.0 */ public function handleResponse(Input $input): TokenResponse; /** * Handles exchanging a refresh token for an access token * * @param Input $input The raw application input object * * @return TokenResponse * @since 8.4.0 */ public function handleRefresh(Input $input): TokenResponse; public function getEngineNameForHumans(): string; }PK [Y!]�B,_� � Oauth2/OAuth2UriException.phpnu &1i� <?php /** * @package akeebabackup * @copyright Copyright (c)2006-2023 Nicholas K. Dionysopoulos / Akeeba Ltd * @license GNU General Public License version 3, or later */ namespace Akeeba\Backup\Site\Model\Oauth2; defined('_JEXEC') || die; use RuntimeException; use Throwable; /** * OAuth2 Helper error redirecting to a URL * * @since 8.4.0 */ class OAuth2UriException extends RuntimeException { /** @var string */ private $url; public function __construct(string $url, Throwable $previous = null) { $message = sprintf('For more information please visit %s', $url); $this->url = $url; parent::__construct($message, 500, $previous); } public function getUrl(): string { return $this->url; } }PK [Y!]����� � ! Oauth2/OnedrivebusinessEngine.phpnu &1i� <?php /** * @package akeebabackup * @copyright Copyright (c)2006-2023 Nicholas K. Dionysopoulos / Akeeba Ltd * @license GNU General Public License version 3, or later */ namespace Akeeba\Backup\Site\Model\Oauth2; defined('_JEXEC') || die; use FOF40\Input\Input; class OnedrivebusinessEngine extends AbstractProvider implements ProviderInterface { /** @var string */ protected $tokenEndpoint = 'https://login.microsoftonline.com/common/oauth2/v2.0/token'; /** @var string */ protected $engineNameForHumans = 'OneDrive'; public function getAuthenticationUrl(): string { $this->checkConfiguration(); [$id, $secret] = $this->getIdAndSecret(); $params = [ 'client_id' => $id, 'response_type' => 'code', 'redirect_uri' => $this->getUri('step2'), 'response_mode' => 'query', 'scope' => implode( ' ', [ 'files.readwrite.all', 'user.read', 'offline_access', ] ), ]; return 'https://login.microsoftonline.com/common/oauth2/v2.0/authorize?' . http_build_query($params); } protected function getResponseCustomFields(Input $input): array { return array_merge( parent::getResponseCustomFields($input), [ 'scope' => 'files.readwrite.all user.read offline_access', 'redirect_uri' => $this->getUri('step2'), ] ); } protected function getRefreshCustomFields(Input $input): array { return array_merge( parent::getRefreshCustomFields($input), [ 'redirect_uri' => $this->getUri('step2'), ] ); } }PK [Y!]�7o�u u Oauth2/AbstractProvider.phpnu &1i� <?php /** * @package akeebabackup * @copyright Copyright (c)2006-2023 Nicholas K. Dionysopoulos / Akeeba Ltd * @license GNU General Public License version 3, or later */ namespace Akeeba\Backup\Site\Model\Oauth2; defined('_JEXEC') || die; use FOF40\Input\Input; use Joomla\CMS\Component\ComponentHelper; use Joomla\CMS\Factory; use Joomla\CMS\Language\Text; use Joomla\CMS\Uri\Uri; abstract class AbstractProvider implements ProviderInterface { /** @var string */ protected $tokenEndpoint = ''; /** @var string */ protected $engineNameForHumans = ''; public function doRedirect(string $uri) { Factory::getApplication()->redirect($uri); } public function getEngineNameForHumans(): string { return $this->engineNameForHumans; } public final function handleResponse(Input $input): TokenResponse { $this->checkConfiguration(); $code = $input->getRaw('code'); if (!$code) { throw new OAuth2Exception('no_code', 'No code has been provided in the URL.'); } $query = http_build_query($this->getResponseCustomFields($input), '', '&'); $ch = curl_init($this->tokenEndpoint); $options = [ CURLOPT_SSL_VERIFYPEER => true, CURLOPT_VERBOSE => true, CURLOPT_HEADER => false, CURLINFO_HEADER_OUT => false, CURLOPT_RETURNTRANSFER => true, CURLOPT_CAINFO => AKEEBA_CACERT_PEM, CURLOPT_FOLLOWLOCATION => true, CURLOPT_POST => 1, CURLOPT_POSTFIELDS => $query, CURLOPT_HTTPHEADER => [ 'Content-Type: application/x-www-form-urlencoded', ], ]; curl_setopt_array($ch, $options); // Get the tokens $response = curl_exec($ch); $errNo = curl_errno($ch); $error = curl_error($ch); curl_close($ch); // Did cURL die? if ($errNo) { throw new OAuth2Exception( 'curl_error', <<< HTML An error occurred communicating with $this->engineNameForHumans. Technical information:<br/><br/> Error Number: $errNo<br/> Error Description: $error<br/> HTML ); } // Decode the response $result = @json_decode($response, true); // Did we receive invalid JSON? if (!$result) { throw new OAuth2Exception( 'invalid_json', sprintf("%s failed to response with a valid token. Please try again later.", $this->engineNameForHumans) ); } // Do we have an error reported by the remote endpoint? if (isset($result['error'])) { $error = $result['error']; $errorUri = $result['error_uri'] ?? null; $errorDescription = $result['error_uri'] ?? null; if ($errorUri) { throw new OAuth2UriException($errorUri); } throw new OAuth2Exception($error, $errorDescription); } $ret = new TokenResponse(); $ret['accessToken'] = $result['access_token'] ?? ''; $ret['refreshToken'] = $result['refresh_token'] ?? ''; return $ret; } public final function handleRefresh(Input $input): TokenResponse { $refreshToken = $input->getRaw('refresh_token', null); $this->checkConfiguration(); if (empty($refreshToken)) { throw new OAuth2Exception( 'no_refresh_token', 'A refresh token was not provided. Operation aborted.' ); } // Prepare the request to get the tokens $query = http_build_query($this->getRefreshCustomFields($input), '', '&'); $ch = curl_init($this->tokenEndpoint); $options = [ CURLOPT_SSL_VERIFYPEER => true, CURLOPT_VERBOSE => true, CURLOPT_HEADER => false, CURLINFO_HEADER_OUT => false, CURLOPT_RETURNTRANSFER => true, CURLOPT_CAINFO => AKEEBA_CACERT_PEM, CURLOPT_FOLLOWLOCATION => true, CURLOPT_POST => 1, CURLOPT_POSTFIELDS => $query, CURLOPT_HTTPHEADER => [ 'Content-Type: application/x-www-form-urlencoded', ], ]; curl_setopt_array($ch, $options); // Get the tokens $response = curl_exec($ch); $errNo = curl_errno($ch); $error = curl_error($ch); curl_close($ch); // Did cURL die? if ($errNo) { throw new OAuth2Exception( 'curl_error', sprintf( "An error occurred refreshing the token. Error Number: %s -- Error Description: %s", $errNo, $error ) ); } // Decode the response $result = @json_decode($response, true); // Did we receive invalid JSON? if (!$result) { throw new OAuth2Exception( 'invalid_json', sprintf( "%s failed to respond with a valid token to our token refresh request.", $this->engineNameForHumans ) ); } $ret = new TokenResponse(); $ret['accessToken'] = $result['access_token'] ?? ''; $ret['refreshToken'] = $result['refresh_token'] ?? ''; return $ret; } protected function getResponseCustomFields(Input $input): array { [$id, $secret] = $this->getIdAndSecret(); $code = $input->getRaw('code'); return [ 'code' => $code, 'client_id' => $id, 'client_secret' => $secret, 'grant_type' => 'authorization_code', ]; } protected function getRefreshCustomFields(Input $input): array { $refreshToken = $input->getRaw('refresh_token', null); [$id, $secret] = $this->getIdAndSecret(); return [ 'refresh_token' => $refreshToken, 'client_id' => $id, 'client_secret' => $secret, 'grant_type' => 'refresh_token', ]; } protected final function getEngineName(): string { $parts = explode('\\', rtrim(get_class($this), '\\')); $name = array_pop($parts); if (substr($name, -6) === 'Engine') { $name = substr($name, 0, -6); } return strtolower($name); } protected final function checkConfiguration(): void { $engine = $this->getEngineName(); // Is the engine enabled? $cParams = ComponentHelper::getParams('com_akeeba'); if ($cParams->get('oauth2_client_' . $engine, 0) == 0) { throw new OAuth2Exception('no_access', Text::_('JERROR_ALERTNOAUTHOR')); } $id = $cParams->get($engine . '_client_id', null); $secret = $cParams->get($engine . '_client_secret', null); if (empty($id) || empty($secret)) { throw new OAuth2Exception('no_access', Text::_('JERROR_ALERTNOAUTHOR')); } } protected final function getIdAndSecret(): array { $cParams = ComponentHelper::getParams('com_akeeba'); $engine = $this->getEngineName(); $id = $cParams->get($engine . '_client_id', null); $secret = $cParams->get($engine . '_client_secret', null); return [$id, $secret]; } protected final function getUri(string $task = 'step1') { $uri = rtrim(Uri::base(), '/'); if (substr($uri, -14) === '/administrator') { $uri = substr($uri, 0, -14); } elseif (substr($uri, -4) === '/administrator') { $uri = substr($uri, 0, -4); } return sprintf( "%s/index.php?option=com_akeeba&view=oauth2&task=step2&format=raw&engine=%s", $uri, $this->getEngineName() ); } }PK [Y!]�5�� � Oauth2/TokenResponse.phpnu &1i� <?php /** * @package akeebabackup * @copyright Copyright (c)2006-2023 Nicholas K. Dionysopoulos / Akeeba Ltd * @license GNU General Public License version 3, or later */ namespace Akeeba\Backup\Site\Model\Oauth2; defined('_JEXEC') || die; class TokenResponse implements \ArrayAccess { /** @var string|null */ private $accessToken = null; /** @var string|null */ private $refreshToken = null; /** @inheritDoc */ public function offsetExists($offset) { return isset($this->{$offset}); } /** @inheritDoc */ public function offsetGet($offset) { return $this->{$offset} ?? null; } /** @inheritDoc */ public function offsetSet($offset, $value) { if ($this->offsetExists($offset)) { return; } $this->{$offset} = $value; } /** @inheritDoc */ public function offsetUnset($offset) { throw new \BadMethodCallException( sprintf( 'You cannot unset an offset in %s', __CLASS__ ) ); } /** * Casts the data into a plain array * * @return array * @since 8.4.0 */ public function toArray() { return [ 'accessToken' => $this->accessToken, 'refreshToken' => $this->refreshToken, ]; } }PK [Y!]�֧ � Oauth2/GoogledriveEngine.phpnu &1i� <?php /** * @package akeebabackup * @copyright Copyright (c)2006-2023 Nicholas K. Dionysopoulos / Akeeba Ltd * @license GNU General Public License version 3, or later */ namespace Akeeba\Backup\Site\Model\Oauth2; defined('_JEXEC') || die; use FOF40\Input\Input; class GoogledriveEngine extends AbstractProvider implements ProviderInterface { /** @var string */ protected $tokenEndpoint = 'https://www.googleapis.com/oauth2/v4/token'; /** @var string */ protected $engineNameForHumans = 'Google Drive'; public function getAuthenticationUrl(): string { $this->checkConfiguration(); [$id, $secret] = $this->getIdAndSecret(); $params = [ 'client_id' => $id, 'redirect_uri' => $this->getUri('step2'), 'scope' => 'https://www.googleapis.com/auth/drive', 'access_type' => 'offline', 'prompt' => 'consent', 'response_type' => 'code', ]; return 'https://accounts.google.com/o/oauth2/v2/auth?' . http_build_query($params); } protected function getResponseCustomFields(Input $input): array { return array_merge( parent::getResponseCustomFields($input), [ 'redirect_uri' => $this->getUri('step2'), ] ); } }PK [Y!]��.Nn n Oauth2/OAuth2Exception.phpnu &1i� <?php /** * @package akeebabackup * @copyright Copyright (c)2006-2023 Nicholas K. Dionysopoulos / Akeeba Ltd * @license GNU General Public License version 3, or later */ namespace Akeeba\Backup\Site\Model\Oauth2; defined('_JEXEC') || die; use RuntimeException; use Throwable; /** * Generic OAuth2 Helper error * * @since 8.4.0 */ class OAuth2Exception extends RuntimeException { public function __construct(string $error, ?string $description = "", Throwable $previous = null) { $description = $description ?: $this->getDefaultErrorDescription($error); $message = sprintf('%s: %s', $error, $description); parent::__construct($message, 500, $previous); } private function getDefaultErrorDescription(string $error): string { switch ($error) { case 'invalid_request': return 'The request sent to the storage provider is invalid. Please check your Client ID and Client Secret in Akeeba Backup\'s configuration. Also, make sure the callback URI is set up correctly on the remote storage provider. If necessary, relink Akeeba Backup with the remote storage provider'; case 'invalid_client': return 'The configured Client ID is incorrect.'; case 'invalid_grant': return 'The grant type is invalid, the code has already been used (you tried to refresh the page), you failed to log into the remote storage provider, or declined to give authorisation.'; case 'unauthorized_client': return 'Your account with the remote storage provider is not allowed to be linked with your API application. Please check your API application configuration with the remote storage provider.'; case 'unsupported_grant_type': return 'The grant type requested is not supported by the remote storage provider. Please check your API application configuration with the remote storage provider.'; case 'invalid_scope': return 'The authentication scope requested is not supported by the remote storage provider. Please check your API application configuration with the remote storage provider.'; default: return 'A generic error occurred, which we do not have any further information for.'; } } }PK [Y!]���ԁ � Oauth2.phpnu &1i� <?php /** * @package akeebabackup * @copyright Copyright (c)2006-2023 Nicholas K. Dionysopoulos / Akeeba Ltd * @license GNU General Public License version 3, or later */ namespace Akeeba\Backup\Site\Model; defined('_JEXEC') || die; use Akeeba\Backup\Site\Model\Oauth2\ProviderInterface; use FOF40\Model\Model; use Joomla\CMS\Component\ComponentHelper; /** * Custom OAuth2 Helper model * * @since 8.4.0 */ class Oauth2 extends Model { /** * Returns the provider object for the requested engine * * @param string $engine The requested engine * * @return ProviderInterface The provider object * @throws \InvalidArgumentException If the engine is not available * @since 8.4.0 */ public function getProvider(string $engine): ProviderInterface { $className = __NAMESPACE__ . '\\Oauth2\\' . ucfirst(strtolower($engine)) . 'Engine'; if (!class_exists($className)) { throw new \InvalidArgumentException(sprintf("Invalid engine: %s", $engine)); } return new $className; } /** * Is the requested provider enabled in the component options? * * @param string $engine The requested engine * * @return bool * @since 8.4.0 */ public function isEnabled(string $engine): bool { $key = sprintf('oauth2_client_%s', strtolower($engine)); $cParams = ComponentHelper::getParams('com_akeeba'); return $cParams->get($key, 0) != 0; } }PK [Y!]��ѡ� � .htaccessnu &1i� <IfModule !mod_authz_core.c> Order deny,allow Deny from all </IfModule> <IfModule mod_authz_core.c> <RequireAll> Require all denied </RequireAll> </IfModule> PK [Y!]�z z Statistics.phpnu &1i� <?php /** * @package akeebabackup * @copyright Copyright (c)2006-2023 Nicholas K. Dionysopoulos / Akeeba Ltd * @license GNU General Public License version 3, or later */ namespace Akeeba\Backup\Site\Model; // Protect from unauthorized access defined('_JEXEC') || die(); use Akeeba\Backup\Admin\Model\Statistics as AdminModel; class Statistics extends AdminModel { } PK [Y!]|��N web.confignu &1i� <?xml version="1.0"?> <!-- This only works on IIS 7 or later. See https://www.iis.net/configreference/system.webserver/security/requestfiltering/fileextensions --> <configuration> <system.webServer> <security> <requestFiltering> <fileExtensions allowUnlisted="false" > <clear /> <add fileExtension=".html" allowed="true"/> </fileExtensions> </requestFiltering> </security> </system.webServer> </configuration>PK [Y!]L�J�� � index.htmlnu &1i� PK [Y!]�4$t t $ Updates.phpnu &1i� PK [Y!]Gj�v v � Profiles.phpnu &1i� PK [Y!]ǩF�0 0 � Oauth2/BoxEngine.phpnu &1i� PK [Y!]�h � Oauth2/DropboxEngine.phpnu &1i� PK [Y!]�4Jo_ _ X Oauth2/ProviderInterface.phpnu &1i� PK [Y!]�B,_� � Oauth2/OAuth2UriException.phpnu &1i� PK [Y!]����� � ! ( Oauth2/OnedrivebusinessEngine.phpnu &1i� PK [Y!]�7o�u u g Oauth2/AbstractProvider.phpnu &1i� PK [Y!]�5�� � '7 Oauth2/TokenResponse.phpnu &1i� PK [Y!]�֧ � �; Oauth2/GoogledriveEngine.phpnu &1i� PK [Y!]��.Nn n �@ Oauth2/OAuth2Exception.phpnu &1i� PK [Y!]���ԁ � �I Oauth2.phpnu &1i� PK [Y!]��ѡ� � aO .htaccessnu &1i� PK [Y!]�z z @P Statistics.phpnu &1i� PK [Y!]|��N �Q web.confignu &1i� PK ; GT
| ver. 1.4 |
Github
|
.
| PHP 8.1.34 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка