cfmgrv3 init...3

This commit is contained in:
최준흠 2023-06-22 09:02:32 +09:00
parent 25ab3b8faf
commit dc41b7c76a
2 changed files with 10 additions and 9 deletions

View File

@ -6,7 +6,6 @@ use App\Models\Cloudflare\API\AuthModel;
use CodeIgniter\HTTP\RequestInterface;
use CodeIgniter\HTTP\ResponseInterface;
use Psr\Log\LoggerInterface;
use App\Libraries\Log\Log;
class AuthController extends APIController
{

View File

@ -172,20 +172,22 @@ class CommonController extends BaseController
}
protected function update_validate($entity)
{
//변경된 값 적용
$this->_viewDatas['fieldDatas'] = array();
foreach ($this->_viewDatas['fields'] as $field) {
$logs = array();
$value = rtrim($this->request->getVar($field));
if ($entity->$field != $value) {
$log = "{$entity->getTitle()}{$field} : {$entity->$field}=>{$value}";
//암호는 보안상 log에 남지 않게하기 위함
if ($field != 'passwd') {
Log::add("info", $log);
}
array_push($logs, $log);
$entity->$field = $this->_viewDatas['fieldDatas'][$field] = $value;
$log = "{$entity->getTitle()}{$field} : {$entity->$field}=>{$value}";
//암호는 보안상 log에 남지 않게하기 위함
if ($field != 'passwd') {
Log::add("info", $log);
}
array_push($logs, $log);
$entity->$field = $this->_viewDatas['fieldDatas'][$field] = $value;
}
// throw new \Exception(var_export($this->_viewDatas['fieldDatas'], true));
if (!$entity->hasChanged()) {
throw new \Exception("새로 변경된 값이 없습니다." . var_export($logs, true));
}