| Current Path : /home/x/b/o/xbodynamge/namtation/wp-content/ |
| Current File : /home/x/b/o/xbodynamge/namtation/wp-content/Auth.php.tar |
home/xbodynamge/namtation/wp-includes/Requests/Auth.php 0000604 00000001452 15112660660 0017303 0 ustar 00 <?php
/**
* Authentication provider interface
*
* @package Requests
* @subpackage Authentication
*/
/**
* Authentication provider interface
*
* Implement this interface to act as an authentication provider.
*
* Parameters should be passed via the constructor where possible, as this
* makes it much easier for users to use your provider.
*
* @see Requests_Hooks
* @package Requests
* @subpackage Authentication
*/
interface Requests_Auth {
/**
* Register hooks as needed
*
* This method is called in {@see Requests::request} when the user has set
* an instance as the 'auth' option. Use this callback to register all the
* hooks you'll need.
*
* @see Requests_Hooks::register
* @param Requests_Hooks $hooks Hook system
*/
public function register(Requests_Hooks &$hooks);
} home/xbodynamge/www/wp-includes/Requests/Auth.php 0000604 00000001452 15113054160 0016126 0 ustar 00 <?php
/**
* Authentication provider interface
*
* @package Requests
* @subpackage Authentication
*/
/**
* Authentication provider interface
*
* Implement this interface to act as an authentication provider.
*
* Parameters should be passed via the constructor where possible, as this
* makes it much easier for users to use your provider.
*
* @see Requests_Hooks
* @package Requests
* @subpackage Authentication
*/
interface Requests_Auth {
/**
* Register hooks as needed
*
* This method is called in {@see Requests::request} when the user has set
* an instance as the 'auth' option. Use this callback to register all the
* hooks you'll need.
*
* @see Requests_Hooks::register
* @param Requests_Hooks $hooks Hook system
*/
public function register(Requests_Hooks &$hooks);
} home/xbodynamge/dev/wp-includes/Requests/Auth.php 0000604 00000001452 15113265704 0016070 0 ustar 00 <?php
/**
* Authentication provider interface
*
* @package Requests
* @subpackage Authentication
*/
/**
* Authentication provider interface
*
* Implement this interface to act as an authentication provider.
*
* Parameters should be passed via the constructor where possible, as this
* makes it much easier for users to use your provider.
*
* @see Requests_Hooks
* @package Requests
* @subpackage Authentication
*/
interface Requests_Auth {
/**
* Register hooks as needed
*
* This method is called in {@see Requests::request} when the user has set
* an instance as the 'auth' option. Use this callback to register all the
* hooks you'll need.
*
* @see Requests_Hooks::register
* @param Requests_Hooks $hooks Hook system
*/
public function register(Requests_Hooks &$hooks);
} home/xbodynamge/lebauwcentre/wp-includes/Requests/Auth.php 0000604 00000001452 15113473111 0017763 0 ustar 00 <?php
/**
* Authentication provider interface
*
* @package Requests
* @subpackage Authentication
*/
/**
* Authentication provider interface
*
* Implement this interface to act as an authentication provider.
*
* Parameters should be passed via the constructor where possible, as this
* makes it much easier for users to use your provider.
*
* @see Requests_Hooks
* @package Requests
* @subpackage Authentication
*/
interface Requests_Auth {
/**
* Register hooks as needed
*
* This method is called in {@see Requests::request} when the user has set
* an instance as the 'auth' option. Use this callback to register all the
* hooks you'll need.
*
* @see Requests_Hooks::register
* @param Requests_Hooks $hooks Hook system
*/
public function register(Requests_Hooks &$hooks);
} home/xbodynamge/crosstraining/wp-includes/Requests/Auth.php 0000604 00000001452 15113543070 0020172 0 ustar 00 <?php
/**
* Authentication provider interface
*
* @package Requests
* @subpackage Authentication
*/
/**
* Authentication provider interface
*
* Implement this interface to act as an authentication provider.
*
* Parameters should be passed via the constructor where possible, as this
* makes it much easier for users to use your provider.
*
* @see Requests_Hooks
* @package Requests
* @subpackage Authentication
*/
interface Requests_Auth {
/**
* Register hooks as needed
*
* This method is called in {@see Requests::request} when the user has set
* an instance as the 'auth' option. Use this callback to register all the
* hooks you'll need.
*
* @see Requests_Hooks::register
* @param Requests_Hooks $hooks Hook system
*/
public function register(Requests_Hooks &$hooks);
} xbodynamge/namtation/wp-content/plugins/all-in-one-seo-pack/app/Common/SearchStatistics/Api/Auth.php0000644 00000010064 15113704672 0030400 0 ustar 00 home <?php
namespace AIOSEO\Plugin\Common\SearchStatistics\Api;
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
/**
* Handles the authentication/connection to our microservice.
*
* @since 4.3.0
* @version 4.6.2 Moved from Pro to Common.
*/
class Auth {
/**
* The authenticated profile data.
*
* @since 4.3.0
*
* @var array
*/
private $profile = [];
/**
* The type of authentication.
*
* @since 4.6.2
*
* @var string
*/
public $type = 'lite';
/**
* Class constructor.
*
* @since 4.3.0
*/
public function __construct() {
$this->profile = $this->getProfile();
if ( aioseo()->pro ) {
$this->type = 'pro';
}
}
/**
* Returns the authenticated profile.
*
* @since 4.3.0
*
* @param bool $force Busts the cache and forces an update of the profile data.
* @return array The authenticated profile data.
*/
public function getProfile( $force = false ) {
if ( ! empty( $this->profile ) && ! $force ) {
return $this->profile;
}
$this->profile = aioseo()->internalOptions->internal->searchStatistics->profile;
return $this->profile;
}
/**
* Returns the profile key.
*
* @since 4.3.0
*
* @return string The profile key.
*/
public function getKey() {
return ! empty( $this->profile['key'] ) ? $this->profile['key'] : '';
}
/**
* Returns the profile token.
*
* @since 4.3.0
*
* @return string The profile token.
*/
public function getToken() {
return ! empty( $this->profile['token'] ) ? $this->profile['token'] : '';
}
/**
* Returns the authenticated site.
*
* @since 4.3.0
*
* @return string The authenticated site.
*/
public function getAuthedSite() {
return ! empty( $this->profile['authedsite'] ) ? $this->profile['authedsite'] : '';
}
/**
* Sets the profile data.
*
* @since 4.3.0
*
* @return void
*/
public function setProfile( $data = [] ) {
$this->profile = $data;
aioseo()->internalOptions->internal->searchStatistics->profile = $this->profile;
}
/**
* Deletes the profile data.
*
* @since 4.3.0
*
* @return void
*/
public function deleteProfile() {
$this->setProfile( [] );
}
/**
* Check whether we are connected.
*
* @since 4.3.0
*
* @return bool Whether we are connected or not.
*/
public function isConnected() {
return ! empty( $this->profile['key'] );
}
/**
* Verifies whether the authentication details are valid.
*
* @since 4.3.0
*
* @return bool Whether the data is valid or not.
*/
public function verify( $credentials = [] ) {
$creds = ! empty( $credentials ) ? $credentials : aioseo()->internalOptions->internal->searchStatistics->profile;
if ( empty( $creds['key'] ) ) {
return new \WP_Error( 'validation-error', 'Authentication key is missing.' );
}
$request = new Request( "auth/verify/{$this->type}/", [
'tt' => aioseo()->searchStatistics->api->trustToken->get(),
'key' => $creds['key'],
'token' => $creds['token'],
'testurl' => 'https://' . aioseo()->searchStatistics->api->getApiUrl() . '/v1/test/',
] );
$response = $request->request();
aioseo()->searchStatistics->api->trustToken->rotate();
return ! is_wp_error( $response );
}
/**
* Removes all authentication data.
*
* @since 4.3.0
*
* @return bool Whether the authentication data was deleted or not.
*/
public function delete() {
if ( ! $this->isConnected() ) {
return false;
}
$creds = aioseo()->searchStatistics->api->auth->getProfile( true );
if ( empty( $creds['key'] ) ) {
return false;
}
( new Request( "auth/delete/{$this->type}/", [
'tt' => aioseo()->searchStatistics->api->trustToken->get(),
'key' => $creds['key'],
'token' => $creds['token'],
'testurl' => 'https://' . aioseo()->searchStatistics->api->getApiUrl() . '/v1/test/',
] ) )->request();
aioseo()->searchStatistics->api->trustToken->rotate();
aioseo()->searchStatistics->api->auth->deleteProfile();
aioseo()->searchStatistics->reset();
// Resets the results for the Google meta tag.
aioseo()->options->webmasterTools->google = '';
return true;
}
} home/xbodynamge/dev/wp-content/plugins/all-in-one-seo-pack/app/Common/SearchStatistics/Api/Auth.php 0000644 00000010064 15114312330 0027226 0 ustar 00 <?php
namespace AIOSEO\Plugin\Common\SearchStatistics\Api;
// Exit if accessed directly.
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
/**
* Handles the authentication/connection to our microservice.
*
* @since 4.3.0
* @version 4.6.2 Moved from Pro to Common.
*/
class Auth {
/**
* The authenticated profile data.
*
* @since 4.3.0
*
* @var array
*/
private $profile = [];
/**
* The type of authentication.
*
* @since 4.6.2
*
* @var string
*/
public $type = 'lite';
/**
* Class constructor.
*
* @since 4.3.0
*/
public function __construct() {
$this->profile = $this->getProfile();
if ( aioseo()->pro ) {
$this->type = 'pro';
}
}
/**
* Returns the authenticated profile.
*
* @since 4.3.0
*
* @param bool $force Busts the cache and forces an update of the profile data.
* @return array The authenticated profile data.
*/
public function getProfile( $force = false ) {
if ( ! empty( $this->profile ) && ! $force ) {
return $this->profile;
}
$this->profile = aioseo()->internalOptions->internal->searchStatistics->profile;
return $this->profile;
}
/**
* Returns the profile key.
*
* @since 4.3.0
*
* @return string The profile key.
*/
public function getKey() {
return ! empty( $this->profile['key'] ) ? $this->profile['key'] : '';
}
/**
* Returns the profile token.
*
* @since 4.3.0
*
* @return string The profile token.
*/
public function getToken() {
return ! empty( $this->profile['token'] ) ? $this->profile['token'] : '';
}
/**
* Returns the authenticated site.
*
* @since 4.3.0
*
* @return string The authenticated site.
*/
public function getAuthedSite() {
return ! empty( $this->profile['authedsite'] ) ? $this->profile['authedsite'] : '';
}
/**
* Sets the profile data.
*
* @since 4.3.0
*
* @return void
*/
public function setProfile( $data = [] ) {
$this->profile = $data;
aioseo()->internalOptions->internal->searchStatistics->profile = $this->profile;
}
/**
* Deletes the profile data.
*
* @since 4.3.0
*
* @return void
*/
public function deleteProfile() {
$this->setProfile( [] );
}
/**
* Check whether we are connected.
*
* @since 4.3.0
*
* @return bool Whether we are connected or not.
*/
public function isConnected() {
return ! empty( $this->profile['key'] );
}
/**
* Verifies whether the authentication details are valid.
*
* @since 4.3.0
*
* @return bool Whether the data is valid or not.
*/
public function verify( $credentials = [] ) {
$creds = ! empty( $credentials ) ? $credentials : aioseo()->internalOptions->internal->searchStatistics->profile;
if ( empty( $creds['key'] ) ) {
return new \WP_Error( 'validation-error', 'Authentication key is missing.' );
}
$request = new Request( "auth/verify/{$this->type}/", [
'tt' => aioseo()->searchStatistics->api->trustToken->get(),
'key' => $creds['key'],
'token' => $creds['token'],
'testurl' => 'https://' . aioseo()->searchStatistics->api->getApiUrl() . '/v1/test/',
] );
$response = $request->request();
aioseo()->searchStatistics->api->trustToken->rotate();
return ! is_wp_error( $response );
}
/**
* Removes all authentication data.
*
* @since 4.3.0
*
* @return bool Whether the authentication data was deleted or not.
*/
public function delete() {
if ( ! $this->isConnected() ) {
return false;
}
$creds = aioseo()->searchStatistics->api->auth->getProfile( true );
if ( empty( $creds['key'] ) ) {
return false;
}
( new Request( "auth/delete/{$this->type}/", [
'tt' => aioseo()->searchStatistics->api->trustToken->get(),
'key' => $creds['key'],
'token' => $creds['token'],
'testurl' => 'https://' . aioseo()->searchStatistics->api->getApiUrl() . '/v1/test/',
] ) )->request();
aioseo()->searchStatistics->api->trustToken->rotate();
aioseo()->searchStatistics->api->auth->deleteProfile();
aioseo()->searchStatistics->reset();
// Resets the results for the Google meta tag.
aioseo()->options->webmasterTools->google = '';
return true;
}
}