# HG changeset patch # User Dan # Date 1184203719 14400 # Node ID 8f6143115bf5110aa4b2a1898be3453e0732cfd3 # Parent f9ffdbd966071f6a7dd90966e827b3b7f9216d03 Nothing exciting, just syncing with Scribus... diff -r f9ffdbd96607 -r 8f6143115bf5 plugins/PunBB.php --- a/plugins/PunBB.php Wed Jul 11 21:01:48 2007 -0400 +++ b/plugins/PunBB.php Wed Jul 11 21:28:39 2007 -0400 @@ -1,1 +1,81 @@ +attachHook('base_classes_initted', ' + global $paths; + + $paths->add_page(Array( + \'name\'=>\'Forum\', + \'urlname\'=>\'Forum\', + \'namespace\'=>\'Special\', + \'special\'=>0,\'visible\'=>1,\'comments_on\'=>0,\'protected\'=>1,\'delvotes\'=>0,\'delvote_ips\'=>\'\', + )); + '); + +define('PUNANO_VERSION', '0.1.12.15'); + +function page_Special_Forum() +{ + if ( getConfig('punbb_installed') != 'yes' ) + { + punano_installer(); + } + else if ( getConfig('punbb_version') != PUNANO_VERSION ) + { + punano_upgrade(); + } + else + { + punano_main(); + } +} + +function punano_installer() +{ + global $db, $session, $paths, $template, $plugins; // Common objects + // First check our permissions + if ( $session->user_level < USER_LEVEL_ADMIN ) + { + die_friendly('Punano initialization error', '

The Punano plugin doesn\'t have its database schema installed yet, and your user account doesn\'t have permission to install it. Please ask the administrator of this site to set up Punano.

'); + } + else if ( $session->auth_level < USER_LEVEL_ADMIN ) + { + $url = makeUrlNS('Special', 'Login/' . $paths->page, 'level=' . USER_LEVEL_ADMIN, true); + redirect($url, 'Permission denied', 'You need to have an active high-privilege session to set up Punano.', 4); + } + // Permissions are good +} + +function punano_upgrade() +{ + global $db, $session, $paths, $template, $plugins; // Common objects + +} + +function punano_main() +{ + global $db, $session, $paths, $template, $plugins; // Common objects + +} + +?>