Beispiel #1
0
            public SimpleSession(SecuritySystem security, FileSystem filesystem, ShellFactory shells, Terminal terminal, int userID)
            {
                this.security   = security;
                this.filesystem = filesystem;
                this.terminal   = terminal;
                this.userID     = userID;

                //get users home dir
                string homepath = security.UserHomeDirectory(userID);

                this.homeDir = (Directory)filesystem.Find(homepath);
                if (this.homeDir == null)
                {
                    throw new Exception("Failed to home users home directory: " + homepath);
                }

                //get shell
                string shellname = security.UserPreferredShell(userID);

                shell = shells.CreateShell(shellname, this);
                if (shell == null)
                {
                    throw new Exception("Failed to find user's preferred shell");
                }
                //TODO  get the shell from a factory
            }
Beispiel #2
0
            public SimpleSession(SecuritySystem security, FileSystem filesystem, ShellFactory shells, Terminal terminal, int userID)
            {
                this.security   = security;
                this.filesystem = filesystem;
                this.shells     = shells;
                this.terminal   = terminal;
                this.userID     = userID;


                // get user's home directory
                homeDir = (Directory)filesystem.Find(security.UserHomeDirectory(userID));

                // identify user's shell
                shell = shells.CreateShell(security.UserPreferredShell(UserID), this);
            }