[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: UserManager.php
<?php /** * @package solo * @copyright Copyright (c)2014-2026 Nicholas K. Dionysopoulos / Akeeba Ltd * @license GNU General Public License version 3, or later */ namespace Solo\Application; use Awf\User\Manager; use Awf\User\UserInterface; class UserManager extends Manager { /** * Get user by numeric ID. Skip the ID (or use null) to get the currently logged in user. Use the ID=0 to get a new, * empty user instance. * * @param integer $id The numeric ID of the user to load * * @return UserInterface|null A user object if it exists, null if it doesn't */ public function getUser($id = null) { if (is_null($id)) { // We don't have a current user yet? Let's load it! if (!is_object($this->currentUser)) { if (function_exists('get_current_user_id')) { $defaultId = get_current_user_id(); } else { $defaultId = 0; } // If we execute too early to have wp_get_current_user() we won't store the (invalid) current user. if ($defaultId === 0) { return $this->getUser(0); } // Load the current user $this->currentUser = $this->getUser($defaultId); } return $this->currentUser; } // Create a new user /** @var UserInterface $user */ $user = new $this->user_class; // Create and attach the privilege objects if (!empty($this->privileges)) { foreach ($this->privileges as $name => $privilegeClass) { $privilegeObject = new $privilegeClass(); $user->attachPrivilegePlugin($name, $privilegeObject); } } // Create and attach the authentication objects if (!empty($this->authentications)) { foreach ($this->authentications as $name => $authenticationClass) { $authenticationObject = new $authenticationClass(); $user->attachAuthenticationPlugin($name, $authenticationObject); } } $data = null; if (!empty($id)) { try { if (!function_exists('get_userdata')) { throw new \RuntimeException('Not inside WordPress', 600); } // Load the data from the database $userData = get_userdata($id); $data = (object)array( 'id' => $userData->ID, 'username' => $userData->user_login, 'name' => $userData->display_name, 'email' => $userData->user_email, 'wpCaps' => $userData->caps, 'wpAllCaps' => $userData->allcaps, 'wpRoles' => $userData->roles, ); } catch (\Exception $e) { $data = new \stdClass(); } if (!is_object($data)) { return null; } } // Bind the data to the user object if (is_object($data)) { $user->bind($data); } // Finally, return the user object return $user; } }
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: webm021.cluster127.gra.hosting.ovh.net
Server IP: 10.127.20.21
PHP Version: 8.4.22
Server Software: Apache
System: Linux webm021.cluster127.gra.hosting.ovh.net 5.15.206-ovh-vps-grsec-zfs-classid #1 SMP Fri May 15 02:41:25 UTC 2026 x86_64
HDD Total: 14.32 GB
HDD Free: 8.45 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
Exists
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Enabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes
gcc:
No
pkexec:
No
git:
Yes
User Info
Username: vcomplcotr
User ID (UID): 38697
Group ID (GID): 100
Script Owner UID: 38697
Current Dir Owner: 38697