Dashboard permissions

Hi,
I know I've probably made some really basic error but I'd be grateful for some help. I've implemented a dashboard as per the tutorial and enabled permissions in conf.ini and ApplicationDelegate.php:
[_auth]
users_table=users
username_column=username
password_column=password
I've added the following to actions.ini:
[dashboard]
permission = view
I've added the following in dashboard.php in the dashboard table folder:
The dashboard works fine, but when not logged in although all the other tables request a login, the dashboard is available to any anymous user, with the dropdown lists populated. If I comment out the beforeHandleRequest method in ApplicationDelegate.php going to the dashboard tab then also requests a login.
Thanks for a great tool and any advice you can give.
Regards
Phil
I know I've probably made some really basic error but I'd be grateful for some help. I've implemented a dashboard as per the tutorial and enabled permissions in conf.ini and ApplicationDelegate.php:
[_auth]
users_table=users
username_column=username
password_column=password
- Code: Select all
<?php
class conf_ApplicationDelegate {
function getPermissions(&$record){
// $record is a Dataface_Record object
$auth =& Dataface_AuthenticationTool::getInstance();
$user =& $auth->getLoggedInUser();
if ( $user ) return Dataface_PermissionsTool::ALL();
else return Dataface_PermissionsTool::NO_ACCESS();
}
function beforeHandleRequest(){
$app =& Dataface_Application::getInstance();
$query =& $app->getQuery();
if ( $query['-table'] == 'dashboard' and ($app->_conf['using_default_action']) ){
$query['-action'] = 'dashboard';
}
}
}
?>
I've added the following to actions.ini:
[dashboard]
permission = view
I've added the following in dashboard.php in the dashboard table folder:
- Code: Select all
<?php
class tables_dashboard {
function getPermissions(&$record){
// $record is a Dataface_Record object
$auth =& Dataface_AuthenticationTool::getInstance();
$user =& $auth->getLoggedInUser();
if ( $user ) return Dataface_PermissionsTool::ALL();
else return Dataface_PermissionsTool::NO_ACCESS();
}
}
?>
The dashboard works fine, but when not logged in although all the other tables request a login, the dashboard is available to any anymous user, with the dropdown lists populated. If I comment out the beforeHandleRequest method in ApplicationDelegate.php going to the dashboard tab then also requests a login.
Thanks for a great tool and any advice you can give.
Regards
Phil