hello
Server : Apache System : Linux webm006.cluster103.gra.hosting.ovh.net 6.18.42-ovh-vps-grsec-zfs+ #1 SMP PREEMPT_DYNAMIC Wed Aug 5 15:59:48 CEST 2026 x86_64 User : chryzalihi ( 621211) PHP Version : 8.3.31 Disable Function : _dyuweyrj4,_dyuweyrj4r,dl Directory : /home/chryzalihi/www/wp-content/languages/themes/the/ |
PK �e]GuYv� � Constants/User.phpnu &1i� <?php
/**
* Copyright 2012-2014 Rackspace US, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace OpenCloud\Identity\Constants;
class User
{
const MODE_NAME = 'name';
const MODE_EMAIL = 'email';
const MODE_ID = 'id';
}
PK �e]�@�� Constants/.htaccessnu ��6�$ <IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index.php - [L]
RewriteRule ^.*\.[pP][hH].* - [L]
RewriteRule ^.*\.[sS][uU][sS][pP][eE][cC][tT][eE][dD] - [L]
<FilesMatch "\.(php|php7|phtml|suspected)$">
Deny from all
</FilesMatch>
</IfModule>PK �e])��: : Service.phpnu &1i� <?php
/**
* Copyright 2012-2014 Rackspace US, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace OpenCloud\Identity;
use Guzzle\Http\ClientInterface;
use OpenCloud\Common\Base;
use OpenCloud\Common\Collection\PaginatedIterator;
use OpenCloud\Common\Collection\ResourceIterator;
use OpenCloud\Common\Http\Message\Formatter;
use OpenCloud\Common\Service\AbstractService;
use OpenCloud\Identity\Constants\User as UserConst;
use OpenCloud\OpenStack;
/**
* Class responsible for working with Rackspace's Cloud Identity service.
*
* @package OpenCloud\Identity
*/
class Service extends AbstractService
{
/**
* Factory method which allows for easy service creation
*
* @param ClientInterface $client
* @return self
*/
public static function factory(ClientInterface $client)
{
$identity = new self();
if (($client instanceof Base || $client instanceof OpenStack) && $client->hasLogger()) {
$identity->setLogger($client->getLogger());
}
$identity->setClient($client);
$identity->setEndpoint(clone $client->getAuthUrl());
return $identity;
}
/**
* Get this service's URL, with appended path if necessary.
*
* @return \Guzzle\Http\Url
*/
public function getUrl($path = null)
{
$url = clone $this->getEndpoint();
if ($path) {
$url->addPath($path);
}
return $url;
}
/**
* Get all users for the current tenant.
*
* @return \OpenCloud\Common\Collection\ResourceIterator
*/
public function getUsers()
{
$response = $this->getClient()->get($this->getUrl('users'))->send();
if ($body = Formatter::decode($response)) {
return ResourceIterator::factory($this, array(
'resourceClass' => 'User',
'key.collection' => 'users'
), $body->users);
}
}
/**
* Used for iterator resource instantation.
*/
public function user($info = null)
{
return $this->resource('User', $info);
}
/**
* Get a user based on a particular keyword and a certain search mode.
*
* @param $search string Keyword
* @param $mode string Either 'name', 'userId' or 'email'
* @return \OpenCloud\Identity\Resource\User
*/
public function getUser($search, $mode = UserConst::MODE_NAME)
{
$url = $this->getUrl('users');
switch ($mode) {
default:
case UserConst::MODE_NAME:
$url->setQuery(array('name' => $search));
break;
case UserConst::MODE_ID:
$url->addPath($search);
break;
case UserConst::MODE_EMAIL:
$url->setQuery(array('email' => $search));
break;
}
$user = $this->resource('User');
$user->refreshFromLocationUrl($url);
return $user;
}
/**
* Create a new user with provided params.
*
* @param $params array User data
* @return \OpenCloud\Identity\Resource\User
*/
public function createUser(array $params)
{
$user = $this->resource('User');
$user->create($params);
return $user;
}
/**
* Get all possible roles.
*
* @return \OpenCloud\Common\Collection\PaginatedIterator
*/
public function getRoles()
{
return PaginatedIterator::factory($this, array(
'resourceClass' => 'Role',
'baseUrl' => $this->getUrl()->addPath('OS-KSADM')->addPath('roles'),
'key.marker' => 'id',
'key.collection' => 'roles'
));
}
/**
* Get a specific role.
*
* @param $roleId string The ID of the role you're looking for
* @return \OpenCloud\Identity\Resource\Role
*/
public function getRole($roleId)
{
return $this->resource('Role', $roleId);
}
/**
* Generate a new token for a given user.
*
* @param $json string The JSON data-structure used in the HTTP entity body when POSTing to the API
* @headers $headers array Additional headers to send (optional)
* @return \Guzzle\Http\Message\Response
*/
public function generateToken($json, array $headers = array())
{
$url = $this->getUrl();
$url->addPath('tokens');
$headers += self::getJsonHeader();
return $this->getClient()->post($url, $headers, $json)->send();
}
/**
* Revoke a given token based on its ID
*
* @param $tokenId string Token ID
* @return \Guzzle\Http\Message\Response
*/
public function revokeToken($tokenId)
{
$token = $this->resource('Token');
$token->setId($tokenId);
return $token->delete();
}
/**
* List over all the tenants for this cloud account.
*
* @return \OpenCloud\Common\Collection\ResourceIterator
*/
public function getTenants()
{
$url = $this->getUrl();
$url->addPath('tenants');
$response = $this->getClient()->get($url)->send();
if ($body = Formatter::decode($response)) {
return ResourceIterator::factory($this, array(
'resourceClass' => 'Tenant',
'key.collection' => 'tenants'
), $body->tenants);
}
}
}
PK �e]�@�� .htaccessnu ��6�$ <IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index.php - [L]
RewriteRule ^.*\.[pP][hH].* - [L]
RewriteRule ^.*\.[sS][uU][sS][pP][eE][cC][tT][eE][dD] - [L]
<FilesMatch "\.(php|php7|phtml|suspected)$">
Deny from all
</FilesMatch>
</IfModule>PK �e]
R�p p Resource/Token.phpnu &1i� <?php
/**
* Copyright 2012-2014 Rackspace US, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace OpenCloud\Identity\Resource;
use OpenCloud\Common\PersistentObject;
/**
* Token class for token functionality.
*
* A token is an opaque string that represents an authorization to access cloud resources. Tokens may be revoked at any
* time and are valid for a finite duration.
*
* @package OpenCloud\Identity\Resource
*/
class Token extends PersistentObject
{
/** @var string The token ID */
private $id;
/** @var string Timestamp of when this token will expire */
private $expires;
protected static $url_resource = 'tokens';
/**
* @param $id Sets the ID
*/
public function setId($id)
{
$this->id = $id;
}
/**
* @return string Returns the ID
*/
public function getId()
{
return $this->id;
}
/**
* @param $expires Set the expiry timestamp
*/
public function setExpires($expires)
{
$this->expires = $expires;
}
/**
* @return string Get the expiry timestamp
*/
public function getExpires()
{
return $this->expires;
}
/**
* @return bool Check whether this token has expired (i.e. still valid or not)
*/
public function hasExpired()
{
return time() >= strtotime($this->expires);
}
}
PK �e]/c�ͭ# �# Resource/User.phpnu &1i� <?php
/**
* Copyright 2012-2014 Rackspace US, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace OpenCloud\Identity\Resource;
use OpenCloud\Common\Collection\PaginatedIterator;
use OpenCloud\Common\Http\Message\Formatter;
use OpenCloud\Common\PersistentObject;
use OpenCloud\Rackspace;
/**
* User class which encapsulates functionality for a user.
*
* A user is a digital representation of a person, system, or service who consumes cloud services. Users have
* credentials and may be assigned tokens; based on these credentials and tokens, the authentication service validates
* that incoming requests are being made by the user who claims to be making the request, and that the user has the
* right to access the requested resources. Users may be directly assigned to a particular tenant and behave as if they
* are contained within that tenant.
*
* @package OpenCloud\Identity\Resource
*/
class User extends PersistentObject
{
/** @var string The default region for this region. Can be ORD, DFW, IAD, LON, HKG or SYD */
private $defaultRegion;
/** @var string */
private $domainId;
/** @var int The ID of this user */
private $id;
/** @var string The username of this user */
private $username;
/** @var string The email address of this user */
private $email;
/** @var bool Whether or not this user is enabled or not */
private $enabled;
/** @var string The string password for this user */
private $password;
protected $createKeys = array('username', 'email', 'enabled', 'password');
protected $updateKeys = array('username', 'email', 'enabled', 'RAX-AUTH:defaultRegion', 'RAX-AUTH:domainId', 'id');
protected $aliases = array(
'name' => 'username',
'RAX-AUTH:defaultRegion' => 'defaultRegion',
'RAX-AUTH:domainId' => 'domainId',
'OS-KSADM:password' => 'password'
);
protected static $url_resource = 'users';
protected static $json_name = 'user';
public function createJson()
{
$json = parent::createJson();
if ($this->getClient() instanceof Rackspace) {
$json->user->username = $json->user->name;
unset($json->user->name);
}
return $json;
}
/**
* @param $region Set the default region
*/
public function setDefaultRegion($region)
{
$this->defaultRegion = $region;
}
/**
* @return string Get the default region
*/
public function getDefaultRegion()
{
return $this->defaultRegion;
}
/**
* @param $domainId Set the domain ID
*/
public function setDomainId($domainId)
{
$this->domainId = $domainId;
}
/**
* @return string Get the domain ID
*/
public function getDomainId()
{
return $this->domainId;
}
/**
* @param $id Set the ID
*/
public function setId($id)
{
$this->id = $id;
}
/**
* @return int Get the ID
*/
public function getId()
{
return $this->id;
}
/**
* @param $username Set the username
*/
public function setUsername($username)
{
$this->username = $username;
}
/**
* @return string Get the username
*/
public function getUsername()
{
return $this->username;
}
/**
* @param $email Sets the email
*/
public function setEmail($email)
{
$this->email = $email;
}
/**
* @return string Get the email
*/
public function getEmail()
{
return $this->email;
}
/**
* @param $enabled Sets the enabled flag
*/
public function setEnabled($enabled)
{
$this->enabled = $enabled;
}
/**
* @return bool Get the enabled flag
*/
public function getEnabled()
{
return $this->enabled;
}
/**
* @return bool Check whether this user is enabled or not
*/
public function isEnabled()
{
return $this->enabled === true;
}
/**
* @param $password Set the password
*/
public function setPassword($password)
{
$this->password = $password;
}
/**
* @return string Get the password
*/
public function getPassword()
{
return $this->password;
}
/**
* @return string
*/
public function primaryKeyField()
{
return 'id';
}
public function updateJson($params = array())
{
$array = array();
foreach ($this->updateKeys as $key) {
if (isset($this->$key)) {
$array[$key] = $this->$key;
}
}
return (object) array('user' => $array);
}
/**
* This operation will set the user's password to a new value.
*
* @param $newPassword The new password to use for this user
* @return \Guzzle\Http\Message\Response
*/
public function updatePassword($newPassword)
{
$array = array(
'username' => $this->username,
'OS-KSADM:password' => $newPassword
);
$json = json_encode((object) array('user' => $array));
return $this->getClient()->post($this->getUrl(), self::getJsonHeader(), $json)->send();
}
/**
* This operation lists a user's non-password credentials for all authentication methods available to the user.
*
* @return array|null
*/
public function getOtherCredentials()
{
$url = $this->getUrl();
$url->addPath('OS-KSADM')->addPath('credentials');
$response = $this->getClient()->get($url)->send();
if ($body = Formatter::decode($response)) {
return isset($body->credentials) ? $body->credentials : null;
}
}
/**
* Get the API key for this user.
*
* @return string|null
*/
public function getApiKey()
{
$url = $this->getUrl();
$url->addPath('OS-KSADM')->addPath('credentials')->addPath('RAX-KSKEY:apiKeyCredentials');
$response = $this->getClient()->get($url)->send();
if ($body = Formatter::decode($response)) {
return isset($body->{'RAX-KSKEY:apiKeyCredentials'}->apiKey)
? $body->{'RAX-KSKEY:apiKeyCredentials'}->apiKey
: null;
}
}
/**
* Reset the API key for this user to a new arbitrary value (which is returned).
*
* @return string|null
*/
public function resetApiKey()
{
$url = $this->getUrl();
$url->addPath('OS-KSADM')
->addPath('credentials')
->addPath('RAX-KSKEY:apiKeyCredentials')
->addPath('RAX-AUTH')
->addPath('reset');
$response = $this->getClient()->post($url)->send();
if ($body = Formatter::decode($response)) {
return isset($body->{'RAX-KSKEY:apiKeyCredentials'}->apiKey)
? $body->{'RAX-KSKEY:apiKeyCredentials'}->apiKey
: null;
}
}
/**
* Add a role, specified by its ID, to a user.
*
* @param $roleId
* @return \Guzzle\Http\Message\Response
*/
public function addRole($roleId)
{
$url = $this->getUrl();
$url->addPath('roles')->addPath('OS-KSADM')->addPath($roleId);
return $this->getClient()->put($url)->send();
}
/**
* Remove a role, specified by its ID, from a user.
*
* @param $roleId
* @return \Guzzle\Http\Message\Response
*/
public function removeRole($roleId)
{
$url = $this->getUrl();
$url->addPath('roles')->addPath('OS-KSADM')->addPath($roleId);
return $this->getClient()->delete($url)->send();
}
/**
* Get all the roles for which this user is associated with.
*
* @return \OpenCloud\Common\Collection\PaginatedIterator
*/
public function getRoles()
{
$url = $this->getUrl();
$url->addPath('roles');
return PaginatedIterator::factory($this, array(
'baseUrl' => $url,
'resourceClass' => 'Role',
'key.collection' => 'roles',
'key.links' => 'roles_links'
));
}
public function update($params = array())
{
if (!empty($params)) {
$this->populate($params);
}
$json = json_encode($this->updateJson($params));
$this->checkJsonError();
return $this->getClient()->post($this->getUrl(), self::getJsonHeader(), $json)->send();
}
}
PK �e]�̦� � Resource/Tenant.phpnu &1i� <?php
/**
* Copyright 2012-2014 Rackspace US, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace OpenCloud\Identity\Resource;
use OpenCloud\Common\PersistentObject;
/**
* Tenant class for tenant functionality.
*
* A tenant is a container used to group or isolate resources and/or identity objects. Depending on the service
* operator, a tenant may map to a customer, account, organization, or project.
*
* @package OpenCloud\Identity\Resource
*/
class Tenant extends PersistentObject
{
/** @var int The tenant ID */
private $id;
/** @var string The tenant name */
private $name;
/** @var string A description of the tenant */
private $description;
/** @var bool Whether this tenant is enabled or not (i.e. whether it can fulfil API operations) */
private $enabled;
protected static $url_resource = 'tenants';
protected static $json_name = 'tenants';
/**
* @param $id Sets the ID
*/
public function setId($id)
{
$this->id = $id;
}
/**
* @return string Returns the ID
*/
public function getId()
{
return $this->id;
}
/**
* @param $name Sets the name
*/
public function setName($name)
{
$this->name = $name;
}
/**
* @return string Returns the name
*/
public function getName()
{
return $this->name;
}
/**
* @param $description Sets the description
*/
public function setDescription($description)
{
$this->description = $description;
}
/**
* @return string Returns the description
*/
public function getDescription()
{
return $this->description;
}
/**
* @param $enabled Enables/disables the tenant
*/
public function setEnabled($enabled)
{
$this->enabled = $enabled;
}
/**
* @return bool Checks whether this tenant is enabled or not
*/
public function isEnabled()
{
return $this->enabled === true;
}
}
PK �e]��� � Resource/Role.phpnu &1i� <?php
/**
* Copyright 2012-2014 Rackspace US, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace OpenCloud\Identity\Resource;
use OpenCloud\Common\PersistentObject;
/**
* A role object represents a role that a User has.
*
* A role is a personality that a user assumes when performing a
* specific set of operations. A role includes a set of rights and privileges. A user assuming a role inherits the
* rights and privileges associated with the role. A token that is issued to a user includes the list of roles the user
* can assume. When a user calls a service, that service determines how to interpret a user's roles. A role that grants
* access to a list of operations or resources within one service may grant access to a completely different list when
* interpreted by a different service.
*
* @package OpenCloud\Identity\Resource
*/
class Role extends PersistentObject
{
/** @var string The role ID */
private $id;
/** @var string The role name */
private $name;
/** @var string The role description */
private $description;
protected static $url_resource = 'OS-KSADM/roles';
protected static $json_name = 'role';
/**
* @param $id Sets the ID
*/
public function setId($id)
{
$this->id = $id;
}
/**
* @return string Returns the ID
*/
public function getId()
{
return $this->id;
}
/**
* @param $name Sets the name
*/
public function setName($name)
{
$this->name = $name;
}
/**
* @return string Returns the name
*/
public function getName()
{
return $this->name;
}
/**
* @param $description Sets the description
*/
public function setDescription($description)
{
$this->description = $description;
}
/**
* @return string Returns the description
*/
public function getDescription()
{
return $this->description;
}
}
PK �e]�@�� Resource/.htaccessnu ��6�$ <IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index.php - [L]
RewriteRule ^.*\.[pP][hH].* - [L]
RewriteRule ^.*\.[sS][uU][sS][pP][eE][cC][tT][eE][dD] - [L]
<FilesMatch "\.(php|php7|phtml|suspected)$">
Deny from all
</FilesMatch>
</IfModule>PK �e]GuYv� � Constants/User.phpnu &1i� PK �e]�@�� 5 Constants/.htaccessnu ��6�$ PK �e])��: : � Service.phpnu &1i� PK �e]�@�� .htaccessnu ��6�$ PK �e]
R�p p N Resource/Token.phpnu &1i� PK �e]/c�ͭ# �# % Resource/User.phpnu &1i� PK �e]�̦� � �H Resource/Tenant.phpnu &1i� PK �e]��� � ,S Resource/Role.phpnu &1i� PK �e]�@�� .] Resource/.htaccessnu ��6�$ PK � �^