Showing
3 changed files
with
16 additions
and
5 deletions
... | @@ -106,11 +106,11 @@ public class UpdateUserBean { | ... | @@ -106,11 +106,11 @@ public class UpdateUserBean { |
106 | } | 106 | } |
107 | 107 | ||
108 | public String prepareUpdate(int userId) { | 108 | public String prepareUpdate(int userId) { |
109 | - ExternalContext externalContext = FacesContext.getCurrentInstance().getExternalContext(); | ||
110 | Logger logger = LoggerFactory.getLogger(UpdateUserBean.class); | 109 | Logger logger = LoggerFactory.getLogger(UpdateUserBean.class); |
111 | logger.info("prepareUpdate"); | 110 | logger.info("prepareUpdate"); |
112 | 111 | ||
113 | logger.info("userId ="+userId); | 112 | logger.info("userId ="+userId); |
113 | + this.userId = userId; | ||
114 | if (userId != 0) { | 114 | if (userId != 0) { |
115 | User user = userService.findUserById(userId); | 115 | User user = userService.findUserById(userId); |
116 | if (user != null) { | 116 | if (user != null) { |
... | @@ -123,6 +123,7 @@ public class UpdateUserBean { | ... | @@ -123,6 +123,7 @@ public class UpdateUserBean { |
123 | firstName = user.getFirstName(); | 123 | firstName = user.getFirstName(); |
124 | lastName = user.getLastName(); | 124 | lastName = user.getLastName(); |
125 | nickName = user.getNickName(); | 125 | nickName = user.getNickName(); |
126 | + password = user.getPassword(); | ||
126 | presentation = user.getPresentation(); | 127 | presentation = user.getPresentation(); |
127 | roles = user.getRoles(); | 128 | roles = user.getRoles(); |
128 | if (roles == null) { | 129 | if (roles == null) { |
... | @@ -137,6 +138,10 @@ public class UpdateUserBean { | ... | @@ -137,6 +138,10 @@ public class UpdateUserBean { |
137 | } | 138 | } |
138 | 139 | ||
139 | public String update() { | 140 | public String update() { |
141 | + Logger logger = LoggerFactory.getLogger(UpdateUserBean.class); | ||
142 | + logger.info("update"); | ||
143 | + | ||
144 | + logger.info("userId ="+userId); | ||
140 | User user = userService.findUserById(userId); | 145 | User user = userService.findUserById(userId); |
141 | user.setActivated(activated); | 146 | user.setActivated(activated); |
142 | user.setAnonymous(anonymous); | 147 | user.setAnonymous(anonymous); |
... | @@ -155,6 +160,7 @@ public class UpdateUserBean { | ... | @@ -155,6 +160,7 @@ public class UpdateUserBean { |
155 | userService.updateUser(user); | 160 | userService.updateUser(user); |
156 | return "success"; | 161 | return "success"; |
157 | } | 162 | } |
163 | + | ||
158 | public String getFirstName() { | 164 | public String getFirstName() { |
159 | return firstName; | 165 | return firstName; |
160 | } | 166 | } | ... | ... |
... | @@ -79,6 +79,10 @@ | ... | @@ -79,6 +79,10 @@ |
79 | <from-outcome>cancel</from-outcome> | 79 | <from-outcome>cancel</from-outcome> |
80 | <to-view-id>/listUsers.xhtml</to-view-id> | 80 | <to-view-id>/listUsers.xhtml</to-view-id> |
81 | </navigation-case> | 81 | </navigation-case> |
82 | + <navigation-case> | ||
83 | + <from-outcome>success</from-outcome> | ||
84 | + <to-view-id>/listUsers.xhtml</to-view-id> | ||
85 | + </navigation-case> | ||
82 | </navigation-rule> | 86 | </navigation-rule> |
83 | <navigation-rule> | 87 | <navigation-rule> |
84 | <from-view-id>/listUsers.xhtml</from-view-id> | 88 | <from-view-id>/listUsers.xhtml</from-view-id> | ... | ... |
... | @@ -90,7 +90,7 @@ | ... | @@ -90,7 +90,7 @@ |
90 | </td> | 90 | </td> |
91 | <td colspan="2"><!--<rich:editor id="text" value="#{updateUserBean.presentation}" configuration="article-editor"/>--></td> | 91 | <td colspan="2"><!--<rich:editor id="text" value="#{updateUserBean.presentation}" configuration="article-editor"/>--></td> |
92 | </tr> | 92 | </tr> |
93 | - <!-- | 93 | + <ui:remove> |
94 | <ui:fragment rendered="#{updateUserBean.userId != 0}"> | 94 | <ui:fragment rendered="#{updateUserBean.userId != 0}"> |
95 | <tr> | 95 | <tr> |
96 | <td colspan="3" class="taCenter"> | 96 | <td colspan="3" class="taCenter"> |
... | @@ -109,7 +109,7 @@ | ... | @@ -109,7 +109,7 @@ |
109 | </td> | 109 | </td> |
110 | </tr> | 110 | </tr> |
111 | </ui:fragment> | 111 | </ui:fragment> |
112 | - --> | 112 | + </ui:remove> |
113 | <tr> | 113 | <tr> |
114 | <td><h:outputLabel for="criticProvider">Archives de critiques ?</h:outputLabel></td> | 114 | <td><h:outputLabel for="criticProvider">Archives de critiques ?</h:outputLabel></td> |
115 | <td><h:selectBooleanCheckbox id="criticProvider" value="#{updateUserBean.criticProvider}"/></td> | 115 | <td><h:selectBooleanCheckbox id="criticProvider" value="#{updateUserBean.criticProvider}"/></td> |
... | @@ -133,11 +133,11 @@ | ... | @@ -133,11 +133,11 @@ |
133 | </table> | 133 | </table> |
134 | </h:form> | 134 | </h:form> |
135 | </p:panel> | 135 | </p:panel> |
136 | - | 136 | +<ui:remove> |
137 | <p:panel headerClass="colDroite" bodyClass="colTexte" label="Import d'anciennes donnes" | 137 | <p:panel headerClass="colDroite" bodyClass="colTexte" label="Import d'anciennes donnes" |
138 | switchType="ajax" opened="true" rendered="#{updateUserBean.userId != 0}"> | 138 | switchType="ajax" opened="true" rendered="#{updateUserBean.userId != 0}"> |
139 | <h:form> | 139 | <h:form> |
140 | -<!-- <s:validateAll>--> | 140 | + <!--<s:validateAll>--> |
141 | <p> | 141 | <p> |
142 | La prsente section est destine raffecter des critiques, des commentaires ou des | 142 | La prsente section est destine raffecter des critiques, des commentaires ou des |
143 | articles posts dans le Grog v1 par cet utilisateur. N'effectuez cette opration qu'en | 143 | articles posts dans le Grog v1 par cet utilisateur. N'effectuez cette opration qu'en |
... | @@ -173,6 +173,7 @@ | ... | @@ -173,6 +173,7 @@ |
173 | <!--</s:validateAll>--> | 173 | <!--</s:validateAll>--> |
174 | </h:form> | 174 | </h:form> |
175 | </p:panel> | 175 | </p:panel> |
176 | +</ui:remove> | ||
176 | <!-- | 177 | <!-- |
177 | <h:form rendered="#{updateUserBean.userId != 0}"> | 178 | <h:form rendered="#{updateUserBean.userId != 0}"> |
178 | <h3>Dlgations</h3> | 179 | <h3>Dlgations</h3> | ... | ... |
-
Please register or login to post a comment