FTP commands in PHP

 
Post new topic   Reply to topic    Aprelium Forum Index -> PHP
View previous topic :: View next topic  
Author Message
Flux
-


Joined: 13 Oct 2006
Posts: 48

PostPosted: Mon Mar 26, 2007 6:57 am    Post subject: FTP commands in PHP Reply with quote

I'm using GuildFTPd and am somewhat confused by php.net's description of ftp commands.

I've seen plenty of samples of putting a file on the server, taking one off, setting file permissions, logging in, connecting, but nothing resembling administration (beyond the file permissions [chmod]).

Can someone (preferably who has/knows how to deal with GuildFTPd in particular) help me out with a sample script of, per se, adding a user to the ftp server and/or giving him/her fiolders to work wtih, or something...?

so far what I have in script format are snippets that can be learned in a minute from the ftp commands section of php.net, and all the rest is a concept in my head that I can't translate to script (hence the thread).

Any and all help is appreciated as usual :D
_________________
My signature is so lame.

I think phpBB forums hates my laptop '.';
Back to top View user's profile Send private message
aprelium
-


Joined: 22 Mar 2002
Posts: 6800

PostPosted: Mon Mar 26, 2007 9:18 pm    Post subject: Re: FTP commands in PHP Reply with quote

Flux,

Could you post an URL of a sample FTP-related script? We'll use it as the basis of a GuildFTPD user declaration PHP script.
_________________
Support Team
Aprelium - http://www.aprelium.com
Back to top View user's profile Send private message Send e-mail
Flux
-


Joined: 13 Oct 2006
Posts: 48

PostPosted: Tue Mar 27, 2007 4:40 am    Post subject: Reply with quote

no, not really.
I don't know the actual functions that work to add users, delete users, edit users, etc.

I can give the url for the ftp section of php.net
http://us3.php.net/manual/en/ref.ftp.php
_________________
My signature is so lame.

I think phpBB forums hates my laptop '.';
Back to top View user's profile Send private message
aprelium
-


Joined: 22 Mar 2002
Posts: 6800

PostPosted: Mon Apr 02, 2007 5:34 pm    Post subject: Reply with quote

Flux wrote:
I don't know the actual functions that work to add users, delete users, edit users, etc.


They should be available in the documentation of the FTP server. Note that they are server dependant since there are not part of the standard FTP commands.
_________________
Support Team
Aprelium - http://www.aprelium.com
Back to top View user's profile Send private message Send e-mail
Flux
-


Joined: 13 Oct 2006
Posts: 48

PostPosted: Mon Apr 02, 2007 6:34 pm    Post subject: Reply with quote

Ah.

GuildFTPd's documentation is in text files, with the program...

Ugh, so many simple obvious answers.

Thanks for being patient with me, aprelium. (And thanks for the cookie help).

Now that I have these commands:

*Add USER:
*SITE ADDUSER %d[Group:] %d[Usename:] %d[Password:]
*Description: Add user (will add user to the given group it finds in the ftp server)


*Add GROUP:
*SITE ADDGROUP %d[Group:]
*Description: Add group (will add an empty group with the specified name)


*Add PATH:
*SITE ADDPATH %d[Group\Name:] %d[LocalPath:] %d[VirtualPath:]
*Description: Add Path (will add a path to the specified group\user with the given local & virtual path with only read & list rights)


*Change Login Amont:
*SITE CHLOGINS %d[Username:] %d[Amount]
*Description: Change Maximum Login Amount for a certain User name


Allow Anonymous login:
SITE ANON ALLOW
Description: Users using the anonymous l/p will be able to login


Deny Anonymous Login:
SITE ANON DENY
Description: Users using the anonymous l/p will NOT be allow to login

*Change Login Pass:
*SITE CHPASS %d[user] %d[new pass]
*Description: Changes the user's password.


*Delete User:
*SITE DELUSER %d[User:]
*Description: Delete the user's l/p


*Delete Group:
*SITE DELGROUP %d[Group:]
*Description: Delete the group specified


*Delete Path:
*SITE DELPATH %d[User/Group:] %d[Local Path]
*Description: Deletes the specified local path from the given user / group


*Disable User:
*site disable %d[User:]
*Description: Users trying to login using a certain l/p won't be able to get in. But the l/p *will remain.


*Enable User:
*site enable %d[User:]
*Description: If the Siteop has disable the l/p, this option will enable users to login *again. Useful for temporary accounts such as upload/upload if u don't want ppl to keep on *uploading too much.


*Who's online:
*SITE WHO
*Description: Shows you a list of users currently logged in


*Kick a User:
*SITE KICK %d[user id]
*Description: After doing the SITE WHO u can select which user to kick.

*Message Admin:
*SITE MSG %d[Message]
*Description: Send a message to the administrator

It is quite straightforward. However, how do I use them in php? Is there some ftp_query function I can use (like mysql_query, which I've been using a lot lately, except for FTP servers)?

Ah, indeed. ftp_site.

Again, thank you for being patient.
_________________
My signature is so lame.

I think phpBB forums hates my laptop '.';
Back to top View user's profile Send private message
TRUSTAbyss
-


Joined: 29 Oct 2003
Posts: 3752
Location: USA, GA

PostPosted: Mon Apr 02, 2007 9:45 pm    Post subject: Reply with quote

If those are command line parameters, you can use the exec() function to perform those actions.
Back to top View user's profile Send private message Visit poster's website
Flux
-


Joined: 13 Oct 2006
Posts: 48

PostPosted: Mon Apr 02, 2007 10:14 pm    Post subject: Reply with quote

I figured it out, and I don't have to deal with command line parameters, but thanks anyway, and I'll keep that in mind for when I do have to.
_________________
My signature is so lame.

I think phpBB forums hates my laptop '.';
Back to top View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Aprelium Forum Index -> PHP All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB phpBB Group