1 18 package net.sf.drftpd.master.usermanager.glftpd; 19 20 import java.util.Collection ; 21 import java.util.Vector ; 22 23 import net.sf.drftpd.DuplicateElementException; 24 import net.sf.drftpd.master.usermanager.AbstractUser; 25 import net.sf.drftpd.master.usermanager.UnixPassword; 26 import net.sf.drftpd.util.Crypt; 27 28 33 public class GlftpdUser extends AbstractUser implements UnixPassword { 34 private String password; 35 private Vector privateGroups = new Vector (); 37 40 43 public GlftpdUser(String username) { 44 super(username); 45 } 47 public void addPrivateGroup(String group) 48 throws DuplicateElementException { 49 addGroup(group); 50 privateGroups.add(group); 51 } 52 public boolean checkPassword(String userPassword) { 53 String userhash = 54 Crypt.crypt(this.password.substring(0, 2), userPassword); 55 if (password.equals(userhash)) { 56 login(); 57 return true; 58 } 59 return false; 60 } 61 public void commit() { 62 throw new UnsupportedOperationException (); 63 } 64 67 public long getCreated() { 68 return 0; 69 } 70 71 public long getLastReset() { 72 return System.currentTimeMillis(); 73 } 74 78 85 public Collection getPrivateGroups() { 86 return privateGroups; 87 } 88 89 public String getUnixPassword() { 90 return password; 91 } 92 public long getWeeklyAllotment() { 93 return weeklyAllotment; 94 } 95 public void purge() { 96 throw new UnsupportedOperationException (); 97 } 98 public void rename(String name) { 99 throw new UnsupportedOperationException (); 100 } 101 105 public void setPassword(String password) { 106 throw new UnsupportedOperationException (); 107 } 110 111 public void setUnixPassword(String password) { 112 this.password = password; 113 } 114 public void setWeeklyAllotment(long weeklyAllotment) { 115 this.weeklyAllotment = weeklyAllotment; 116 } 117 public void update() { 118 throw new UnsupportedOperationException (); 119 } 120 121 public void updateCredits(long credits) { 122 throw new UnsupportedOperationException (); 123 } 124 127 public void updateDownloadedBytes(long bytes) { 128 throw new UnsupportedOperationException (); 129 } 130 133 public void updateUploadedBytes(long bytes) { 134 throw new UnsupportedOperationException (); 135 } 136 137 } | Popular Tags |