+ // Updates the user profile with the new values.
+ $res = XDB::execute("UPDATE auth_user_md5
+ SET naissance = {?}, deces = {?}, password = {?},
+ perms = {?}, prenom = {?}, nom = {?}, nom_usage = {?},
+ flags = {?}, promo = {?}, comment = {?}
+ WHERE user_id = {?}",
+ $naiss, $deces, $pass_encrypted,
+ $perms, $prenom, $nom, $nomusage,
+ $flags, $promo, $comm, $user->id());
+ if ($res) {
+ require_once("user.func.inc.php");
+ user_reindex($user->id());
+ $new_fields = XDB::query($watch_query, $user->id())->fetchOneAssoc();
+
+ // Redacts the password in the notification, to avoid transmitting
+ // sensitive information by email.
+ $new_fields['password'] = ($old_fields['password'] != $new_fields['password'] ? 'new' : 'old');
+ $old_fields['password'] = 'old';
+
+ // Notifies the admins of the profile update.
+ $mailer = new PlMailer("admin/useredit.mail.tpl");
+ $mailer->assign("admin", S::user()->login());
+ $mailer->assign("user", $user->login());
+ $mailer->assign('old', $old_fields);
+ $mailer->assign('new', $new_fields);
+ $mailer->send();