我已经安装了 LDAP 和phpLDAP管理员在我的 Ubuntu 14.04 (Trusty Tahr) 上。它正在运行,我可以访问 phpLDAPadmin GUI,还可以使用 GUI 创建 OU 和组,但我无法创建用户。
当我尝试创建用户时出现以下错误:
Error trying to get a non-existant value (appearance,password_hash)
This template uses a selection list for attribute [gidNumber], however the selection list is empty.
You may need to create some dependancy entries in your LDAP server so that this attribute renders with values.
Alternatively, you may be able to define the appropriate selection values in the template file.
File /usr/share/phpldapadmin/lib/functions.php (444)
Function error (a:5:{i:0;s:67:"Error trying to get a non-existant ...)
File /usr/share/phpldapadmin/lib/ds.php (81)
Function debug_dump_backtrace (a:2:{i:0;s:67:"Error trying to get a non-existant ...)
File /usr/share/phpldapadmin/lib/TemplateRender.php (2469)
Function getValue (a:2:{i:0;s:10:"appearance";i:1;s:13:"password_hash...)
File /usr/share/phpldapadmin/lib/TemplateRender.php ()
Function drawDefaultHelperPasswordAttribute (a:2:{i:0;O:17:"PasswordAttribute":34:{s:4:"name";s...)
File /usr/share/phpldapadmin/lib/Visitor.php (58)
Function call_user_func_array (a:2:{i:0;a:2:{i:0;O:14:"TemplateRender":9:{s:24:"...)
File /usr/share/phpldapadmin/lib/PageRender.php (1005)
Function __call (a:2:{i:0;s:4:"draw";i:1;a:3:{i:0;s:13:"DefaultHelp...)
File /usr/share/phpldapadmin/lib/PageRender.php (1005)
Function draw (a:3:{i:0;s:13:"DefaultHelper";i:1;O:17:"PasswordAt...)
File /usr/share/phpldapadmin/lib/PageRender.php ()
Function drawFormReadWriteValuePasswordAttribute (a:2:{i:0;O:17:"PasswordAttribute":34:{s:4:"name";s...)
File /usr/share/phpldapadmin/lib/Visitor.php (58)
Function call_user_func_array (a:2:{i:0;a:2:{i:0;O:14:"TemplateRender":9:{s:24:"...)
File /usr/share/phpldapadmin/lib/PageRender.php (596)
Function __call (a:2:{i:0;s:4:"draw";i:1;a:3:{i:0;s:18:"FormReadWri...)
File /usr/share/phpldapadmin/lib/PageRender.php (596)
Function draw (a:3:{i:0;s:18:"FormReadWriteValue";i:1;O:17:"Passw...)
File /usr/share/phpldapadmin/lib/PageRender.php ()
Function drawFormValueAttribute (a:2:{i:0;O:17:"PasswordAttribute":34:{s:4:"name";s...)
File /usr/share/phpldapadmin/lib/Visitor.php (58)
Function call_user_func_array (a:2:{i:0;a:2:{i:0;O:14:"TemplateRender":9:{s:24:"...)
File /usr/share/phpldapadmin/lib/TemplateRender.php (2159)
Function __call (a:2:{i:0;s:4:"draw";i:1;a:3:{i:0;s:9:"FormValue";i...)
File /usr/share/phpldapadmin/lib/TemplateRender.php (2159)
Function draw (a:3:{i:0;s:9:"FormValue";i:1;O:17:"PasswordAttribu...)
File /usr/share/phpldapadmin/lib/TemplateRender.php ()
Function drawValueAttribute (a:2:{i:0;O:17:"PasswordAttribute":34:{s:4:"name";s...)
答案1
在您喜欢的编辑器中打开模板文件,/usr/share/phpldapadmin/lib/TemplateRender.php
例如:
sudo vi /usr/share/phpldapadmin/lib/TemplateRender.php
搜索行
$default = $this->getServer()->getValue('appearance','password_hash');
并将其更改为
$default = $this->getServer()->getValue('appearance','password_hash_custom');
并保存该文件并重新加载浏览器,它将不会显示此错误。