Invo: security and products page warning

Hi there,

I'm working on the INVO tutorial to learn a bit more abpout phalcon. Working well so far, but I have an issue with the security/products page: the tutorial explains that trying to access the protected page (http://mydomain.dev/products/ ) it should display the home page with a warning.

When trying on my dev version, I end up with a blank page. I've added a trace (dump $_SERVER) in the index.php file to see what's happening and where I ended up:

$SERVER = array ( 'FCGIROLE' => 'RESPONDER', 'QUERYSTRING' => 'url=/products/index', 'REQUESTMETHOD' => 'GET', 'SCRIPTNAME' => '/index.php', 'REQUESTURI' => '/products/index', 'DOCUMENTURI' => '/index.php', 'DOCUMENTROOT' => '/data/www/invo/public', 'SERVERPROTOCOL' => 'HTTP/1.1', 'GATEWAYINTERFACE' => 'CGI/1.1', 'SERVERSOFTWARE' => 'nginx/1.6.2', 'REMOTEPORT' => '52551', 'SERVERPORT' => '80', 'SERVERNAME' => 'phalcon.nis.dev', 'REDIRECTSTATUS' => '200', 'SCRIPTFILENAME' => '/data/www/invo/public/index.php', 'HTTPHOST' => 'phalcon.nis.dev', 'HTTPCOOKIE' => 'PHPSESSID=nojsgpfu2ooi49b8nljrfkbmd7', 'PHPSELF' => '/index.php', ... )

Checked the dispatcher and SecurtyPlugins are called, but nothing significant there. Plus even though the page displays the trace, the HTTP hreader show the status 404... o_O
I'm a bit lost there.

Is that a bug in the INVO tuto or something wrong with my setting ? Best.



30.7k

Hi,

http error 404 with a blank page, that's strange indeed. Because Invo implements a notFound handler and a dedicated view ...

What does appache error.log tells you ?



12.8k
edited Feb '15

Hi,

Nothing in the error log, that's why I've added traces myself. Digged a bit deeper... the beforeException method is executed in the notFoundPlugin class, and it's supposed to redirect me to the error page [ $dispatcher->forward(array( 'controller' => 'errors', 'action' => 'show500')); ]

But the show500Action() method doesn't seem to be called/executed. Is there any way to trace what's happening when the forward method is called ?

Cheers

[edit] I've tried to use the forward method on the home page, and it doesn't work. Throwing an exception and sending me to the show500 method. Seems like the problem come from there.

[edit2] I believe I've located exactly where the problem is: SecurityPlugin, line 114. The plugin figure out I'm trying to access a restricted page, tries to redirect me to the ErrorController->show401() but that fails, the function show401 is never executed.

[edit3] It seems there's a double problem with the INVO project: - securityPlugin: the action show401 is not listed in the publicResources array leading to an infinite loop - even after making show401 public, the forward method can't reach it (so ... redicret to show401)

edited Mar '15

That was so obvious if you think about it. Just needed somone to point it out. Thank you... Was gona trace route myself, since log was useless, but then i thought of google, and found Sutefu. Nice thanks again.

It seems there's a double problem with the INVO project: - securityPlugin: the action show401 is not listed in the publicResources array leading to an infinite loop - even after making show401 public, the forward method can't reach it (so ... redicret to show401)