Details
-
Type: Bug
-
Status: Closed
-
Priority: Major
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 5.2.1
-
Component/s: None
-
Labels:None
Description
https://github.com/blesta/module-vesta/issues/17
To reproduce:
- Create a Vesta service for hostdomain.com
- Try to create a Vesta service for hostdomaine.com
- Receive error
- Check module logs
- See error "Error: user hostdom0 exists"
To resolve, update vesta.php around line 1345 from
if (isset($user['status']) && $user['status']) { for ($i = 0; $i < (int) str_repeat(9, $account_matching_characters); $i++) { $new_username = substr($username, 0, -strlen($i)) . $i; $user = $vesta->getAccountsUsage($new_username); if (isset($user['status']) && $user['status']) { $username = $new_username; break; } } }
to
if (isset($user['status']) && $user['status'] == 'true') { for ($i = 0; $i < (int) str_repeat(9, $account_matching_characters); $i++) { $new_username = substr($username, 0, -strlen($i)) . $i; $user = $vesta->getAccountsUsage($new_username); if (isset($user['status']) && $user['status'] == 'false') { $username = $new_username; break; } } }