Good afternoon! I am developing a stand-alone application, which uses drupal functions and I faced with some troubles. First of all my application must check has the user access to this application and if he doesn't have permissions show error message. If user is logged on and has permissions my application must show him some actions... First of all I created subdomain in Apache, for example I named it:
myapps.site.com. The trouble is: when unauthorized user entered this address, main page of site.com is loaded (not my page with error message), but when he printed myapps.site.com/index.php everything is OK and error message loads. When authorized user enteres this page everything is OK. WTF? I have checked, that the problem is with drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
Here is my sample of code:

<?php
    chdir
('/www/mysite/');
    require_once
'./includes/bootstrap.inc';
require_once
'./includes/form.inc';
// Here is problem
// if I comment this and show only err message  everything is also OK
   
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
    global
$user;
   
// Here I am loading additional info to check if the user has access
   
profile_load_profile(&$user);
    echo
'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <link rel="stylesheet" href="styles/styles.css" />
    <script src="jscripts/jQuery.js"></script>
    <title>app</title>
    </head>
    <body>'
;
   
//  here i check user priviliges
   
if (!$user->uid || $user->profile_is_priviliged == FALSE )
    {
       echo
'some err msg';
    }
    else
    {
        echo
'some actions';       
    }
    echo
'</body></html>';
?>

Can anyone help me please with this error. Thanks!

Comments

I'm not exactly sure what you are doing

Can you provide more details as to what you are trying to achieve? It might make a lot more sense to just build your application "inside" Drupal rather than using the approach you are taking.

Okay. I have registered a

Okay. I have registered a subdomain ex. app.mysite.com. mysite.com is developed on Drupal. app.mysite.com does not developed on Drupal, but I need to use some Drupal functions from my scripts. To do this I need bootstrap drupal drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL); as I have read . But if unregistered user visits my page app.mysite.com, main page of mysite.com is loaded (without pictures, only text). But if unregistered user visits app.mysite.com/index.php everything is OK... This problem is actual only for unregistred users (that who are registred comes on app.mysite.com normally). I tried to use domain module, but I have no success.
May be there are some other variants how to do this?

nobody click here