$this->assignData($page);
}
+ private function createHash($line, $key = null)
+ {
+ $hash = implode(time(), $line) . rand();
+ $hash = md5($hash);
+ return $hash;
+ }
+
public function sendTo($prenom, $nom, $login, $sexe, $html, $hash = 0)
{
global $globals;
+ $alias = $login;
if (strpos($login, '@') === false) {
$login = "$login@{$globals->mail->domain}";
}
+ require_once('user.func.inc.php');
+ $forlife = get_user_forlife($login, '_silent_user_callback');
+ if ($forlife) {
+ $alias = $forlife;
+ }
+ if (strpos($alias, '@') === false && (is_null($hash) || $hash == 0)) {
+
+ $hash = $this->createHash(array($prenom, $nom, $login, $sexe, $html, rand(), "X.org rulez"));
+ XDB::query("UPDATE {$this->_subscriptionTable} as ni
+ INNER JOIN aliases AS a ON (ni.user_id = a.id)
+ SET ni.hash = {?}
+ WHERE ni.user_id != 0 AND a.alias = {?}",
+ $hash, $alias);
+ }
$mailer = new PlMailer($this->_tpl);
$this->assignData($mailer);
$mailer->assign('sexe', $sexe);
$mailer->assign('prefix', null);
$mailer->assign('hash', $hash);
+ $mailer->assign('email', $login);
+ $mailer->assign('alias', $alias);
$mailer->addTo("\"$prenom $nom\" <$login>");
$mailer->send($html);
}
return "SELECT u.user_id, CONCAT(a.alias, '@{$globals->mail->domain}'),
u.prenom, IF(u.nom_usage='', u.nom, u.nom_usage),
FIND_IN_SET('femme', u.flags),
- q.core_mail_fmt AS pref, 0 AS hash
+ q.core_mail_fmt AS pref, ni.hash AS hash
FROM {$this->_subscriptionTable} AS ni
INNER JOIN auth_user_md5 AS u USING(user_id)
INNER JOIN auth_user_quick AS q ON(q.user_id = u.user_id)
INNER JOIN aliases AS a ON(u.user_id=a.id AND FIND_IN_SET('bestalias',a.flags))
LEFT JOIN emails AS e ON(e.uid=u.user_id AND e.flags='active')
- WHERE ni.last < {?} AND ({$this->subscriptionWhere()}) AND e.email IS NOT NULL
+ WHERE ni.last < {?} AND ({$this->subscriptionWhere()}) AND
+ (e.email IS NOT NULL OR FIND_IN_SET('googleapps', u.mail_storage))
GROUP BY u.user_id";
}