javascript - How to fetch password from Alfresco UI page which has been created by admin for the new user? -


i had used code auto generation of mails. problem password shown in mail password generated script. want password fetched alfresco new user page, admin has created password new user not random string. below script generated automatic mail generation.

if (document.iscontainer && document.displaypath == "/company home/user homes") { var owner = document.properties["cm:owner"]; var pnode = people.getperson(owner); if (pnode!=null && pnode.exists()){      var username = pnode.properties.username;     var email = pnode.properties.email;     var randpassword = math.random().tostring(36).substr(2, 30)+"-"+(date.now());      people.setpassword(username, randpassword);     logger.debug("invitation mail: user "+username+" password has been changed.");      var mail = actions.create("mail");     //mail.parameters.from = "noreply@customdomain";     mail.parameters.to = email;      mail.parameters.subject = "welcome site, login: "+username+", password: "+randpassword;     mail.parameters.template = companyhome.childbynamepath("data dictionary/email templates/invite email templates/invite_user_email.ftl");     var templatemodel = new array();     templatemodel['newpassword'] = randpassword; // use ${newpassword} expression inside template     mail.parameters.template_model = templatemodel;     mail.executeasynchronously(document);     logger.debug("invitation mail has been sent "+email); } else {     logger.warn("invitation mail: user not found: "+owner); } }  

please guide me how proceed further.

you can't decode password hash. can encode new password , match hash.

you can modify alfresco share store raw password in custom user aspect, bad practice. admin shouldn't know user password.


Comments

Popular posts from this blog

python - How to insert QWidgets in the middle of a Layout? -

python - serve multiple gunicorn django instances under nginx ubuntu -

module - Prestashop displayPaymentReturn hook url -