Page 1 of 1

Windows Vista

PostPosted: Thu Sep 11, 2008 5:39 am
by njw
I have a Xataface system up and running. It works fine except when trying to access the system using a client PC running Vista.

Has anyone come across problems using Vista?

Many thanks for any help

Neil

PostPosted: Thu Sep 11, 2008 11:32 am
by shannah
I don't have access to any Vista machines right now. Can you describe the problem?

I'll try

PostPosted: Thu Sep 11, 2008 1:10 pm
by njw
but the PC the error is on is 3,000 miles away! The reported error is:

Fatal error: Call to a member function getLoggedInUser() on a non-object in /home/archomai/public_html/alcreg/tables/Student/Student.php on line 22

I usually get something like this after I log out of the system, but on first access there's a hook to force the user to the login screen.

Many thanks

Neil

PostPosted: Fri Sep 12, 2008 8:49 am
by shannah
Can you post a snippet around where the error occurs (line 22 of Student.php)?

-Steve

Snippet

PostPosted: Fri Sep 12, 2008 8:59 am
by njw
Code: Select all
    function getPreferences(){
        $mytable =& Dataface_Table::loadTable('Student') ;
        $auth =& Dataface_AuthenticationTool::getInstance();
        $user =& $auth->getLoggedInUser();
        if ( $user and  $user->val('role') != 'ADMIN' ) {
        // We apply the security filter to non admin users.
            $mytable->setSecurityFilter(array('Company'=>$user->val('Company')));
        }
    return array();  // Mandatory!! getPreferences() must return array.
    }

    function beforeInsert(&$record) {
        $auth =& Dataface_AuthenticationTool::getInstance();
        $user =& $auth->getLoggedInUser();
        $record->setValue('Company', $user->val('Company'));
    }

PostPosted: Mon Sep 15, 2008 7:16 am
by shannah
One observation is that the getPreferences() method should be in the applcation delegate class not the student table delegate class.

How does your hook work to force the user to the login screen?

-Steve

It is in both

PostPosted: Mon Sep 15, 2008 8:22 am
by njw
I thought I needed it in both - I have a number of tables, some of which are available to non-Admin users and some are not.

Many thanks

Neil

PostPosted: Tue Sep 16, 2008 3:54 pm
by shannah
This is very strange. The authentication tool should be available in any triggers you might have so long as your application has an [_auth] section defined in the conf.ini file.

Although, it gets instantiated inside the Dataface_Application::display() method, so if you're doing some special stuff in the index.php file before the display() method is called, then this could happen.

Tough to diagnose completely from this vantage point.

It looks like it might have gone away

PostPosted: Wed Sep 17, 2008 12:24 am
by njw
but I'll find out when I am next out there, early next month.

Many thanks for your help

Neil