Show More
@@ -111,7 +111,7 b' OUTPUT::' | |||
|
111 | 111 | "email" : "<email>", |
|
112 | 112 | "active" : "<bool>", |
|
113 | 113 | "admin" : "<bool>", |
|
114 |
"ldap" : |
|
|
114 | "ldap_dn" : "<ldap_dn>" | |
|
115 | 115 | } |
|
116 | 116 | |
|
117 | 117 | error: null |
@@ -141,7 +141,7 b' OUTPUT::' | |||
|
141 | 141 | "email" : "<email>", |
|
142 | 142 | "active" : "<bool>", |
|
143 | 143 | "admin" : "<bool>", |
|
144 |
"ldap" : |
|
|
144 | "ldap_dn" : "<ldap_dn>" | |
|
145 | 145 | }, |
|
146 | 146 | … |
|
147 | 147 | ] |
@@ -191,14 +191,15 b' INPUT::' | |||
|
191 | 191 | api_key : "<api_key>" |
|
192 | 192 | method : "update_user" |
|
193 | 193 | args : { |
|
194 | "userid" : "<user_id or username>", | |
|
194 | 195 | "username" : "<username>", |
|
195 | 196 | "password" : "<password>", |
|
196 | 197 | "email" : "<useremail>", |
|
197 |
"firstname" : "<firstname> |
|
|
198 |
"lastname" : "<lastname> |
|
|
199 |
"active" : "<bool> |
|
|
200 |
"admin" : "<bool> |
|
|
201 |
"ldap_dn" : "<ldap_dn> |
|
|
198 | "firstname" : "<firstname>", | |
|
199 | "lastname" : "<lastname>", | |
|
200 | "active" : "<bool>", | |
|
201 | "admin" : "<bool>", | |
|
202 | "ldap_dn" : "<ldap_dn>" | |
|
202 | 203 | } |
|
203 | 204 | |
|
204 | 205 | OUTPUT:: |
@@ -100,7 +100,7 b' class ApiController(JSONRPCController):' | |||
|
100 | 100 | email=user.email, |
|
101 | 101 | active=user.active, |
|
102 | 102 | admin=user.admin, |
|
103 | ldap=user.ldap_dn | |
|
103 | ldap_dn=user.ldap_dn | |
|
104 | 104 | ) |
|
105 | 105 | |
|
106 | 106 | @HasPermissionAllDecorator('hg.admin') |
@@ -122,7 +122,7 b' class ApiController(JSONRPCController):' | |||
|
122 | 122 | email=user.email, |
|
123 | 123 | active=user.active, |
|
124 | 124 | admin=user.admin, |
|
125 | ldap=user.ldap_dn | |
|
125 | ldap_dn=user.ldap_dn | |
|
126 | 126 | ) |
|
127 | 127 | ) |
|
128 | 128 | return result |
@@ -168,8 +168,8 b' class ApiController(JSONRPCController):' | |||
|
168 | 168 | raise JSONRPCError('failed to create user %s' % username) |
|
169 | 169 | |
|
170 | 170 | @HasPermissionAllDecorator('hg.admin') |
|
171 |
def update_user(self, apiuser, username, password, email, |
|
|
172 |
lastname |
|
|
171 | def update_user(self, apiuser, userid, username, password, email, | |
|
172 | firstname, lastname, active, admin, ldap_dn): | |
|
173 | 173 | """ |
|
174 | 174 | Updates given user |
|
175 | 175 | |
@@ -183,7 +183,7 b' class ApiController(JSONRPCController):' | |||
|
183 | 183 | :param admin: |
|
184 | 184 | :param ldap_dn: |
|
185 | 185 | """ |
|
186 |
if not User.get_ |
|
|
186 | if not UserModel().get_user(userid): | |
|
187 | 187 | raise JSONRPCError("user %s does not exist" % username) |
|
188 | 188 | |
|
189 | 189 | try: |
General Comments 0
You need to be logged in to leave comments.
Login now