* 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
***************************************************************************/
-// {{{ DEFINES
-
define('SIZE_MAX', 32768);
-// }}}
-// {{{ class ValidateIterator
-
/**
* Iterator class, that lists objects through the database
*/
class ValidateIterator extends XOrgDBIterator
{
// {{{ constuctor
-
+
function ValidateIterator ()
{
parent::XOrgDBIterator('SELECT data,stamp FROM requests ORDER BY stamp', MYSQL_NUM);
// }}}
}
-// }}}
-// {{{ class Validate
-
/** classe "virtuelle" à dériver pour chaque nouvelle implémentation
*/
class Validate
*/
function Validate($_uid, $_unique, $_type)
{
- global $globals;
$this->uid = $_uid;
$this->stamp = date('YmdHis');
$this->unique = $_unique;
*/
function submit ()
{
- global $globals;
if ($this->unique) {
XDB::execute('DELETE FROM requests WHERE user_id={?} AND type={?}', $this->uid, $this->type);
}
function update ()
{
- global $globals;
XDB::execute('UPDATE requests SET data={?}, stamp=stamp
WHERE user_id={?} AND type={?} AND stamp={?}',
$this, $this->uid, $this->type, $this->stamp);
*/
function clean ()
{
- global $globals;
if ($this->unique) {
return XDB::execute('DELETE FROM requests WHERE user_id={?} AND type={?}',
$this->uid, $this->type);
// ajout d'un commentaire
if (Env::has('hold') && Env::has('comm')) {
- $this->comments[] = Array(Session::get('bestalias'), Env::get('comm'));
+ $this->comments[] = Array(S::v('bestalias'), Env::v('comm'));
// envoi d'un mail à hotliners
global $globals;
$mailer->addTo("hotliners@{$globals->mail->domain}");
$body = "Validation {$this->type} pour {$this->prenom} {$this->nom}\n\n"
- . Session::get('bestalias')." a ajouté le commentaire :\n\n"
- . Env::get('comm')."\n\n"
+ . S::v('bestalias')." a ajouté le commentaire :\n\n"
+ . Env::v('comm')."\n\n"
. "cf la discussion sur : ".$globals->baseurl."/admin/valider.php";
$mailer->setTxtBody(wordwrap($body));
}
if (Env::has('refuse')) {
- if (Env::get('comm')) {
+ if (Env::v('comm')) {
$this->sendmail(false);
$this->clean();
$this->trig('mail envoyé');
$body = "Cher(e) camarade,\n\n"
. $this->_mail_body($isok)
- . (Env::has('comm') ? "\n\n".Env::get('comm') : '')
+ . (Env::has('comm') ? "\n\n".Env::v('comm') : '')
. "\n\nCordialement,\nL'équipe Polytechnique.org\n";
$mailer->setTxtBody(wordwrap($body));
*/
function get_request($uid, $type, $stamp = -1)
{
- global $globals;
if ($stamp == -1) {
$res = XDB::query('SELECT data FROM requests WHERE user_id={?} and type={?}', $uid, $type);
} else {
// }}}
}
-// }}}
-// {{{ IMPLEMENTATIONS
-
foreach (glob(dirname(__FILE__).'/validations/*.inc.php') as $file) {
require_once($file);
}
-// }}}
-
/* vim: set expandtab shiftwidth=4 tabstop=4 softtabstop=4 foldmethod=marker: */
?>