| Server IP : 202.61.199.114 / Your IP : 216.73.217.139 Web Server : nginx/1.22.1 System : Linux de.arni-solutions.de 6.1.0-49-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.174-1 (2026-05-26) x86_64 User : web20 ( 1018) PHP Version : 8.4.23 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /var/www/clients/client2/api.pacim.de/web/Codiad/components/settings/ |
Upload File : |
<?php
/*
* Copyright (c) Codiad & Andr3as, distributed
* as-is and without warranty under the MIT License. See
* [root]/license.txt for more. This information must remain intact.
*/
class Settings
{
//////////////////////////////////////////////////////////////////
// PROPERTIES
//////////////////////////////////////////////////////////////////
public $username = '';
public $settings = '';
//////////////////////////////////////////////////////////////////
// METHODS
//////////////////////////////////////////////////////////////////
// -----------------------------||----------------------------- //
//////////////////////////////////////////////////////////////////
// Construct
//////////////////////////////////////////////////////////////////
public function __construct()
{
}
//////////////////////////////////////////////////////////////////
// Save User Settings
//////////////////////////////////////////////////////////////////
public function Save()
{
if (!file_exists(DATA . "/settings.php")) {
saveJSON('settings.php', array($this->username => array('codiad.username' => $this->username)));
}
$settings = getJSON('settings.php');
// Security: prevent user side overwritten value
$this->settings['username'] = $this->username;
$settings[$this->username] = $this->settings;
saveJSON('settings.php', $settings);
echo formatJSEND("success", null);
}
//////////////////////////////////////////////////////////////////
// Load User Settings
//////////////////////////////////////////////////////////////////
public function Load()
{
if (!file_exists(DATA . "/settings.php")) {
saveJSON('settings.php', array($this->username => array('codiad.username' => $this->username)));
}
$settings = getJSON('settings.php');
echo formatJSEND("success", $settings[$this->username]);
}
}