<?php
/***************************************************************************
- * Copyright (C) 2003-2008 Polytechnique.org *
+ * Copyright (C) 2003-2009 Polytechnique.org *
* http://opensource.polytechnique.org/ *
* *
* This program is free software; you can redistribute it and/or modify *
public $warning = true;
- public $homonymes_forlife;
+ public $homonymes_hruid;
public $rules = "Accepter, sauf cas particulier d'utilisateur dont l'homonymie est traité plus ... manuellement";
// }}}
// {{{ constructor
- public function __construct(User $_user, $_loginbis, $_homonymes_forlife, $warning=true)
+ public function __construct(User &$_user, $_loginbis, $_homonymes_hruid, $warning=true)
{
$this->warning = $warning;
$this->refuse = false;
$this->loginbis = $_loginbis;
- $this->homonymes_forlife = $_homonymes_forlife;
+ $this->homonymes_hruid = $_homonymes_hruid;
}
// }}}
public function commit()
{
- require_once('homonymes.inc.php');
-
- switch_bestalias($this->user->id(), $this->loginbis);
+ Platal::load('admin', 'homonyms.inc.php');
+ switch_bestalias($this->user, $this->loginbis);
if (!$this->warning) {
XDB::execute("UPDATE aliases SET type = 'homonyme', expire = NOW() WHERE alias = {?}", $this->loginbis);
XDB::execute("REPLACE INTO homonymes (homonyme_id, user_id) VALUES({?}, {?})", $this->user->id(), $this->user->id());