Exemplo n.º 1
0
 }
 $password = $_REQUEST['password'];
 $owner = strtok($name, '_');
 $users = ZUser::getUsers();
 $account = ZFtp::getFtpAccount($name);
 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'])) {
Exemplo n.º 2
0
function removeFtpAccount($user)
{
    return ZFtp::removeFtpAccount($user);
}