From a4abd47d1c2780e5bb25290f7200648d7fae624d Mon Sep 17 00:00:00 2001 From: Nicolas Boisselier Date: Fri, 2 Mar 2018 01:33:10 +0000 Subject: [PATCH] etc/dbq/ldap.php --- etc/dbq/ldap.php | 1 + lib/php/db.php | 4 ++-- lib/php/db/table.php | 3 +-- lib/php/page.php | 8 ++++---- www/dbq/dbq.php | 2 -- 5 files changed, 8 insertions(+), 10 deletions(-) diff --git a/etc/dbq/ldap.php b/etc/dbq/ldap.php index 32f5fdee..5cee7fd8 100644 --- a/etc/dbq/ldap.php +++ b/etc/dbq/ldap.php @@ -50,6 +50,7 @@ if (preg_match('/^([^,]+),(.*?)$/',$user,$m)) { $filter = '(&('.$filter.')(userPassword=*))'; $DBQ['ldap'] = $GLOBALS['DBQ_LDAP'] + [ 'name' => $base, + 'title' => 'nbdom.net', 'type' => 'ldap', 'tables' => [ 'me' => [ diff --git a/lib/php/db.php b/lib/php/db.php index ea917918..4d2cb45c 100644 --- a/lib/php/db.php +++ b/lib/php/db.php @@ -542,7 +542,7 @@ class Db extends nb { if ($value!==null) return header("$format: $value"); - if (!$mime=mime::get($format)) return false; + if (!$mime=Mime::get($format)) return false; header('Content-type: '.$mime); return $mime; @@ -1329,7 +1329,7 @@ class Db extends nb { public static function content_type2format($content_type=null) { if (empty($content_type)) $content_type = self::client_content_type(); - switch (mime::ext($content_type)) { + switch (Mime::ext($content_type)) { case "html": return 'table'; default: diff --git a/lib/php/db/table.php b/lib/php/db/table.php index 71f81c50..2e8df04c 100644 --- a/lib/php/db/table.php +++ b/lib/php/db/table.php @@ -1610,9 +1610,8 @@ Class Table extends nb { if ($this->buttons() and !empty($buttons[0])) $html .= ''.$buttons[0].''.NB_EOL; foreach ($row as $k => $v) { - $mime = ''; if ( !empty($this->field($k)) ) { - $v = $this->field($k)->htmlValue($v,$mime); + $v = $this->field($k)->htmlValue($v); } $html .= '_rows_table_class($this->field($k)).'>'.$v.''.NB_EOL; } diff --git a/lib/php/page.php b/lib/php/page.php index 3361b7a3..c6bc237d 100644 --- a/lib/php/page.php +++ b/lib/php/page.php @@ -95,7 +95,7 @@ class Page extends nb { public static function out($v) { echo $v; } public static function title2filename($title,$content_type='') { - $ext = $content_type ? mime::ext($content_type) : ''; + $ext = $content_type ? Mime::ext($content_type) : ''; $title = self::no_accent($title); $title = preg_replace('/\W+/','_',$title); if ($ext) $title .= '.'.$ext; @@ -604,14 +604,14 @@ class Page extends nb { $content_type = self::p('content_type'); if (!$format and $content_type) { - self::p('format',mime::ext($content_type)); + self::p('format',Mime::ext($content_type)); } elseif (!$format and ($client_type = self::client_content_type())) { - self::p('format',mime::ext($client_type)); + self::p('format',Mime::ext($client_type)); } - if (!$content_type and $format) $content_type = mime::get($format); + if (!$content_type and $format) $content_type = Mime::get($format); if (!$content_type and !$format and self::php_cli()) $content_type = 'text/plain'; if (!$content_type) $content_type = self::content_type(); #debug([$content_type,self::content_type()]); diff --git a/www/dbq/dbq.php b/www/dbq/dbq.php index dfd568c8..a63c2f86 100644 --- a/www/dbq/dbq.php +++ b/www/dbq/dbq.php @@ -478,8 +478,6 @@ class DbQ extends nb { $row_parse_post = $this->db()->row_parse_post; return; } - # nb 31.01.18: move to out.php or ldap.php - if ($this->is_html) Mime::html($r); if (empty($row_parse_post)) return; $row_parse_post($r,$this->table); -- 2.47.3