]> git.nbdom.net Git - nb.git/commitdiff
www/dbq/dbq.php
authorroot <sys@15gifts.com>
Wed, 23 Aug 2017 16:20:09 +0000 (17:20 +0100)
committerroot <sys@15gifts.com>
Wed, 23 Aug 2017 16:20:09 +0000 (17:20 +0100)
www/dbq/dbq.php

index 73cb523106d0de827b03ecbde71c548c71e418fd..d328c00da056b87dd48dc547164bcb71d192e8de 100644 (file)
@@ -963,7 +963,9 @@ EOF;
 
     } 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) {
@@ -978,6 +980,11 @@ EOF;
     }
   }
 
+  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);