<?php
/***************************************************************************
- * Copyright (C) 2003-2007 Polytechnique.org *
+ * Copyright (C) 2003-2008 Polytechnique.org *
* http://opensource.polytechnique.org/ *
* *
* This program is free software; you can redistribute it and/or modify *
class HomonymeReq extends Validate
{
// {{{ properties
-
+
public $loginbis;
public $warning = true;
// }}}
// {{{ constructor
-
+
public function __construct($_uid, $_loginbis, $_homonymes_forlife, $warning=true)
{
$this->warning = $warning;
$this->loginbis = $_loginbis;
$this->homonymes_forlife = $_homonymes_forlife;
}
-
+
// }}}
// {{{ title()
-
+
private function title()
{
return $this->warning?'alerte alias':'robot répondeur';
protected function _mail_subj()
{
+ global $globals;
return "[Polytechnique.org/Support] ".($this->warning?"Dans une semaine : suppression de l'alias":"Mise en place du robot")." $loginbis@" . $globals->mail->domain;
}
// }}}
// {{{ function _mail_body
-
+
protected function _mail_body($isok)
{
global $globals;
}
// }}}
// {{{ function commit()
-
+
public function commit()
{
require_once('homonymes.inc.php');
XDB::execute("UPDATE aliases SET type='homonyme',expire=NOW() WHERE alias={?}", $this->loginbis);
XDB::execute("REPLACE INTO homonymes (homonyme_id,user_id) VALUES({?},{?})", $this->uid, $this->uid);
}
-
+
return true;
}