It would be useful to integrate a feature that would email site admin when profile fields are updated/edited. I am a complete newby with php, but came accross this code below.

function mymodule_user($op, &$edit, &$user, $category = NULL) {
  switch ($op) {
    case 'update':
      //ok, the user is updating his profile
      mail("your email", "user update", "user with uid# $user->uid updated his profile");
      break;
  }
}

At the end of the advuser module this function is called everytime a new user registers on the site

function advuser_user($type, &$edit, &$user, $category = NULL) {
  switch ($type) {
    case 'insert':
      return advuser_user_insert($edit, $user, $category);
  }
  
  //print $type;
}

It emails site admin whenever someone registers. If anyone can please show how to implement the hook to detect whenever someone updates a profile field, into this function or into the module, I will gladly update it.

I played around with the code and things got buggy. Can the hook be added to the above function or will a new function be required? I have to say there is something very beautifully intersting in code.

Comments

Mojah’s picture

Status: Active » Fixed
Anonymous’s picture

Status: Fixed » Closed (fixed)