This repository has been archived on 2026-07-19. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
espocrm-base/application/Espo/Controllers/Settings.php
T
Yuri Kuznetsov 18d366bda0 fix config
2014-01-22 14:36:37 +02:00

24 lines
547 B
PHP

<?php
namespace Espo\Controllers;
use \Espo\Core\Exceptions\Error;
class Settings extends \Espo\Core\Controllers\Base
{
public function actionRead($params, $data)
{
return $this->getConfig()->getData($this->getUser()->isAdmin());
}
public function actionPatch($params, $data)
{
$result = $this->getConfig()->setData($data, $this->getUser()->isAdmin());
if ($result === false) {
throw new Error('Cannot save settings');
}
return $this->getConfig()->getData($this->getUser()->isAdmin());
}
}