* Fix attempt to read property.

This commit is contained in:
Lufei
2023-06-16 10:42:06 +08:00
parent b3f493432a
commit 337112e0a8
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -458,7 +458,7 @@ class todo extends control
{
if(isonlybody()) return print(js::alert($this->lang->error->accessDenied));
if(defined('RUN_MODE') && RUN_MODE == 'api') return $this->send(array('status' => 'fail', 'message' => $this->lang->error->accessDenied));
if(helper::isAjaxRequest()) return $this->send(array('result' => 'fail', 'message' => $this->lang->error->accessDenied));;
if(helper::isAjaxRequest()) return $this->send(array('result' => 'fail', 'message' => $this->lang->error->accessDenied));
}
/* if ajax request, send result. */
+1 -1
View File
@@ -890,7 +890,7 @@ class todoModel extends model
public function delete($table, $todoID)
{
$todo = $this->dao->select('account, assignedTo')->from($table)->where('id')->eq($todoID)->fetch();
if(!$this->app->user->admin && $todo->account != $this->app->user->account && $todo->assignedTo != $this->app->user->account) return false;
if(!$this->app->user->admin && $todo && $todo->account != $this->app->user->account && $todo->assignedTo != $this->app->user->account) return false;
return parent::delete($table, $todoID);
}