Just followed documented steps to setup user login screen on my app.
The “Log In” button/text appears but when clicked I get a blank screen.
I’ve created tbl_admin to hold the username and password.
CREATE TABLE IF NOT EXISTS `tbl_admin` (
`UserID` mediumint(5) unsigned zerofill NOT NULL AUTO_INCREMENT,
`Email` varchar(40) NOT NULL,
`Codeword` varchar(32) NOT NULL,
`Role` enum('No Access','Read Only','Edit','Delete','Owner','User','Admin') DEFAULT 'Read Only',
`CountryID` mediumint(5) unsigned zerofill NOT NULL,
`Phone` varchar(20) NOT NULL,
`DateLoaded` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`UserID`),
UNIQUE KEY `Email` (`Email`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=6 ;
Codeword the password field is encrypted as a MD5 using table fields.ini and xataface table edit screen. Contents confirmed via MySQL phpMyAdmin utility screen.
I’ve added [_Auth] into conf.ini
[_auth]
users_table=tbl_admin
username_column=Email
password_column=Codeword
When I add the function getPermissions code into conf/ApplicationDelegate.php the app just returns a blank screen.
FYI function beforeHandleRequest() previously inserted by me to change my logo image, and works!
<?php
class conf_ApplicationDelegate{
function beforeHandleRequest() {
$app = dataface_Application::getInstance();
$app->addHeadContent(sprintf('<link rel="stylesheet" type="text/css" href="%s"/>',
htmlspecialchars(DATAFACE_SITE_URL.'/style.css')
));
$query =& $app->getQuery();
if (isset($query['-path'])){
languageUtilities::setLanguageFromPath($query['-path']);
}
}
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 remove the function getPermissions code, app runs fine but login screen is blank.
Error log shows the following.
[Fri Jul 28 14:18:57 2017] [error] PHP Warning: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/53/284764/webspace/httpdocs/mydomainname.com/myapp/index.php:1) in /var/www/vhosts/53/284764/webspace/httpdocs/mydomainname.com/myapp/xataface/js.php on line 13
[Fri Jul 28 14:19:25 2017] [error] PHP Warning: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/53/284764/webspace/httpdocs/mydomainname.com/myapp/index.php:1) in /var/www/vhosts/53/284764/webspace/httpdocs/mydomainname.com/myapp/xataface/Dataface/Application.php on line 878
[Fri Jul 28 14:19:25 2017] [error] PHP Warning: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/53/284764/webspace/httpdocs/mydomainname.com/myapp/index.php:1) in /var/www/vhosts/53/284764/webspace/httpdocs/mydomainname.com/myapp/xataface/Dataface/Application.php on line 1584
[Fri Jul 28 14:19:25 2017] [error] PHP Warning: session_start(): Cannot send session cookie - headers already sent by (output started at /var/www/vhosts/53/284764/webspace/httpdocs/mydomainname.com/myapp/index.php:1) in /var/www/vhosts/53/284764/webspace/httpdocs/mydomainname.com/myapp/xataface/Dataface/Application.php on line 1716
What have a missed ? Any thoughts?
Thanks
Regards
AndyB
--
You received this message because you are subscribed to the Google Groups "Xataface" group.
Visit this group at https://groups.google.com/group/xataface.
To view this discussion on the web visit https://groups.google.com/d/msgid/xataface/307f8771-1c9d-4a64-a51e-0e1f9b08fc27%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/xataface/630b7ef7-63be-4207-a27f-dd71955b6998%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/xataface/7a1a1a1c-abfc-4dc7-9d98-a30a463bfb73%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/xataface/cb62adf5-e69b-4f68-8531-47b63b8d5bd3%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/xataface/cb62adf5-e69b-4f68-8531-47b63b8d5bd3%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/xataface/49e7af02-8813-400b-a060-9d0d7f7f516f%40googlegroups.com.