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

Study guide API not working #17

Closed
therbom opened this issue Jun 8, 2014 · 30 comments
Closed

Study guide API not working #17

therbom opened this issue Jun 8, 2014 · 30 comments
Assignees

Comments

@therbom
Copy link

therbom commented Jun 8, 2014

Hi, I'm trying to use your API to get the study guides available on our school's server. The login process works, as it correctly returns my real name, but getStudyGuideList() returns an empty array. I can verify that they exist if I login normally to https://mata-zaamnoord.magister.net.

Output of var_dump($session):

object(mataphp\Session)#1 (4) {
  ["school"]=>
  object(mataphp\School)#2 (2) {
    ["name"]=>
    string(8) "Damstede"
    ["url"]=>
    string(27) "mata-zaamnoord.magister.net"
  }
  ["userId"]=>
  int(5394)
  ["sessionId"]=>
  string(13) "5394440b8e221"
  ["realName"]=>
  string(12) "Marco Brohet"
}

Output of var_dump(mataphp\getStudyGuideList($session)):

array(0) {
}

PHP error log:

[Sun Jun 08 13:07:55 2014] [error] [client ***] PHP Notice:  Use of undefined constant STDERR - assumed 'STDERR' in ***/api.php on line 6
[Sun Jun 08 13:07:55 2014] [error] [client ***] PHP Strict Standards:  Non-static method mataphp\\Mataphp::encodeURIComponent() should not be called statically in ***/api.php on line 160
[Sun Jun 08 13:07:55 2014] [error] [client ***] PHP Strict Standards:  Non-static method mataphp\\Mataphp::curlget() should not be called statically in ***/api.php on line 160
[Sun Jun 08 13:07:55 2014] [error] [client ***] PHP Warning:  curl_setopt(): CURLOPT_FOLLOWLOCATION cannot be activated when an open_basedir is set in ***/api.php on line 130
[Sun Jun 08 13:07:55 2014] [error] [client ***] PHP Strict Standards:  Non-static method mataphp\\Mataphp::curlget() should not be called statically in ***/api.php on line 224
[Sun Jun 08 13:07:55 2014] [error] [client ***] PHP Warning:  curl_setopt(): CURLOPT_FOLLOWLOCATION cannot be activated when an open_basedir is set in ***/api.php on line 130
[Sun Jun 08 13:07:55 2014] [error] [client ***] PHP Strict Standards:  Non-static method mataphp\\Mataphp::curlget() should not be called statically in ***/api.php on line 168
[Sun Jun 08 13:07:55 2014] [error] [client ***] PHP Warning:  curl_setopt(): CURLOPT_FOLLOWLOCATION cannot be activated when an open_basedir is set in ***/api.php on line 130
[Sun Jun 08 13:07:55 2014] [error] [client ***] PHP Warning:  Invalid argument supplied for foreach() in ***/api.php on line 171
[Sun Jun 08 13:07:55 2014] [error] [client ***] PHP Strict Standards:  Non-static method mataphp\\Mataphp::curlget() should not be called statically in ***/api.php on line 187
[Sun Jun 08 13:07:55 2014] [error] [client ***] PHP Warning:  curl_setopt(): CURLOPT_FOLLOWLOCATION cannot be activated when an open_basedir is set in ***/api.php on line 130
[Sun Jun 08 13:07:55 2014] [error] [client ***] PHP Warning:  Invalid argument supplied for foreach() in ***/api.php on line 190
[Sun Jun 08 13:07:55 2014] [error] [client ***] PHP Warning:  file_exists(): open_basedir restriction in effect. File(.mata-php.api.cookie.5394440b8e221) is not within the allowed path(s): (***:/tmp:/var/tmp:/usr/local/lib/php/) in ***/api.php on line 33
@lieuwex lieuwex assigned tomsmeding and tkon99 and unassigned tomsmeding Jun 8, 2014
@tkon99
Copy link
Member

tkon99 commented Jun 9, 2014

Hi, are you trying this on your localhost or on a webhost. The errors show problems with your basedir. Perhaps the cookies aren't saved. Could you try fetching homework.

@tomsmeding
Copy link
Member

This link might be useful to look at; looks like an "open_basedir restriction" is in effect.

@therbom
Copy link
Author

therbom commented Jun 9, 2014

Thanks, it was indeed on a webhost. I got it working on a local XAMPP server. I should be able to modify the code to get it pass the open_basedir restrictions. Under which license is this project released?

@therbom therbom closed this as completed Jun 9, 2014
@tkon99
Copy link
Member

tkon99 commented Jun 9, 2014

In your FTP client, give the cookie file 777 permissions. @tomsmeding can
you give a screenshot, I'm on mobile.
Op 9 jun. 2014 12:54 schreef "Marco Brohet (cobje)" <
[email protected]>:

Closed #17 #17.


Reply to this email directly or view it on GitHub
#17 (comment).

@lieuwex
Copy link
Member

lieuwex commented Jun 9, 2014

@therbom GPLv2

@tomsmeding
Copy link
Member

@therbom did this work or do you need further help with file permissions and suchlike?

On 9 Jun 2014, at 13:26, Thomas Konings [email protected] wrote:

In your FTP client, give the cookie file 777 permissions. @tomsmeding can
you give a screenshot, I'm on mobile.
Op 9 jun. 2014 12:54 schreef "Marco Brohet (cobje)" <
[email protected]>:

Closed #17 #17.


Reply to this email directly or view it on GitHub
#17 (comment).


Reply to this email directly or view it on GitHub.

@therbom
Copy link
Author

therbom commented Jul 6, 2014

Hi there, I was busy with my final 'toetsweek' :)
My school is going to upgrade to Magister 6, so I think I'll wait for that. Have you already seen https://corlaer.magister.net/#/inloggen ?

@lieuwex
Copy link
Member

lieuwex commented Jul 6, 2014

That's cool!

I hope your tests have gone well :)
We're already aware of magister 6 and we will start working on it whenever
the school of one of us haves magister 6.

We will notify you when it's done!
On 6 Jul 2014 19:35, "Marco Brohet (cobje)" [email protected]
wrote:

Hi there, I was busy with my final 'toetsweek' :)
My school is going to upgrade to Magister 6, so I think I'll wait for
that. Have you already seen https://corlaer.magister.net/#/inloggen ?


Reply to this email directly or view it on GitHub
#17 (comment)
.

@lesander
Copy link

lesander commented Jul 6, 2014

My school is already fully operational with magister 6 :3 http://dspierson.magister.net

@tkon99
Copy link
Member

tkon99 commented Jul 6, 2014

Can you program any language?
Op 6 jul. 2014 20:09 schreef "Sander Laarhoven" [email protected]:

My school is already fully operational with magister 6 :3
http://dspierson.magister.net


Reply to this email directly or view it on GitHub
#17 (comment)
.

@tkon99
Copy link
Member

tkon99 commented Jul 6, 2014

Or are you willing to give us your network communication when you are using
it?
Op 6 jul. 2014 20:09 schreef "Thomas Konings" [email protected]:

Can you program any language?
Op 6 jul. 2014 20:09 schreef "Sander Laarhoven" <[email protected]

:

My school is already fully operational with magister 6 :3
http://dspierson.magister.net


Reply to this email directly or view it on GitHub
#17 (comment)
.

@lieuwex
Copy link
Member

lieuwex commented Jul 6, 2014

If you are willing to than it would be awesome if you could install http://www.telerik.com/fiddler and dump the ouput :D

@lieuwex
Copy link
Member

lieuwex commented Jul 6, 2014

Or, if you really trust us, you can give your login credentials :P

@tkon99
Copy link
Member

tkon99 commented Jul 6, 2014

@lesander I've looked over your profile. Seems like your great in php. Would you like to join our team? We can always use some assistance 😉

@lesander
Copy link

lesander commented Jul 6, 2014

Yeah, sure I'll join the dutch code geeks 😉 Should we make a new repository or branch for magister 6? Is there a roadmap of features you guys are planning? Sorry if I'm hijacking this issue 😟

@tomsmeding
Copy link
Member

@lesander We don't really have a plan for that yet, although we'd of course like to have the features that are built-in or on the roadmap for current projects.

@lieuwex
Copy link
Member

lieuwex commented Jul 6, 2014

Note to all the PHP guys, please write down all the api methods so I (and everybody who wants to help) can make a library for .NET and Meteor.

@tomsmeding
Copy link
Member

If you want it quickly, I won't be able to do it because of school an' stuffz tomorrow. After that I'll be pretty much free.

On Jul 06, 2014, at 10:04 PM, Lieuwe Rooijakkers [email protected] wrote:

Note to all the PHP guys, please write down all the api methods so I (and everybody who wants to help) can implement them in C# and Meteor


Reply to this email directly or view it on GitHub.

@lieuwex
Copy link
Member

lieuwex commented Jul 6, 2014

@tkon99
Copy link
Member

tkon99 commented Jul 6, 2014

I'll open up registrations on our forums tomorrow. It's a better way tot
communicate. As github issues take a long time to load on mac.
Op 6 jul. 2014 22:07 schreef "Lieuwe Rooijakkers" <[email protected]

:

DutchCodeGeeks/MagisterHub#1
DutchCodeGeeks/MagisterHub#1


Reply to this email directly or view it on GitHub
#17 (comment)
.

@tkon99
Copy link
Member

tkon99 commented Jul 10, 2014

Registrations are open: please register at http://dutchcodegeeks.tk/

@lesander
Copy link

If I were you, I'd add some plugins from the EsoTalk.org forums to prevent spam sign-ups.

@tkon99
Copy link
Member

tkon99 commented Jul 10, 2014

I now have to approve every new account.

@KeizerDev
Copy link

Is there already a documentation repo?
I'm busy porting making a Java(Android app) client and that would speed up the process a lot!

Btw: I've written a documentation myself but I really want to see if you guys have found new things I didn't notice.

Always nice to share some knowledge,
Thanks

@lesander
Copy link

@KeizerDev People have moved on to Magister 6 and JavaScript / NodeJS: https://github.com/simplyGits/MagisterJS

@KeizerDev
Copy link

Obviously, but why not make a general documentation about the Magister 6 api?

@tkon99
Copy link
Member

tkon99 commented Mar 16, 2015

Well, we thought it wasn't needed as
1 - It's pretty easy to view through network log
2 - The libs got good documentation

@KeizerDev
Copy link

True that. But if you want to see how "cijfers" works for example, it's
pretty nested and it is quite annoying to have to login on Magister again
and check out the Network log to see how something work.
If we instead of that just made one easy documentation repo, it wil be a
lot easier for everyone to make their Magister module or program and port
it to different languages like Python, Java, Objective-C, etc.
Op 16 mrt. 2015 21:31 schreef "Thomas Konings" [email protected]:

Well, we thought it wasn't needed as
1 - It's pretty easy to view through network log
2 - The libs got good documentation


Reply to this email directly or view it on GitHub
#17 (comment)
.

@tkon99
Copy link
Member

tkon99 commented Mar 16, 2015

You could create a new file in:
https://github.com/DutchCodeGeeks/MagisterHub?files=1
And send us a pull request.

Op ma 16 mrt. 2015 22:12 schreef KeizerDev [email protected]:

True that. But if you want to see how "cijfers" works for example, it's
pretty nested and it is quite annoying to have to login on Magister again
and check out the Network log to see how something work.
If we instead of that just made one easy documentation repo, it wil be a
lot easier for everyone to make their Magister module or program and port
it to different languages like Python, Java, Objective-C, etc.
Op 16 mrt. 2015 21:31 schreef "Thomas Konings" [email protected]:

Well, we thought it wasn't needed as
1 - It's pretty easy to view through network log
2 - The libs got good documentation


Reply to this email directly or view it on GitHub
<
#17 (comment)

.


Reply to this email directly or view it on GitHub
#17 (comment)
.

@lieuwex
Copy link
Member

lieuwex commented Mar 17, 2015

@KeizerDev Go ahead, I'm too busy right now. :P

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

6 participants