Active
Project:
Media Mover
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
24 Jun 2009 at 01:49 UTC
Updated:
24 Jun 2009 at 01:49 UTC
One of the Ftp servers, I am harvesting from is not using the default 21 port.
Can you add the option to specify the port num when setting up the FTP Configuration.
http://w3schools.com/PHP/func_ftp_connect.asp
I am still new to using drupal forms so I might make mistakes in my draft here,
Added the form item for
For the media_mover_ftp.module
in function media_mover_ftp_config($configuration) {
after the line 183
$form['mm_ftp_conf']['mm_ftp_portnum'] = array(
'#title' => t('FTP Port Number'),
'#type' => 'textfield',
'#default_value' => $configuration['mm_ftp_portnum'],
'#description' => t('Enter number for the FTP Port Number. Default is 21.'),
'#size' => 5 //not sure this should be larger than 5
);
For the media_mover_ftp.module
in function media_mover_ftp_connect($configuration, $display = false) {
change the line to
$connection['ftp_connection'] = ftp_connect($configuration['mm_ftp_host'], $configuration['mm_ftp_portnum']);
I didn't see the validate form and I am bit iffy on how to get the validation to work for this when there is a fieldset in the form.
['mm_ftp_conf']
/**
* Validate the configuration form.
*/
function _validate($form, $form_state) {
$portnum = $form_state['values']['mm_ftp_portnum']
if (!is_numeric($portnum)){
form_set_error('mm_ftp_portnum', t('Please enter a number for the Port Number.'));
}
}