Jump to content

Recommended Posts

Posted

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!

Posted

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.

Posted

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.

Posted

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?

Posted

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.

Posted
@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.

Posted (edited)

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
Posted

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...

Posted

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.

Posted

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.

Posted

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!

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...