Beispiel #1
0
        /// <summary>
        /// Creates a new BoxFolderInfo object
        /// </summary>
        /// <param name="username">The username of the user registered for acess to the explorer</param>
        public FolderInfo(string username)
        {
            m_Structure = new GenericNode();
            m_Folders   = new System.Collections.ArrayList(RemoteExplorerConfig.GetExplorerFolder(username));

            // Create the folders structure
            foreach (string folder in m_Folders)
            {
                BoxUtil.EnsureFolder(folder);

                GenericNode fNode = new GenericNode(folder);

                DoFolder(Path.Combine(BoxUtil.RunUOFolder, folder), fNode);

                m_Structure.Elements.Add(fNode);
            }
        }
Beispiel #2
0
        public override AuthenticationResult Authenticate(string password, bool hashed)
        {
            AuthenticationResult auth = base.Authenticate(password, AccountHandler.ProtectPasswords);

            if (auth == AuthenticationResult.Success)
            {
                string[] folders = RemoteExplorerConfig.GetExplorerFolder(Username);

                if (folders != null && folders.Length > 0)
                {
                    m_Folders = new ArrayList(folders);
                    return(AuthenticationResult.Success);
                }
                else
                {
                    return(AuthenticationResult.UnregisteredUser);
                }
            }
            else
            {
                return(auth);
            }
        }