Show errors on in.php

Daegaladh

Member
I made some modifications to in.php and need to show errors in the function gateway($username), i used $this->error() in older versions, but i can't in 1.3
 

Basti

Administrator
Staff member
base::error('text here') it is. May i ask what you want to do? If its plugin hooks you need, we can always add them, but i advise not to modify in.php, unless you just want to test.
 

Daegaladh

Member
Nope, I already tried that

Strict Standards: Non-static method base::error() should not be called statically in /sources/in.php on line 140
Fatal error: Using $this when not in object context in /sources/misc/classes.php on line 35

It's an antiproxy mod I made, and yeah it would be useful an official hook right before the session require.
 

Basti

Administrator
Staff member
Ah right, wrong use of a non static within a static function. This will do
Code:
    $base = new base;
    $base->error('text here');
But it will display error on the wrapper file, not the gateway template. So you might not want to use this if you want to display an error there. That would also trigger a 404 not found php header ( although could be ignored, not so nice ).

Might be better to simply manually call the error
Code:
if($some_error == 1) {
    $TMPL['my_error'] = 'text here';
}
and {$my_error} in gateway.html

Please post here or PM me ( if you not want to share codes ) the code you want to integrate using a hook. Might not need a new hook, should normally be able to use thehook already present there
 
Last edited:

Daegaladh

Member
Oh right, it works now. And yeah it needs a new hook because i need it to work before the session is created.
 

Basti

Administrator
Staff member
Alright, please add this hook
Code:
    eval (PluginManager::getPluginManager ()->pluginHooks ('in_gateway_start'));
 

cajkan

Active Member
Hello Daegaladh,

Does this antiproxy works correctly or still in beta? Would love to test it.
 
Top