Leve mieux les erreurs dans la class d'auth ip

This commit is contained in:
Alan Garcia 2013-02-01 09:12:55 +00:00
parent 15bc530b97
commit f8a6e80f7e
2 changed files with 11 additions and 2 deletions

View File

@ -52,7 +52,7 @@ $lac = $authip->list_affected();
<br />
<?php if (isset($error) && $error) { ?>
<p class="error"><?php echo $error ?></p>
<p class="error"><?php echo $error ; $error=''; ?></p>
<?php } ?>
<p><?php __("Here you can add rules to restrict access to AlternC's services, filtered by IP. First, add trusted IPs in the 'Known IP and networks' list. Then, add rules to grant access on services to the chosen IPs from this list.") ?></p>

View File

@ -319,14 +319,23 @@ class m_authip {
* @return boolean Retourne TRUE
*/
function call_hooks($function, $affectation_id) {
global $hooks;
global $hooks,$err;
// On récure l'objet dont on parle
$d = $this->list_affected();
if (! isset($d[$affectation_id] )) {
$err->raise('authip', _("Object not available"));
return false;
}
$affectation = $d[$affectation_id];
// On en déduis la classe qui le concerne
$e = $this->get_auth_class();
if (! isset($e[$affectation['protocol']])) {
$err->raise('authip', sprintf(_("Can't identified class for the protocole %s"), $affectation['protocol']));
return false;
}
$c = $e[$affectation['protocol']]['class'];
// On appelle le hooks de cette classe