Beispiel #1
0
        private IFtpFolder CreateAdminFolder(VirtualFtpSession session)
        {
            String solutionName = session.Username.Split('_')[0];

            CreateFileSystemFoldersIfNotExists(solutionName);

            VirtualFolder f = new VirtualFolder(rootFolder, session.Username);

            SetReadOnly(f, session.Username);

            DiscFolder df;

            df = new DiscFolder(null, "exchange", GetExchangeFolder(solutionName));
            SetReadOnly(df, session.Username);
            df.UserWrite = true;
            f.Add(df);

            CatalogFile cfs = new CatalogFile(null, "exchange.txt", GetExchangeFolder(solutionName));

            SetReadOnly(cfs, session.Username);
            f.Add(cfs);

            df = new DiscFolder(null, "shared", GetSharedFolder(solutionName));
            SetReadOnly(df, session.Username);
            df.UserWrite = true;
            f.Add(df);

            cfs = new CatalogFile(null, "shared.txt", GetSharedFolder(solutionName));
            SetReadOnly(cfs, session.Username);
            f.Add(cfs);

            df = new DiscFolder(null, "private", GetPrivateFolder(solutionName, ""));
            SetReadOnly(df, session.Username);
            df.UserWrite = true;
            f.Add(df);

            cfs = new CatalogFile(null, "private.txt", GetPrivateFolder(solutionName, ""));
            SetReadOnly(cfs, session.Username);
            f.Add(cfs);

            rootFolder.Add(f);
            return(f);
        }
Beispiel #2
0
        private IFtpFolder CreateUserFolder(VirtualFtpSession session)
        {
            String[] arr            = session.Username.Split('_');
            String   solutionName   = arr[0];
            String   userFolderName = arr[1];

            CreateFileSystemFoldersIfNotExists(solutionName);

            VirtualFolder f = new VirtualFolder(rootFolder, session.Username);

            SetReadOnly(f, session.Username);

            String     sharedFolder = GetSharedFolder(solutionName);
            DiscFolder df;

            df = new DiscFolder(null, "shared", sharedFolder);
            SetReadOnly(df, session.Username);
            f.Add(df);

            CatalogFile cfs = new CatalogFile(null, "shared.txt", sharedFolder);

            SetReadOnly(cfs, session.Username);
            f.Add(cfs);

            String privateFolder = GetPrivateFolder(solutionName, userFolderName);

            df = new DiscFolder(null, "private", privateFolder);
            SetReadOnly(df, session.Username);
            df.UserWrite = true;
            f.Add(df);

            CatalogFile cfp = new CatalogFile(null, "private.txt", privateFolder);

            SetReadOnly(cfp, session.Username);
            f.Add(cfp);

            rootFolder.Add(f);
            return(f);
        }
Beispiel #3
0
        private IFtpFolder CreateUserFolder(VirtualFtpSession session)
        {
            String[] arr = session.Username.Split('_');
            String solutionName = arr[0];
            String userFolderName = arr[1];

            CreateFileSystemFoldersIfNotExists(solutionName);

            VirtualFolder f = new VirtualFolder(rootFolder, session.Username);
            SetReadOnly(f, session.Username);

            String sharedFolder = GetSharedFolder(solutionName);
            DiscFolder df;
            df = new DiscFolder(null, "shared", sharedFolder);
            SetReadOnly(df, session.Username);
            f.Add(df);

            CatalogFile cfs = new CatalogFile(null, "shared.txt", sharedFolder);
            SetReadOnly(cfs, session.Username); 
            f.Add(cfs);

            String privateFolder = GetPrivateFolder(solutionName, userFolderName);
            df = new DiscFolder(null, "private", privateFolder);
            SetReadOnly(df, session.Username);
            df.UserWrite = true;
            f.Add(df);

            CatalogFile cfp = new CatalogFile(null, "private.txt", privateFolder);
            SetReadOnly(cfp, session.Username);
            f.Add(cfp);

            rootFolder.Add(f);
            return f;
        }
Beispiel #4
0
        private IFtpFolder CreateAdminFolder(VirtualFtpSession session)
        {
            String solutionName = session.Username.Split('_')[0];

            CreateFileSystemFoldersIfNotExists(solutionName);

            VirtualFolder f = new VirtualFolder(rootFolder, session.Username);
            SetReadOnly(f, session.Username);

            DiscFolder df;
            df = new DiscFolder(null, "exchange", GetExchangeFolder(solutionName));
            SetReadOnly(df, session.Username);
            df.UserWrite = true;
            f.Add(df);

            CatalogFile cfs = new CatalogFile(null, "exchange.txt", GetExchangeFolder(solutionName));
            SetReadOnly(cfs, session.Username);
            f.Add(cfs);

            df = new DiscFolder(null, "shared", GetSharedFolder(solutionName));
            SetReadOnly(df, session.Username);
            df.UserWrite = true;
            f.Add(df);

            cfs = new CatalogFile(null, "shared.txt", GetSharedFolder(solutionName));
            SetReadOnly(cfs, session.Username);
            f.Add(cfs);

            df = new DiscFolder(null, "private", GetPrivateFolder(solutionName, ""));
            SetReadOnly(df, session.Username);
            df.UserWrite = true;
            f.Add(df);

            cfs = new CatalogFile(null, "private.txt", GetPrivateFolder(solutionName, ""));
            SetReadOnly(cfs, session.Username);
            f.Add(cfs);

            rootFolder.Add(f);
            return f;
        }