Exemplo n.º 1
0
                    }
                } 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');
}
Exemplo n.º 2
0
 function ftp_list()
 {
     $owner = isadmin() ? '' : getmyname();
     $accounts = ZFtp::getFtpAccounts($owner);
     return json_encode($accounts);
 }
Exemplo n.º 3
0
function getFtpAccounts($owner = '')
{
    return ZFtp::getFtpAccounts($owner);
}