X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=bin%2Fcron%2Fprofile_modification.php;h=c2c9e52ce97b1a4a0b7b68d59a194bf9b88463bb;hb=173ff0bdf41db90ee0995e0c3bf844bf2151d0e6;hp=8d4b4d099eddd8e35f10e5d61f7ff93524489104;hpb=adbcb1b5252fc261a5f2f0e49a8c2b75863472b9;p=platal.git diff --git a/bin/cron/profile_modification.php b/bin/cron/profile_modification.php index 8d4b4d0..c2c9e52 100755 --- a/bin/cron/profile_modification.php +++ b/bin/cron/profile_modification.php @@ -1,7 +1,7 @@ #!/usr/bin/php5 -q total() > 0) { $date = time(); @@ -40,7 +40,7 @@ if ($res->total() > 0) { $pid = $values['pid']; $sex = ($values['sex'] == 'female') ? 1 : 0; $yourself = $values['yourself']; - $alias = $values['alias']; + $user = User::getSilentWithUID($values['uid']); $hrpid = $values['hrpid']; $modifications = array(); $modifications[] = array( @@ -53,7 +53,7 @@ if ($res->total() > 0) { while ($values = $res->next()) { if ($values['pid'] != $pid) { $mailer = new PlMailer('profile/notification.mail.tpl'); - $mailer->addTo($alias . '@' . $globals->mail->domain); + $mailer->addTo($user); $mailer->assign('modifications', $modifications); $mailer->assign('yourself', $yourself); $mailer->assign('hrpid', $hrpid); @@ -65,7 +65,7 @@ if ($res->total() > 0) { $pid = $values['pid']; $sex = ($values['sex'] == 'female') ? 1 : 0; $yourself = $values['yourself']; - $alias = $values['alias']; + $user = User::getSilentWithUID($values['uid']); $hrpid = $values['hrpid']; $modifications[] = array( 'full_name' => $values['full_name'], @@ -75,7 +75,7 @@ if ($res->total() > 0) { ); } $mailer = new PlMailer('profile/notification.mail.tpl'); - $mailer->addTo($alias . '@' . $globals->mail->domain); + $mailer->addTo($user); $mailer->assign('modifications', $modifications); $mailer->assign('yourself', $yourself); $mailer->assign('hrpid', $hrpid); @@ -83,7 +83,8 @@ if ($res->total() > 0) { $mailer->assign('date', $date); $mailer->send(); - XDB::execute('DELETE FROM profile_modifications'); + XDB::execute('DELETE FROM profile_modifications + WHERE type = \'third_party\''); } // vim:set et sw=4 sts=4 sws=4 foldmethod=marker enc=utf-8: