Page 1 of 1

Login prompt without table list

PostPosted: Mon Jul 20, 2009 5:17 am
by Byte
Hi,

How can I get a custom login prompt for non-logged-in users so that they can't see the table menu?

PostPosted: Mon Jul 20, 2009 12:54 pm
by shannah
You can override the tables_menu_options slot to output nothing.

i.e. add the following method to the application delegate class:

Code: Select all
function block__tables_menu_options(){
    $auth =& Dataface_AuthenticationTool::getInstance();
    if ( $auth->isLoggedIn() ){
        return PEAR::raiseError("Just use the default");
    }
    return true;

}


The idea behind this is that if you return a PEAR_Error object from any slot method, it tells xataface to use the default content instead of your slot. Otherwise it uses whatever you output from your slot function.

An alternative would be to use the http authentication module (available in SVN http://weblite.ca/svn/dataface/modules/Auth/http/trunk/) to use HTTP authentication instead.

-Steve

PostPosted: Tue Jul 21, 2009 12:38 am
by Byte
Hi Steve,

Worked great, thanks. I will also look into the HHTP authentication, but as a quick patch it's working fine.

Thx,
Michael

PostPosted: Tue Jul 21, 2009 1:44 am
by Byte
Update: I just tried the hhtp_auth module. It works really great, BUT: I can't logout any more. When I click on "Logout" the page reloads and nothing happens. I would expect that I get kicked back to the login prompt?!?

PostPosted: Tue Jul 21, 2009 12:06 pm
by shannah
I've added this to the issue tracker. Hopefully I can get around to checking this out soon.

http://bugs.weblite.ca/view.php?id=563