Advertisement
Guest User

Untitled

a guest
Sep 24th, 2018
268
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.54 KB | None | 0 0
  1. <?php
  2. // This script is really useful for doing additional things when a user is created.
  3.  
  4. // You have access to two things that will really be helpful.
  5. //
  6. // You have the new user id for your new user. Comment out below to see it.
  7. // dump($theNewId);
  8.  
  9. //You also have access to everything that was submitted in the form.
  10. // dump($_POST);
  11.  
  12. //If you added additional fields to the join form, you can process them here.
  13. //For example, in additional_join_form_fields.php we have a sample form field called account_id.
  14. // You may wish to do additional validation, but we'll keep it simple. Uncomment out the code below to test it.
  15.  
  16. // The format of the array is ['column_name'=>Data_for_column]
  17.  
  18. // $db->update('users',$theNewId,['account_id'=>Input::get('account_id')]);
  19.  
  20. // You'll notice that the account id is now in the database!
  21.  
  22. // Even if you do not want to add additional fields to the the join form, this is a great opportunity to add this user to another database table.
  23. // Get creative!
  24.  
  25. // The script below will automatically login a user who just registered if email activation is not turned on
  26. $db->update('users',$theNewId,['refer'=>Input::get('ref')]);
  27.  
  28. $e = $db->query("SELECT email_act FROM email")->first();
  29. if($e->email_act != 1){
  30. $user = new User();
  31. $login = $user->loginEmail(Input::get('email'), trim(Input::get('password')), 'off');
  32. if(!$login){Redirect::to('login.php?err=There+was+a+problem+logging+you+in+automatically.');}
  33. //where the user goes just after login is in usersc/scripts/custom_login_script.php
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement