Example #1
0
 function onUserAfterUpdate(Am_Event_UserAfterUpdate $event)
 {
     $newEmail = $event->getUser()->get('email');
     $oldEmail = $event->getOldUser()->get('email');
     if ($newEmail != $oldEmail) {
         foreach ($this->getDi()->plugins_newsletter->getAllEnabled() as $pl) {
             $pl->changeEmail($event->getUser(), $oldEmail, $newEmail);
         }
     }
 }
Example #2
0
File: arp.php Project: grlf/eyedock
 function onUserAfterUpdate(Am_Event_UserAfterUpdate $event)
 {
     $ef = $this->getConfig('email_field', 'email');
     if ($ef != 'email') {
         $oldEmail = $event->getOldUser()->get($ef);
         $newEmail = $event->getUser()->get($ef);
         if ($oldEmail != $newEmail) {
             $this->changeEmail($event->getUser(), $oldEmail, $newEmail);
         }
     }
 }
Example #3
0
 function onUserAfterUpdate(Am_Event_UserAfterUpdate $event)
 {
     $e = new Am_Event_SubscriptionChanged($event->getUser(), array(), array());
     return $this->onSubscriptionChanged($e, $event->getOldUser());
 }
Example #4
0
 function onUserAfterUpdate(Am_Event_UserAfterUpdate $e)
 {
     if ($e->getUser()->is_approved && !$e->getOldUser()->is_approved && $e->getUser()->is_affiliate) {
         $this->sendAffRegistrationEmail($e->getUser());
     }
 }
Example #5
0
 function onUserAfterUpdate(Am_Event_UserAfterUpdate $event)
 {
     $user = $event->getUser();
     $old = $event->getOldUser();
     if ($user->get('is_locked') != $old->get('is_locked')) {
         $this->getDi()->db->query("UPDATE ?_user SET is_locked=?d WHERE subusers_parent_id=?d", $user->get('is_locked'), $user->pk());
     }
 }
Example #6
0
 public function onUserAfterUpdate(Am_Event_UserAfterUpdate $event)
 {
     $user = $event->getUser();
     $oldUser = $event->getOldUser();
     if ($user->email != $oldUser->email) {
         return;
     }
     if ($user->getName() != $oldUser->getName()) {
         $this->changeEmail($user, $user->email, $user->email);
         return;
     }
     $cfg = $this->getConfig('custom_fields');
     if (!empty($cfg)) {
         foreach (explode("\n", str_replace("\r", "", $cfg)) as $str) {
             if (!$str) {
                 continue;
             }
             list($k, $v) = explode("|", $str);
             if (!$v) {
                 continue;
             }
             $v1 = $user->get($v);
             $v2 = $oldUser->get($v);
             $v3 = $user->data()->get($v);
             $v4 = $oldUser->data()->get($v);
             if (($v1 || $v2) && $v1 != $v2 || ($v3 || $v4) && $v3 != $v4) {
                 $this->changeEmail($user, $user->email, $user->email);
                 return;
             }
         }
     }
 }