Is it possible to add a button that calls the function that resets an individual user's password? - Forum - Rollbase - Progress Community

Is it possible to add a button that calls the function that resets an individual user's password?

 Forum

Is it possible to add a button that calls the function that resets an individual user's password?

This question is not answered

I'd like to update the personal setup page to have a button that will reset the user's password.  It looks like the reset password under the more actions section calls a function using rbf_runObjectAction("rbf_userReset").  Is there a way I can run this same function from a button?

All Replies
  • Hi Jason,

    Are you referring to the EDIT page of a user or in a VIEW page?

    Thanks,
    Orchid
  • I'd actually like to add it to the personal setup page, so tecnically, I think it is an edit page.  That way, they can access the reset under the "Update Profile" link.

  • Currently there is no functionality for this aside from view page, but you can utilize this workaround.

    NOTE: Steps below is a workaround, it was tested and works fine since no hard-coded IDs. Still I suggest to file an enhancement for this.

    1. Create a button first > Go to object definition of USER object and create New Button under Button section

    2. In New button page specify "Run client-side JavaScript" as the behavior and in the textarea specify the code below. Below section you select the "Personal Setup" or select other pages too. NOTE: once saved you cannot edit in which page it will be displayed.

    rbf_runObjectAction('rbf_userReset');

    3. In the Personal Setup page add a script component and paste the code below. If button was added to the edit page you specify this code too.

    <script type="text/javascript">
    	function rbf_userResetConfirmed() {
    		window.location.href = '../servlet/Object?act=resetPassword&id={!id}&objDefId={!#OBJ_ID.USER}&destId={!name#url}';
    	}
    	function rbf_userReset() {
    		var dt = 'Reset Password?';
    		var dc = '<span class="bold">Are you sure you want to reset the password for {!firstName} {!lastname}?</span><br/><br/><span class="bold">Note:</span> An email will be sent to this user containing a new temporary password (this email is based on the <i>Password Reset Notification</i> User Email Template which can be customized).';
    
    		showPopWin('../dialog/confirmCheckDialog.jsp', 500, 290, rbf_userResetConfirmed, true, dc, dt);
    	}
    	rbf_addObjectAction('rbf_userReset', rbf_userReset);
    </script>


    4. Button can be seen together with the other default actions.


    Hope this may help.

    Regards,

    Orchid

  • I've got all that code in place.  It looks the same, the source code looks good when I check it, but I am not getting the confirmation dialog to perform the reset.

  • Can you check in the console(F12) if there are errors?

  • I did and didn't see any.

  • Can we have a lync session, so I can see the actual process?

    It would help me debug the issue too. Just give me your email address.

    Regards,

    Orchid

  • Will send you lync invite as soon as I get your email or you can tell me when would you be available, since in my test it is working perfectly.

    Regards,

    Orchid

  • Hi Jason,

    Have you made this working already?

    Regards,
    Orchid
  • Sorry, i haven't yet.  The customer isn't sure if they are going to need this functionality.  I'm waiting to hear back from them. Thanks for following up!

  • Also if they can reset their own password in the personal setup they will be automatically logout. I suggest to use the "Change my password" instead so that user will not be automatically logout and can still continue its activities. This way new password will take effect after logout.

    Regards,
    Orchid