Closed (fixed)
Project:
Advanced User
Version:
master
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
16 Jun 2006 at 18:21 UTC
Updated:
2 Aug 2006 at 11:30 UTC
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
Comment #1
Mojah commentedComment #2
(not verified) commented