From f21a9fdffe2c7d72a50533ae2466938de5a0a8ee Mon Sep 17 00:00:00 2001 From: Christoph Burschka Date: Sat, 18 Jan 2014 13:03:11 +0100 Subject: Implement session auth for Drupal. --- plugins/drupal7/drupal7.module | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'plugins/drupal7') diff --git a/plugins/drupal7/drupal7.module b/plugins/drupal7/drupal7.module index 0c593cd..e1cd857 100644 --- a/plugins/drupal7/drupal7.module +++ b/plugins/drupal7/drupal7.module @@ -2,7 +2,7 @@ use Drupal\Core\DrupalKernel; -function drupal7_init($config) { +function drupal7_bootstrap($config) { define('DRUPAL_ROOT', $config['root_path']); $_SERVER['REMOTE_ADDR'] = '127.0.0.1'; require_once DRUPAL_ROOT . '/includes/bootstrap.inc'; @@ -10,5 +10,14 @@ function drupal7_init($config) { require_once __DIR__ . '/BridgeDrupal7.php'; drupal_static('conf_path', "sites/{$config['site']}"); drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL); +} + +function drupal7_init($config) { + drupal7_bootstrap($config); return new BridgeDrupal7(); -} \ No newline at end of file +} + +function drupal7_session($config) { + drupal7_bootstrap($config); + return user_is_logged_in() ? $GLOBALS['user']->name : FALSE; +} -- cgit v1.1