authzgroups : Raise an exception if there is a SQL error
git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@2453 bf3deb0d-5f1a-0410-827f-c0cc1f45334c
This commit is contained in:
@@ -70,10 +70,17 @@ class authzgroups
|
|||||||
if ($user !== "cli" && $user !== "root")
|
if ($user !== "cli" && $user !== "root")
|
||||||
$st->bindValue (":user", $user);
|
$st->bindValue (":user", $user);
|
||||||
$st->bindValue (":module", $module);
|
$st->bindValue (":module", $module);
|
||||||
$rc = $st->execute ();
|
try
|
||||||
if ($rc === false)
|
|
||||||
{
|
{
|
||||||
if ($this->dbObject->debug) echo "DEBUG : EXECUTE ERROR ! Return FALSE\n";
|
$rc = $st->execute ();
|
||||||
|
if ($rc === false)
|
||||||
|
throw new Exception ("Can't execute SQL request", 500);
|
||||||
|
}
|
||||||
|
catch (Exception $e)
|
||||||
|
{
|
||||||
|
if ($this->dbObject->debug) echo "DEBUG : EXECUTE ERROR ! Return FALSE".
|
||||||
|
$e->getMessage()."\n";
|
||||||
|
throw new Exception ($e->getMessage(), 500);
|
||||||
}
|
}
|
||||||
$res = array ();
|
$res = array ();
|
||||||
while ($d = $st->fetch (PDO::FETCH_ASSOC))
|
while ($d = $st->fetch (PDO::FETCH_ASSOC))
|
||||||
@@ -301,6 +308,12 @@ class authzgroups
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Disconnect from the database. Should be only used in the unit tests */
|
||||||
|
public function disconnect ()
|
||||||
|
{
|
||||||
|
$this->dbObject->disconnect ();
|
||||||
|
}
|
||||||
|
|
||||||
/** Create the tables in the database to store the datas */
|
/** Create the tables in the database to store the datas */
|
||||||
public function createTables ()
|
public function createTables ()
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user