Skip to content

Commit

Permalink
Fix new REST key not confirmed on create and UserDetail block showing…
Browse files Browse the repository at this point in the history
… incorrectly that it was. Fixes #825.
  • Loading branch information
dcs619 committed Feb 4, 2015
1 parent d5f545b commit 722f2a6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
1 change: 1 addition & 0 deletions RockWeb/Blocks/Security/RestKeyDetail.ascx.cs
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ protected void lbSave_Click( object sender, EventArgs e )
userLogin.UserName = Guid.NewGuid().ToString();
}
userLogin.IsConfirmed = true;
userLogin.ApiKey = tbKey.Text;
userLogin.PersonId = restUser.Id;
userLogin.EntityTypeId = entityType.Id;
Expand Down
19 changes: 8 additions & 11 deletions RockWeb/Blocks/Security/UserLoginList.ascx.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ namespace RockWeb.Blocks.Security
[DisplayName( "User Login List" )]
[Category( "Security" )]
[Description( "Block for displaying logins. By default displays all logins, but can be configured to use person context to display logins for a specific person." )]

[ContextAware]
public partial class UserLoginList : Rock.Web.UI.RockBlock
{
Expand All @@ -45,7 +44,7 @@ public partial class UserLoginList : Rock.Web.UI.RockBlock
private int? _personId = null;
private bool _canEdit = false;

#endregion
#endregion Fields

#region Base Control Methods

Expand Down Expand Up @@ -107,13 +106,12 @@ protected override void OnLoad( EventArgs e )
}

ShowDialog();

}

base.OnLoad( e );
}

#endregion
#endregion Base Control Methods

#region Events

Expand Down Expand Up @@ -350,7 +348,7 @@ protected void Block_BlockUpdated( object sender, EventArgs e )
{
}

#endregion
#endregion Events

#region Methods

Expand All @@ -373,11 +371,11 @@ private void BindFilter()
private void BindGrid()
{
int personEntityTypeId = EntityTypeCache.Read( "Rock.Model.Person" ).Id;
if ( ContextTypesRequired.Any( e => e.Id == personEntityTypeId ) && ContextEntity<Person>() == null)
if ( ContextTypesRequired.Any( e => e.Id == personEntityTypeId ) && ContextEntity<Person>() == null )
{
return;
}

var qry = new UserLoginService( new RockContext() ).Queryable()
.Where( l => !_personId.HasValue || l.PersonId == _personId.Value );

Expand Down Expand Up @@ -478,7 +476,7 @@ protected void ShowEdit( int userLoginId )
}

tbUserName.Text = userLogin.UserName;
cbIsConfirmed.Checked = userLogin.IsConfirmed ?? true;
cbIsConfirmed.Checked = userLogin.IsConfirmed ?? false;
cbIsLockedOut.Checked = userLogin.IsLockedOut ?? false;
if ( userLogin.EntityType != null )
{
Expand Down Expand Up @@ -563,7 +561,6 @@ private void HideDialog()
hfActiveDialog.Value = string.Empty;
}


#endregion
}
#endregion Methods
}
}

0 comments on commit 722f2a6

Please sign in to comment.