Login prompt without table list

A place for users and developers of the Xataface to discuss and receive support.

Login prompt without table list

Postby Byte » Mon Jul 20, 2009 5:17 am

Hi,

How can I get a custom login prompt for non-logged-in users so that they can't see the table menu?
Byte
 
Posts: 13
Joined: Thu Jul 16, 2009 3:48 am

Postby shannah » Mon Jul 20, 2009 12:54 pm

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
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Postby Byte » Tue Jul 21, 2009 12:38 am

Hi Steve,

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

Thx,
Michael
Byte
 
Posts: 13
Joined: Thu Jul 16, 2009 3:48 am

Postby Byte » Tue Jul 21, 2009 1:44 am

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?!?
Byte
 
Posts: 13
Joined: Thu Jul 16, 2009 3:48 am

Postby shannah » Tue Jul 21, 2009 12:06 pm

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
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm


Return to Xataface Users

Who is online

Users browsing this forum: No registered users and 15 guests

cron
Powered by Dataface
© 2005-2007 Steve Hannah All rights reserved