Exemplo n.º 1
0
$ogArticleManager->fAuthorID = $oUser->getID();
$ogArticleManager->fEditorID = $oUser->getID();
// running dry
if (!$ogArticleManager->initialize()) {
    _throw("FNoArticlesTable", "There is no articles table called \"{$fusebox['tableArticles']}\" present in DB");
}
$ogArticleManager->fTitleEditLink = "%s&nbsp;<a href=\"javascript:void(0);\" onClick=\"popupContentForm('" . $myself . "util.showArticleForm', %d, '%s', %d, 1);\">Edit</a>";
$ogArticleManager->fContentEditLink = "%s&nbsp;<a href=\"javascript:void(0);\" onClick=\"popupContentForm('" . $myself . "util.showArticleForm', %d, '%s', %d, 2);\">Edit</a>";
$ogArticleAttachmentManager = new ArticleAttachmentManager($oDB, $ogArticleManager, $fusebox['tableArticleAttachments']);
// creating gallery manager
$ogGalleryManager = new GalleryManager($oDB, $oLanguage, $fusebox['tableGalleriesTokens'], $fusebox['tableGalleries'], $fusebox['tableImagesTokens'], $fusebox['tableImages'], $fusebox['tableGalleriesComments'], $fusebox['tableImagesComments']);
// setting authorship
$ogGalleryManager->fAuthorID = $oUser->getID();
$ogGalleryManager->fEditorID = $oUser->getID();
// bringing up
if (!$ogGalleryManager->initialize()) {
    _throw("FNoGalleryTables", "There is no gallery and images tables present in DB");
}
// security managers initialization (for current FA and 'global' for entire site)
if ($fusebox['mode'] == "development" || $oUser->isDev()) {
    $oSecurityManager = new SecurityManager($oDB, $oUser, $oFuseaction, $fusebox['tableSecurity'], $fusebox['tableGroups'], $fusebox['tableUsersGroups'], $fusebox['defaultGroup'], SECURITYMODE_LOOSE, true);
    $ogSecurityManager = new SecurityManager($oDB, $oUser, $ogFuseaction, $fusebox['tableSecurity'], $fusebox['tableGroups'], $fusebox['tableUsersGroups'], $fusebox['defaultGroup'], SECURITYMODE_LOOSE, true);
} else {
    if ($fusebox['globalSecurityMode'] == "STRICT") {
        $oSecurityManager = new SecurityManager($oDB, $oUser, $oFuseaction, $fusebox['tableSecurity'], $fusebox['tableGroups'], $fusebox['tableUsersGroups'], $fusebox['defaultGroup'], SECURITYMODE_STRICT, false);
        $ogSecurityManager = new SecurityManager($oDB, $oUser, $ogFuseaction, $fusebox['tableSecurity'], $fusebox['tableGroups'], $fusebox['tableUsersGroups'], $fusebox['defaultGroup'], SECURITYMODE_STRICT, false);
    } elseif ($fusebox['globalSecurityMode'] == "LOOSE") {
        $oSecurityManager = new SecurityManager($oDB, $oUser, $oFuseaction, $fusebox['tableSecurity'], $fusebox['tableGroups'], $fusebox['tableUsersGroups'], $fusebox['defaultGroup'], SECURITYMODE_LOOSE, false);
        $ogSecurityManager = new SecurityManager($oDB, $oUser, $ogFuseaction, $fusebox['tableSecurity'], $fusebox['tableGroups'], $fusebox['tableUsersGroups'], $fusebox['defaultGroup'], SECURITYMODE_LOOSE, false);
    } else {
        _throw("FUncertainSecurityMode", "Security mode is uncertain");