Register Advertise with usHelp Desk Today's Posts Search

Closed Thread
Thread Tools Search this Thread
Unread 1st Jun 2011, 05:32 PM   #1
Warrior Member
 
Join Date: 2011
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default
How do you create a FTP user from a PHP script?
Share on: 
fb share twitter share gplus share more share

Does anyone know how to create an FTP user from a PHP script. I have a way but its kinda... rigged up funny. If anyone has an efficient way let me know.
mattleaconsulting is offline  
Unread 2nd Jun 2011, 10:41 AM   #2
Warrior Member
 
Join Date: 2011
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default
Re: How do you create a FTP user from a PHP script?
Share on: 
fb share twitter share gplus share more share

Interesting, is there any issue with that not running as root, because its forcing me to be root to add users.

Either way Thanks!
mattleaconsulting is offline  
Unread 2nd Jun 2011, 05:33 PM   #3
HyperActive Warrior
War Room Member
 
Join Date: 2009
Location: Costa Rica
Posts: 164
Thanks: 63
Thanked 44 Times in 41 Posts
Default
Re: How do you create a FTP user from a PHP script?
Share on: 
fb share twitter share gplus share more share

one way to accomplish it, if your domain is using cpanel:

- review what script is being used by cpanel to create the account.
- take note of everything that is needed (cpanel user,cpanel pass, port,script name,parameters)
- create a php script that passes the correct auth info, new account info

i do something similar already, and here is the snippet of code that does the call to the cpanel script..

note, my variable names keep getting stripped out in the forum post so i'm just putting placeholders for you to see:

PHP Code:
// CODE TO POST CREATION REQUEST
script_url_variable = "http://:@:2082/frontend/x2/mail/doaddfwd.html?email=&domain=&forward=";
result_variable = file_get_contents(script_url_variable); 
peace

I MARKET STUFF

imarketstuff is offline  
Unread 12th Jun 2011, 09:46 PM   #4
Hard Hitting Developers
War Room Member
 
ionisis's Avatar
 
Join Date: 2011
Posts: 52
Thanks: 4
Thanked 4 Times in 4 Posts
Default
Re: How do you create a FTP user from a PHP script?
Share on: 
fb share twitter share gplus share more share

Your vsftpd.conf can make use of a generic GROUP/User which all users will be issued. That eliminates the need to add group/user accounts.
ionisis is offline  
Unread 13th Jun 2011, 05:59 AM   #5
Warrior Member
 
Join Date: 2011
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default
Re: How do you create a FTP user from a PHP script?
Share on: 
fb share twitter share gplus share more share

you can get help about php from w3schools.com...you will some nice tutorials there.

victorjames is offline  
Unread 13th Jun 2011, 10:09 AM   #6
Hard Hitting Developers
War Room Member
 
ionisis's Avatar
 
Join Date: 2011
Posts: 52
Thanks: 4
Thanked 4 Times in 4 Posts
Tip
Re: How do you create a FTP user from a PHP script?
Share on: 
fb share twitter share gplus share more share

Originally Posted by victorjames View Post

you can get help about php from w3schools.com...you will some nice tutorials there.
Why would you send them there? w3schools COPIES content from php.net, so you should ONLY give credit to the original source: php.net.

I hate when people do that. It's like when facebook uses wikipedia content to generate content to get more traffic: it's pathetic, and it takes away from wikipedia, and all those kind people who took the time to develop the articles on wikipedia, which we should all be GRATEFUL for. Same for php.net.

Wikipedia and php.net spend millions of dollars in infrastructure, and thousands of hours in free man-power, to bring open knowledge to the world; and facebook, and w3schools, and users like YOU, spit in the face of wikipedia and php.net by clicking on links to facebook or w3schools, or referring other people there.

Stop giving credit to other sources. That's not cool. It gives the original authors NO reason to continue trying to provide the world with open knowledge. That is the VERY REASON why some companies will not go open source: they will never get full appreciation of what they're offering, because others will STEAL their thunder.

Give credit where credit is DUE: PHP: Hypertext Preprocessor and Wikipedia
ionisis is offline  
Closed Thread


Bookmarks

Tags
create, ftp, php, script, user


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
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




All times are GMT -6. The time now is 03:16 PM.