Zen Cart Logo
Forums / Bug Reports / Upgrade: Missing ADMIN_NAME_MINIMUM_LENGTH

Upgrade: Missing ADMIN_NAME_MINIMUM_LENGTH

Views: 351

Results 1 to 3 of 3
3 Aug 2019, 12:14 PM
#1
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,085
Plugin Contributions:
56

Upgrade: Missing ADMIN_NAME_MINIMUM_LENGTH

The subject configuration setting, introduced in zc156, gets added to the site's configuration table on an initial install ... but not when a site's database is upgraded.

This results in a log similar to the following on a user-update in the admin:

[02-Aug-2019 17:41:38 UTC] Request URI: /myadmin/users.php, IP address: 47.49.36.106
#1  zen_update_user() called at [/home/my_site/mysite/myadmin/users.php:73]
--> PHP Notice: Use of undefined constant ADMIN_NAME_MINIMUM_LENGTH - assumed 'ADMIN_NAME_MINIMUM_LENGTH' in /home/my_site/mysite/myadmin/includes/functions/admin_access.php on line 192.

To correct, you'll need to copy/paste and then run the following SQL script in your admin's Tools->Install SQL Patches:

INSERT INTO configuration (configuration_title, configuration_key, configuration_value, val_function, configuration_description, configuration_group_id, sort_order, date_added) VALUES ('Admin Usernames', 'ADMIN_NAME_MINIMUM_LENGTH', '4', '{"error":"TEXT_MIN_ADMIN_USER_LENGTH","id":"FILTER_VALIDATE_INT","options":{"options":{"min_range":4}}}', 'Minimum length of admin usernames (must be 4 or more)', '2', '18', now());
4 Aug 2019, 11:44 AM
#3
swguy avatar

swguy

Administrator

Join Date:
Feb 2006
Location:
Tampa Bay, Florida
Posts:
10,693
Plugin Contributions:
56

Re: Upgrade: Missing ADMIN_NAME_MINIMUM_LENGTH