@@ -65,14 +65,11 @@ public override IEnumerable<Tab<ContentPropertyDisplay>> Map(IMember source, Map
65
65
66
66
var resolved = base . Map ( source , context ) ;
67
67
68
- // This is kind of a hack because a developer is supposed to be allowed to set their property editor - would have been much easier
69
- // if we just had all of the membership provider fields on the member table :(
70
- // TODO: But is there a way to map the IMember.IsLockedOut to the property ? i dunno.
68
+ // IMember.IsLockedOut can't be set to true, so make it readonly when that's the case (you can only unlock)
71
69
var isLockedOutProperty = resolved . SelectMany ( x => x . Properties ) . FirstOrDefault ( x => x . Alias == Constants . Conventions . Member . IsLockedOut ) ;
72
70
if ( isLockedOutProperty ? . Value != null && isLockedOutProperty . Value . ToString ( ) != "1" )
73
71
{
74
- isLockedOutProperty . View = "readonlyvalue" ;
75
- isLockedOutProperty . Value = _localizedTextService . Localize ( "general" , "no" ) ;
72
+ isLockedOutProperty . Readonly = true ;
76
73
}
77
74
78
75
return resolved ;
@@ -191,28 +188,14 @@ public IEnumerable<ContentPropertyDisplay> MapMembershipProperties(IMember membe
191
188
{
192
189
var properties = new List < ContentPropertyDisplay >
193
190
{
194
- new ContentPropertyDisplay
195
- {
196
- Alias = $ "{ Constants . PropertyEditors . InternalGenericPropertiesPrefix } id",
197
- Label = _localizedTextService . Localize ( "general" , "id" ) ,
198
- Value = new List < string > { member . Id . ToString ( ) , member . Key . ToString ( ) } ,
199
- View = "idwithguid"
200
- } ,
201
- new ContentPropertyDisplay
202
- {
203
- Alias = $ "{ Constants . PropertyEditors . InternalGenericPropertiesPrefix } doctype",
204
- Label = _localizedTextService . Localize ( "content" , "membertype" ) ,
205
- Value = _localizedTextService . UmbracoDictionaryTranslate ( CultureDictionary , member . ContentType . Name ) ,
206
- View = _propertyEditorCollection [ Constants . PropertyEditors . Aliases . Label ] . GetValueEditor ( ) . View
207
- } ,
208
191
GetLoginProperty ( member , _localizedTextService ) ,
209
192
new ContentPropertyDisplay
210
193
{
211
194
Alias = $ "{ Constants . PropertyEditors . InternalGenericPropertiesPrefix } email",
212
195
Label = _localizedTextService . Localize ( "general" , "email" ) ,
213
196
Value = member . Email ,
214
197
View = "email" ,
215
- Validation = { Mandatory = true }
198
+ Validation = { Mandatory = true }
216
199
} ,
217
200
new ContentPropertyDisplay
218
201
{
@@ -221,20 +204,21 @@ public IEnumerable<ContentPropertyDisplay> MapMembershipProperties(IMember membe
221
204
Value = new Dictionary < string , object >
222
205
{
223
206
// TODO: why ignoreCase, what are we doing here?!
224
- { "newPassword" , member . GetAdditionalDataValueIgnoreCase ( "NewPassword" , null ) } ,
207
+ { "newPassword" , member . GetAdditionalDataValueIgnoreCase ( "NewPassword" , null ) }
225
208
} ,
226
- // TODO: Hard coding this because the changepassword doesn't necessarily need to be a resolvable (real) property editor
227
209
View = "changepassword" ,
228
- // Initialize the dictionary with the configuration from the default membership provider
229
- Config = GetPasswordConfig ( member )
210
+ Config = GetPasswordConfig ( member ) // Initialize the dictionary with the configuration from the default membership provider
230
211
} ,
231
212
new ContentPropertyDisplay
232
213
{
233
214
Alias = $ "{ Constants . PropertyEditors . InternalGenericPropertiesPrefix } membergroup",
234
215
Label = _localizedTextService . Localize ( "content" , "membergroup" ) ,
235
216
Value = GetMemberGroupValue ( member . Username ) ,
236
217
View = "membergroups" ,
237
- Config = new Dictionary < string , object > { { "IsRequired" , true } }
218
+ Config = new Dictionary < string , object >
219
+ {
220
+ { "IsRequired" , true }
221
+ }
238
222
}
239
223
} ;
240
224
0 commit comments