
| Key: |
SQ-326
|
| Type: |
Improvement
|
| Status: |
Open
|
| Priority: |
Normal
|
| Assignee: |
Unassigned
|
| Reporter: |
teefal
|
| Votes: |
1
|
| Watchers: |
0
|
|
If you were logged in you would be able to see more operations.
|
|
|
|
A button on the login box that said "Signup" (it's free!), which led to a dialog box that had:
Username
Password
Password Again
First Name
Last Name
Email
Tell us about yourself (with text box)
--- java code that does the signup (translate to squeak) --
public static boolean doWebCreateAccount( String pHost, String pUsername, String pPassword,
String pEmail )
{
boolean aResult = false;
String aPostUrl = HTTP_HEADER + pHost + "/action/accountSave";
PostMethod aMethod = new PostMethod( aPostUrl );
aMethod.addParameter( "username", pUsername );
aMethod.addParameter( "password", pPassword );
aMethod.addParameter( "passwordTwo", pPassword ); // add passwordTwo field to box (to Storymill jsp? asks Jon)
aMethod.addParameter( "email", pEmail );
try
{
int aStatus = getHttpClient().executeMethod( aMethod );
String respBody = aMethod.getResponseBodyAsString(); // required, though not used
Header aLocationHeader = aMethod.getResponseHeader( "Location" );
String aRedirectUri = ( aLocationHeader != null ) ? aLocationHeader.toString() : null;
aResult = ( ( aStatus == HttpStatus.SC_MOVED_TEMPORARILY ) && ( aRedirectUri !=
null ) && ( aRedirectUri.indexOf( "accountSaved" ) >= 0 ) );
}
catch ( IOException e ) // This can happen with no network connection
{
aResult = false;
}
finally
{
if ( aMethod != null ) aMethod.releaseConnection();
}
return aResult;
}
----
Note that you can add these fields to the above (with this spelling & capitalization):
firstName
lastName
comment
(last one is for "Tell us about yourself")
|
|
Description
|
A button on the login box that said "Signup" (it's free!), which led to a dialog box that had:
Username
Password
Password Again
First Name
Last Name
Email
Tell us about yourself (with text box)
--- java code that does the signup (translate to squeak) --
public static boolean doWebCreateAccount( String pHost, String pUsername, String pPassword,
String pEmail )
{
boolean aResult = false;
String aPostUrl = HTTP_HEADER + pHost + "/action/accountSave";
PostMethod aMethod = new PostMethod( aPostUrl );
aMethod.addParameter( "username", pUsername );
aMethod.addParameter( "password", pPassword );
aMethod.addParameter( "passwordTwo", pPassword ); // add passwordTwo field to box (to Storymill jsp? asks Jon)
aMethod.addParameter( "email", pEmail );
try
{
int aStatus = getHttpClient().executeMethod( aMethod );
String respBody = aMethod.getResponseBodyAsString(); // required, though not used
Header aLocationHeader = aMethod.getResponseHeader( "Location" );
String aRedirectUri = ( aLocationHeader != null ) ? aLocationHeader.toString() : null;
aResult = ( ( aStatus == HttpStatus.SC_MOVED_TEMPORARILY ) && ( aRedirectUri !=
null ) && ( aRedirectUri.indexOf( "accountSaved" ) >= 0 ) );
}
catch ( IOException e ) // This can happen with no network connection
{
aResult = false;
}
finally
{
if ( aMethod != null ) aMethod.releaseConnection();
}
return aResult;
}
----
Note that you can add these fields to the above (with this spelling & capitalization):
firstName
lastName
comment
(last one is for "Tell us about yourself")
|
Show » |
Sort Order:
|