Page 1 of 1

registration form problem

PostPosted: Sun Jul 10, 2011 4:50 pm
by manifold
I'm trying to get the new user registration working, but have hit a road block. I have the login page appear, along with the 'Register' option.

The documentation seems to indicate that selecting 'Register' would result in a 'new record' page in the 'user' (or equivalent) table. Basically, it seems that all that is needed is something like:

' Register' - redirects to - 'htp://www.xxxxxx.com/application_directory/index.php?-action=new&-table=users'

But clicking on Register only yields a blank page..

I know this is a noob question; nevertheless, if someone can provide some insight, I'd appreciate it!

TIA,
-manifold

Re: registration form problem

PostPosted: Sun Jul 10, 2011 4:57 pm
by manifold
Sorry,

Let me further clarify:

1) I know that 'htp' needs to be 'http' in the url i listed... as a new member here, using a URL incurs a scolding! It is correctly written in my code.

2) I do not actually get a white or blank page; I get this:

Registration Form
[-] Edit Details

So.. any suggestions would be appreciated!

-manifold

Re: registration form problem

PostPosted: Sun Jul 10, 2011 5:07 pm
by shannah
what version of xataface are you using? It could be a permissions issue. Anonymous users need to have the register permission granted on the users table or at least some of it's fields.

I'm on my iPhone right now so can't easily post an example but will post one later.

Steve

Re: registration form problem

PostPosted: Sun Jul 10, 2011 5:49 pm
by manifold
Hi,

I'm using version 1.3

I've tried working with the 'users.php' file in order to assign permission to add a new record to an unlogged-in user, but that hasn't had any effect. I'm sure I've bungled something somewhere.

Thank you for your quick response, especially on a Sunday night! I am viewing this as a 'learn by doing .. and re-doing' experience, and so I'll also just soldier on.

-manifold

Re: registration form problem

PostPosted: Mon Jul 11, 2011 2:27 pm
by shannah
1. Confirm if it is a permissions issue by allowing ALL permissions to all users.
2. Check your error logs for clues.

_Steve

Re: registration form problem

PostPosted: Mon Jul 11, 2011 2:36 pm
by manifold
Well, I've gotten the registration screen to appear, and I can register users. If i register in as an admin, everything works fine; if I log in as anything else, I get a 'permission denied - requires list permission, only granted 'register'.

I think I see the place to attack, just havent figured out how:

=====================================
<?php


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


class tables_users {

function getpermissions($record) {
if ( isAdmin() ) return null;
$perms['register'] = 1;
return $perms;

}
}
?>
=========================================

There must be something to follow, or replace the " $perm['register'] = 1 " so as to allow for the other built-in settings
(ie, Edit, Read Only, Delete).

Any pointers welcomed!

-manifold

Re: registration form problem

PostPosted: Mon Jul 11, 2011 2:54 pm
by shannah
The permission denied you quote happened when you were trying to access the list action, not the register action. It confirms that your user has correctly been granted the register action.

-Steve

Re: registration form problem

PostPosted: Mon Jul 11, 2011 3:08 pm
by manifold
Yes; however, when I register now, it seems a user (other than an admin) is permitted ONLY to register, and not do anything else... including successfully login after receiving his authorization email!

Getting closer...