/ Published in: PHP
# HOW TO USE #
1. Copy & save this into scripts folder.
2. cd YOUR-DRUPAL-ROOT-PATH
3. php scripts/YOUR-SCRIPT-FILE
1. Copy & save this into scripts folder.
2. cd YOUR-DRUPAL-ROOT-PATH
3. php scripts/YOUR-SCRIPT-FILE
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
#!/usr/bin/php <?php $users = " first_name last_name\temail\tpassword\n first_name last_name\temail\tpassword\n first_name last_name\temail\tpassword\n first_name last_name\temail\tpassword\n first_name last_name\temail\tpassword\n "; $_SERVER['HTTP_HOST'] = 'default'; $_SERVER['PHP_SELF'] = '/index.php'; $_SERVER['REMOTE_ADDR'] = '127.0.0.1'; $_SERVER['SERVER_SOFTWARE'] = NULL; $_SERVER['REQUEST_METHOD'] = 'GET'; $_SERVER['QUERY_STRING'] = ''; $_SERVER['PHP_SELF'] = $_SERVER['REQUEST_URI'] = '/'; $_SERVER['HTTP_USER_AGENT'] = 'console'; include_once DRUPAL_ROOT . '/includes/password.inc'; include_once DRUPAL_ROOT . './includes/bootstrap.inc'; drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL); foreach ($users as $user) { { continue; } { continue; } $old = user_load_by_mail($user[1]); { continue; } $obj = new stdClass(); $obj->theme = 'garland'; $obj->status = 1; 2 => 'authenticated user', // here is the role list // [ROLE_ID] => '[ROLE_NAME]' ); user_save($obj); } echo 'Done';