Thread: [psa-users] Drive Include Path Problem on new pages
Brought to you by:
koivi
From: Peter H. <pe...@pe...> - 2003-05-18 22:07:02
|
I've just tried to install phpsecurityadm. I was a little frustrated by the documentation on metabase, but finally got so that I could log on to the admin page, add users, change passwords, etc. I can't get the driver_test stuff on metabase to work, but phpsecurity seems to work... Things are looking promising, so I build a page (in the directory above all the metabase and phpSecurity pages), adding it to the database, and get the following error. it was not specified a valid DBMS driver include path OK. I'm lost. Where might the system be breaking down? I'm running a linux box with mysql. The test page is simply: <?php require_once "phpsecurityadmin/_restrict.php"; echo "<html><title>Starting Page</title><body><h4>Starting Page</h4><br />"; echo "Starting page stuff"; echo "</body></html>"; ?> Peter |
From: Albert L. <al...@pl...> - 2003-05-19 11:56:29
|
Hi Peter, It sounds like metabase is not loading the db driver correctly. I'm surprised that you can log in because the config file is the one that contains the matabase directives, not _restrict.php. The documentation on metabase is actually pretty good I think. You need to give the profile access to the page as well as add it to the site structure, but it doesn't sound like that is the problem. You're not using the CVS version are you? Justin, do you know anything about this? - Al On 5/18/03 6:06 PM, "Peter Hiltz" <pe...@pe...> wrote: > I've just tried to install phpsecurityadm. I was a little frustrated by the > documentation on metabase, but finally got so that I could log on to the > admin page, add users, change passwords, etc. > > I can't get the driver_test stuff on metabase to work, but phpsecurity seems > to work... > > Things are looking promising, so I build a page (in the directory above all > the metabase and phpSecurity pages), adding it to the database, and get the > following error. > > it was not specified a valid DBMS driver include path > > OK. I'm lost. Where might the system be breaking down? I'm running a linux box > with mysql. > > The test page is simply: > > <?php > require_once "phpsecurityadmin/_restrict.php"; > > echo "<html><title>Starting Page</title><body><h4>Starting Page</h4><br />"; > echo "Starting page stuff"; > echo "</body></html>"; > > ?> > > > > Peter > > > ------------------------------------------------------- > This SF.net email is sponsored by: If flattening out C++ or Java > code to make your application fit in a relational database is painful, > don't do it! Check out ObjectStore. Now part of Progress Software. > http://www.objectstore.net/sourceforge > _______________________________________________ > phpsecurityadm-users mailing list > php...@li... > https://lists.sourceforge.net/lists/listinfo/phpsecurityadm-users > |
From: Justin K. <ju...@ko...> - 2003-05-19 21:05:57
|
Peter Hiltz wrote: >It doesn't make any difference. >I've moved the metabase files down one directory below the phpsecurityadmin >directory, and modified include/config.php so that it shows: > > 'IncludePath' => dirname(__FILE__).'../../metabase' // where to find >the metabase files > > This won't work quite as you're expecting.... You need to have the slash added after dirname() like: dirname(__FILE__).'/../../metabase' >But that doesn't make a difference either. If I change that directive, I get a >complaint about being unable to find the metabase_interface.php file. > > Above is likely why you get this error. >I feel like I'm missing something obvious. Somewhere there is a config file >staring me in the face and laughing. > Did you try checking out the latest CVS source? Maybe there is something that we had fixed there without realizing it. Basically, I always use dirname(__FILE__) when looking for files so I know exactly where I am. I haven't had the no DBMS Driver error in so long I don't remember exactly what caused it. Another option is to go to the metabase board in Yahoo groups and search the archives there. It definately sounds like metabase isn't playing nice with you. >On Monday 19 May 2003 03:32 pm, Justin Koivisto wrote: > > >>Just out of curiosity, what happens when you change your require >>statement to something like: >>require_once dirname(__FILE__).'/phpsecurityadmin/_restrict.php'; >> >>I did have a similar problem when I was first starting to use Metabase, >>and it all came down to the include path for Metabase wasn't set, and >>that is when I realized that the 'IncludePath' had to be set for >>metabase to work even if I had already included the files successfully. >> >> > > > > |
From: Peter H. <pe...@pe...> - 2003-05-19 22:16:28
|
Okay, I've changed the include file to read: 'IncludePath' => dirname(__FILE__).'/../metabase' Now, no error message, but I get a blank page. Or almost a blank page. If I look at the source code, something has dumped in some html 4.01 structure and a css style, but there is nothing between the body tags. It is obviously not coming back to my page and picking up the rest of the page. I've just picked up the CVS source, but it will be another two days before I can get to it. It's now midnight and it looks like another long day at work tomorrow. Peter > Did you try checking out the latest CVS source? Maybe there is something > that we had fixed there without realizing it. Basically, I always use > dirname(__FILE__) when looking for files so I know exactly where I am. > I haven't had the no DBMS Driver error in so long I don't remember > exactly what caused it. > > Another option is to go to the metabase board in Yahoo groups and search > the archives there. It definately sounds like metabase isn't playing > nice with you. |
From: Peter H. <pe...@pe...> - 2003-05-19 22:39:24
|
Staying up late. Ok. I've picked up the CVS source. Remember my test page was in the directory above phpsecurityadm. The page generates a "You do not have access rights to this content message"...right above the content. I go back down to the phpsecurityadm directory, to index.php. Log in. Go back up to the content directory. Same as above. Time for some sleep. Peter |
From: Peter H. <pe...@pe...> - 2003-05-20 05:52:30
|
Now running CVS version. Test Page source is : <?php require_once $PSA_PATH.'/phpsecurity/include/config.php'; echo "Starting page stuff"; ?> Looking at the output to the browser, the line "Starting page stuff" is being output after the closing body and html tags. I.E. body style="background-color: #ffffff; color: #000099;"> You do not have access rights to this content </body> </html> Starting page stuff Something is out of sync. Peter On Tuesday 20 May 2003 12:39 am, Peter Hiltz wrote: > Staying up late. Ok. I've picked up the CVS source. Remember my test page > was in the directory above phpsecurityadm. The page generates a "You do not > have access rights to this content message"...right above the content. |
From: Justin K. <ju...@ko...> - 2003-05-20 12:54:57
|
Peter Hiltz wrote: >Now running CVS version. > >Test Page source is : ><?php > > require_once $PSA_PATH.'/phpsecurity/include/config.php'; > >echo "Starting page stuff"; >?> > >Looking at the output to the browser, the line "Starting page stuff" is being >output after the closing body and html tags. I.E. > >body style="background-color: #ffffff; color: #000099;"> >You do not have access rights to this content </body> ></html> >Starting page stuff > >Something is out of sync. > > This looks like you do not have the correct URI for the page you are trying to access. If your test page is something like http://www.example.com/test.php, then in the site structure, you will need to have an entry for "/test.php" - you will also need to have this entry selected in a profile, and that profile selected for the user you are trying to access the page with. Also, you should use phpsecurityadmin/_restrict.php rather than the config file. |
From: Justin K. <ju...@ko...> - 2003-05-20 21:40:11
|
Peter Hiltz wrote: >Output is: > >You do not have access rights to this content. >page X >Go to Page Y > >Obviously the fact that "page X" and "Go to Page Y" are shown is undesireable. >Browser source code indicates that "page X" and "Go to Page Y" are after the >closing </html> tag. > >Stepping through _restrict.php shows that on the viewing denied page, the >securityHeader() and securityFooter() are called, and are output as part of >$PSA_OUTPUT. > >Then the remainder of the echo statements on pageX are called. > >My tentative reaction is that it looks as if _restrict.php is missing an >exit() call after the last call of securityFooter(). > > That's right, it is... I am going to update CVS in a minute or two, but the end of the _restrict.php should look like: if(!$PSA_test && !$PSA_STOP_EXEC){ if($PSA_DISPLAY_OUTPUT) securityHeader(); echo $PSA_SYS->Error(); // Display Error if($PSA_DISPLAY_OUTPUT){ securityFooter(); exit(); } } $PSA_OUTPUT=ob_get_contents(); ob_end_clean(); if($PSA_DISPLAY_OUTPUT) echo $PSA_OUTPUT; ?> >However, I also don't think that I understand how the output buffering >functions work with respect to my code. If my code needs to start getting >included in the buffering, with a test for whether the user has viewing >privileges, then I think I need to add more to each page (or function) than >just including the _restrict.php page. If so, this should be documented a bit >more for slow learners like me. Or am I missing something else? > I do need to create real documentation for the class and GUI, but I just haven't had the time to do it yet. The way the output buffering is set up is so that you can use it as a standalone application as most people do. However, if you want to incorporate the GUI and/or login form into an existing framework, then setting $PSA_DISPLAY_OUTPUT=FALSE; will allow you to use the $PSA_OUTPUT variable where ever you want to put it in your page. |
From: Albert L. <al...@pl...> - 2003-05-21 13:20:47
|
Wow Peter good find, we'll update that. I see that Justin is already on it. Cool. Glad to see you're testing the CVS too, have you tried the password reset - we just added that. Its not elegant but is safe and quick. We're looking to make a new release of the CVS code so if you find anything else let us know. > You do not have access rights to this content. > page X > Go to Page Y > > Obviously the fact that "page X" and "Go to Page Y" are shown is undesireable. > Browser source code indicates that "page X" and "Go to Page Y" are after the > closing </html> tag. > > Stepping through _restrict.php shows that on the viewing denied page, the > securityHeader() and securityFooter() are called, and are output as part of > $PSA_OUTPUT. > > Then the remainder of the echo statements on pageX are called. > > My tentative reaction is that it looks as if _restrict.php is missing an > exit() call after the last call of securityFooter(). > > However, I also don't think that I understand how the output buffering > functions work with respect to my code. If my code needs to start getting > included in the buffering, with a test for whether the user has viewing > privileges, then I think I need to add more to each page (or function) than > just including the _restrict.php page. If so, this should be documented a bit > more for slow learners like me. Or am I missing something else? > > Peter > > > |