plugins/PunBB.php
changeset 4 eb9ed4c366d0
parent 3 c0c445d4a13e
child 5 e3d7322305bf
--- a/plugins/PunBB.php	Thu Jul 12 15:00:35 2007 -0400
+++ b/plugins/PunBB.php	Sun Sep 02 10:56:36 2007 -0400
@@ -36,9 +36,9 @@
 $plugins->attachHook('session_started', '
     $pid = RenderMan::strToPageId($paths->get_pageid_from_url());
 
-    if ( getConfig("punbb_installed") == "yes" && getConfig("punbb_version") == PUNANO_VERSION && $pid[0] == "Forum" && $pid[1] == "Special" )
+    if ( getConfig("punbb_installed") == "yes" && getConfig("punbb_version") == PUNANO_VERSION && preg_match("#^Forum(/.*)?$#", $pid[0]) && $pid[1] == "Special" )
     {
-      require( "punbb/include/common.php" );
+      require( ENANO_ROOT . "/punbb/include/common.php" );
     }
     ');
 
@@ -204,7 +204,7 @@
 function punano_upgrade()
 {
   global $db, $session, $paths, $template, $plugins; // Common objects
-  
+  die('Punano upgrade was requested but this isn\'t implemented yet.');
 }
 
 function punano_main()
@@ -261,6 +261,7 @@
 
   if ( $session->auth_level < $need_level )
   {
+    $need_level = ( $session->user_level > $need_level ) ? $session->user_level : $need_level;
     redirect( makeUrlNS('Special', 'Login/' . $paths->fullpage, 'level=' . $need_level, false), 'Permission denied', 'You need to have permission level ' . $session->userlevel_to_string($need_level) . ' to use the PunBB administration console.', 2);
   }