New user, backend access default setting
When adding a new user, by default "This user can access site backend" is checked off (screencast.com/.../lwX5Njp2fU5m).
Is there a way to change this default setting to 'unchecked'?
Hello Greg,
You should map the UserNew template and set the checkbox to be initially false. You can do this through Administration -> Settings -> Advanced -> Controls -> ViewMap. Create New and add to HostType: Telerik.Sitefinity.Security.Web.UI.Principals.UserNewDialog, Telerik.Sitefinity, in LayoutTemplatePath set the path to the new template. Example. I have attached the modified view for the UserNewDialog. After adding the ViewMap, restart the application. Now the checkbox should be initially not checked.
Regards,
Nikola Zagorchev
Telerik
Nikola,
Thank you. This worked.
Hi Greg,
I am glad you have achieved what you wanted. Write back if you have any questions.
Regards,
Nikola Zagorchev
Telerik
It only works the first time though... Click create a user, then back to Users, then Create a User. The box is checked the second time through.
Hi
You have to set the checked property in the ClearForm function from the ascx, as well:
function
ClearForm()
var
chkUserIsBackendUser = $get(
'<%= chkUserIsBackendUser.ClientID %>'
);
var
formIndex = 0;
var
usernameField = $get(
'UserName'
+ formIndex);
var
passwordField = $get(
'Password'
+ formIndex);
var
emailField = $get(
'Email'
+ formIndex);
var
confirmPasswordField = $get(
'ConfirmPassword'
+ formIndex);
var
passwordQuestionField = $get(
'PasswordQuestion'
+ formIndex);
var
passwordAnswerField = $get(
'PasswordAnswer'
+ formIndex);
var
commentField = $get(
'Comment'
+ formIndex);
usernameField.value =
''
;
passwordField.value =
''
;
emailField.value =
''
;
confirmPasswordField.value =
''
;
passwordQuestionField.value =
''
;
passwordAnswerField.value =
''
;
commentField.value =
''
;
var
profilesDataControl = $find(
"<%= profilesData.ClientID %>"
);
profilesDataControl.reset();
$(
'input[name="roles"]'
).each(
function
(i)
$(
this
).removeAttr(
'checked'
);
);
// Modified
chkUserIsBackendUser.checked =
false
;
chkUserIsBackendUser.disabled =
false
;
window.scrollTo(0, 0);
That works... Thanks!
Hello
Thank you for letting me know. Glad it works on your end, as well.
Regards,
Nikola Zagorchev
Telerik