/src/classes/SiteLoginController.cls
Visual Basic | 23 lines | 19 code | 4 blank | 0 comment | 0 complexity | 38f02f91362116fcf039f64e3af0e8cd MD5 | raw file
- /**
- * An apex page controller that exposes the site login functionality
- */
- global with sharing class SiteLoginController {
- global String username {get; set;}
- global String password {get; set;}
- global PageReference login() {
- String startUrl = System.currentPageReference().getParameters().get('startURL');
- return Site.login(username, password, startUrl);
- }
-
- global SiteLoginController () {}
-
- global static testMethod void testSiteLoginController () {
- // Instantiate a new controller with all parameters in the page
- SiteLoginController controller = new SiteLoginController ();
- controller.username = 'test@salesforce.com';
- controller.password = '123456';
-
- System.assertEquals(controller.login(),null);
- }
- }