提交 c1986732 编写于 作者: K Kohsuke Kawaguchi

honor UserPropertyDescriptor.isEnabled()

上级 57d85b18
......@@ -443,12 +443,15 @@ public class User extends AbstractModelObject implements AccessControlled, Savea
List<UserProperty> props = new ArrayList<UserProperty>();
int i = 0;
for (UserPropertyDescriptor d : UserProperty.all()) {
JSONObject o = json.getJSONObject("userProperty" + (i++));
UserProperty p = getProperty(d.clazz);
if (p != null) {
p = p.reconfigure(req, o);
} else {
p = d.newInstance(req, o);
JSONObject o = json.optJSONObject("userProperty" + (i++));
if (o!=null) {
if (p != null) {
p = p.reconfigure(req, o);
} else {
p = d.newInstance(req, o);
}
}
p.setUser(this);
......
......@@ -42,14 +42,16 @@ THE SOFTWARE.
<j:invokeStatic var="descriptors" className="hudson.model.UserProperty" method="all" />
<j:set var="instances" value="${it.properties}" />
<j:forEach var="d" items="${descriptors}" varStatus="loop">
<f:section title="${d.displayName}">
<j:set var="descriptor" value="${d}" />
<j:set var="instance" value="${instances[d]}" />
<f:rowSet name="userProperty${loop.index}">
<st:include from="${d}" page="${d.configPage}"/>
</f:rowSet>
</f:section>
<j:if test="${d.enabled}">
<f:section title="${d.displayName}">
<j:set var="descriptor" value="${d}" />
<j:set var="instance" value="${instances[d]}" />
<f:rowSet name="userProperty${loop.index}">
<st:include from="${d}" page="${d.configPage}"/>
</f:rowSet>
</f:section>
</j:if>
</j:forEach>
<f:block>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册