]> git.nbdom.net Git - nb.git/commitdiff
table.is_admin
authorNicolas Boisselier <nicolas.boisselier@gmail.com>
Thu, 25 Aug 2016 14:00:28 +0000 (16:00 +0200)
committerNicolas Boisselier <nicolas.boisselier@gmail.com>
Thu, 25 Aug 2016 14:00:28 +0000 (16:00 +0200)
lib/php/db/table.php

index bd520ef9085fb3f3623f389df282154d5c0d221c..2003e4ecadc907ffb18c2402791718e1e58a9e51 100644 (file)
@@ -30,6 +30,7 @@ Class Table extends nb {
   public $count;
   public $engine;
   public $created;
+  public static $is_admin = true;
 
   # hidden, sort, ... fields
   public static $params = array( 'db', 'table', 'limit', 'debug', 'action'
@@ -1327,7 +1328,7 @@ Class Table extends nb {
     // If no primary keys, we use all field
     if (empty($keys)) $keys = $this->fields();
 
-    if (!($where = $this->where($keys,$hvalues,true))) {
+    if (!($where = $this->where($keys,$hvalues,self::$is_admin ? false : true))) {
       err('Db.delete(): Missing keys values');
       return null;
     }