Advertisement
Guest User

Untitled

a guest
Mar 31st, 2015
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. User u = new User();
  2. Contact c= new Contact(AccountId = DEF_ACC_ID,....);
  3. insert c;
  4. u.ContactId = c.Id;
  5. insert u;
  6.  
  7. <apex:page controller="MobileAppLoginCtrl" action="{!onInit}">
  8. </apex:page>
  9.  
  10. public class MobileAppLoginCtrl {
  11.  
  12. public PageReference onInit() {
  13. String un = ApexPages.currentPage().getParameters().get('un');
  14. String pass = ApexPages.currentPage().getParameters().get('pw');
  15. PageReference pr = Site.login(un, pass, '/one/one.app');
  16. pr.setRedirect(true);
  17. System.debug (pr);
  18. return pr;
  19. }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement