} } else { if ($op == 'edit') { foreach ($_REQUEST as $k => $v) { $_REQUEST[$k] = str_replace(':', '', $v); } if (ZFtp::updateFtpAccount($owner, $name, $password, $_REQUEST['docroot'], $_REQUEST['writable'])) { setmsg(t('Ftp Account Modified.'), 'notice', 'ftp.php'); } } } } } break; case 'sync': if (syncFtpUsers()) { setmsg(t('Ftp configuration updated!'), 'notice'); } else { setmsg(t('Can not write the configuration file.'), 'error'); } break; case 'list': default: $task = 'list'; $owner = isadmin() ? '' : $me; $accounts = ZFtp::getFtpAccounts($owner); break; } if (!$norender) { include template('ftp'); }
function ftp_list() { $owner = isadmin() ? '' : getmyname(); $accounts = ZFtp::getFtpAccounts($owner); return json_encode($accounts); }
function syncFtpAccounts() { return ZFtp::syncFtpAccounts(); }