Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Sign in as the specified user within this session.
- *
- * @author Overv
- *
- * @param username Username to sign in with.
- * @param password Associated passsword.
- * @param callback Function to pass the result to.
- */
- public void login( String username, String password, final LoginCallback callback )
- {
- this.username = username;
- String pwdHash = MD5( password );
- asyncWebRequest( "login.php?do=login", "do=login&cookieuser=1&vb_login_username=" + username + "&vb_login_md5password=" + pwdHash, new WebRequestCallback()
- {
- public void onResult( String source, String cookies )
- {
- if ( source != null && cookies.contains( "bb_password" ) )
- {
- bb_userid = Integer.parseInt( quickMatch( "bb_userid=([0-9]+)", cookies ) );
- bb_password = quickMatch( "bb_password=([a-zA-Z0-9]+)", cookies );
- callback.onResult( true );
- } else {
- callback.onResult( false );
- }
- }
- } );
- }
Add Comment
Please, Sign In to add comment