@@ -261,7 +261,7 @@ protected virtual void PrepareCustomerModelForEdit(CustomerModel model, Customer
261261 model . LastActivityDate = Services . DateTimeHelper . ConvertToUserTime ( customer . LastActivityDateUtc , DateTimeKind . Utc ) ;
262262 model . LastIpAddress = model . LastIpAddress ;
263263 model . LastVisitedPage = customer . GetAttribute < string > ( SystemCustomerAttributeNames . LastVisitedPage ) ;
264-
264+
265265 foreach ( var tzi in Services . DateTimeHelper . GetSystemTimeZones ( ) )
266266 {
267267 model . AvailableTimeZones . Add ( new SelectListItem { Text = tzi . DisplayName , Value = tzi . Id , Selected = tzi . Id == model . TimeZoneId } ) ;
@@ -635,6 +635,12 @@ public ActionResult Edit(CustomerModel model, bool continueEditing, FormCollecti
635635 return RedirectToAction ( "List" ) ;
636636 }
637637
638+ if ( customer . IsAdmin ( ) && ! Services . WorkContext . CurrentCustomer . IsAdmin ( ) )
639+ {
640+ NotifyError ( T ( "Admin.Customers.CustomerRoles.OnlyAdminsAllowed" ) ) ;
641+ return RedirectToAction ( "Edit" , new { customer . Id } ) ;
642+ }
643+
638644 // Validate customer roles.
639645 var allowManagingCustomerRoles = Services . Permissions . Authorize ( Permissions . Customer . EditRole ) ;
640646
@@ -906,11 +912,11 @@ public ActionResult Impersonate(int id)
906912 if ( customer == null )
907913 return RedirectToAction ( "List" ) ;
908914
909- // ensure that a non-admin user cannot impersonate as an administrator
910- // otherwise , that user can simply impersonate as an administrator and gain additional administrative privileges
915+ // Ensure that a non-admin user cannot impersonate as an administrator
916+ // Otherwise , that user can simply impersonate as an administrator and gain additional administrative privileges
911917 if ( ! Services . WorkContext . CurrentCustomer . IsAdmin ( ) && customer . IsAdmin ( ) )
912918 {
913- NotifyError ( "A non-admin user cannot impersonate as an administrator" ) ;
919+ NotifyError ( T ( "Admin.Customers.CustomerRoles.OnlyAdminsAllowed" ) ) ;
914920 return RedirectToAction ( "Edit" , customer . Id ) ;
915921 }
916922
@@ -1207,7 +1213,7 @@ private void PrepareAddressModel(CustomerAddressModel model, Customer customer,
12071213 model . Address . LastNameRequired = true ;
12081214 model . Address . EmailEnabled = true ;
12091215 model . Address . EmailRequired = true ;
1210-
1216+
12111217 MiniMapper . Map ( _addressSettings , model . Address ) ;
12121218
12131219 model . Address . AvailableCountries = _countryService . GetAllCountries ( true )
0 commit comments