Пример #1
0
 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');
                 }
             }
         }
     }
Пример #2
0
function suspendFtpUser($name, $state)
{
    return ZFtp::suspendFtpUser($name, $state);
}