Sha256: 5412efcbdaad0923f06015a9f18d22919d98a99cb1d93f2ef37864dc6a42577e

Contents?: true

Size: 1.08 KB

Versions: 8

Compression:

Stored size: 1.08 KB

Contents

module Solusvm
  # Solusvm::Client is the class for working with clients
  class Client < Base
    # Creates a client
    #
    # Options:
    # * <tt>:username</tt>
    # * <tt>:password</tt>
    # * <tt>:email</tt>
    # * <tt>:firstname</tt>
    # * <tt>:lastname</tt>
    def create(options ={})
      options.merge!(:action => 'client-create')
      perform_request(options)
    end

    # change client password for the solus admin
    def change_password(username, password)
      perform_request({:action => "client-updatepassword", :username => username, :password => password})
      statusmsg.match /success/i
    end

    # checks wether a specific client exists
    def exists?(username)
      perform_request({:action => 'client-checkexists', :username => username})
      statusmsg.match /client exists/i
    end

    # Verify a clients login. Returns true when the specified login is correct
    def authenticate(username, password)
      perform_request({:action => 'client-authenticate', :username => username, :password => password})
      statusmsg.match /validated/i
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
solusvm-0.10.1 lib/solusvm/client.rb
solusvm-0.10.0 lib/solusvm/client.rb
solusvm-0.9.0 lib/solusvm/client.rb
solusvm-0.8.1 lib/solusvm/client.rb
solusvm-0.7.0 lib/solusvm/client.rb
solusvm-0.6.1 lib/solusvm/client.rb
solusvm-0.6.0 lib/solusvm/client.rb
solusvm-0.5.1 lib/solusvm/client.rb