public $hruid;
public $email;
public $group;
+ public $groups;
public $rules = "Accepter si l'adresse email parait correcte, et pas absurde
(ou si le demandeur est de confiance). Si le demandeur marque sa propre
FROM accounts
WHERE hruid = {?}',
$hruid);
+ $this->groups = implode(',', XDB::fetchColumn('SELECT g.nom
+ FROM groups AS g
+ INNER JOIN group_members AS m ON (g.id = m.asso_id)
+ WHERE m.uid = {?}
+ ORDER BY g.nom',
+ $this->uid));
}
// }}}
public function commit()
{
$hash = rand_url_id(12);
- XDB::execute('INSERT INTO register_pending_xnet (uid, hruid, email, date, hash)
- VALUES ({?}, {?}, {?}, NOW(), {?})',
- $this->uid, $this->hruid, $this->email, $hash);
-
- $mailer = new PlMailer('xnet/account.mail.tpl');
- $mailer->addTo($this->email);
- $mailer->assign('hash', $hash);
- $mailer->assign('hruid', $this->hruid);
- $mailer->assign('group', $this->group);
- $mailer->assign('user', $this->user);
- $mailer->send();
+ XDB::execute('INSERT INTO register_pending_xnet (uid, hruid, email, date, hash, sender_name, group_name)
+ VALUES ({?}, {?}, {?}, NOW(), {?}, {?}, {?})',
+ $this->uid, $this->hruid, $this->email, $hash, $this->user->fullName(), $this->group);
return true;
}
WHERE type = \'account\'
ORDER BY stamp');
- $is_pending = false;
while (list($data) = $res->next()) {
$request = Validate::unserialize($data);
- $is_pending = ($is_pending || ($request->uid == $uid));
+ if ($request->uid == $uid) {
+ return true;
+ }
}
- return $is_pending;
+ return false;
}
// }}}