Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 2 > Tips/Tricks/Mods

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 3rd August 2006, 09:13
ppettigrew ppettigrew is offline
Junior Member
 
Join Date: Apr 2006
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default Domain with numbers unable to create users

Hi,

Sorry to be coming back to the forum with an issue - we are such grateful users of this wonderful application.

We are unable to create a user in ISPConfig, for a domain that starts in a number. Ie:

domain name = 12thman.com.au
User prefix = [DOMAIN]_
desired user email = info@12thman.com.au
This should result in a username = 12thman.com.au_info

However, when trying to add the user we are getting the following ISPConfig error.....
Field: Username
The user name has to contain a minimum of 4 and a maximum of 32 letters or figures and has to begin with a letter.

Is there any way we can achieve the use of a domain that starts with a digit, without making a global change to the User prefix setting?

Many thanks for your ideas on how to resolve this issue.

Cheers,

Paul
Reply With Quote
Sponsored Links
  #2  
Old 4th August 2006, 12:56
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,730 Times in 2,568 Posts
Default

I don't know if this works today, but a few years ago Linux didn't allow user names that started with a digit... That's why we have this restriction in ISPConfig.
You can try to add a user that begins with a digit with the useradd command for testing purposes. Please make sure you give that user a user ID below 10000 (otherwise it will conflict with your ISPConfig users).
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #3  
Old 5th August 2006, 13:14
ppettigrew ppettigrew is offline
Junior Member
 
Join Date: Apr 2006
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Falko,

Great to receive your reply, thank you.

Yes, our FC4 server can happily create the user with the adduser command.

Would it be possible for us to disable the numeric prefix check/constraint ISPConfig uses (as it is not necessary on this distro)? If so, which file do we need to change?

With many thanks,

Paul
Reply With Quote
  #4  
Old 6th August 2006, 13:59
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,730 Times in 2,568 Posts
Default

Quote:
Originally Posted by ppettigrew
If so, which file do we need to change?
Have a look at /home/admispconfig/ispconfig/lib/plugins/isp_username.plugin.php.
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #5  
Old 8th August 2006, 07:22
ppettigrew ppettigrew is offline
Junior Member
 
Join Date: Apr 2006
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks Falko - we are all fixed :-)

Please find below our MINI-HOWTO to help others that may search this forum looking for the solution.....
-----------------------------------------------------
HOWTO - Enabling numeric prefix on usernames in ISPConfig (as at Version 2.2.5)
-----------------------------------------------------
Target settings:
domain name = 13thbloke.com.au
User prefix = [DOMAIN]_
desired user email = info@13thbloke.com.au
This should result in a username = 13thbloke.com.au_info

Issue:
When trying to add the user will get the following ISPConfig error.....
Field: Username
The user name has to contain a minimum of 4 and a maximum of 32 letters
or figures and has to begin with a letter.

Workaround:
# cp /home/admispconfig/ispconfig/lib/plugins/isp_username.plugin.php /home/admispconfig/ispconfig/lib/plugins/isp_username.plugin.php-ORIGINAL
# vi /home/admispconfig/ispconfig/lib/plugins/isp_username.plugin.php

Find the following line:
if(!preg_match("/^[a-z][\w\.\-\_]{3,64}$/",$user_prefix . $username)) {
$go_api->db->query("DELETE from isp_isp_user where doc_id = '$doc_id'");

And change it to:
if(!preg_match("/^[a-zA-Z0-9][\w\.\-\_]{3,64}$/",$user_prefix . $username)) {
$go_api->db->query("DELETE from isp_isp_user where doc_id = '$doc_id'");

Done :-)

PS: You will probably need to make this change each time ISPConfig is upgraded, until
the functionality is included into the base package (assumes UNIX system of choice will
allow numeric prefix as Fedora does).
Reply With Quote
  #6  
Old 29th August 2006, 05:23
datayoung datayoung is offline
Junior Member
 
Join Date: Jul 2006
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default May be more than just Number or not?

Thanks ppettigrew,

Can I add @ in your updated code like this for let user
from 13thbloke.com.au_info to info@13thbloke.com.au

by

if(!preg_match("/^[a-z][\w\.\-\_\@]{3,64}$/",$user_prefix . $username)) {
$go_api->db->query("DELETE from isp_isp_user where doc_id = '$doc_id'");


Find the following line:
if(!preg_match("/^[a-z][\w\.\-\_]{3,64}$/",$user_prefix . $username)) {
$go_api->db->query("DELETE from isp_isp_user where doc_id = '$doc_id'");

And change it to:
if(!preg_match("/^[a-zA-Z0-9][\w\.\-\_]{3,64}$/",$user_prefix . $username)) {
$go_api->db->query("DELETE from isp_isp_user where doc_id = '$doc_id'");

I not test yet,anyone have comment for this
I don't know reason of ispconfig to unaccept @ in username format

I test add user by hand into my Ubutu 6.061 Server ,it is no problem from username@xxxxx format
Reply With Quote
  #7  
Old 29th August 2006, 07:53
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 35,461
Thanks: 813
Thanked 5,245 Times in 4,111 Posts
 
Default

Quote:
Can I add @ in your updated code like this for let user
from 13thbloke.com.au_info to info@13thbloke.com.au
No, because linux system user accounts may not contain a @ sign.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Roaming Profile Error with Samba Domain Controller Setup noahlau HOWTO-Related Questions 6 8th March 2008 18:33
HotSaNIC domino Tips/Tricks/Mods 23 6th November 2006 05:19
/etc/aliases deliver locally local domain users Davide Installation/Configuration 15 28th September 2006 22:04
Howto suggestion suse PhP ver 4 + Ver 5 wwparrish Suggest HOWTO 11 7th August 2006 13:29
Create Domain with same name after deleting torusturtle Installation/Configuration 5 20th June 2006 14:18


All times are GMT +2. The time now is 11:47.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.