Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- define('DRUPAL_ROOT', getcwd() . "/..");
- require_once DRUPAL_ROOT . '/includes/bootstrap.inc';
- drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
- $username = "Silox";
- $password = "hidden";
- global $user;
- $account = user_authenticate($username, $password);
- // Woah, it seems like we don't know this user, let's create him!
- if (!$account) {
- $userinfo = array(
- 'name' => $username,
- 'pass' => $password,
- 'init' => $username,
- 'status' => 1,
- 'access' => REQUEST_TIME,
- );
- $account = user_save(drupal_anonymous_user(), $userinfo);
- $account = user_authenticate($username, $password);
- }
- $user = user_load($account, TRUE);
- drupal_session_regenerate();
- ?>
- <?php
- chdir('../');
- require_once './includes/bootstrap.inc';
- drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement