The following warnings occurred:
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/global.php(961) : eval()'d code 26 errorHandler->error
/global.php 961 eval
/printthread.php 16 require_once



UserSpice
After Registration/Signin auto redirect url question - Printable Version

+- UserSpice (https://userspice.com/forums)
+-- Forum: Support Center (https://userspice.com/forums/forumdisplay.php?fid=23)
+--- Forum: UserSpice 4.3 and Below (https://userspice.com/forums/forumdisplay.php?fid=26)
+--- Thread: After Registration/Signin auto redirect url question (/showthread.php?tid=847)



After Registration/Signin auto redirect url question - replevinorder - 11-23-2017

Hello,

I looked in forums, but may have missed an answer to this question.

It really is 2 questions maybe, but they are inter-related as far as what I would like to have userspice help me with.

I am using userspice solely for gathering a database of users. I am creating an app that I want to gather registration info for people who will use the app. ( Note-Noob-I don't know how to integrate my jquery pages with the userspice interface).
Users can use the app even without registering currently, but I am just winging it for now while learning, hoping a popup prompt will at least help me get people to register so I have some sort of user data.

Navigation-
user goes to app web site
registers ( In settings I chose everything with the least amount of setting required to get a user register)
after registration - a user has to Login
Question 1- I there a way after a successful registration ( No email confirmation required) that it will auto log the person in and then redirect to my app home page?
Question 2 - nearly same idea- after singing in, or google auth, redirect to a page on my same domain?

I would like it to redirect to my app home page again.

Thank You,

Wayne


After Registration/Signin auto redirect url question - mudmin - 11-23-2017

Register - In version 4.3 and up, there is a file called
usersc/includes/scripts/during_user_creation.php

It's at the perfect spot for what you need.
Put this code at the bottom (editing your redirection page).
Code:
$user = new User();
Code:
$login = $user->loginEmail(Input::get('username'), trim(Input::get('password')), 'off');
Code:
if ($login) { Redirect::to('mypage.php');}

For facebook, you put your redirect after login on the admin dashboard under social logins.
For the others, you put it in usersc/includes/scripts/custom_login_script.php

I think that about covers it. Let me know if you have any issues.


After Registration/Signin auto redirect url question - mudmin - 11-27-2017

You can forget that 3rd line in my code sample above. The code will never hit it (although you could do an error message for if !login

You change where the user goes after login in usersc/scripts/custom_login_script.php