Authentication not working
Posted: Tue Feb 21, 2012 5:05 pm
I added the _auth specs to my config.ini
in the staff table created an ENUM field populated with the built in roles from the xataface/permissions.ini file
added my username and login info and made my role MANAGER.
copied and pasted the code into from the tutorial tar.gz file as per the tutorial
/conf/ApplicationDelegate.php
when I hit the site, it displays part of the code in the ApplicationDelegate php file and nothing else:
is it a php issue with -> ?
our PHP version is 5.3.3 running on Apache/2.2.3 (Red Hat)
Thanks,
Betty
- Code: Select all
[_auth]
users_table = mytablename
username_column = myunfieldname
password_column = mypwfieldname
in the staff table created an ENUM field populated with the built in roles from the xataface/permissions.ini file
added my username and login info and made my role MANAGER.
copied and pasted the code into from the tutorial tar.gz file as per the tutorial
/conf/ApplicationDelegate.php
- Code: Select all
<?
/**
* A delegate class for the entire application to handle custom handling of
* some functions such as permissions and preferences.
*/
class conf_ApplicationDelegate {
/**
* Returns permissions array. This method is called every time an action is
* performed to make sure that the user has permission to perform the action.
* @param record A Dataface_Record object (may be null) against which we check
* permissions.
* @see Dataface_PermissionsTool
* @see Dataface_AuthenticationTool
*/
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.
}
}
?>
when I hit the site, it displays part of the code in the ApplicationDelegate php file and nothing else:
- Code: Select all
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. } } ?>
is it a php issue with -> ?
our PHP version is 5.3.3 running on Apache/2.2.3 (Red Hat)
Thanks,
Betty