lib/lumberg/whm/account.rb in lumberg-2.0.0.pre4 vs lib/lumberg/whm/account.rb in lumberg-2.0.0.pre5
- old
+ new
@@ -40,11 +40,11 @@
# * <tt>:username</tt> - PENDING
# * <tt>:password</tt> - PENDING
def change_password(options = {})
options[:user] = options.delete(:username)
options[:pass] = options.delete(:password)
- server.perform_request('passwd', options.merge(:response_key => 'passwd'))
+ server.perform_request('passwd', options.merge(response_key: 'passwd'))
end
# Displays pertinent information about a specific account
#
# ==== Required
@@ -157,11 +157,11 @@
# Obtains user data for a specific domain
#
# ==== Required
# * <tt>:domain</tt> - PENDING
def domain_user_data(options = {})
- server.perform_request('domainuserdata', options.merge(:response_key => 'userdata')) do |s|
+ server.perform_request('domainuserdata', options.merge(response_key: 'userdata')) do |s|
s.boolean_params = :hascgi
end
end
# Prevents a cPanel user from accessing his or her account. Once an account is suspended, it can be un-suspended to allow a user to access the account again
@@ -194,11 +194,11 @@
#
# ==== Required
# * <tt>:username</tt> - PENDING
def privs(options ={})
verify_user(options[:username]) do
- resp = server.perform_request('myprivs', options.merge(:response_key => 'privs')) do |s|
+ resp = server.perform_request('myprivs', options.merge(response_key: 'privs')) do |s|
s.boolean_params = :all
end
# if you get this far, it's successful
resp[:success] = true
resp
@@ -224,11 +224,11 @@
# * <tt>:mail</tt> - PENDING
# * <tt>:mysql</tt> - PENDING
# * <tt>:subs</tt> - PENDING
def restore_account(options = {})
options[:user] = options.delete(:username) if options[:username]
- server.perform_request('restoreaccount', options.merge(:response_key => 'metadata'))
+ server.perform_request('restoreaccount', options.merge(response_key: 'metadata'))
end
protected
# Some WHM API methods always return a result, even if the user
# doesn't actually exist. This makes it seem like your request
@@ -237,10 +237,10 @@
# Example
# verify_user('bob') do
# change_password()
# end
def verify_user(username, &block)
- exists = summary(:username => username)
+ exists = summary(username: username)
if exists[:success]
yield
else
raise WhmInvalidUser, "User #{username} does not exist"
end