I need this module to authenticate most of my users, but I also need to create additional users. (These latter users will never need to login. I'm using the Signup module, and my administrators need to sign them up for things.) The cosign module disables user creation. So I did this:

function cosign_form_alter(&$form, $form_state, $form_id) {
/* cmb  this is disabling admin/user/user/create
  if ($form_id == "user_register") {
    drupal_goto('https://' . $_SERVER['SERVER_NAME'] . base_path());
  } 
cmb */
  if ($form_id == "user_register" && !user_access('administer users')) {
    drupal_goto('https://' . $_SERVER['SERVER_NAME'] . base_path());
  } 

Is there any reason this is a bad idea? The admins will have to be careful not to create a user with the same username as anyone in the cosign system. And I should use my_own_form_alter, but I don't know how to block the drupal_goto.

I also tried disabling the cosign module, creating some users, then re-enabling. That seemed to work too, but I might have to add these fake users occasionally after launch. I'd hate to have to go to maintenance mode each time. Besides, I want the admins to be able to do it....and I don't really want them disabling modules.

Comments

mlhess’s picture

Version: 6.x-1.6 » 7.x-1.x-dev
Issue summary: View changes

In d7, we don't prevent the creation of users. However, you are correct, you need to be careful about username overlap.

mlhess’s picture

Status: Active » Closed (works as designed)