if (!$account) { setmsg(t('No such user.')); } $myuid = ZUser::getuid($owner); $dirs = ZFile::getUserDirs($owner); $docroot = trim($account->home); $docroot = str_replace("/home/{$owner}", '~', $docroot); if (checktoken()) { $op = $_REQUEST['op']; if ($op == 'remove') { if (ZFtp::removeFtpAccount($name)) { setmsg(t('Ftp Account Deleted.'), 'notice', 'ftp.php'); } } else { if ('suspend' == $op) { if (ZFtp::suspendFtpUser($name, !intval($_REQUEST['suspend']))) { setmsg('', 'notice'); } else { setmsg(t('Error')); } } 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'); } } } }
function suspendFtpUser($name, $state) { return ZFtp::suspendFtpUser($name, $state); }