I'll need as much information as you can give me so i can look into this issue as i cant replicate it.
I just created two users in the live the demo http://crusthq.com/script/uFlexDemo/
tom1 and tom2 with the same password(password), tom1 is group 1, and tom2 2. I was able to login with both without problem.
--
Project's home page http://crusthq.com/projects/uFlex/
---
You received this message because you are subscribed to the Google Groups "uFlex" group.
To post to this group, send email to uf...@googlegroups.com.
To unsubscribe from this group, send email to uflex+un...@googlegroups.com.
Visit this group at http://groups.google.com/group/uflex?hl=en-US.
Ok, i see what you want to do now. You cant register a user if is already logged in with same class instance.
I have not tried this my self, you could try to make a new uFlex instance to allow the logged in user to register another user. In this new object you should use a different "user_session" to avoid polluting the logged in user's session.
if($user->signed and $user->data['group_id'] == 2)
{
$u = clone $user;
$u->opt['user_session'] = "newRegister";
//clear the properties of the current from the clone
$u->logout();
//register new user
$u->register($newUserInfo);
//keep doing what you would do, check for errors, send email and so on....
}
Let me know if you can make this work, if not i'll test it over the weekend.
Glad you got it working
Hi! I had same problem. After first registration (admin) I moved register form to admin panel (and registering new users while signed). Then I was not able to login as new user except admin.Then I changed /uflex/register.php from:if($user->signed) redirect("/");//Proccess Registrationif(count($_POST)){//Register User$registered = $user->register($_POST);if(!$registered){$_SESSION['NoteMsgs'] = $user->error();$_SESSION["regData"] = $_POST;redirect();}else{$_SESSION['NoteMsgs'][] = "User Registered Successfully";$_SESSION['NoteMsgs'][] = "You may login now!";redirect("/administrace");}}else{redirect();}TO your code:
if($user->signed and $user->data['group_id'] == 2){
//Proccess Registration
if(count($_POST)){//Register User
$u = clone $user;$u->opt['user_session'] = "newRegister";//clear the properties of the current from the clone$u->logout();//register new user$u->register($newUserInfo);
//$registered = $user->register($_POST);if(!$registered){$_SESSION['NoteMsgs'] = $user->error();$_SESSION["regData"] = $_POST;redirect();}else{$_SESSION['NoteMsgs'][] = "User Registered Successfully";$_SESSION['NoteMsgs'][] = "You may login now!";redirect("/administrace");}}else{redirect();}}And now It just works ;-)Thanks Pablo!
Dne středa, 10. října 2012 17:36:12 UTC+2 Pablo napsal(a):