Fix: use bad object

This commit is contained in:
Regis Houssin 2011-10-22 19:26:25 +08:00
parent 5a20fa8169
commit 9924b2f17d

View File

@ -147,7 +147,6 @@ foreach ($modulesdir as $dir)
$db->commit();
// Affiche lignes des permissions
$sql = "SELECT r.id, r.libelle, r.module, r.perms, r.subperms, r.bydefault";
$sql.= " FROM ".MAIN_DB_PREFIX."rights_def as r";
@ -159,10 +158,11 @@ $sql.= " ORDER BY r.module, r.id";
$result = $db->query($sql);
if ($result)
{
$num = $db->num_rows($result);
$i = 0;
$var=True;
$old = "";
$num = $db->num_rows($result);
$i = 0;
$var = True;
$oldmod = "";
while ($i < $num)
{
$obj = $db->fetch_object($result);
@ -176,7 +176,7 @@ if ($result)
// Check if permission we found is inside a module definition. If not, we discard it.
$found=false;
foreach($objMod->rights as $key => $val)
foreach($modules[$obj->module]->rights as $key => $val)
{
$rights_class=$objMod->rights_class;
if ($val[4] == $obj->perms && (empty($val[5]) || $val[5] == $obj->subperms))
@ -190,12 +190,13 @@ if ($result)
$i++;
continue;
}
// Break found, it's a new module to catch
if ($old <> $obj->module)
if ($oldmod <> $obj->module)
{
$objMod=$modules[$obj->module];
$picto=($objMod->picto?$objMod->picto:'generic');
$oldmod = $obj->module;
$objMod = $modules[$obj->module];
$picto = ($objMod->picto?$objMod->picto:'generic');
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Module").'</td>';
@ -203,7 +204,6 @@ if ($result)
print '<td align="center">'.$langs->trans("Default").'</td>';
print '<td align="center">&nbsp;</td>';
print "</tr>\n";
$old = $obj->module;
}
$var=!$var;