-
Notifications
You must be signed in to change notification settings - Fork 145
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
Invalid argument supplied for foreach() #5
Comments
I have not seen this error before. Which PHP and cURL versions are you using? |
I was able to reproduce this. It is due to a bit of a session confusion. I tried connecting to UBNT 3.2.10 at first (I know the comments say 4.0.0 minimum, but I had to try before going through that hassle :P). I started getting 401s from the API, which did not register with the code as being a failed request (it looks for 400, so must be difference from old controller versions), so it tries to continue. This allowed I then upgraded the controller to 4.8.20, and refreshed the page. Since the session variable My suggestion is the change this line. on
To:
This allowed the sites from my updated controller to be pulled in correctly. |
Thanks for the feedback: seems to make sense to do it like this. I will test this change and include if all goes well. |
I checked the PHP docs and it turns out when using empty() there is no need to also use isset() as test. |
Hello, i updated my unifi controller to 5.2.2 and suddenly it works... i put an .htpasswd simple http authorization on the app because it shows the ssh password of the aps and operator of hotspot... |
There is popular demand for a reporting tool: where the API Browser tool is really a tool for developers there are quite a lot of non-technical users that want to have a tool that produces tabular reports (e.g. using DataTables) on the most relevant data collections/API endpoints. Such a tool should allow the user to select/deselect columns and a select a time range (e.g. using DataRangeSelector). I have some idea's for this but just can't find the time to develop it. |
@facuxt Would be nice if you would be able to spend some time on that...:-) |
maybe we can form some kind of project... i need that kind of reporting tool... with the api you can get historical data? for example from the unifi controller you just can get only 30 days ago... There is any documentation of the api? |
Would be nice project to work on. The API can report on historical data as long as it's available from the controller. There is no documentation but I have made an effort in providing a start by adding comments to the functions in the |
Hello, im having this issue....
Warning: Invalid argument supplied for foreach() in C:\xampp\htdocs\unifi\index.php on line 452
i enabled debug mode, and this is what i get...
`Array
(
[url] => https://XXXXXXXXXX:8443/api/login
[content_type] => application/json;charset=UTF-8
[http_code] => 200
[header_size] => 332
[request_size] => 217
[filetime] => -1
[ssl_verify_result] => 18
[redirect_count] => 0
[total_time] => 0.656
[namelookup_time] => 0
[connect_time] => 0
[pretransfer_time] => 0.031
[size_upload] => 42
[size_download] => 41
[speed_download] => 62
[speed_upload] => 64
[download_content_length] => 41
[upload_content_length] => 42
[starttransfer_time] => 0.656
[redirect_time] => 0
[redirect_url] =>
[primary_ip] => XXXXXXXXXXX
[certinfo] => Array
(
)
)
-----RESPONSE----------------
HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
X-FRAME-OPTIONS: SAMEORIGIN
Set-Cookie: unifises=XXXXXXXXXXXX; Path=/; Secure; HttpOnly
Set-Cookie: csrf_token=XXXXXXXXXXXXXX; Path=/; Secure
Content-Type: application/json;charset=UTF-8
Content-Length: 41
Date: Wed, 06 Jul 2016 03:25:47 GMT
{ "data" : [ ] , "meta" : { "rc" : "ok"}}
-----------------------------`
Then i have a logout and seems to be ok aswell... what is going on? im trying unifi 5.1.1 Beta at the moment..
Thank you in advance...
The text was updated successfully, but these errors were encountered: