2018-06-04 00:06:17 +08:00
|
|
|
(function (global, document) {
|
|
|
|
|
|
|
|
// Get self details.
|
|
|
|
global.selfGet = function(callback) {
|
|
|
|
var json = {
|
|
|
|
"session": global.cookieGet("session"),
|
|
|
|
};
|
|
|
|
|
2018-06-05 18:01:14 +08:00
|
|
|
global.post(global.commento_origin + "/api/owner/self", json, function(resp) {
|
2018-06-04 00:06:17 +08:00
|
|
|
if (!resp.success || !resp.loggedIn) {
|
|
|
|
document.location = "/login";
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
global.owner = resp.owner;
|
|
|
|
callback();
|
|
|
|
});
|
|
|
|
};
|
|
|
|
|
|
|
|
}(window, document));
|