Error using field_UserName function.

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

Error using field_UserName function.

Postby jvinolas » Fri Aug 27, 2010 2:29 am

Hi,

I'm using authentication with no problems at all. But, when a user edits their own profile, the field UserName appears blank, and I would like it to be the username by default. I know I can do it with this code:

Code: Select all
function field__UserName(&$record){
   $auth =& Dataface_AuthenticationTool::getInstance();
       $user =& $auth->getLoggedInUser();
       if ($user and $user->val('UserName')){
               return $user->val('UserName');}
}


But this error comes as I apply the code:

CREATE VIEW command denied to user 'lesmeves_oiko'@'localhost' for table 'dataface__view_users_d18a8d7ff3c4d268255d2ca340a227b5'


Also, it is not working the code to disallow editing of field UserName that I use in other fields with no problem. This is the code:

Code: Select all
function UserName__permissions(&$record){
   $auth =& Dataface_AuthenticationTool::getInstance();
         $user =& $auth->getLoggedInUser();
         if ( !isset($user) ) {return Dataface_PermissionsTool::NO_ACCESS();
         $role = $user->val('Role');
         if ( $role!="ADMINISTRACIO"){
             return array('edit'=>0);   
         } else {
               return null;
         }
}


I would really appreciate any information about those problems.
jvinolas
 
Posts: 51
Joined: Thu Apr 15, 2010 12:31 am

Re: Error using field_UserName function.

Postby shannah » Wed Sep 01, 2010 11:11 am

Can you check your mysql permssions and make sure that the user that xataface is using to connect to the database (i.e. the username/pass in the conf.ini file) has permission to create views?
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm


Return to Xataface Users

Who is online

Users browsing this forum: No registered users and 41 guests

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