<%@language="javascript"%> <% /* $Revision$ $Id$ File: pchange.asp Description: Laat de user het wachtwoord wijzigen Context: Modal vanuit bepaalde schermen, submit naar ..? NOTE: Men kan zelf het eigen wachtwoord wijzigen, en met WEB_PRSSYS of WEB_FACMGT rechten kan men dat ook voor een ander (er wordt geen PRS-scope op FACMGT toegepast!) */ %> <% var EXPIRED_PASSWORD_OK = true; %> <% var isExpired = getQParamInt("expired",0) == 1; // Ben ik hier naar toe gestuurd vanwege een expired wachtwoord? // Dan redirecten we na afloop naar de voorpagina var theUser = getQParamInt("prs_key", user_key); var xfunc = user.func_enabled2("FAC", { prs_key: theUser, isOptional: true } ); if (theUser != user_key && !xfunc.canWrite("WEB_PRSSYS")&& !xfunc.canWrite("WEB_FACMGT")) abort_with_warning(L("lcl_no_auth")); // Als ik zelf geen PRSSYS heb mag ik niet het wachtwoord veranderen van mensen die dat wel hebben. // Anders een ernstig security lek if (!xfunc.canWrite("WEB_PRSSYS") && new Perslid(theUser).checkAutorisation("WEB_PRSSYS", true)) abort_with_warning(L("lcl_no_auth")); var user_info = new Perslid(theUser); %> <% FCLTHeader.Generate(); %>
<% BLOCK_START("prsPwd", L("lcl_password_title") + " " + safe.html(user_info.naam())); if (Session("must_reset_password") == 1) { %><%=L("lcl_password_expired_title")%><% } else { if ( (!xfunc.canWrite("WEB_PRSSYS") && !xfunc.canWrite("WEB_FACMGT")) || (theUser == user_key && user_info.haspw()) ) RWFIELDTR("password0", "fldnotresponsive", L("lcl_ch_password_old"), "", { required: true, html: " type=password" }); } RWFIELDTR("password1", "fldnotresponsive", L("lcl_ch_password_new"), "", { required: true, html: " type=password" }); RWFIELDTR("password2", "fldnotresponsive", L("lcl_ch_password_con"), "", { required: true, html: " type=password" }); if (theUser != user_key) { RWCHECKBOXTR("pass_expired", "fldcheck", L("lcl_ch_pass_expired"), false, { boxfirst: true }); // Een vinkje met 'Stuur bevestiging naar user_info.prs_perslid_email()' klinkt leuk maar dan staat // het wachtwoord plain-text in een e-mail wat not done is. // Als bovenstaand vinkje aanstaat zouden we wel de volgende aan kunnen zetten? Ooit... // if (user_info.prs_perslid_email()) // RWCHECKBOXTR("pass_mail", "fldcheck", L("lcl_ch_pass_mail")); } BLOCK_END(); IFACE.FORM_END(); %>
<% var buttons = []; if (!isExpired && (theUser == user_key || xfunc.canWrite("WEB_PRSSYS") || xfunc.canWrite("WEB_FACMGT"))) buttons.push({title: L("lcl_delete_sessions"), icon:"reject.png", action:"doClearSessions()"}); if (!isExpired && (xfunc.canWrite("WEB_PRSSYS") || xfunc.canWrite("WEB_FACMGT"))) buttons.push({title: L("lcl_delete_password"), icon:"undo.png", action:"doClearPassword()"}); buttons.push({title: L("lcl_submit"), icon:"opslaan.png", action:"doOK()"}); buttons.push({title: L("lcl_cancel"), icon:"undo.png", action:"doCancel()"}); CreateButtons(buttons) %>