hruid = $hruid; $this->email = $email; $this->group = $group; $this->dim = $dim; $this->uid = XDB::fetchOneCell('SELECT uid FROM accounts WHERE hruid = {?}', $hruid); $this->groups = XDB::fetchAllAssoc('SELECT g.nom, g.diminutif 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); } // }}} // {{{ function formu() public function formu() { return 'include/form.valid.account.tpl'; } // }}} // {{{ function _mail_subj protected function _mail_subj() { return "[Polytechnique.org] Création d'un compte Polytechnique.net"; } // }}} // {{{ function _mail_body protected function _mail_body($isok) { if ($isok) { return " Un email vient d'être envoyé à {$this->email} pour que cette personne puisse activer son compte sur Polytechnique.net."; } else { return " Nous n'avons pas jugé bon d'envoyer d'email à {$this->email} pour que cette personne puisse activer son compte sur Polytechnique.net."; } } // }}} // {{{ function commit() public function commit() { $hash = rand_url_id(12); 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; } // }}} // {{{ function isPending() static public function isPending($uid) { $res = XDB::iterRow('SELECT data FROM requests WHERE type = \'account\' ORDER BY stamp'); while (list($data) = $res->next()) { $request = Validate::unserialize($data); if ($request->uid == $uid) { return true; } } return false; } // }}} } // vim:set et sw=4 sts=4 sws=4 foldmethod=marker fenc=utf-8: ?>