Module: Lwqzx

Defined in:
lib/lwqzx.rb,
lib/lwqzx/version.rb

Constant Summary collapse

VERSION =
"0.0.6"

Class Method Summary collapse

Class Method Details

.auth(login, passwd) ⇒ Object



5
6
7
8
9
10
11
12
13
14
# File 'lib/lwqzx.rb', line 5

def self.auth(,passwd)
  lurl = "http://www.lwqzx.sdedu.net/kernel/net_school/core/jslogin.php"
  res = ::RestClient.post lurl,{login: , password: passwd}
  hsh = ::JSON.parse(res.body)
  return {} if hsh["name"].empty?
   = hsh["login"]
  name = hsh["name"]
  groups = hsh["user_group"]
  return {login: , name: name, groups: groups}
end