This patch introduces a single command, cas-user-create, to provision CAS users via drush. This is helpful for us as we run a campus-wide installation of Drupal at our university and utilize drush/features to deploy new sites on a daily basis. We currently provision site owners' accounts using a custom module with its own drush commands, and promote them to the admin role, so they are admins upon first login to their site via CAS. It doesn't make sense to continue this practice as we prepare for D7 since drush now has the user-add-role command, so I wrote this patch to add account creation by drush to CAS. Thanks!

Comments

vinmassaro’s picture

Status: Active » Needs review
StatusFileSize
new1.85 KB

Patch attached.

vinmassaro’s picture

Issue summary: View changes

Added detail.

vinmassaro’s picture

Issue summary: View changes

Clarity

bfroehle’s picture

Looks great. I'll try it out soon and will hopefully commit this later this week. Thanks!

vinmassaro’s picture

StatusFileSize
new1.97 KB

Great! I've made it so an argument is required, so please use this patch.

bfroehle’s picture

StatusFileSize
new1.75 KB

vinmassaro: I've made some revisions and would like to propose an alternative implementation.

The main difference is cas-user-create now only creates one user at a time. This is the same as `drush user-create` and will allow us to extend the interface at a later time to support setting the name and e-mail address when the user is created.

I addition, I've implemented support for the --simulate flag.

Do you approve?

vinmassaro’s picture

Yes, it does make more sense to match the functionality of drush user-create. We usually pass more than one user account at a time so we'll pass this user list to the command multiple times. Thanks.

bfroehle’s picture

Version: 7.x-1.x-dev » 6.x-3.x-dev
Status: Needs review » Patch (to be ported)

Committed to 7.x-1.x. Since folks might want this in 6.x-3.x as well, I'll leave the status as "patch (to be ported)". Thanks!

bfroehle’s picture

Status: Patch (to be ported) » Fixed

Cherry picked the patch in 7.x-1.x and committed to 6.x-3.x. Tested to work okay.

Status: Fixed » Closed (fixed)

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

jmoughon’s picture

Status: Closed (fixed) » Needs work

I am having a few issues with the 6.x-3.2. I upgraded to get Drush functionality. cas-user-create is only working on one of my sites that had not had CAS until 6.x-3.2. All the other sites were upgrades from 6.x-3.1 or 3.0 and they are not working. I get "The drush command 'cas-user-create user' could not be found." I have tried the Dev version as well. I have tried unistalling and reinstalling, running cron and update.php.

bfroehle’s picture

Status: Needs work » Active

Do you need to run "drush cc drush"?

jmoughon’s picture

Status: Active » Closed (fixed)

I was looking for that command. Still somewhat new to Drush. Thanks that fixed it.

jmoughon’s picture

Issue summary: View changes

clarity

  • Commit 8b60634 on 7.x-1.x, 8.x-1.x by bfroehle:
    Issue #1461046 by vinmassaro, bfroehle: Added Drush integration.