- Code: Select all
Parse error: parse error, unexpected ';', expecting T_FUNCTION in /home/path/to/conf/ApplicationDelegate.php on line 32
original function added as per basic tutorial (this works, and I get the login prompt and can login as both "admin" and "publicuser"):
- Code: Select all
function getPermissions(&$record){
$auth =& Dataface_AuthenticationTool::getInstance();
$user =& $auth->getLoggedInUser();
if ( !isset($user) ) return Dataface_PermissionsTool::NO_ACCESS();
// if the user is null then nobody is logged in... no access.
// This will force a login prompt.
$role = $user->val('Role');
return Dataface_PermissionsTool::getRolePermissions($role);
// Returns all of the permissions for the user's current role.
}
...function per the online tutorial for creating an online user submission form (this one doesn't work and I get the above php error - copy/pasted directly from the online tutorial):
- Code: Select all
function getPermissions(&$record){
$app =& Dataface_Application::getInstance();
$query =& $app->getQuery();
if ( $query['-action'] == 'new'){
return Dataface_PermissionsTool::ALL();
} else {
$auth =& Dataface_AuthenticationTool::getInstance();
$user =& $auth->getLoggedInUser();
if ( $user and isAdmin($user->val('role'))){
return Dataface_PermissionsTool::ALL();
} else {
return Dataface_PermissionsTool::NO_ACCESS();
}
}
}
Please advise what I've done wrong. Thanks.
Michael Wassil