lawn-login 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of lawn-login might be problematic. Click here for more details.
- data.tar.gz.sig +0 -0
- data/README.txt +0 -4
- data/bin/lawn +7 -2
- data/lib/lawn.rb +5 -1
- metadata +2 -2
- metadata.gz.sig +0 -0
data.tar.gz.sig
CHANGED
Binary file
|
data/README.txt
CHANGED
data/bin/lawn
CHANGED
@@ -37,7 +37,7 @@ end
|
|
37
37
|
if options[:password]
|
38
38
|
puts info[:encrypted_password]
|
39
39
|
print "New LAWN password? "
|
40
|
-
puts info[:encrypted_password] = Lawn.encrypt_password(Lawn
|
40
|
+
puts info[:encrypted_password] = Lawn.encrypt_password(Lawn.get_encryption_password(info[:username]), gets.chomp)
|
41
41
|
|
42
42
|
File.open(file, 'w') { |f|
|
43
43
|
f.write(YAML::dump(info))
|
@@ -47,4 +47,9 @@ end
|
|
47
47
|
|
48
48
|
PASSWORD = Lawn.decrypt_password(Lawn.get_encryption_password(info[:username]), info[:encrypted_password])
|
49
49
|
USERNAME = info[:username]
|
50
|
-
|
50
|
+
result = Lawn.login(USERNAME, PASSWORD)
|
51
|
+
if result == 1
|
52
|
+
puts "Logged in successfully."
|
53
|
+
else
|
54
|
+
puts "An error occured, e.g. you're already logged in."
|
55
|
+
end
|
data/lib/lawn.rb
CHANGED
@@ -2,7 +2,7 @@ require 'rubygems'
|
|
2
2
|
require 'ezcrypto'
|
3
3
|
module Lawn
|
4
4
|
extend self
|
5
|
-
VERSION = "0.0.
|
5
|
+
VERSION = "0.0.7"
|
6
6
|
|
7
7
|
def get_encryption_password(username)
|
8
8
|
if username.length < 7
|
@@ -19,4 +19,8 @@ module Lawn
|
|
19
19
|
def decrypt_password(encryption_password, password)
|
20
20
|
EzCrypto::Key.decrypt_with_password encryption_password, "salt", password
|
21
21
|
end
|
22
|
+
|
23
|
+
def login(username, password)
|
24
|
+
`curl -s -f -F username=\'#{username}\' -F password=\'#{password}\' -F iss=\'false\' -F output=\'binary\' https://auth.lawn.gatech.edu/index.php`
|
25
|
+
end
|
22
26
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lawn-login
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mike Skalnik
|
@@ -30,7 +30,7 @@ cert_chain:
|
|
30
30
|
jjVX87g40jCN9NIGt+c=
|
31
31
|
-----END CERTIFICATE-----
|
32
32
|
|
33
|
-
date: 2008-09-
|
33
|
+
date: 2008-09-25 00:00:00 -04:00
|
34
34
|
default_executable:
|
35
35
|
dependencies:
|
36
36
|
- !ruby/object:Gem::Dependency
|
metadata.gz.sig
CHANGED
Binary file
|