Jump to content

Actionhooks - ClientEdit Bug!!!


hideipvpn

Recommended Posts

Hi all,

 

I have a hook that work on ClientEdit.

 

I made some tests and it's looks like when you try to select client info from database after user pressed "Save Changes" button that data is old one!!!

 

I need to get updated data: email and one custom field.

 

 

Why it's not working ?

 

Here is my code (not all)

 

 

function change_vpn_password($vars) {

 

$vars = func_get_args();

$idclient = $vars[0];

 

.................

 

$select = "SELECT id,email,status FROM `tblclients` where status='Active' AND id='$idclient'";

 

..............

 

$id = $row['id'];

$user = $row['email'];

 

// getting custom filed

 

$sel_pass = "SELECT value FROM `tblcustomfieldsvalues` WHERE fieldid='7' AND relid='$id' ";

$rez_pass = mysql_query($sel_pass) or die ('Error udating database');

$pass = mysql_result($rez_pass, 0);

echo $str = $user ." " .$pass ."\n";

}

 

add_hook("ClientEdit",0,"change_vpn_password");

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