Some questions on xataface 2.0

Archived from the Xataface Users forum.

insyte — Tue Oct 30, 2012 8:38 pm

Hi I’m trying to update my database project to xataface 2.0 because I really need to use the depselect and htmlreports module. But I can’t seem to figure out some basic stuff. Here are my questions.

  1. How do i require users to log in to access the site in xataface 2.0? This doesn’t work anymore.
Code: Select all
`<?

class conf_ApplicationDelegate {
   
     function getPermissions(&$record){
         $auth =& Dataface_AuthenticationTool::getInstance();
         $user =& $auth->getLoggedInUser();
         if ( !isset($user) ) return Dataface_PermissionsTool::NO_ACCESS();
       
         $role = $user->val(‘Role’);
         return Dataface_PermissionsTool::getRolePermissions($role);
             // Returns all of the permissions for the user’s current role.
      }
}
?>`

  1. Where do i define permissions for tables such as users.php? The code below also doesn’t work anymore for xataface 2.0.
Code: Select all
`<?
class tables_users {

   function getPermissions($record){
        if ( isAdmin() ) return null;
        $perms[‘register’] = 1;
        $perms[‘view’]=1;
        return $perms;
   }
     
   function role__permissions(&$record){
    if ( isAdmin() ) return null;
    return Dataface_PermissionsTool::READ_ONLY();
}
   
   function username__permissions(&$record) {
      if (!isAdmin() ) return array(‘edit’=>0);
      return null;
}
    }
?>`

  1. How do I change the logo if Im using the g2 module?

Thanks in advance.


shannah — Wed Oct 31, 2012 7:32 am

Permissions are unchanged in 2.0 so far as your inquiry is concerned. The problem must be elsewhere.
As for the logo, you can change it with pure CSS. Add a CSS file and target the #xf-logo element. E.g.

Code: Select all
#xf-logo {    background-image: url(../images/survey_builder_logo_150x84-export.png);    height: 84px;     }

-Steve


insyte — Thu Nov 01, 2012 4:20 pm

Thank you


insyte — Thu Nov 15, 2012 4:05 am

I figured out my problem, it was due to file permissions. I just had to chmod 777 some files

I have another question though.

How can I make the bread crumbs on the left side bar and the one above, to also use the first name since only the last name is being used?

Thanks again


shannah — Thu Nov 15, 2012 8:58 am

Implement the getTitle() method in the delegate class.
e.g.

Code: Select all
function getTitle(Dataface_Record $record){     return $record->val('first_name').' '.$record->val('last_name'); }

insyte — Sun Nov 18, 2012 9:57 pm

Thanks again. Everything is working now


arthrqgtch — Thu Nov 22, 2012 2:43 am

I can’t realize about the session-id here…