Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

is_staff #75

Closed
Kaan2106 opened this issue Nov 1, 2016 · 8 comments
Closed

is_staff #75

Kaan2106 opened this issue Nov 1, 2016 · 8 comments

Comments

@Kaan2106
Copy link

Kaan2106 commented Nov 1, 2016

Is there a way to get the "is_staff" status [0 OR 1] (in table xf_user) ?

waves'

@segg21
Copy link

segg21 commented Nov 4, 2016

I'm thinking about starting up another project similar as this with better features, optimizations, and faster responses.

Besides, this is really outdated. You might as well grab the databases yourself to check for staff.

@Kaan2106
Copy link
Author

Kaan2106 commented Nov 4, 2016

I'm currently working with XenForo 1.4.10.
No thats no problem to grab the needed informations from database itself, but I doen't want to put "so many" MySQL queries into the plugins for my server (minecraft).
That's why I decided to use XenApi - well it's working right now, but there are so many functions missing like you said.

I looking forward to you, LegitSoulja.

@segg21
Copy link

segg21 commented Nov 4, 2016

@Kaan2106

Why are you putting sql with your plugins when it's best to use server side PHP and direct requests from Java and your web service

@Kaan2106
Copy link
Author

Kaan2106 commented Nov 4, 2016

Because our plugins working with MYSQL already like add / remove from other table (for example /promote adds in table "team" 'id' (by autoincrement), 'user-id' and 'Moderator'.
Then the plugin promotes the user to the rank 'Moderator' but aren't set him / her to the status "is_staff". Also the user get's the rank but isn't shown on the "members" (team) page because is_staff is 0.
I though, using the API would be awesomer and easier (and much more efficiency) as much many mysql-queries.

(sorry for my bad english, just now back from work q_q)

@segg21
Copy link

segg21 commented Nov 4, 2016

@Kaan2106 Let me look more into the xenapi and see if you can get staff. Im pretty sure you can. You can get admin i know for a fact.

Have you looked at any of the output from any of the requests?

@segg21
Copy link

segg21 commented Nov 4, 2016

@Kaan2106 Yes, by the looks you can.

?action=getUser&value=[name or id]&hash=[api key, or value hash]

Just send a POST request http call from java to your forum /api.php, and get the result,
parse the json and get is_staff

@CloudburstSys
Copy link

CloudburstSys commented Apr 11, 2019

If you're still working on this @Kaan2106
Pocketmine expresses a post function at pocketmine/utils/Utils->postURL();
we'll say pocketmine/utils/Utils is Utils.
you would use the following code to get user data
$player is an IPlayer.
$this->APIKEY is a private variable containing the api key
$this->APIENDPOINT is a public variable containing the url for the api without api.php

$data = Utils::postURL($this->APIENDPOINT."api.php",
           array(
               'action' => "getUser",
               'value' => $player->getName(),
               'hash' => $this->APIKEY,
           )
);

Using that you can then use $data["is_staff"] once you are certain that the api didn't throw an error.

@Kaan2106
Copy link
Author

@LegoDevStudio I don't work on this anymore. I found a workaround.
Thanks for your reply anyways.
I hope this should help someone in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants