Sometime since 3/20 it seems that the -u command line option to drush.php stopped working - $user is left as anonymous even though a different userid was set. This is causing me lots of immediate grief as I'm using drush to make calls to node_delete which checks access.

Comments

moshe weitzman’s picture

Assigned: Unassigned » adrian
adrian’s picture

works fine here :

Moya:~ adrian$ php /Users/adrian/Projects/hosting/drush/drush.php --root='/Users/adrian/Projects/hosting/platforms/DRUPAL-6' --uri='http://includetest.dev' -u 1 status
  Drupal Root       : /Users/adrian/Projects/hosting/platforms/DRUPAL-6
  Drupal version    : 6.10
  Site Path         : sites/includetest.dev
  Site URI          : http://includetest.dev
  Database Driver   : mysql
  Database Hostname : localhost
  Database Username : site_1700
  Database Name     : site_1700
  Database Name     : V4mtRWD4TU
  Database          : Connected
  Drupal Bootstrap  : Successful
  Drupal User       : admin

Text string too.

[?
Moya:~ adrian$ php /Users/adrian/Projects/hosting/drush/drush.php --root='/Users/adrian/Projects/hosting/platforms/DRUPAL-6' --uri='http://includetest.dev' -u admin status
Drupal Root : /Users/adrian/Projects/hosting/platforms/DRUPAL-6
Drupal version : 6.10
Site Path : sites/includetest.dev
Site URI : http://includetest.dev
Database Driver : mysql
Database Hostname : localhost
Database Username : site_1700
Database Name : site_1700
Database Name : V4mtRWD4TU
Database : Connected
Drupal Bootstrap : Successful
Drupal User : admin
?]

I think this is related to the default bootstrap level for commands being BOOTSTRAP_DRUPAL_FULL , and the login happens in DRUPAL_BOOTSTRAP_LOGIN.

adrian’s picture

Status: Active » Fixed

I've changed the default bootstrap phase to DRUSH_BOOTSTRAP_DRUPAL_LOGIN

if -u isn't specified, it will log in as anon

committed.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.