Some questions on xataface 2.0

A place for users and developers of the Xataface to discuss and receive support.

Some questions on xataface 2.0

Postby 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.
      }
}
?>


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.
insyte
 
Posts: 4
Joined: Tue Oct 30, 2012 8:27 pm

Re: Some questions on xataface 2.0

Postby 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
--
Steve Hannah
@shannah78 (on twitter)
sjhannah.com blog
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Re: Some questions on xataface 2.0

Postby insyte » Thu Nov 01, 2012 4:20 pm

Thank you :)
insyte
 
Posts: 4
Joined: Tue Oct 30, 2012 8:27 pm

Re: Some questions on xataface 2.0

Postby 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?

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


Thanks again
insyte
 
Posts: 4
Joined: Tue Oct 30, 2012 8:27 pm

Re: Some questions on xataface 2.0

Postby 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');
}
--
Steve Hannah
@shannah78 (on twitter)
sjhannah.com blog
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Re: Some questions on xataface 2.0

Postby insyte » Sun Nov 18, 2012 9:57 pm

Thanks again. Everything is working now :)
insyte
 
Posts: 4
Joined: Tue Oct 30, 2012 8:27 pm

Re: Some questions on xataface 2.0

Postby arthrqgtch » Thu Nov 22, 2012 2:43 am

I can't realize about the session-id here...
arthrqgtch
 
Posts: 1
Joined: Thu Nov 22, 2012 1:22 am


Return to Xataface Users

Who is online

Users browsing this forum: No registered users and 21 guests

cron
Powered by Dataface
© 2005-2007 Steve Hannah All rights reserved