Improve permission checking in objects, fix some initialization bugs

This commit is contained in:
Chris Morgan
2005-10-26 02:09:49 +00:00
committed by WineHQ
parent 25edd18770
commit 89abe706dc
6 changed files with 383 additions and 181 deletions

View File

@@ -132,6 +132,9 @@ class Category {
*/
function delete($bSilent=false)
{
if(!$_SESSION['current']->canDeleteCategory($this))
return false;
if(sizeof($this->aApplicationsIds)>0)
{
addmsg("The category has not been deleted because there are still applications linked to it.", "red");
@@ -143,6 +146,8 @@ class Category {
query_appdb($sQuery);
addmsg("The category has been deleted.", "green");
}
return true;
}
@@ -232,8 +237,7 @@ function make_cat_path($path, $appId = '', $versionId = '')
$oVersion = new Version($versionId);
$str .= " > ".html_ahref($oApp->sName,"appview.php?appId=$appId");
$str .= " > ".$oVersion->sName;
}
else
} else
{
$str .= " > ".$oApp->sName;
}