mirror of
https://github.com/oqtane/oqtane.framework.git
synced 2025-05-18 18:44:23 +00:00
bug fixes
This commit is contained in:
parent
8f944e29ac
commit
bdf36fc49c
@ -67,7 +67,7 @@ else
|
|||||||
<td>@context.EffectiveDate</td>
|
<td>@context.EffectiveDate</td>
|
||||||
<td>@context.ExpiryDate</td>
|
<td>@context.ExpiryDate</td>
|
||||||
<td>
|
<td>
|
||||||
<ActionDialog Header="Remove User" Message="@Localizer["Are You Sure You Wish To Remove {0} From This Role?", context.User.DisplayName]" Action="Delete" Security="SecurityAccessLevel.Admin" Class="btn btn-danger" OnClick="@(async () => await DeleteUserRole(context.UserRoleId))" Disabled="@(context.Role.IsAutoAssigned)" ResourceKey="DeleteUserRole" />
|
<ActionDialog Header="Remove User" Message="@Localizer["Are You Sure You Wish To Remove {0} From This Role?", context.User.DisplayName]" Action="Delete" Security="SecurityAccessLevel.Admin" Class="btn btn-danger" OnClick="@(async () => await DeleteUserRole(context.UserRoleId))" Disabled="@(context.Role.IsAutoAssigned || PageState.User.Username == UserNames.Host)" ResourceKey="DeleteUserRole" />
|
||||||
</td>
|
</td>
|
||||||
</Row>
|
</Row>
|
||||||
</Pager>
|
</Pager>
|
||||||
|
@ -152,33 +152,36 @@ else
|
|||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
profiles = await ProfileService.GetProfilesAsync(PageState.Site.SiteId);
|
// OnParametersSetAsync is called when the edit modal is closed - in which case there is no id parameter
|
||||||
|
if (PageState.QueryString.ContainsKey("id"))
|
||||||
userid = Int32.Parse(PageState.QueryString["id"]);
|
|
||||||
var user = await UserService.GetUserAsync(userid, PageState.Site.SiteId);
|
|
||||||
if (user != null)
|
|
||||||
{
|
{
|
||||||
username = user.Username;
|
profiles = await ProfileService.GetProfilesAsync(PageState.Site.SiteId);
|
||||||
email = user.Email;
|
userid = Int32.Parse(PageState.QueryString["id"]);
|
||||||
displayname = user.DisplayName;
|
var user = await UserService.GetUserAsync(userid, PageState.Site.SiteId);
|
||||||
if (user.PhotoFileId != null)
|
if (user != null)
|
||||||
{
|
{
|
||||||
photofileid = user.PhotoFileId.Value;
|
username = user.Username;
|
||||||
photo = await FileService.GetFileAsync(photofileid);
|
email = user.Email;
|
||||||
|
displayname = user.DisplayName;
|
||||||
|
if (user.PhotoFileId != null)
|
||||||
|
{
|
||||||
|
photofileid = user.PhotoFileId.Value;
|
||||||
|
photo = await FileService.GetFileAsync(photofileid);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
photofileid = -1;
|
||||||
|
photo = null;
|
||||||
|
}
|
||||||
|
settings = await SettingService.GetUserSettingsAsync(user.UserId);
|
||||||
|
createdby = user.CreatedBy;
|
||||||
|
createdon = user.CreatedOn;
|
||||||
|
modifiedby = user.ModifiedBy;
|
||||||
|
modifiedon = user.ModifiedOn;
|
||||||
|
deletedby = user.DeletedBy;
|
||||||
|
deletedon = user.DeletedOn;
|
||||||
|
isdeleted = user.IsDeleted.ToString();
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
photofileid = -1;
|
|
||||||
photo = null;
|
|
||||||
}
|
|
||||||
settings = await SettingService.GetUserSettingsAsync(user.UserId);
|
|
||||||
createdby = user.CreatedBy;
|
|
||||||
createdon = user.CreatedOn;
|
|
||||||
modifiedby = user.ModifiedBy;
|
|
||||||
modifiedon = user.ModifiedOn;
|
|
||||||
deletedby = user.DeletedBy;
|
|
||||||
deletedon = user.DeletedOn;
|
|
||||||
isdeleted = user.IsDeleted.ToString();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
|
@ -52,7 +52,7 @@ namespace Oqtane.Controllers
|
|||||||
public Role Get(int id)
|
public Role Get(int id)
|
||||||
{
|
{
|
||||||
var role = _roles.GetRole(id);
|
var role = _roles.GetRole(id);
|
||||||
if (role != null && role.SiteId == _alias.SiteId)
|
if (role != null && (role.SiteId == _alias.SiteId || User.IsInRole(RoleNames.Host)))
|
||||||
{
|
{
|
||||||
return role;
|
return role;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user