mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
added some user access settings
This commit is contained in:
parent
1663b40737
commit
a2ce0bdce6
10 changed files with 252 additions and 19 deletions
31
ApiClient.js
31
ApiClient.js
|
@ -1432,9 +1432,9 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout) {
|
|||
/**
|
||||
* Gets all users from the server
|
||||
*/
|
||||
self.getUsers = function () {
|
||||
self.getUsers = function (options) {
|
||||
|
||||
var url = self.getUrl("users");
|
||||
var url = self.getUrl("users", options || {});
|
||||
|
||||
return self.ajax({
|
||||
type: "GET",
|
||||
|
@ -1870,6 +1870,32 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout) {
|
|||
return files;
|
||||
};
|
||||
|
||||
/**
|
||||
* Authenticates a user
|
||||
* @param {String} name
|
||||
* @param {String} password
|
||||
*/
|
||||
self.authenticateUserByName = function (name, password) {
|
||||
|
||||
if (!name) {
|
||||
throw new Error("null name");
|
||||
}
|
||||
|
||||
var url = self.getUrl("Users/" + name + "/authenticatebyname");
|
||||
|
||||
var postData = {
|
||||
password: MediaBrowser.SHA1(password || "")
|
||||
};
|
||||
|
||||
return self.ajax({
|
||||
type: "POST",
|
||||
url: url,
|
||||
data: JSON.stringify(postData),
|
||||
dataType: "json",
|
||||
contentType: "application/json"
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Authenticates a user
|
||||
* @param {String} userId
|
||||
|
@ -1891,6 +1917,7 @@ MediaBrowser.ApiClient = function ($, navigator, JSON, WebSocket, setTimeout) {
|
|||
type: "POST",
|
||||
url: url,
|
||||
data: JSON.stringify(postData),
|
||||
dataType: "json",
|
||||
contentType: "application/json"
|
||||
});
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue