Page 1 of 1

Trouble with registration

PostPosted: Wed Jun 30, 2010 12:21 am
by silenis
Hello,

First I would like to tell thank you to all the people working on Xataface. It is a really good tool and I really enjoy learning it.

I must confess that I am not a specialist of php and I have some troubles to set up everything. I usually find the solution by myself but here after 3 full days of full work, I really need your expertise.

Basically, I am setting up a registration form. The authentication is working perfect but impossible to make the registration form working. I always get the following error:

Code: Select all
Fatal error: Call to undefined method dataface_actions_register_permissions_delegate::filterPermissions() in <PATH>/Dataface/PermissionsTool.php on line 172


For your information, here is some code that might be useful. As you will see I tried to stick as close as possible from the xataface tutorials:

conf.ini

Code: Select all
[_auth]
users_table=users
username_column=login
password_column=password
allow_register=1


ApplicationDelegate.php

Code: Select all
<?
class conf_ApplicationDelegate {
     function getPermissions(&$record){
         $auth =& Dataface_AuthenticationTool::getInstance();
         $user =& $auth->getLoggedInUser();
         if ( !isset($user) ) return Dataface_PermissionsTool::getRolePermissions('NO ACCESS');
         $role = $user->val('role');
         return Dataface_PermissionsTool::getRolePermissions($role);
      }
}
?>


include in index.php

Code: Select all
function isAdmin(){
    $auth =& Dataface_AuthenticationTool::getInstance();
    $user =& $auth->getLoggedInUser();
    if ( $user and $user->val('role') == 'ADMIN')  return true;
    return false;
}


users.php

Code: Select all
class tables_users {
    function getPermissions($record){
        if ( isAdmin() ) return null;
        $perms['register'] = 1;
        return $perms;
     
    }


I hope that someone will be able to show me the right path since I am really stuck.

Many thanks

Vincent

Re: Trouble with registration

PostPosted: Mon Jul 05, 2010 4:38 pm
by shannah
Sorry... I found that I had forgotten to commit the registration code to support the register permission with the last release. It is now in SVN and will be included with the next release some time this week.