DA User Tool

l0rdphi1

Verified User
Joined
Jun 22, 2003
Messages
1,471
This is a tool that currently allows Users to be converted to Resellers, Resellers back to Users, and changing of any user's owner. See below for a full features list.

Current Version: v1.2
Last updated 2004-02-06 at 7:01 PM EST

Instructions:Features:
  • Convert Users to Resellers
  • Convert Resellers to Users
  • Change the owner of users
  • RH and FBSD support
Have fun! ;)
 
Last edited:

l0rdphi1

Verified User
Joined
Jun 22, 2003
Messages
1,471
Thanks :)

Example run:
perl dausertool.pl -fr l0rdphi1 sumaleth
User `l0rdphi1' has sucessfully been converted to a Reseller.
User `sumaleth' has sucessfully been converted to a Reseller.
;)
 

l0rdphi1

Verified User
Joined
Jun 22, 2003
Messages
1,471
S2S-Robert sent me an email asking for some new features. Here was the key part of my responce:
I do actually have plans to extend the tools ability via 'change user name' and 'change user owner' functions, along with anything else thought up, but all time permitting, of course.
On incorporating this into DA, I don't have any problems with that, but I'm not exactly sure how it would work, especially when I want to release a new version, but nonetheless it could work.
 

l0rdphi1

Verified User
Joined
Jun 22, 2003
Messages
1,471
phriendly-Mark said:
you would create a custom script linked out of DA :)
Yes, I see... linked out of DA? *grumble* Not sure exactly how you mean to do that there ;) Maybe we should wait to see what John/Mark thinks of this and how it would be done.

phriendly-Mark said:
rename user shouldnt be too hard to do...
That's the easy part :D


*edited for clarity*
 
Last edited:

FarCry

Verified User
Joined
Jun 6, 2003
Messages
280
Location
Perth, Australia
I had john make me some API functions to allow exactly this to happen. I will make an php class and perl module to use these fast and easily once 1.203 is released.
 

l0rdphi1

Verified User
Joined
Jun 22, 2003
Messages
1,471
If they're API functions I can probably do it simply by using the class I already wrote; can't wait to see how this turns out :)
 

l0rdphi1

Verified User
Joined
Jun 22, 2003
Messages
1,471
phriendly-Mark said:
I had john make me some API functions to allow exactly this to happen. I will make an php class and perl module to use these fast and easily once 1.203 is released.
Any news on these APIs?
 

l0rdphi1

Verified User
Joined
Jun 22, 2003
Messages
1,471
Okay, I *think* I understand where this is going. I can create an external script and tap into DA's current session to validate the end user. Interesting.

This brings a few questions up for me. First, where can I get 'session_id' from? A cookie? If this is stored in a cookie, will not the browser have to access scripts via port 2222? Maybe the cookies aren't port-2222 specific, but I'm positive a script couldn't be located just anywhere on the server.

Looking good though; keep up the good work. I guess I was after more of a 'plugin' API for DA. An API where I wouldn't have to modify a skin to link my script directly from DA, e.g.,
PHP:
$plug = new Plugin('DA User Tool');
$plug->add_admin_option('User Tools','CMD_USER_TOOLS');

if ( $plug->cmd = 'CMD_USER_TOOL' )
{
	// someone clicked on the user-tools link...

}


// or even a structure like:
class DAUserTool extends DAPlugin {

	var $name = 'DA User Tool';
	var $key = 'DA_USER_TOOL'; // cmd key to get into this plugin

	function chooser()
	{
		if ( $this->user_level == 'admin' && ... ) 
		{
			$this->user_tools_menu();
		}
	}

	function on_add_user_save()
	{
		// do stuff... :}

	}

	function user_tools_menu()
	{
		echo "blah blah";
	}

}
In DA I'm not sure how CMD's are handled, but to do this you'd most likely have to call an external PHP and/or Perl script when the CMD value specified can not be found in DA itself.

Just an idea, but it's probably a bit too much.
 
Last edited:

Icheb

Verified User
Joined
Sep 15, 2003
Messages
556
Location
The Netherlands
I am really really really sorry for this giant kick, but i do have a question.

I used this tool today to migrate a user to a reseller account, but the reseller account the user is created from still lists it in allocated quota size.
How can i make sure this migrated user, made by a reseller called 'abcd' entirely goes to the admin as if it was created by the admin user.

Second note: After the migration no IP's are standard transferred to the reseller to use...

Thanks in advance,

Icheb

edit:
I can explain this way simpler :D :

Ok, so far i have :
* converted the user to a reseller
* added an ip to use for the reseller
* changed the user.conf so that the reseller appears to be created by admin instead of another reseller
* changed users.list of the original reseller so that the new reseller is no longer listed

Problem : The for the user/new reseller allocated disk space is still available on the reseller panel for the reseller that previously had the user. How do i change this to reflect the correct settings without deleting the reseller ?
 
Last edited:
Top