Permalink
Browse files

Login accepts username password

Mechanize instance moved as last param
  • Loading branch information...
1 parent ab80da0 commit 46e9ddfc19fe8befb836b7b6d3b4ad9993fc39dd @jvliwanag jvliwanag committed Oct 17, 2012
Showing with 5 additions and 3 deletions.
  1. +5 −3 conf/oadevenv.rb
View
@@ -6,15 +6,17 @@
$sipxconfig_url = 'http://10.24.7.87:12000/sipxconfig/'
-def login(a=nil)
+def login(username=nil, password=nil, a=nil)
a = Mechanize.new if a.nil?
+ username = $admin_username if username.nil?
+ password = $admin_password if password.nil?
login_p = a.get($sipxconfig_url)
login_f = login_p.form_with(:action => "/sipxconfig/j_acegi_security_check")
throw :login_not_found if login_f.nil?
- login_f['j_username'] = $admin_username
- login_f['j_password'] = $admin_password
+ login_f['j_username'] = username
+ login_f['j_password'] = password
login_f.submit
end

0 comments on commit 46e9ddf

Please sign in to comment.