diff --git a/www/admin/table_arrays/array_edit_users.inc b/www/admin/table_arrays/array_edit_users.inc index c9b86a9a..1f0cd95e 100644 --- a/www/admin/table_arrays/array_edit_users.inc +++ b/www/admin/table_arrays/array_edit_users.inc @@ -34,6 +34,7 @@ 'output_name' => 'Password change interval', 'error_check' => 'intervalshort', // can be any date length format. n Y/M/D [not H/M/S], only one set, no combination 'type' => 'text', + 'interval' => 1, // interval needs NULL write for empty 'size' => 5, // make it 5 chars long 'length' => 5 ), diff --git a/www/libs/Class.DB.Array.IO.inc b/www/libs/Class.DB.Array.IO.inc index 00aacd4e..2faa225a 100644 --- a/www/libs/Class.DB.Array.IO.inc +++ b/www/libs/Class.DB.Array.IO.inc @@ -429,6 +429,13 @@ $this->debug('write_check', "[$column][".$this->table_array[$column]["value"]."] $_value = $this->table_array[$column]["value"]; $q_data .= $_value; } + elseif ($this->table_array[$column]["interval"]) + { + // for interval we check if no value, then we set null + if (!$this->table_array[$column]["value"]) + $_value = 'NULL'; + $q_data .= $_value; + } else // normal string { @@ -500,7 +507,10 @@ $this->debug('write_check', "[$column][".$this->table_array[$column]["value"]."] } // set primary key if ($insert) - $this->ok = $this->table_array[$this->pk_name]["value"] = $this->insert_id; + { + $this->table_array[$this->pk_name]["value"] = $this->insert_id; + $this->ok = $this->insert_id; + } // return the table if needed return $this->table_array; }