Migration problem.

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

Migration problem.

Postby jvinolas » Thu Jul 01, 2010 4:38 am

HI,

I created a local application and tried to make it work on domain. Changed database config, but when I point to the root of my application folder what I get is part of ApplicationDelegate.php, which is the same that it is working on my local installation. What I get in browser (as text) is this:

getLoggedInUser(); if ( !isset($user) ) return Dataface_PermissionsTool::NO_ACCESS(); // if the user is null then nobody is logged in... no access. // This will force a login prompt. $role = $user->val('Role'); $app =& Dataface_Application::getInstance(); $tables =& $app->_conf['_tables']; if ($role=="EDIT"){ unset($tables['resultats_classificacio']); unset($tables['users']); } return Dataface_PermissionsTool::getRolePermissions($role); // Returns all of the permissions for the user's current role. } /* function after_action_new(){ $app =& Dataface_Application::getInstance(); $query =& $app->getQuery(); $query['-action'] = 'browse'; $url = $app->url($query).'&--msg='.urlencode('Record added. You may add another record'); header("Location: $url"); exit; } */ } ?>

That is part of my ApplicationDelegate.php:

<?
/**
* A delegate class for the entire application to handle custom handling of
* some functions such as permissions and preferences.
*/
class conf_ApplicationDelegate {
/**
* Returns permissions array. This method is called every time an action is
* performed to make sure that the user has permission to perform the action.
* @param record A Dataface_Record object (may be null) against which we check
* permissions.
* @see Dataface_PermissionsTool
* @see Dataface_AuthenticationTool
*/
function getPermissions(&$record){
$auth =& Dataface_AuthenticationTool::getInstance();
$user =& $auth->getLoggedInUser();
if ( !isset($user) ) return Dataface_PermissionsTool::NO_ACCESS();
// if the user is null then nobody is logged in... no access.
// This will force a login prompt.
$role = $user->val('Role');.......


I have other xataface applications working well in my domain, but don't know what is causing this.

Thanks.
jvinolas
 
Posts: 51
Joined: Thu Apr 15, 2010 12:31 am

Re: Migration problem.

Postby jvinolas » Thu Jul 01, 2010 8:27 am

Hi again,

I've disabled authentication (removed ApplicationDelegate, removed _auth from conf.ini and other authentication functions and then it works). But, what is the problem with my actual ApplicationDelegate? (it works on local but not in domain, even the database and users table is created, well backed up direcltly from my local mysql to the domain).

This is my ApplicationDelegate:

Code: Select all
<?
/**
* A delegate class for the entire application to handle custom handling of
* some functions such as permissions and preferences.
*/
class conf_ApplicationDelegate {
    /**
     * Returns permissions array.  This method is called every time an action is
     * performed to make sure that the user has permission to perform the action.
     * @param record A Dataface_Record object (may be null) against which we check
     *               permissions.
     * @see Dataface_PermissionsTool
     * @see Dataface_AuthenticationTool
     */
     function getPermissions(&$record){
         $auth =& Dataface_AuthenticationTool::getInstance();
         $user =& $auth->getLoggedInUser();
         if ( !isset($user) ) return Dataface_PermissionsTool::NO_ACCESS();
             // if the user is null then nobody is logged in... no access.
             // This will force a login prompt.
         $role = $user->val('Role');

        // Disables tables depending on rights.
        /*
        $app =& Dataface_Application::getInstance();
        $tables =& $app->_conf['_tables'];
        if ($role=="EDIT"){
                unset($tables['resultats_classificacio']);
                unset($tables['users']);
        }
        */

         return Dataface_PermissionsTool::getRolePermissions($role);
         // Returns all of the permissions for the user's current role.
      }
}
?>


And my conf.ini

Code: Select all
;;Configuration settings for application
title="lime_survey"

[_database]
        host="localhost"
        name="lime"
        user="XXXX"
        password="XXXXX"

[_auth]
     users_table=users
     username_column=Usuari
     password_column=Clau

[_tables]

r_dades = "Dades Alumnes"
r_classificacio = "Graf. Questionari"
resultats_classificacio = "Tipus Preguntes"
users = "Usuaris"

[_modules]
modules_DataGrid=modules/DataGrid/DataGrid.php

[languages]
en=English
ca="Catala"


Don't know what is causing this error, but it is due to rights. I will double check users table, but I'm pretty sure it is ok because I can edit it through my xataface app when authentication is disabled.

Thanks.-
jvinolas
 
Posts: 51
Joined: Thu Apr 15, 2010 12:31 am

Re: Migration problem.

Postby shannah » Mon Jul 05, 2010 4:36 pm

Your server doesn't have short_open_tags enabled. You need to either enable short open tags in your php.ini file or you need to change your open tags to full tags.

i.e.g
change
Code: Select all
<?

to
Code: Select all
<?php
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Re: Migration problem.

Postby jvinolas » Tue Jul 06, 2010 10:30 am

It was making me crazy! Thanks a lot, now it is working as it should.
jvinolas
 
Posts: 51
Joined: Thu Apr 15, 2010 12:31 am


Return to Xataface Users

Who is online

Users browsing this forum: No registered users and 22 guests

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