CANNOT Set a moderator. Again the same problem.

All Union Platform questions, comments, feature requests, and bug reports.

CANNOT Set a moderator. Again the same problem.

Postby goodguy » Sat 03 Nov 2012 01:37

Hey Guys,
There seems to be the same problem again, with setting a moderator.
I've downloaded the latest version of union server, the latest reactor and the latest union admin tool.
And again, there's the same problem which was in earlier versions of union. I wanna set some account a moderator. When I select the account thru union admin tool, click "set moderator" it says "account is now a moderator" then I quickly go to "user accounts" tab, click that account and see the line: Moderator: Yes and it changes to - (dash) right away, this occurs all the time.
When I launch my client, it says account is not a moderator.
I removed the account and created it anew. It didn't help.
The mechanism is definitely "buggy" again. There was probably some error injection in union source like before.

All a could do to mend the problem in any way was to create a server-side method that does this job:
Code: Select all
public void setModerator(Message message, Client client) {
      if (!client.isLoggedIn()) return;
      String userID = client.getAccount().getUserID();
      if (isAdminAccount(userID)) {
         String accountToSetModer = message.getArg("account");
         if (accountToSetModer != null) {
            try {
               server.getAccount(accountToSetModer).setModerator(true);
            } catch (Exception e) {
               e.printStackTrace();
            }
         }
      }
   }
   public static boolean isAdminAccount(String userID) {
      for (AllowedAccount aa : ALLOWED_ACCS) {
         if (aa.account.equals(userID)) {
            return true;
         }
      }
      return false;
   }

And to send its state message to client so that it could know that account is privileged.
The server-side code seems to work correctly.

regards, Konstantin.
goodguy
 
Posts: 66
Joined: Sun 23 Oct 2011 01:47

Re: CANNOT Set a moderator. Again the same problem.

Postby colin » Thu 15 Nov 2012 23:45

hi konstantin,
we have tried various attempts to reproduce the behaviour you are describing, but have not been successful. the moderator flag is set in all our tests.

we tried:
1) connect Union Admin
2) create account
3) login client A
4) in Union Admin, on User Accounts tab, make moderator

result:
-client A was instantly updated with the new moderator status (as tested via UserAccount's isModerator() method in Reactor)
-Union Admin's "Clients" tab showed "Moderator: true"

we also tried:
1) connect client A
2) connect Union Admin
3) in Union Admin, on User Accounts tab, create account N
4) in Union Admin, on User Accounts tab, make account N a moderator
5) login account

result:
-client A's UserAccount's isModerator() returned true in Reactor
-Union Admin's "Clients" tab showed "Moderator: true"

could you please try to give us exact steps to reproduce the problem so that we can investigate further?

screen shots would be helpful.

thanks,
colin
colin
 
Posts: 232
Joined: Mon 17 Oct 2011 18:47

Re: CANNOT Set a moderator. Again the same problem.

Postby goodguy » Fri 16 Nov 2012 08:41

Hey Colin,
thanks for your reply. I'll try to create some example. But before that, a little detail.
The moderator is set correctly. I can check it on server side and it will definitely say the account is moderator.
Some wrong stuff happens in reactor and union admin.

How did you create the account? Via union admin tool?
My accounts are always created in a custom server module via server.createAccount()
probably the difference is essential
goodguy
 
Posts: 66
Joined: Sun 23 Oct 2011 01:47

Re: CANNOT Set a moderator. Again the same problem.

Postby colin » Fri 16 Nov 2012 13:15

i used Union Admin to create the account and set the moderator role.

a minimal code example showing exact steps to reproduce the problem would be very helpful.

thanks,
colin
colin
 
Posts: 232
Joined: Mon 17 Oct 2011 18:47


Return to Union Platform

Online

Users browsing this forum: No registered users and 1 guest