Add New User From t...
 
Notifications
Clear all

Add New User From the Login User

8 Posts
2 Users
0 Reactions
952 Views
(@mazen)
Posts: 13
Eminent Member
Topic starter
 

in my AdminClass() i tray to add new user from the log-in user , the new user login automatic after i add it ,

i just want to late the admin add user without auto login to this new user.

Thanks

 
Posted : 06/06/2016 11:13 pm
(@skaredcreations)
Posts: 805
Prominent Member Admin
 

Sorry, I don't understand the question... can you be clearer?

FRANCESCO CROCETTI @ SKARED CREATIONS

 
Posted : 06/06/2016 11:58 pm
(@mazen)
Posts: 13
Eminent Member
Topic starter
 

Ok 

In my App i have 

AdminClass(); // the users of this class can add or remove other users 

StudentClass();

-when i add new Student from the admin login user (admin in my App not in Combu Web side) the new Student auto login after i add it

exmpale:

StudentUser newStudent = newStudentUser();
newStudent.userName = "Max";
newStudent.password = "1234";
newStudent.Update( (bool success, string error) => {
if (success)
        Debug.Log("Save success: ID " +newStudent.id);

else

       Debug.Log("Save failed: " + error);

});

i just want to add this Max Student from the login admin , thats it .

 
Posted : 07/06/2016 12:28 am
(@skaredcreations)
Posts: 805
Prominent Member Admin
 

If you mean the records in CB_Session, try to comment the line CB_Account::SetSession($user) in /users.php (should be at line ~341) and it will not create the session record with last login date etc. But besides this, the new accounts are not automatically logged in by the system, the authentication is handled by User.Authenticate and not User.Update so I'm not sure why you say "auto-login" (the user logged in is CombuManager.localUser and you can easily print out its userName in your debug log to see that it's not getting changed after the creation of new users).

FRANCESCO CROCETTI @ SKARED CREATIONS

 
Posted : 07/06/2016 12:57 am
(@mazen)
Posts: 13
Eminent Member
Topic starter
 

i figured out the case 

    public void AddUser()
    {
        ACMangerUser newUser = new ACMangerUser();
        newUser.userName = "Max";
        newUser.password = "1234";
        newUser.Update( (bool success, string error) => {
            // NB: registration does not make the user logged
            if (success)
                Debug.Log("Save success: ID " + newUser.id);
            else
                Debug.Log("Save failed: " + error);
            });

    }

if i'm not login & Authentication as local user i can add user very will  AddUser()

but when i login as local user AddUser()  Log say 

Save failed:
UnityEngine.Debug:Log(Object)

You just tray to test AddUser() when you login & when you not login ,thats it !!

thanks

 
Posted : 07/06/2016 12:32 pm
(@skaredcreations)
Posts: 805
Prominent Member Admin
 

Try to uncomment the "if" statement that is at top of /users.php (it should be at line 6, after the comment "Deny access to unsecured/non-signed requests").

FRANCESCO CROCETTI @ SKARED CREATIONS

 
Posted : 08/06/2016 12:05 pm
(@mazen)
Posts: 13
Eminent Member
Topic starter
 

Yes ,now i can add new user from the login user ,

combu is the first & almost only social platform integrate SQL for Unity with simple way ,in my project i can add , edit ,remove users in game play .

Thanks for help every time

 
Posted : 08/06/2016 11:12 pm
(@skaredcreations)
Posts: 805
Prominent Member Admin
 

Great, all these fixes will be added to the next update. Subscribe to our newsletter, if you didn't yet, to be informed as soon as we release an update to our assets.

FRANCESCO CROCETTI @ SKARED CREATIONS

 
Posted : 08/06/2016 11:22 pm
Share: