Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 3 > General

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 28th June 2012, 20:08
ColdFire ColdFire is offline
Junior Member
 
Join Date: Dec 2007
Posts: 6
Thanks: 1
Thanked 1 Time in 1 Post
Default Assign / Re-Assign existing client to a reseller

Hello everybody,

I'm missing something would allow me to assign an existing customer with all of his "assets" (domains, email and website stuff) to a reseller

How may I achieve that ?

If not in the GUI can I handle that manually in the database?
Reply With Quote
The Following User Says Thank You to ColdFire For This Useful Post:
gegorasusasday2756 (26th September 2012)
Sponsored Links
  #2  
Old 29th June 2012, 11:16
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lneburg, Germany
Posts: 36,202
Thanks: 829
Thanked 5,420 Times in 4,262 Posts
Default

You can do that in the database only.

1) Edit the record of the client in the client table and set the field "parent_client_id" to the client_id of the reseller.

2) Then edit the the login user of the reseller in the "sys_user" table and add the groupid of the client (see sys_group for the id, you can look it up by using the client_id column) in the "groups" field, separated by ",".
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
The Following 2 Users Say Thank You to till For This Useful Post:
finn (3rd February 2013), yqapmnflndq (15th September 2012)
  #3  
Old 29th June 2012, 13:07
cfoe cfoe is offline
ISPConfig Developer
 
Join Date: Oct 2011
Location: NRW, Germany
Posts: 233
Thanks: 27
Thanked 57 Times in 32 Posts
Send a message via Skype™ to cfoe
Default

maybe open a feature request on the bugtracker.
It seems like a feature that could come in handy for other users (me included) in the future.
__________________
Christian Foellmann

OpenSource-Projects - GitHub-Projects - SVN-Mirrors on GitHub - Foe Services
Reply With Quote
  #4  
Old 7th August 2012, 12:15
cfoe cfoe is offline
ISPConfig Developer
 
Join Date: Oct 2011
Location: NRW, Germany
Posts: 233
Thanks: 27
Thanked 57 Times in 32 Posts
Send a message via Skype™ to cfoe
Default

vote here: http://bugtracker.ispconfig.org/inde...ls&task_id=926
__________________
Christian Foellmann

OpenSource-Projects - GitHub-Projects - SVN-Mirrors on GitHub - Foe Services
Reply With Quote
  #5  
Old 14th September 2012, 23:15
pfaf pfaf is offline
Junior Member
 
Join Date: Jun 2012
Location: Nikea, Greece
Posts: 9
Thanks: 2
Thanked 3 Times in 2 Posts
Default Move client to another reseller: Not working exaclty as it should.

OK, it seems to work, but we cannot see the moved client under clients when we login with the new reseller. We can see the web site records under web sites. We can still see the clients that the new reseller has created.

Moreover, the reseller cannot delete the database that was created from the old reseller for the client. The old reseller is the admin user of ISPConfig, the one that was created during setup.

Any ideas?

Thank you in advance for your support.

Kind regards,

Panos.

Quote:
Originally Posted by till View Post
You can do that in the database only.

1) Edit the record of the client in the client table and set the field "parent_client_id" to the client_id of the reseller.

2) Then edit the the login user of the reseller in the "sys_user" table and add the groupid of the client (see sys_group for the id, you can look it up by using the client_id column) in the "groups" field, separated by ",".
Reply With Quote
  #6  
Old 21st October 2012, 18:02
pfaf pfaf is offline
Junior Member
 
Join Date: Jun 2012
Location: Nikea, Greece
Posts: 9
Thanks: 2
Thanked 3 Times in 2 Posts
Default

Using the main administrator we have created a client under clients and a website which belongs to the client.

Later we created a reseller and want to assign the client and website under the reseller.

We followed
http://www.howtoforge.com/forums/showthread.php?t=55628
and assigned the website to the reseller. Then we should login with the reseller id and assign the website to the client.

We have followed the manual way of assigning a client created under the installation (main) user to a reseller we created later according to http://www.howtoforge.com/forums/showthread.php?t=57770.

When we login with the reseller id and we go to CLIENTS then we cannot see the client under clients. We can see the client when we edit the site but when we assign the the final client, the reseller has no more access the the website data.

Do we miss anything?
Quote:
Originally Posted by till View Post
You can do that in the database only.

1) Edit the record of the client in the client table and set the field "parent_client_id" to the client_id of the reseller.

2) Then edit the the login user of the reseller in the "sys_user" table and add the groupid of the client (see sys_group for the id, you can look it up by using the client_id column) in the "groups" field, separated by ",".
Reply With Quote
The Following User Says Thank You to pfaf For This Useful Post:
feeninuoumn (16th January 2014)
  #7  
Old 21st October 2012, 18:33
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lneburg, Germany
Posts: 36,202
Thanks: 829
Thanked 5,420 Times in 4,262 Posts
Default

The permission system in ispconfig is similar to the used in Linux for file permissions and consists of users and groups. Each client and reseller has a group in the sys_group table. To make a record visible to a reseller or client, the record must either have the userid of the client or reseller in the sys_user_id column or the groupid of the client or reseller in the sys_group_id column.

Please check that the group_id of the sys_group of the reseller is used in the sys_group_id column of the client that is not visible when you login as reseller.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
The Following User Says Thank You to till For This Useful Post:
pfaf (21st October 2012)
  #8  
Old 21st October 2012, 23:16
pfaf pfaf is offline
Junior Member
 
Join Date: Jun 2012
Location: Nikea, Greece
Posts: 9
Thanks: 2
Thanked 3 Times in 2 Posts
Default Move a client under a different reseller

So, to summarize the steps in order for a Client to be moved under another Reseller :

1.Locate the following values for the Reseller under which you want to assign the client to.
R_userid: Search by 'username' in the 'sys_user' table and get column 'userid'
R_groupid: Search by 'name' in the 'sys_group' table and get column 'groupid'
R_client_id: Search by 'name' in the 'sys_group' table and get column 'client_id'

2. Locate the following values for the Client under which you want to assign the client to.
C_userid: Search by 'username' in the 'sys_user' table and get column 'userid'
C_groupid: Search by 'name' in the 'sys_group' table and get column 'groupid'
C_client_id: Search by 'name' in the 'sys_group' table and get column 'client_id'

3. Table 'client'
Locate the record of the client using C_client_id in column 'client_id' and modify the field 'parent_id' = R_client_id.
Also change column 'sys_userid' to R_userid and column 'sys_groupid' to R_groupid. This is done so that the reseller sees the clients under the clients page.

4. Table 'sys_user'
Locate the reseller record by using column 'username' or R_userid in column 'userid'. Modify the column 'groups' so that it contains also the C_group_id. This is done in order for the reseller to see the client websites.

I hope that the above will be of some help to others.

Kind regards to all,

Panos.
Reply With Quote
The Following 2 Users Say Thank You to pfaf For This Useful Post:
jvargas (25th October 2012), till (22nd October 2012)
  #9  
Old 25th October 2012, 18:59
jvargas jvargas is offline
Junior Member
 
Join Date: May 2012
Posts: 4
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Thanks pfaf, I do confirm your hint works as expected.
Reply With Quote
  #10  
Old 28th October 2013, 01:16
Cheecoh Cheecoh is offline
Junior Member
 
Join Date: Oct 2013
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
 
Default

Quote:
Originally Posted by pfaf View Post
So, to summarize the steps in order for a Client to be moved under another Reseller
Thank you very much for this! That helped me to move the user flawlessly!
I've created some mysql-queries to fetch and update the data.. Simply replace the values you've mentioned already!

Fetch relevant R_(userid|groupid|client_id) and C_(userid|groupid|client_id)
Code:
SELECT Rsu.userid AS R_userid, Rsg.groupid AS R_groupid, Rsg.client_id AS R_client_id, Csu.userid AS C_userid, Csg.groupid AS C_groupid, Csg.client_id AS C_client_id
FROM sys_user AS Rsu
	JOIN sys_group AS Rsg ON Rsu.default_group = Rsg.groupid
	JOIN sys_user AS Csu ON Csu.username = "CLIENT_USERNAME"
	JOIN sys_group AS Csg ON Csu.default_group = Csg.groupid
WHERE Rsu.username = "RESELLER_USERNAME";
UPDATE client and add reseller! (to see client in the reseller view)
Code:
UPDATE `client`
SET `parent_id` = "R_client_id",
	`sys_userid` = "R_userid",
	`sys_groupid` = "R_groupid"
WHERE client_id = "C_client_id";
UPDATE reseller to see client's websites (It was necessary to "re-auth/login" with the reseller account to see the clients websites)
Code:
UPDATE `sys_user`
	SET `groups` = CONCAT(`groups`,',','C_groupid')
WHERE `userid` = "R_userid";
Best Regards,

Chris

Last edited by Cheecoh; 28th October 2013 at 01:20. Reason: Changed PHP to CODE and added colors
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
link my domain to my server, impossible! 007007 Installation/Configuration 7 17th January 2012 13:59
DNS Lookups kieron General 4 4th May 2011 19:49
Being Spammed/Hacked/Probed not sure PLEASE HELP! kresser General 10 29th October 2010 17:25
Can't access to my website - after install problem pallermo Installation/Configuration 18 4th June 2010 13:29
Possible bug in admin / reseller / client domain allocation finn General 3 21st February 2010 21:35


All times are GMT +2. The time now is 13:14.


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