Jump to content

Showing password in cleartext in Clients Profile page


dgaramond

Recommended Posts

I ended up wrapping clientsprofile.php (the original renamed to clientsprofile.whmcs). The password field is now blank(ed), and when it is submitted blank too then password will not be changed. Ugly, but at least it works for me. Reprinted here in case someone finds it useful.

 

<?php

ob_start();

$keep_password = false;
if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'savedetails' && $_REQUEST['password'] == '') {
   $keep_password = true;
   $res = mysql_query("SELECT password FROM tblclients WHERE id=$_REQUEST[userid]");
   list($orig_epassword) = mysql_fetch_row($res);
}

include "clientsprofile.whmcs";

# if password is not specified when saving details, reset it
if ($keep_password) {
   $res = mysql_query("UPDATE tblclients SET password='$orig_epassword' WHERE id=$_REQUEST[userid]");
}

$ct = ob_get_clean();

# don't show password
$ct = preg_replace('#(<td align=right>Password</td>.+ name="password" value=").*?(">)#', '$1$2', $ct);

echo $ct;

?>

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated