| Server IP : 85.158.181.41 / Your IP : 216.73.217.12 Web Server : Apache System : Linux cloud9-vm129 6.1.178+1-ph #ph SMP PREEMPT_DYNAMIC Wed Jul 29 09:00:54 UTC 2026 x86_64 User : moncbefd ( 1024) PHP Version : 7.3.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/moncbefd/www.moneta.at/GXModules/Gambio/StyleEdit/Api/Storage/ |
Upload File : |
<?php
/* --------------------------------------------------------------
StyleEditWelcomeStorage.inc.php 2019-03-15
Gambio GmbH
http://www.gambio.de
Copyright (c) 2016 Gambio GmbH
Released under the GNU General Public License (Version 2)
[http://www.gnu.org/licenses/gpl-2.0.html]
--------------------------------------------------------------
*/
namespace Gambio\StyleEdit\Api\Storage;
class StyleEditWelcomeStorage extends \ConfigurationStorage
{
/**
* Configuration storage namespace
*/
const CONFIG_STORAGE_NAMESPACE = 'modules/gambio/styleedit';
/**
* Secret configuration key name template
*/
const SECRET_CONFIG_KEY_TEMPLATE = 'welcomed/{CUSTOMER_ID}';
/**
* StyleEditWelcomeStorage constructor.
*/
public function __construct()
{
parent::__construct(self::CONFIG_STORAGE_NAMESPACE);
}
/**
* @param \IdType $customerId
*
* @return \Gambio\StyleEdit\Api\Storage\StyleEditWelcomeStorage
*/
public function storeWelcomeStatusSeenForCustomer(\IdType $customerId)
{
$key = $this->configurationKeyForCustomer($customerId);
parent::set($key, '1');
return $this;
}
/**
* @param \IdType $customerId
*
* @return bool has the logged in user been welcomed? (StarUp-view of theme list)
*/
public function welcomeStatusSeenForCustomer(\IdType $customerId)
{
$key = $this->configurationKeyForCustomer($customerId);
$value = parent::get($key);
return $value ? : false;
}
/**
* Return the substituted configuration key string for the provided customer ID
*
* @param \IdType $customerId Customer ID
*
* @return string Substituted secret configuration key
*/
protected function configurationKeyForCustomer(\IdType $customerId)
{
$id = (string)$customerId->asInt();
return str_replace('{CUSTOMER_ID}', $id, self::SECRET_CONFIG_KEY_TEMPLATE);
}
}