Image display not working with authentication

341 views
Skip to first unread message

dethrydr

unread,
Sep 15, 2014, 1:33:46 PM9/15/14
to xata...@googlegroups.com
Steve,

When I enable authentication (any kind) on my application, the image does not get displayed as a logo (detail and edit views); even whilst logged in as 'ADMIN'. When I remove the authentication, the image is displayed. I could not find any documentation to support this. Could you please help?


Thanks and regards,
dethrydr

Steve Hannah

unread,
Sep 15, 2014, 1:49:16 PM9/15/14
to xata...@googlegroups.com
What image are you referring to?  Can you post screenshots and relevant config?


--
You received this message because you are subscribed to the Google Groups "Xataface" group.
Visit this group at http://groups.google.com/group/xataface.
To view this discussion on the web visit https://groups.google.com/d/msgid/xataface/0878e4a2-db23-4996-a182-b4e46a6b298b%40googlegroups.com.



--
Steve Hannah
Web Lite Solutions Corp.
Message has been deleted
Message has been deleted

dethrydr

unread,
Sep 15, 2014, 2:46:36 PM9/15/14
to xata...@googlegroups.com
Steve,

Apologies for the lack of context in my post. I was referring to an image uploaded as a blob, then expected to be used a logo. Xataface detects the logo automatically. The first screenshot (xataface inventory image not showing with auth 2014-09-15.png) shows screenshot of the item detail view without the image. Authentication is enabled (tried both basic and LDAP) and the application delegate class restricts viewing by only logged in users ( as per http://xataface.com/documentation/tutorial/getting_started/permissions)

When I remove the [_auth] section from conf.ini of my application and delete the application delegate class the second screenshot (xataface inventory image showing without auth 2014-09-15.png) is obtained.


Thanks in advance.


Regards.

xataface inventory image not showing with auth 2014-09-15.PNG
xataface inventory image showing without auth 2014-09-15.PNG

Steve Hannah

unread,
Sep 15, 2014, 4:25:58 PM9/15/14
to xata...@googlegroups.com
Try right clicking on the broken image icon, and select "View image in new tab", and see what comes up.  There might be an error message there that will give a clue.  Additionally, you should check your PHP error log.  It is likely that there is a message there that will shed some light.

Steve


--
You received this message because you are subscribed to the Google Groups "Xataface" group.
Visit this group at http://groups.google.com/group/xataface.

dethrydr

unread,
Sep 16, 2014, 4:54:14 AM9/16/14
to xata...@googlegroups.com
Steve,

Firefox does not show the broken image at all. Chrome shows it. the image URL within the frame is:

When I try to open the image in a new tab, the URL in the address bar is:

And the message on the browser pane is:
Access Forbidden


As for the PHP, I am too much of an amateur to understand where the PHP logs are on Debian. I configured in the PHP Apache configuration /etc/php5/apache2/php.ini
error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT & ~E_NOTICE
error_log
=  /var/log/apache2/php_errors.log


Not sure what I'm doing wrong with the PHP log; I feel embarrased, but I feel that the browser error might reveal useful information.


Regards,
dethrydr

dethrydr

unread,
Sep 17, 2014, 4:16:06 AM9/17/14
to xata...@googlegroups.com
I have been playing around with enabling and disabling auth a bit more. I realised that...

  • If auth is disabled then if..
    • ApplicationDelegate.php exists in conf/ (even with an empty class with no functions), then the images do not show.
    • ApplicationDelegate.php is deleted, then the images show
  • If auth is enabled then the images do not show, irrespective of ApplicationDelegate.php
Not sure what's happening.

dethrydr

unread,
Sep 17, 2014, 4:26:52 AM9/17/14
to xata...@googlegroups.com
The above is valid for the G2 theme as well.

Steve Hannah

unread,
Sep 17, 2014, 7:10:07 PM9/17/14
to xata...@googlegroups.com
You really need to find your PHP error log.  You're flying blind without it. Try putting in some intentional syntax errors, then make sure they are logged to your error log.  I can't stress enough how important it is to know where PHP errors are logged.  

On Wed, Sep 17, 2014 at 1:26 AM, dethrydr <deth...@malviya.net> wrote:
The above is valid for the G2 theme as well.

--
You received this message because you are subscribed to the Google Groups "Xataface" group.
Visit this group at http://groups.google.com/group/xataface.

dethrydr

unread,
Sep 18, 2014, 7:15:07 AM9/18/14
to xata...@googlegroups.com
Steve,

It's spooky!! That's exactly what I did yesterday. I intentionally put a "throw new exception ();" in ldap.php and PHP errors are being logged to syslog. The "error_reporting" has been configured to "E_ALL".

Unfortunately, loading the details view of the record with the image does not show up at all. I am puzzled by this. I suspect that this might be related to one or more of...


-dethrydr


Steve Hannah

unread,
Sep 18, 2014, 12:11:45 PM9/18/14
to xata...@googlegroups.com
Can you post the relevant delegate class permissions methods?  Can you send me a link to your app so I can take a look for myself?

--
You received this message because you are subscribed to the Google Groups "Xataface" group.
Visit this group at http://groups.google.com/group/xataface.

dethrydr

unread,
Sep 18, 2014, 1:38:38 PM9/18/14
to xata...@googlegroups.com
Steve,

Thanks for your quick response to this. I appreciate your support in this. My "ApplicationDelegate.php" is as follows:
  <?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 the user is null then nobody is logged in... no access.
       
// This will force a login prompt.
       
if ( ! isset ( $user ) ) return Dataface_PermissionsTool::NO_ACCESS();

        $role
= $user->val('RoleField');

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

     
public function beforeHandleRequest ( ) {
       
Dataface_Application::getInstance ( )
         
->addHeadContent (
            sprintf
(
             
'<link rel="stylesheet" type="text/css" href="%s"/>' ,
              htmlspecialchars
( DATAFACE_SITE_URL . '/style.css' )
           
)
         
);
     
}

 
}
?>

Is there a way to privately send you the link to my app and login credentials?


-dethrydr

Steve Hannah

unread,
Sep 18, 2014, 1:41:11 PM9/18/14
to xata...@googlegroups.com


Just send to my email 

Steve

--
You received this message because you are subscribed to the Google Groups "Xataface" group.
Visit this group at http://groups.google.com/group/xataface.

dethrydr

unread,
Sep 18, 2014, 5:27:21 PM9/18/14
to xata...@googlegroups.com
Sent.

dethrydr

unread,
Sep 19, 2014, 4:30:35 PM9/19/14
to xata...@googlegroups.com
On 19 September 2014 17:34, Steve Hannah wrote:
I took a look at the image, and you have white space at the beginning and possibly at the end of the image output.  This is likely caused by extra whitespace at the end of one or more of your PHP files (after the closing ?>). 

dethrydr

unread,
Sep 19, 2014, 4:33:01 PM9/19/14
to xata...@googlegroups.com
Steve,

Well-spotted! I have a habit of indenting my code, so there were whitespaces before the opening <?php tag. There was no way I could have figured this out. It is working now. If you would like to have a look please do and then let me know and I will reset the test login I provided. Many thanks for your support and help.

-dethrydr.


Reply all
Reply to author
Forward
0 new messages