You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何在phpLDAPAdmin模板中为单个属性设置多个默认值?

phpLDAPAdmin多值属性默认值设置方案

要给securityRole这类多值属性设置多个默认值,你需要在同一个<attribute>块内添加多个<value>标签,同时配合<max>标签确保允许输入多个值。以下是具体实现方式:

模板1:默认securityRole为1和2

<attribute id="securityRole">
  <display>Security Role</display>
  <order>10</order>
  <type>text</type>
  <max>10</max> <!-- 允许最多10个角色,按需调整数值 -->
  <value>1</value>
  <value>2</value>
  <required>false</required>
</attribute>

模板2:默认securityRole为1和3

<attribute id="securityRole">
  <display>Security Role</display>
  <order>10</order>
  <type>text</type>
  <max>10</max>
  <value>1</value>
  <value>3</value>
  <required>false</required>
</attribute>

关键注意点

  • 不要拆分多个<attribute id="securityRole">块,phpLDAPAdmin会识别为重复属性导致无效。
  • <max>的数值要大于你设置的默认值数量,确保所有默认值都能正常显示。
  • 每个<value>标签单独对应一个默认角色值,无需额外添加ID或其他属性。

内容的提问来源于stack exchange,提问作者yertym

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.16 19:50:58