Alter user passwords


	require_once 'includes/password.inc';
	$uids = db_select('users', 'u')
	->fields('u', array('uid'))
	->execute()->fetchCol();
	
	foreach($uids as $uid) {
		$user = null;
		if ($uid != 0) {
			$user = user_load($uid);
			$user->pass = user_hash_password('test');
			user_save($user);
		}
	}

Add new comment

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
By submitting this form, you accept the Mollom privacy policy.