Jump to content

Create Ftp Accounts From Script


Recommended Posts

I understand that, and I never said anything about not logging into cPanel. I still will. I simply asked if it was possible to create this script? My goal is to merge things into a single-sign-on environment, which includes some simple cPanel tasks.

Link to comment
Share on other sites

Hello all,

Does anyone know of a script I could use to create an FTP account using information I type into a form? I would like to use this as an alternative to logging into cPanel every month Thanks!

 

Theoretically, this could be done, but since cPanel doesn't have an API, it would be quite difficult.

Link to comment
Share on other sites

I would like to use this as an alternative to logging into cPanel every month

 

@cl58 - I apologize, I didn't realize I said that. I meant to say 'instead of having to log into cPanel just to manage FTP.' Please forgive my mistake.@xaav - I read somewhere that cPanel runs mostly on Perl. Is there a Perl script I could run, or would this type of thing be blocked for security?

Link to comment
Share on other sites

When it comes to computers and the internet in general anything is possible, but when anything is possible sometimes the wiser question becomes is it worth the effort?

 

From my point of view spending some random amount of time varying from half an hour on up to approaching infinity to make the process of creating a new ftp account take 3 seconds instead of 13 seconds seems like a slight waste of time, but then again I guess the balance of time invested versus time saved depends a lot on how much use it would get. Saving 10 seconds per month might not be much of a payout, but if you were to do this process several thousand times a month it would totally be worth it.

Link to comment
Share on other sites

Well I found one, first link in Google: http://www.zubrag.com/scripts/cpanel-ftp-account-creator.php

I'll set it up and test it, and let everyone know how it works.

@Krydos: Yes you are right, I wasn't planning on spending more than 30 minutes on it, but it took less that 10 seconds.

Link to comment
Share on other sites

@xaav - I read somewhere that cPanel runs mostly on Perl. Is there a Perl script I could run, or would this type of thing be blocked for security?

 

You won't be able to do this with a perl script, because the perl script must be run under the "root" account. What you are trying to do is not feasible with cPanel, since you only have a GUI to work with.

 

EDIT: Good job on finding that script.

Link to comment
Share on other sites

I would say that your best chance is to create a script (bot) that will actually access cPanel through HTTP and log in into your cPanel account and "click" whatever is needed to be clicked inside of it for you. Because - as written already by xaav - no any other script executed by you will have enough privileges/permissions to actually create FTP account and cPanel don't have API to allow you to do this in more simple way.

 

This should not be that hard, though, for someone that already did code such bots. Only question is the one posted by Krydos - "is it worth it?". My only experience was coding a bot that log in into SMF forum, grab the page (or RSS feed) that is available only for logged in users and then log out. You (your bot) need to log in, access the "FTP Accounts", fill up the form and send it. There is one catch: I see that a lot in cPanel - including this form - depends on functionality of the javascript. So you need to be familiar with javascript, too (I am not), to make your bot aware of these javascripts used in there and this may be the most difficult point (at least this would be most difficult for me).

Edited by Piotr GRD
Link to comment
Share on other sites

sometimes the wiser question becomes is it worth the effort?

 

 

Only question is the one posted by xaav - "is it worth it?".

Aww darn, xaav got credit for what I said.

 

I've written bots before that moved the mouse and clicked at certain places after certain amounts of time and stuff like that. Like I said anything is possible, but if your bot isn't smart enough to handle unexpected input though...

Link to comment
Share on other sites

Sorry, Krydos, my apologies. I've missed your avatar, it's dark blue, too, like xaav's avatar and while reading the forums quickly I usually put only a "blinking of an eye" period of time of attention to the column with author and all the rest of time to read the content of post. No any excuse... only explanation of how my error happend.

 

.. / Ice / xaav / Ice / dark blue again / Ice / xaav... sorry

 

 

 

This bot would not have to move mouse and actually "click" anything, just follow the URLs, read the HTML and javascript source code, interpret it accordingly and send the proper form. A proper form is most probably dependent on these javascripts.

Link to comment
Share on other sites

Don't worry about the misquote. I was just making a joke. It's probably better that you read posts thoroughly than know who exactly said what.

 

Yeah, I know you don't need a mouse clicking bot, but I was just giving an example of how anything is possible.

Link to comment
Share on other sites

Well it turns out the script was made for earlier versions of cPanel, before it adopted javascript. In short, you fill out the form, it submits it to the html page, and the account is created. Now, because everything has been javascript'ed, this obviously doesn't work. I'm not going to work on it further, since this was just an idea and isn't exactly crucial at the moment. Thanks for everyone's help!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...