function filter_init()
 {
     global $conf, $user;
     // Inject values into the $conf array - will apply to all sites.
     // This can be a useful place to apply generic development settings.
     $conf_inject = unserialize(urldecode(runserver_env('RUNSERVER_CONF')));
     // Merge in the injected conf, overriding existing items.
     $conf = array_merge($conf, $conf_inject);
     // Log in user if needed.
     if (isset($_GET['login'])) {
         $uid = runserver_env('RUNSERVER_USER');
         if (!empty($uid) && $user->uid !== $uid) {
             // If a user was provided, log in as this user.
             $user = user_load($uid);
             if (function_exists('drupal_session_regenerate')) {
                 // Drupal 7
                 drupal_session_regenerate();
             } else {
                 // Drupal 6
                 sess_regenerate();
             }
         }
         // Refresh the page (in case access denied has been called already).
         drupal_goto($_GET['q']);
     }
 }
예제 #2
1
 function system_boot()
 {
     global $conf, $user;
     // Inject values into the $conf array - will apply to all sites.
     // This can be a useful place to apply generic development settings.
     $conf_inject = unserialize(urldecode($_SERVER['RUNSERVER_CONF']));
     // Merge in the injected conf, overriding existing items.
     $conf = array_merge($conf, $conf_inject);
     if (isset($_SERVER['RUNSERVER_USER'])) {
         // If a user was provided, log in as this user.
         $user = unserialize(urldecode($_SERVER['RUNSERVER_USER']));
         if (function_exists('drupal_session_regenerate')) {
             // Drupal 7
             drupal_session_regenerate();
         } else {
             // Drupal 6
             sess_regenerate();
         }
     }
 }