cancel
Showing results for 
Search instead for 
Did you mean: 

Password problem with Share

kestrelfire
Champ in-the-making
Champ in-the-making
When I try to change my password, the following message is displayed:

01140003 Failed to execute script 'classpath*:alfresco/site-webscripts/org/alfresco/components/profile/change-password.post.json.js': 01140002 SyntaxError: syntax error (file:/opt/alfresco-3.4.c/tomcat/webapps/share/WEB-INF/classes/alfresco/site-webscripts/org/alfresco/components/profile/change-password.post.json.js#45(eval)#1)

Any ideas please?
3 REPLIES 3

daja77
Champ in-the-making
Champ in-the-making
Well I had the same error and i digged into it a bit.
The real error message in that case was this
ERROR [extensions.webscripts.AbstractRuntime] Exception from executeScript - redirecting to status template error: 01210001 Do not have appropriate auth or wrong auth 
details provided.
org.springframework.extensions.webscripts.WebScriptException: 01210001 Do not have appropriate auth or wrong auth details provided.
        at org.alfresco.repo.web.scripts.person.ChangePasswordPost.executeImpl(ChangePasswordPost.java:120)

It seems that you cannot change a password for ldap users. In the alfresco app there is no change password button for that user. The only bad thing is that alfresco sends a broken json to the share app that leads to the compilation error that you experienced above. It should instead send a vaild json object that contains a useful error message.

HTH

mrogers
Star Contributor
Star Contributor
Thanks for the diagnosis but please raise that in JIRA so something can be done to fix it. Smiley Happy

michaelc
Champ on-the-rise
Champ on-the-rise
The result returned is blank, so setting an error message in the case of a blank return fixes this issue.
Seems to be resolved in later releases.

change-password.post.json.js

      // perform the REST API to change the user password
      var params = new Array(2);
      params["oldpw"] = oldpass;
      params["newpw"] = newpass1;
      var connector = remote.connect("alfresco");
      var result = connector.post(
            "/api/person/changepassword/" + stringUtils.urlEncode(user.name),
            jsonUtils.toJSONString(params),
            "application/json");
           
           
      if (result == ""){ 
             model.success = false;
             model.errormsg = "Password was NOT changed, reenter old passsword and try again";     
      }
      else
      {
          var repoJSON = eval('(' + result + ')');
          if (repoJSON.success !== undefined)
          {
             model.success = repoJSON.success;
          }
          else
          {
             model.success = false;
             model.errormsg = "Password was NOT changed, reenter old passsword and try again";
          }    
      }

   }
   else
   {
      model.success = false;
      model.errormsg = "New password and confirm password do not match, please retry the changes";
   }