Skip to content

Commit

Permalink
Added requirement that the given username follow Beeminder's naming
Browse files Browse the repository at this point in the history
format (lowercase letters and numbers only).
  • Loading branch information
player-03 committed Jan 25, 2012
1 parent b077677 commit a850a4b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
Binary file modified TagTime.jar
Binary file not shown.
8 changes: 8 additions & 0 deletions src/tagtime/Main.java
Expand Up @@ -27,8 +27,11 @@
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.regex.Pattern;

public class Main {
private static final Pattern BEEMINDER_USERNAME_MATCHER = Pattern.compile("[a-z0-9]+");

private static File dataDirectory;
private static File soundDirectory;
private static Image iconImage;
Expand Down Expand Up @@ -104,6 +107,11 @@ public static void main(String[] args) {
* Creates and runs a new TagTime instance for the given user.
*/
private static void runTagTime(String username) {
if(username == null
|| !BEEMINDER_USERNAME_MATCHER.matcher(username).matches()) {
return;
}

try {
TagTime instance = new TagTime(username);
instance.start();
Expand Down

0 comments on commit a850a4b

Please sign in to comment.