Esempio n. 1
0
 /**
  * Constructor declaration
  *
  *
  * @param c
  * @param id
  */
 public Channel(Channel c, int id)
 {
     iId = id;
     dDatabase = c.dDatabase;
     uUser = c.uUser;
     tTransaction = new ArrayList();
     bAutoCommit = true;
     bReadOnly = c.bReadOnly;
 }
Esempio n. 2
0
        /**
         * Constructor declaration
         *
         *
         * @param name
         * @param password
         * @param admin
         * @param pub
         */
        public User(string name, string password, bool admin, User pub)
        {
            hRight = new Hashtable();
            sName = name;

            setPassword(password);

            bAdministrator = admin;
            uPublic = pub;
        }
Esempio n. 3
0
        /**
         * Constructor declaration
         *
         *
         * @param db
         * @param user
         * @param autocommit
         * @param readonly
         * @param id
         */
        public Channel(Database db, User user, bool autocommit, bool ReadOnly,
			int id)
        {
            iId = id;
            dDatabase = db;
            uUser = user;
            tTransaction = new ArrayList();
            bAutoCommit = autocommit;
            bReadOnly = ReadOnly;
        }
Esempio n. 4
0
 /**
  * Method declaration
  *
  *
  * @param user
  */
 public void setUser(User user)
 {
     uUser = user;
 }
Esempio n. 5
0
        /**
         * Method declaration
         *
         *
         * @throws Exception
         */
        public void disconnect()
        {
            if (bClosed)
            {
                return;
            }

            rollback();

            dDatabase = null;
            uUser = null;
            tTransaction = null;
            bClosed = true;
        }
Esempio n. 6
0
 /**
  * Access Class constructor
  * <P>Creates a new ArrayList to contain the User object instances, as well
  * as creating an initial PUBLIC user, with no password.
  *
  * @throws Exception
  */
 public Access()
 {
     uUser = new ArrayList();
     uPublic = createUser("PUBLIC", null, false);
 }
Esempio n. 7
0
        /**
         * createUser method declaration
         * <P>This method is used to create a new user.  The collection of users
         * is first checked for a duplicate name, and an exception will be thrown
         * if a user of the same name already exists.
         *
         * @param name (User login)
         * @param password (Plaintext password)
         * @param admin (Is this a database admin user?)
         *
         * @return An instance of the newly created User object
         */
        public User createUser(string name, string password, bool admin)
        {
            for (int i = 0; i < uUser.Count; i++)
            {
                User u = (User)uUser[i];

                if (u != null && u.getName().Equals(name))
                {
                    throw Trace.error(Trace.USER_ALREADY_EXISTS, name);
                }
            }

            User unew = new User(name, password, admin, uPublic);

            uUser.Add(unew);

            return unew;
        }