]> git.nbdom.net Git - nb.git/commitdiff
lib/php/db/types/ldap.php
authorNicolas Boisselier <nicolas.boisselier@gmail.com>
Mon, 19 Feb 2018 02:08:55 +0000 (02:08 +0000)
committerNicolas Boisselier <nicolas.boisselier@gmail.com>
Mon, 19 Feb 2018 02:08:55 +0000 (02:08 +0000)
etc/dbq/ldap.php
lib/php/db/field.php
lib/php/db/types/ldap.php

index b142a2883c989285813808df93f1d9b37a2ca2cf..503d50cff89559c50117742f794968bf7525caad 100644 (file)
@@ -77,7 +77,7 @@ $DBQ['ldap'] = $GLOBALS['DBQ_LDAP'] + [
                                'displayName',
                                'givenName',
                                #'audio',
-                               'businessCategory',
+                               #'businessCategory',
                                'carLicense',
                                #'departmentNumber',
                                #'employeeNumber',
index 3efea7af3d221169a5ce893125c06d77a08623c3..6950ad3239a32879d691e01aa5c57295726eb235 100644 (file)
@@ -119,6 +119,8 @@ class field extends nb {
     $html = '';
 
                $multi = is_array($values) ? true : false;
+               #if ($db = $this->db() and $db->type == 'ldap') $multi = true;
+               if ($db = $this->db() and $fct=$db->conf_type('html_edit_multi')) $multi = $fct($this);
                $suff = $multi ? '[]' : '';
                if ($type === null) $type = $this->html_type();
 
index 03c89e4aab144880975107429070b7353a382233..9c3cb7e38d544ee2239795db0126a28c8e63784b 100644 (file)
@@ -37,6 +37,20 @@ $DB_TYPES['ldap'] = [
                $table->fields_only($row,$fields); # reorder by fields
                return $row;
        },
+       'html_edit_multi' => function($field) {
+               $r = !in_array($field->name,[
+                               'dn',
+                               'cn',
+                               'sn',
+                               'uid',
+                               'gid',
+                               'homeDirectory',
+                               'displayName',
+                               'initials',
+                               'loginShell',
+               ]);
+               return $r;
+       },
        'html_edit_row' => function(&$table,&$values) {
                $table->db()->ldap->prepare([
                        'base' => $values['dn'],