Commit Graph

1979 Commits

Author SHA1 Message Date
Isaac Connor
016fda22ce reduce duplicated db code from Config. Use fully namespace'd variables so we can use require instead of use 2019-03-01 12:31:41 -05:00
Isaac Connor
1828ea2d6f small cleanup of zmstats 2019-03-01 10:26:55 -05:00
Isaac Connor
af9c87a112 Merge branch 'master' into storageareas 2019-02-27 10:53:19 -05:00
Isaac Connor
849442502c add support for server based zmeventnotification 2019-02-27 09:28:15 -05:00
Isaac Connor
fd310c0f0a Merge branch 'master' into storageareas 2019-02-22 11:33:47 -05:00
Isaac Connor
2b90bf15a6 Improve session (#2487)
* Introduce ZM_COOKIE_LIFETIME which sets the life of the SESSION cookie, instead of using what is in php.ini

* Use zm specific session functions, which are now located in includes/session.php.  Be more agressive about clearing session on logout.

* Move session code to includes/session.php

* remove duplicate line

* Move is_session_open to session.php.  Move code to clear a session into session.php

* improve debug line when there is a problem updating config entry

* split description into description and help text for COOKIE_LIFETIME

* Remove redirect on line.  We do it in javascript on postlogin view so that we can say logging in before switching to console

* If there is a username in the session, then we are logged in, but we need to load the user object from the db.  We can't just trust it from the session. The user may have been deleted and having that data in the session can be a security risk. So load the user object on every request.

* Use session_regenerate_id instead of our broken code to do the same

* Move auth code to includes/auth.php

* add autocomplete tags to username and password inputs

* Don't redirect to login if we are already viewing login.  Put auth before including skin includes

* need to include session.php in auth.php

* update to php namespace
2019-02-22 09:43:38 -05:00
Chris
b8117f7fc9 Add support for control of Amcrest cameras (#2536)
* Add a control module to support the current Amcrest HTTP API

This patch adds ZoneMinder::Control::Amcrest_HTTP

This module is adapted and improved from one available on the ZoneMinder
forums.[1] It appears that a number of individuals have contributed to
it. This is an attempt to correct some of its interactions with ZM::Control
and friends as well as enhance and extend supported control features
for Amcrest cameras.

This work is based on Amcrest HTTP Protocol API Specifications
Rev. 2.12 2017-03-15

[1]https://forums.zoneminder.com/download/file.php?id=1878

* Fixing zoom methods

* Misc. cleanup of comments, etc.

* Fixing up POD, etc.

* Converting line endings to Unix

* Fixing up preset methods

The current Amcrest HTTP API does not support a Home command per se. So this
method is set up to send the camera to the first preset position. Of course,
this presupposes that the user will setup a preset #1 otherwise the command
will fail on a bad preset error.

If a future version of the API supports a true Home command, we'll adjust
at that point. For now this seems to be a useful workaround.

* Removing duplicate home method

* Adding moveAbs method

I'm putting this in, but absolute camera movement does not seem to be well
supported in the classic skin ATM. Reading
www/skins/classic/include/control_functions.php seems to indicate
a faulty implementation, unless I'm reading it wrong. I see nowhere
where the user is able to specify the absolute location to move to. Rather,
the call is passed back movement in increments of 1 unit. At least with the
Amcrest/Duhua API this would result in the camera moving to the 1* or 0* etc.
position.

moveAbsUp, Down, Left, Right, etc. Doesn't make sense given the definition
of Absolute movement.

* Adding a note about the moveMap method

This method does not appear to be implemented in the classic skin,
but we'll leave it here for future implementation. Caveat: It may
or may not work as-is.

* Fixing up zoomConTele/Wide methods

* Adding a vanilla control type for the Amcrest HTTP API

Please note that this control type matches (mostly) the currently
available control options in Amcrest_HTTP.pm. It does not match
all (or possibly any) of the control options available on a specific
Amcrest camera. The user may need to create their own control type
specific to the camera model they are using.

* Removing misplaced comment

Thanks to connortechnology for pointing this out!
2019-02-22 09:17:28 -05:00
Isaac Connor
24845e0457 Merge branch 'master' into storageareas 2019-02-14 15:40:52 -05:00
Isaac Connor
62bf7d54f1 close sth's on Fatal to prevent error message 2019-02-14 15:40:42 -05:00
Isaac Connor
a3374aa26c Merge branch 'reload_zmfilter_on_filter_save' into storageareas 2019-02-11 13:26:53 -05:00
Steve Gilvarry
87413d447d Set CSRF on as the default for new installs. Fixes #2507 (#2508)
* Set CSRF on as the default for new installs. Not sure we can impact config on existing installations.

* Fix the spelling mistake that I noticed after editing this.
2019-02-10 13:08:58 -05:00
Isaac Connor
555cb4780d Merge branch 'master' into storageareas 2019-02-10 12:37:45 -05:00
Isaac Connor
e2fc0ea25d Increase navbar refresh times. 5 seconds is way too fast 2019-02-08 10:22:42 -05:00
Isaac Connor
d121ecab75 Merge branch 'improve_session' into storageareas 2019-02-05 15:48:42 -05:00
Isaac Connor
5b288d3b67 split description into description and help text for COOKIE_LIFETIME 2019-02-05 11:39:50 -05:00
Isaac Connor
a176c9bbd2 improve debug line when there is a problem updating config entry 2019-02-05 11:39:21 -05:00
Isaac Connor
4e10e6f0ae Merge branch 'improve_session' into storageareas 2019-01-30 15:26:37 -05:00
Isaac Connor
1e56e750cf Introduce ZM_COOKIE_LIFETIME which sets the life of the SESSION cookie, instead of using what is in php.ini 2019-01-30 11:04:38 -05:00
Isaac Connor
cc8de69eba Merge branch 'master' into storageareas 2019-01-22 11:44:42 -05:00
Isaac Connor
e60e3666d5 Fix comment 2019-01-22 10:53:53 -05:00
Matt N
0619a4a161 Validate cnj, obr, and cbr arguments in parseFilter (#2434) 2019-01-22 08:03:25 -05:00
Isaac Connor
b8d065275b Merge branch 'master' into storageareas 2019-01-04 15:22:18 -05:00
techrockedge
571daec8fc Merge branch 'master' of git://github.com/ZoneMinder/zoneminder
refresh with master
2019-01-03 15:02:57 -05:00
techrockedge
e21b8dc1f9 changed to ZM db functions 2019-01-02 16:01:33 -05:00
techrockedge
51d3e6b2cd changed to ZM db functions 2019-01-02 14:09:35 -05:00
Andrew Bauer
bd2b761bcd change configdata.pm.in defaults 2018-12-31 09:54:48 -06:00
techrockedge
f25e176b88 added create table if not exist 2018-12-29 20:57:46 -05:00
techrockedge
60d5880694 Merge branch 'master' of git://github.com/ZoneMinder/zoneminder 2018-12-29 19:36:20 -05:00
techrockedge
2cac25d353 removed unused preset code 2018-12-29 19:35:16 -05:00
Isaac Connor
5060358870 Merge branch 'master' into storageareas 2018-12-29 09:56:53 -05:00
Andrew Bauer
3258d8e590 remove ZM_DIR_IMAGES (#2374) 2018-12-29 09:52:58 -05:00
techrockedge
bcbe9075f9 fixed preset delete and set 2018-12-28 21:11:52 -05:00
techrockedge
826201a3f9 Merge branch 'master' of git://github.com/ZoneMinder/zoneminder 2018-12-28 20:32:04 -05:00
Isaac Connor
1a1231fdaa Merge branch 'master' into storageareas 2018-12-28 10:47:27 -05:00
Jonathan Meredith
265a73ab29 Spelling mistake fix
Changed his to this
2018-12-27 22:26:07 -05:00
Isaac Connor
3e06bbcef8 Merge branch 'master' into storageareas 2018-12-27 13:50:29 -05:00
Isaac Connor
08e5166bcb remove quotes around state in command documentation. 2018-12-27 12:24:50 -05:00
Isaac Connor
c017219a1e use do instead of many lines of dbi. Cleanup logic around command detection 2018-12-27 12:22:06 -05:00
techrockedge
f815aaa5f5 Merge branch 'master' of git://github.com/ZoneMinder/zoneminder 2018-12-21 19:46:45 -05:00
Isaac Connor
7a8beffdcc Merge branch 'master' into storageareas 2018-12-20 15:10:52 -05:00
Isaac Connor
e626049f6b Merge branch 'swresample' into storageareas 2018-12-20 14:08:40 -05:00
Isaac Connor
0c09616059 put back privacy notice update 2018-12-20 13:58:09 -05:00
Isaac Connor
88e148068e Logging and whitespace 2018-12-20 13:56:57 -05:00
Isaac Connor
6af8f0d419 Logging and whitespace 2018-12-20 13:55:18 -05:00
Isaac Connor
64bdf40e86 Logging and whitespace changes. No logical changes 2018-12-20 13:50:55 -05:00
Isaac Connor
eccfdb8a6a Logging and whitespace changes. No logical changes 2018-12-20 13:50:07 -05:00
Isaac Connor
3a068ae6a3 Merge branch 'master' into swresample 2018-12-16 16:15:28 -05:00
techrockedge
180a4b07b1 foscam r2c ptz 2018-12-14 19:13:41 -05:00
techrockedge
51b4c27b27 foscam r2c ptz 2018-12-14 17:30:45 -05:00
Isaac Connor
0bfe1007c8 Merge branch 'master' into storageareas 2018-12-14 10:16:08 -05:00