Skip to content

Commit deef61f

Browse files
committed
Remove search to look for user object in Reset User Password repo web script. No longer works when Solr enabled. Change instead to wrapping the people.setPassword() call in a try.. catch.
git-svn-id: https://share-extras.googlecode.com/svn/trunk/Reset Password Dialog@1244 a3f5c567-fd0f-3a89-9b71-a290c5a5f590
1 parent 8457602 commit deef61f

File tree

2 files changed

+9
-13
lines changed

2 files changed

+9
-13
lines changed

config/alfresco/templates/webscripts/org/sharextras/slingshot/reset-user-password.post.json.js

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -146,29 +146,25 @@ function main()
146146
}
147147
}
148148

149-
var uresults = search.query({
150-
language: "lucene",
151-
store: "user://alfrescoUserStore",
152-
query: "PATH:\"/\\{http\\://www.alfresco.org/model/system/1.0\\}system/\\{http\\://www.alfresco.org/model/system/1.0\\}people/\\{http\\://www.alfresco.org/model/user/1.0\\}user\" +@\\{http\\://www.alfresco.org/model/user/1.0\\}username:" + user.properties.userName
153-
});
154-
155-
// Check that the user is local (i.e. not an LDAP user)
156-
if (uresults.length != 1)
149+
// Reset the password
150+
try
151+
{
152+
u = resetPassword(userToObject(user));
153+
}
154+
catch (e)
157155
{
158156
status.setCode(status.STATUS_BAD_REQUEST, msg.get("error.notLocal"));
159157
status.redirect = true;
160158
return;
161159
}
162160

163-
// Reset the password
164-
u = resetPassword(userToObject(user));
165-
166161
// Send e-mail confirmation
167162
try
168163
{
169164
mailResetPasswordNotification(u);
170165
}
171-
catch (e) {
166+
catch (e)
167+
{
172168
status.setCode(status.STATUS_INTERNAL_SERVER_ERROR, msg.get("error.mail"));
173169
status.redirect = true;
174170
return;

config/alfresco/templates/webscripts/org/sharextras/slingshot/reset-user-password.post.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,5 @@ error.notFound=No user found with e-mail address {0}
1515
error.multiple=Multiple users found. Please contact an administrator to reset your password.
1616
error.disabled=Could not reset the password as the user is disabled
1717
error.disallowed=Password resets are disallowed for this user
18-
error.notLocal=Could not reset the password as the user is not a local user. Please contact an administrator to reset your password.
18+
error.notLocal=Could not reset the password - is this a directory user? Please contact an administrator to reset your password.
1919
error.mail=Could not reset the password as an e-mail confirmation could not be sent

0 commit comments

Comments
 (0)