Task #1044 - Implementation de Test
Replace in class exit by throw new Exception
This commit is contained in:
parent
518a9090d6
commit
54b6037ede
37 changed files with 95 additions and 104 deletions
|
|
@ -354,6 +354,7 @@ class User
|
|||
|
||||
function Admin()
|
||||
{
|
||||
$this->admin = 0;
|
||||
if ($this->login != 'phpcompta')
|
||||
{
|
||||
$pass5 = md5($this->pass);
|
||||
|
|
@ -363,7 +364,7 @@ class User
|
|||
$cn = new Database();
|
||||
$res = $cn->exec_sql($sql, array($this->login));
|
||||
if (Database::num_row($res) == 0)
|
||||
exit(__FILE__ . " " . __LINE__ . " aucun resultat");
|
||||
throw new Exception(__FILE__ . " " . __LINE__ . " aucun resultat");
|
||||
$this->admin = Database::fetch_result($res, 0);
|
||||
}
|
||||
else
|
||||
|
|
@ -402,8 +403,7 @@ class User
|
|||
$pid = Database::fetch_result($Res2, 0, 0);
|
||||
if ($pid == null)
|
||||
{
|
||||
echo _("Aucune période trouvéee !!!");
|
||||
exit(1);
|
||||
throw new Exception( _("Aucune période trouvéee !!!"));
|
||||
}
|
||||
|
||||
$pid = Database::fetch_result($Res2, 0, 0);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue