finish tables api
This commit is contained in:
@@ -3,6 +3,7 @@ using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Pilz.Networking.CloudProviders.Nextcloud.Client;
|
||||
@@ -62,6 +63,11 @@ namespace Pilz.Networking.CloudProviders.Nextcloud
|
||||
}
|
||||
|
||||
public UserInfo? Login(NextcloudLogin login)
|
||||
{
|
||||
return Login(login, true);
|
||||
}
|
||||
|
||||
public UserInfo? Login(NextcloudLogin login, bool checkUser)
|
||||
{
|
||||
// Ensure we are logged out
|
||||
Logout(false);
|
||||
@@ -69,15 +75,20 @@ namespace Pilz.Networking.CloudProviders.Nextcloud
|
||||
// Temporary set user login
|
||||
CurrentLogin = login;
|
||||
|
||||
// Try get user info & check if user is enabled
|
||||
var userInfo = Cloud.GetUserInfo();
|
||||
var isValid = userInfo != null && userInfo.Enabled;
|
||||
if (checkUser)
|
||||
{
|
||||
// Try get user info & check if user is enabled
|
||||
var userInfo = Cloud.GetUserInfo();
|
||||
var isValid = userInfo != null && userInfo.Enabled;
|
||||
|
||||
// If invalid, reset login credentials
|
||||
if (!isValid)
|
||||
CurrentLogin = null;
|
||||
// If invalid, reset login credentials
|
||||
if (!isValid)
|
||||
CurrentLogin = null;
|
||||
|
||||
return userInfo;
|
||||
return userInfo;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public NextcloudLogin? Login(string baseUrl, CancellationToken cancellationToken)
|
||||
|
||||
Reference in New Issue
Block a user