Revision 1e1441bf src/gr/grnet/pithos/web/client/AddUserDialog.java
b/src/gr/grnet/pithos/web/client/AddUserDialog.java | ||
---|---|---|
48 | 48 |
import com.google.gwt.event.dom.client.KeyDownEvent; |
49 | 49 |
import com.google.gwt.http.client.Response; |
50 | 50 |
import com.google.gwt.http.client.URL; |
51 |
import com.google.gwt.regexp.shared.RegExp; |
|
51 | 52 |
import com.google.gwt.user.client.Event.NativePreviewEvent; |
52 | 53 |
import com.google.gwt.user.client.ui.Anchor; |
53 | 54 |
import com.google.gwt.user.client.ui.Button; |
... | ... | |
179 | 180 |
String name = userName.getText().trim(); |
180 | 181 |
if (name.length() == 0) |
181 | 182 |
return; |
183 |
RegExp emailValidator = RegExp.compile("^[A-Z0-9._%+-]+@[A-Z0-9.-]+.[A-Z]{2,4}$", "i"); |
|
184 |
if (!emailValidator.test(name)) { |
|
185 |
app.displayWarning("Username must be a valid email address"); |
|
186 |
return; |
|
187 |
} |
|
188 |
|
|
182 | 189 |
group.addMember(name); |
183 | 190 |
String path = "?update="; |
184 | 191 |
PostRequest updateGroup = new PostRequest(app.getApiPath(), app.getUsername(), path) { |
Also available in: Unified diff