* Fix attempt to read property.
This commit is contained in:
@@ -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. */
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user