mirror of
https://github.com/espocrm/espocrm.git
synced 2026-06-28 15:06:06 +00:00
24 lines
547 B
PHP
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());
|
|
}
|
|
}
|