1 sam2kb Jun 09, 2008 00:16
3 yabba Jun 10, 2008 13:01
inc/_main.inc.php add the new bits (around line 626):
// Display login errors (and form). This uses $io_charset, so it's at the end.
if( $Messages->count( 'login_error' ) )
{
require $htsrv_path.'login.php';
exit();
}
if( $debug == 3 && ( !is_logged_in() || $current_User->group_ID != 1 ) )
{
$Debuglog = & new Log_noop( 'note' );
}
$Timer->pause( '_main.inc');
¥
4 sam2kb Jun 10, 2008 13:25
Thanks
It seems easy, but doesn't work.
5 yabba Jun 10, 2008 20:34
Hmmm, I wonder if $debug is hard coded somewhere for < 3, try changing the if( $debug ==3 .... to if( $debug .... and seeing if that works, if not then I'll have a play with it later and see if I can get it working
¥
6 afwas Jun 10, 2008 20:54
Just as a reminder:
Afwas> No Debug at all with if( $debug && ( [...]
<yabs> I assume you are logged in as an admin group user?
<Afwas> admin
<Afwas> There wasn't any Debug with debug == 3 either
7 sam2kb Jun 10, 2008 21:25
I set $debug = 1 and tried to change inc/_main.inc.php line 167
It displays debug either with true or false. How does it work?
if( true )
{
$Debuglog = & new Log_noop( 'note' );
}
8 yabba Jun 11, 2008 08:27
New day, new head, new snippet ;)
if( $debug == 3 && ( !is_logged_in() || $current_User->group_ID != 1 ) )
{
$debug = 0;
$Debuglog = & new Log_noop( 'note' );
}
¥
9 sam2kb Jun 11, 2008 10:01
Perfect! :) Now it does what I want :cookie:
10 yabba Jun 12, 2008 18:57
Minor correction to the above, the code needs to be moved slightly otherwise non-admins *could* still be shown debug output on the login form :
if( $debug == 3 && ( !is_logged_in() || $current_User->group_ID != 1 ) )
{
$debug = 0;
$Debuglog = & new Log_noop( 'note' );
}
// Display login errors (and form). This uses $io_charset, so it's at the end.
if( $Messages->count( 'login_error' ) )
{
require $htsrv_path.'login.php';
exit();
}
¥
11 afwas Jun 13, 2008 04:54
Just another reminder:
<Afwas> ¥åßßå, what's this: waning: register_shutdown_function() [function.register-shutdown-function]: Invalid shutdown callback 'shutdown' passed in /home/hemmi3/public_html/blog/inc/_main.inc.php on line 247
<Afwas> That's your proposed change
<yabs> you get that from the code change in profiles plugin?
<Afwas> No the debug thing when moving your code up a few lines
<Afwas> / Init charset handling:
<Afwas> init_charsets( $current_charset );
<Afwas> if( $debug == 3 && ( !is_logged_in() || $current_User->group_ID != 1 ) )
<Afwas> {
<Afwas> $debug = 0;
<Afwas> $Debuglog = & new Log_noop( 'note' );
<Afwas> }
<Afwas> / Display login errors (and form). This uses $io_charset, so it's at the end.
<Afwas> if( $Messages->count( 'login_error' ) )
<Afwas> {
<Afwas> require $htsrv_path.'login.php';
<Afwas> exit(0);
<Afwas> }
<yabs> ahhh, hmmm, that was a smidge untested, but it shouldn't have thrown that error
<yabs> I'll have to have a look when I get a free moment
<yabs> mind you, I'm still baffled as to why "$debug = 0" is required, it *really* shouldn't be
<yabs> ( not found the cause of that yet either )
<Afwas> funny
<yabs> I *think* it's sumat to do with $Session, but not narrowed it down ... might ask FG on dev list
<Afwas> go ahead, might even be interesting
<yabs> lol, yeah, might even provoke a reply! ;)
12 yabba Jun 13, 2008 08:36
Hmmmm, I've just tried replicating this and failed miserably, I even tried it on your server and still failed to replicate it.
A search of all files in /inc/ gives this :
My editor of choice wrote:
Found 3 occurrences in 2 files for the word: register_shutdown_function
Yabba:/public_html/inc/plugins/model/_plugins.class.php (1716) register_shutdown_function( array(&$Plugin, 'CacheObjects'),
Yabba:/public_html/inc/plugins/model/_plugins.class.php (1740) register_shutdown_function( array(&$Plugin, 'CacheObjects'),
Yabba:/public_html/inc/sessions/model/_session.class.php (225) register_shutdown_function( array( & $this, 'dbsave' ) );
¥
Great Idea. I use it on coppermine-gallery. it helps.