Exemplo n.º 1
0
        public VirtualFileSystem(FtpConfig config, FtpUserGroup group, string rootpath = null)
        {
            _config = config;
            _group  = group;
            if (!string.IsNullOrEmpty(rootpath))
            {
                _rootPath = rootpath;
            }
            else if (!string.IsNullOrEmpty(group.HomeDir))
            {
                _rootPath = group.HomeDir;
            }
            else
            {
                _rootPath = config.HomeDir;
            }
            _rootDirectory = new VDirectory(null, new FilePermission("r-xr-xr-x"), _rootPath, "");



            _currentDirectory = _rootDirectory;
            _currentDirectory.Refresh();
            AddGroupLinks();    //FIXED:应在刷新后加入链接
            _currentDirectory.Refresh();
            SetPermission(_currentDirectory, true);
        }
Exemplo n.º 2
0
        private void UpdateLists()
        {
            if (!FormUsers.Groups.ContainsKey(_groupName))
            {
                this.Close();
                return;
            }

            _group = FormUsers.Groups[_groupName];
            _links = _group.Links;
            _rules = _group.Rules;
            listLink.Items.Clear();
            foreach (var link in _links)
            {
                listLink.Items.Add(new ListViewItem(new [] { link.Key, link.Value }));
            }
            listRules.Items.Clear();
            foreach (var rule in _rules)
            {
                listRules.Items.Add(new ListViewItem(new[] { rule.Key, GetPermissionString(rule.Value) }));
            }
        }