Files
espocrm/application/Espo/Controllers/Settings.php
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());
}
}