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

Doesn’t works without admin #34

Closed
JanMoritzMeyer opened this issue Aug 28, 2018 · 15 comments
Closed

Doesn’t works without admin #34

JanMoritzMeyer opened this issue Aug 28, 2018 · 15 comments
Labels
willbesolved will be solved in future release
Milestone

Comments

@JanMoritzMeyer
Copy link

I added path_scheme to my configuration but it still tries to get the data from the wrong server

@TobiasFranek
Copy link
Owner

can you please show more information (the code of the comfiguration)

@JanMoritzMeyer
Copy link
Author

<?php require_once 'vendor/autoload.php'; use Webuntis\Configuration\WebuntisConfiguration; use Webuntis\Query\Query; $config = new WebuntisConfiguration([ 'default' => [ 'server' => 'stundenplan.hamburg.de', 'school' => 'Hh5868', 'username' => 'xxx', 'password' => 'xxx', 'path_scheme' => 'https://stundenplan.hamburg.de/WebUntis/jsonrpc.do?school={school}' ], 'admin' => [ 'server' => 'stundenplan.hamburg.de', 'school' => 'Hh5868', 'username' => 'xxx', 'password' => 'xxx', 'path_scheme' => 'https://stundenplan.hamburg.de/WebUntis/jsonrpc.do?school={school}' ] ]); $query = new Query(); $query = $query->get('Period'); log($query); ?>

@TobiasFranek
Copy link
Owner

do you know for certain that the false path_scheme is set? And which version are you using this feature is only supported in 3.0.

@JanMoritzMeyer
Copy link
Author

I installed the version today with composer but in the composer.json its only 2.2, how can I install 3.0?

@TobiasFranek
Copy link
Owner

just change the version in the composer.json file and run composer update.

@JanMoritzMeyer
Copy link
Author

Okay, that works now. Is there any possibility now to just use an default user? We dont have any access to an admin user...

@TobiasFranek
Copy link
Owner

yea sure if you only set the default user it will work nevertheless, but some API routes cannot be executed, because they need special reading rights

@JanMoritzMeyer
Copy link
Author

No, it then puts out the error admin index not set...

@TobiasFranek
Copy link
Owner

ok this is a bug, i will fix this as soon as possible, but just set it with sample data and i should still work.

@JanMoritzMeyer JanMoritzMeyer changed the title path_sheme not working Doesn’t works without admin Aug 29, 2018
@TobiasFranek
Copy link
Owner

Ok I looked into the bug and it is expected behavior, because for example in the Period Model you have alot of children and these children are, for example Teacher or Students, which are protected by the admin wall. This means: You can fetch Period without, but when the childs are fetched like Teacher and Students they require an admin account which can read Teachers and Students.

@TobiasFranek
Copy link
Owner

So this would be a feature to enable it so that children will not be rendered and the original content will be but in as array

@TobiasFranek
Copy link
Owner

will be solved in #39

@TobiasFranek TobiasFranek added the willbesolved will be solved in future release label Aug 31, 2018
@TobiasFranek TobiasFranek added this to the 3.1.0 milestone Aug 31, 2018
@JanMoritzMeyer
Copy link
Author

okay nice, cause I cant find any documentation for the API do you have one? If so, can you send it to me so I can work with that?

@TobiasFranek
Copy link
Owner

you can read more about how you can avoid the admin is not set error in the Configuration docs and there where the 'ignore_children' property is mentioned.

@TobiasFranek
Copy link
Owner

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
willbesolved will be solved in future release
Projects
None yet
Development

No branches or pull requests

2 participants