goss-resetpw.rb v0.1 -- for Lance, etc to reset passwords
This commit is contained in:
		@@ -16,15 +16,15 @@ class GossamerResetPassword
 | 
				
			|||||||
      # Delete Gossamer MD5 Password
 | 
					      # Delete Gossamer MD5 Password
 | 
				
			||||||
      user.custom_fields.delete('md5_password') # This removes the field completely
 | 
					      user.custom_fields.delete('md5_password') # This removes the field completely
 | 
				
			||||||
      user.save!
 | 
					      user.save!
 | 
				
			||||||
      puts "      STEP 1 COMPLETED: Gossamer MD5 Password custom field removed for username: #{username}"
 | 
					      puts "      STEP 1 COMPLETED: Gossamer MD5 Password custom field removed for username: #{discourse_username}"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      # Set the Discourse password with the `password=` method to properly hash the password
 | 
					      # Set the Discourse password with the `password=` method to properly hash the password
 | 
				
			||||||
      user.password = new_password
 | 
					      user.password = new_password
 | 
				
			||||||
      user.save!
 | 
					      user.save!
 | 
				
			||||||
      puts "      STEP 2 COMPLETED: Discourse Password updated for user: #{username}"
 | 
					      puts "      STEP 2 COMPLETED: Discourse Password updated for username: #{discourse_username}"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    else
 | 
					    else
 | 
				
			||||||
      puts "User not found: #{username}"
 | 
					      puts "User not found: #{discourse_username}"
 | 
				
			||||||
    end
 | 
					    end
 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user