Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add function to change password

  • Loading branch information...
commit ee9bd0a05b31931265fc5d94815c7a26ff221dee 1 parent 53b1b9a
@lostapathy authored
Showing with 17 additions and 0 deletions.
  1. +17 −0 lib/google_apps_api/provisioning.rb
View
17 lib/google_apps_api/provisioning.rb
@@ -96,6 +96,23 @@ def delete_user(username, *args)
request(:delete_user, options)
end
+ def update_password(username, *args)
+ options = args.extract_options!
+ options.each { |k,v| options[k] = escapeXML(v)}
+
+ res = <<-DESCXML
+ <?xml version="1.0" encoding="UTF-8"?>
+ <atom:entry xmlns:atom="http://www.w3.org/2005/Atom"
+ xmlns:apps="http://schemas.google.com/apps/2006">
+ <atom:category scheme="http://schemas.google.com/g/2005#kind"
+ term="http://schemas.google.com/apps/2006#user"/>
+ <apps:login password="#{options[:password]}" hashFunctionName="#{options[:hash_name]}"/>
+ </atom:entry>
+
+ DESCXML
+ request(:update_user, options.merge(:username => username, :body => res.strip))
+ end
+
end
Please sign in to comment.
Something went wrong with that request. Please try again.