avalon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ran...@apache.org
Subject cvs commit: jakarta-avalon-apps/ftpserver/src/java/org/apache/avalon/ftpserver/remote UserManager.java RemoteHandler.java
Date Mon, 01 Apr 2002 17:24:32 GMT
rana_b      02/04/01 09:24:32

  Modified:    ftpserver/src/java/org/apache/avalon/ftpserver/remote
                        UserManager.java RemoteHandler.java
  Log:
  get admin user name
  
  Revision  Changes    Path
  1.3       +8 -1      jakarta-avalon-apps/ftpserver/src/java/org/apache/avalon/ftpserver/remote/UserManager.java
  
  Index: UserManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-apps/ftpserver/src/java/org/apache/avalon/ftpserver/remote/UserManager.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- UserManager.java	10 Mar 2002 06:09:57 -0000	1.2
  +++ UserManager.java	1 Apr 2002 17:24:32 -0000	1.3
  @@ -91,5 +91,12 @@
       public void reload() throws Exception {
           mUserManager.reload();
       }
  -
  +    
  +    /**
  +     * Get admin name
  +     */
  +    public String getAdminName() {
  +        return mUserManager.getAdminName();
  +    }
  +    
   } 
  
  
  
  1.3       +8 -4      jakarta-avalon-apps/ftpserver/src/java/org/apache/avalon/ftpserver/remote/RemoteHandler.java
  
  Index: RemoteHandler.java
  ===================================================================
  RCS file: /home/cvs/jakarta-avalon-apps/ftpserver/src/java/org/apache/avalon/ftpserver/remote/RemoteHandler.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- RemoteHandler.java	10 Mar 2002 06:09:57 -0000	1.2
  +++ RemoteHandler.java	1 Apr 2002 17:24:32 -0000	1.3
  @@ -16,6 +16,7 @@
   import java.rmi.server.UID;
   
   import org.apache.avalon.ftpserver.usermanager.User;
  +import org.apache.avalon.ftpserver.usermanager.UserManagerInterface;
   import org.apache.avalon.ftpserver.remote.interfaces.FtpConfigInterface;
   import org.apache.avalon.ftpserver.remote.interfaces.RemoteHandlerInterface;
   
  @@ -76,11 +77,14 @@
           if(password == null) {
               throw new Exception("Please specify password");
           }
  -        if(!User.ADMIN.equals(id)) {
  -            throw new Exception("Not an admin user");
  -        }
           
  -        boolean bSuccess = mFtpConfig.getConfig().getUserManager().authenticate(id, password);
  +        // admin login
  +        UserManagerInterface userManager = mFtpConfig.getConfig().getUserManager();
  +        String adminName = userManager.getAdminName(); 
  +        boolean bSuccess = false;
  +        if ( id.equals(adminName) ) {
  +            bSuccess = userManager.authenticate(id, password);
  +        }
           if(!bSuccess) {
               throw new Exception("Login failure.");
           }
  
  
  

--
To unsubscribe, e-mail:   <mailto:avalon-cvs-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:avalon-cvs-help@jakarta.apache.org>


Mime
View raw message