Akelos Framework v1 forum archive. This forum is no longer maintained. To report bugs please visit https://github.com/akelos/akelos/issues
    • CommentAuthoralake
     

    Regarding this function in AkActionController: function _authenticationRequest($realm) { header('WWW-Authenticate: Basic realm="' . str_replace('"','',$realm) . '"');

        if(method_exists($this, 'access_denied')){
            $this->access_denied();
        }else{
            header('HTTP/1.0 401 Unauthorized');
            echo "HTTP Basic: Access denied.\n";
            exit;
        }
    }
    

    I added the following in my project's ApplicationController:

    function access_denied() {
        echo "test of application_controller:access_denied";
        exit;
    }
    

    I then executed my project (which includes the Admin plugin) and entered an invalid password. The message displayed is the one from AkActionController, indicating to me that <code>if(method_exists($this, 'access_denied'))</code> returned a false value.

    What might I have done wrong, please?

    •  
      CommentAuthorfrancois
     
    Hi Alake,

    Are you sure that you can use the "echo" php method in a controller ? I have never seen that. I think, it will be better if you use a $this->renderText('Error XXXXXXX') in your controller.
    • CommentAuthoroisucf
     
    I've seen something related to this too. I opened the ticket here: http://trac.akelos.org/ticket/187

    I messed around this the same section of code. Never got anywhere with it.