Krang::FTP::Server - Virtual FTP Server for Krang Templates and Media
use Krang::ClassLoader 'FTP::Server';
pkg('FTP::Server')->run();
This module provides an FTP interface to Krang Templates and Media. The directory tree is the site/category tree created in Krang. At the top level (/) will be displayed all instances in which the user who has logged in has a valid login/password. Below each instance there are two directories: /template and /media. What appears to be directories below /template and /media actually correspond with Krang::Sites. Below the site dir appears that site's Krang::Category tree as a directory structure. Files within these directories are Krang::Template .tmpl files (in the /template tree),and media files associated with Krang::Media objects (in the /media tree). When a user downloads a .tmpl or media file with Krang::FTP::Server, they recieve the file from the most recent checked-in version of Template/Media object. When a file is uploaded it is automatically checked in and published/deployed.
Below is a sample directory tree as it might appear when logged in to Krang::FTP::Server-
/instance1/
media/
site1/
test.jpg
category1/
test.png
category2/
test.gif
test2.gif
site2/
category1/
template/
site1/
test.tmpl
category1/
template2.tmpl
category2/
site2/
category1/
/instance2/
media/
siteA/
whatever.jpg
category1/
siteB/
category1/
graphic.gif
category2/
template/
siteA/
category1/
template.tmpl
siteB/
story.tmpl
category1/
category2/
lastpage.tmpl
For installation and configuration instructions see Krang::Admin
Only GET, PUT and DELETE are implemented for templates and media. No modification of categories is supported.
This module inherits from Net::FTPServer and doesn't override any public methods. See Net::FTPServer for details.
pre_configuration_hook()post_accept_hook()authentication_hook() is called to check their
username and password. This method calls
Krang::User->find() using the given username and then
checks the password. Also stores the Krang::User object into
$self->{user_obj}. Returns -1 on login failure or 0 on success.
root_directory_hook()system_error_hook()