/* * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ function userpasslogin(username, password) { $.post(accounthubapi, { key: apikey, username: username, password: password, action: "auth" }, function (resp) { if (resp.status == "OK") { $.post(accounthubapi, { key: apikey, username: username, action: "userinfo" }, function (resp) { if (resp.status == "OK") { setuser(resp.data.username); setname(resp.data.name); setuid(resp.data.uid); openScreen("home"); } else { showmsg(resp.msg, "danger"); } }, "json"); } else { showmsg(resp.msg, "danger"); } }, "json"); } function codelogin(code) { $.post(accounthubapi, { key: apikey, code: code, action: "codelogin" }, function (resp) { if (resp.status == "OK") { setuser(resp.user.username); setname(resp.user.realname); setuid(resp.user.uid); openScreen("home"); } else { showmsg(resp.msg, "danger"); } }, "json"); } function loadQuickLogin() { $.post(accounthubapi, { key: apikey, gid: 4, action: "getusersbygroup", get: "detail" }, function (resp) { if (resp.status == "OK") { var userhtml = ""; for (var user in resp.users) { var u = resp.users[user]; userhtml += '