Skip to content

Commit

Permalink
update check_collective-access.rb
Browse files Browse the repository at this point in the history
Signed-off-by: honza <[email protected]>
  • Loading branch information
honza committed Jan 15, 2019
1 parent b8d07e9 commit d9fab17
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions check_collective-access.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
require 'open-uri'
require 'optparse'
require 'yaml'
require 'openssl'

exit_code = 0
options = {}
Expand Down Expand Up @@ -55,8 +56,8 @@ def usage(optparse)
expected_states = YAML.load(File.read(options[:config]))

begin
html_auth = open("https://#{options[:host]}/service.php/auth/login", :http_basic_authentication=>[options[:user], options[:password]])
html = open("https://#{options[:host]}/index.php/administrate/setup/ConfigurationCheck/DoCheck", "Cookie" => html_auth.meta['set-cookie'].split('; ',2)[0])
html_auth = open("https://#{options[:host]}/service.php/auth/login", :http_basic_authentication=>[options[:user], options[:password]], :ssl_verify_mode => OpenSSL::SSL::VERIFY_NONE)
html = open("https://#{options[:host]}/index.php/administrate/setup/ConfigurationCheck/DoCheck", "Cookie" => html_auth.meta['set-cookie'][/collectiveaccess=[^;]+/], :ssl_verify_mode => OpenSSL::SSL::VERIFY_NONE)
rescue
puts 'Unable to log in to the app, it is either misconfigured or the wrong credentials have been provided'
exit 3
Expand Down

0 comments on commit d9fab17

Please sign in to comment.