Beispiel #1
0
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 *
 ###################################################*/
require_once '../kernel/begin.php';
require_once '../forum/forum_begin.php';
require_once '../forum/forum_tools.php';
$id_get = retrieve(GET, 'id', 0);
//Vérification de l'existance de la catégorie.
if ($id_get != Category::ROOT_CATEGORY && !ForumService::get_categories_manager()->get_categories_cache()->category_exists($id_get)) {
    $controller = PHPBoostErrors::unexisting_category();
    DispatchManager::redirect($controller);
}
//Vérification des autorisations d'accès.
if (!ForumAuthorizationsService::check_authorizations($id_get)->read()) {
    $error_controller = PHPBoostErrors::user_not_authorized();
    DispatchManager::redirect($error_controller);
}
try {
    $category = ForumService::get_categories_manager()->get_categories_cache()->get_category($id_get);
} catch (CategoryNotFoundException $e) {
    $error_controller = PHPBoostErrors::unexisting_page();
    DispatchManager::redirect($error_controller);
}
if ($category->get_url()) {
    $error_controller = PHPBoostErrors::unexisting_page();