} elseif ($action == 'update' and $this->perm >= self::WRITE) {
if (!$this->table->update($_POST,$info)) $this->error('update: '.print_r($info,true));
- header('Location: '.$this->table->base.'/');
+ # NB 23.08.17: TODO
+ $this->redirect_if_no_referer($this->table->base.'/');
+ #header('Location: '.$this->table->base.'/');
$this->page($info);
} elseif ($action == 'rm' and $this->perm >= self::DELETE) {
}
}
+ public function redirect_if_no_referer($url) {
+ if ($this->p('referer')) $url = urldecode($this->p('referer'));
+ header('Location: '.$url);
+ }
+
public function run() {
#$this->bye($_POST);