Page 1 of 1

Some questions on xataface 2.0

PostPosted: Tue Oct 30, 2012 8:38 pm
by insyte
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.
      }
}
?>


2. 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;
}
    }
?>


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


Thanks in advance.

Re: Some questions on xataface 2.0

PostPosted: Wed Oct 31, 2012 7:32 am
by shannah
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

Re: Some questions on xataface 2.0

PostPosted: Thu Nov 01, 2012 4:20 pm
by insyte
Thank you :)

Re: Some questions on xataface 2.0

PostPosted: Thu Nov 15, 2012 4:05 am
by insyte
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?

Screenshot.png
Screenshot.png (29.24 KiB) Viewed 8480 times


Thanks again

Re: Some questions on xataface 2.0

PostPosted: Thu Nov 15, 2012 8:58 am
by shannah
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');
}

Re: Some questions on xataface 2.0

PostPosted: Sun Nov 18, 2012 9:57 pm
by insyte
Thanks again. Everything is working now :)

Re: Some questions on xataface 2.0

PostPosted: Thu Nov 22, 2012 2:43 am
by arthrqgtch
I can't realize about the session-id here...