Commit Graph

877 Commits

Author SHA1 Message Date
Isaac Connor 0dd4a23770 Add Config for showing a system shutdown/restart option 2019-04-12 09:36:30 -04:00
Isaac Connor 3abf263e7a fixup half-merged changes to filter to view in montagereview 2019-04-08 16:57:41 -04:00
Isaac Connor e1873b1693 debug response content 2019-04-05 15:17:13 -04:00
Isaac Connor aaef151815 ZM_VERSION is a constant not a scalar variable 2019-04-05 13:18:06 -04:00
Isaac Connor d579faa291 attr in modern ZM should be StartWeekday. Continue to support legacy filters 2019-03-28 15:13:53 -04:00
Isaac Connor 7b878a4c64 Sync up quotes and space differences frmo zma_to_thread 2019-03-19 17:15:32 -04:00
Isaac Connor 3f9564c10a Merge branch 'master' into storageareas 2019-03-19 10:37:35 -04:00
Chris ad5f6a8729 Camera reboot function (#2554)
* Adding a button for camera reboot function

This series of commits will add a camera reboot function to the
control interface if supported by the camera configuration.

* Adding reboot function option to contorl configuration

This patch adds a reboot option to the camera control configuration
view.

* Adding Reboot field to Controls table

This patch adds a Reboot field to the Controls table to support
a camera reboot control option.

* Correcting button value to match reset

* Updating language files

I'm not sure of the proper procedure to trigger updating of
non-english language files so I'm updating them all with English
hoping that that will draw attention to the changes and others
will translate accordingly.

* Add missing forward slash
2019-03-18 14:49:05 -04:00
Isaac Connor 520c41da23 Merge ../ZoneMinder.connortechnology.bad into storageareas 2019-03-18 14:40:03 -04:00
Chris 6ee689f4bf Dahua control improvements (#2552)
* Adding a presetHome method

The Dahua protocol does not appear to support a preset Home feature. We could
allow the user to assign a preset slot as the "home" slot. Dahua does appear
to support naming presets which may lend itself to this sort of thing. At
this point, we'll just send the camera back to center and zoom wide. (0°,0°,0)

* Adjusting naming of private methods and adding POD

* Adding relative focus methods

This patch also adds the return value of the get request used to
send the command to the camera.

Furthermore, it fixes a small bug in the authentication of requests
sent to the camera after the connection is opened. I really have no
idea why the problem occurred and it appeared to have no practical
effect on the execution of the command. It showed up when I enabled
debug, so this attempts to fix it or at least quiet it.

* Adding POD for the new relative focus methods

Also doing a bit of cleanup on POD in general.

* Adding some documentation to demystify control motion types

This was not clear to me at the outset, and I could not locate existing
documentation which explained the prioritization and exclusion aspects.

Maybe it will help someone else.

* Renaming private methods and adding more POD

This patch renames private methods by prefixing an underscore to
them. This at least helps visually distinguish them as private
when reading through the code.

It also adds more documentation on public methods.

* Grouping all relative motion methods together

This makes for easier reading.

* Adding in a reset method from Issue #2414

This method was supplied by kobold81 who got it from
bobylapointe69300 who posted it in the following forum post:

https://forums.zoneminder.com/viewtopic.php?f=9&t=27000&p=104601&hilit=dahua#p104601

This patch also includes some POD cleanup.

* Adding continuous movement methods and fixing reset

This patch adds the continuous movement methods provided in the patch
for Issue #2414. Note that these are not truly continuous as they
result in movement for less than a ms. Adapting the code to support
truly continuous movement would invovle some considerable work.

This patch also correct the reset method and adds a reboot method.
The two are different creatures with different effects.

POD added as well.

* Removing redundant get request code

Two slightly different versions of code are currently used to post
the get request to the camera in order to execute commands. This
patch modifies the open method in order to allow its re-use and
removes redundant code.

Note: This is the first installment on changes towards improving
the way the HTTP transactions are handled.

* Making authenication failures fatal

Authentication failures result in camera commands not being executed.
They may as well be fatal and return the general reason to the user
directly.

* Work on persistent sessions

I think this will have to wait since it appears that the camera expects
some sort of keepalive/heartbeat signal to keep the session open.

* Restoring accidentally deleted code
2019-03-12 11:09:57 -04:00
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 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 2cac25d353 removed unused preset code 2018-12-29 19:35:16 -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
techrockedge f815aaa5f5 Merge branch 'master' of git://github.com/ZoneMinder/zoneminder 2018-12-21 19:46:45 -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
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
Pliable Pixels ebaafef607 Ffmpeg logs optional (#2345)
* make ffmpeg logs configurable via web

* fix Info
2018-12-14 08:01:23 -05:00
Isaac Connor b61eb7d4fc Merge branch 'master' of github.com:ZoneMinder/ZoneMinder 2018-12-13 10:53:56 -05:00
Isaac Connor 0c5eead929 Merge branch 'master' into fix_startup_db_connection 2018-12-13 10:53:34 -05:00
Isaac Connor 0c7f91c38a Merge branch 'master' into storageareas 2018-12-03 16:25:28 -05:00
Isaac Connor f2f1e230d1 put back missing ! 2018-12-03 16:25:03 -05:00
Isaac Connor df0b600431 Merge branch 'master' into storageareas 2018-11-29 10:49:06 -05:00
Isaac Connor 45a9f9158d spelling mistakes 2018-11-29 10:45:30 -05:00
Isaac Connor 3f4e918b9e Merge branch 'zmaudit_check_other_storageareas' into storageareas 2018-11-26 15:09:14 -05:00
Isaac Connor d6fb4e1910 Add StorageId function to clear Storage when you set a new StorageId. Clear Path when assigning a new StorageArea 2018-11-26 15:09:04 -05:00
Isaac Connor dea5db9dd9 Merge branch 'zmaudit_check_other_storageareas' into storageareas 2018-11-23 11:11:39 -05:00
Andrew Bauer e5f2212a32 fix gpl mailing address 2018-11-15 20:00:53 -06:00
Isaac Connor 35b439629c Merge branch 'master' of github.com:ZoneMinder/ZoneMinder 2018-11-13 18:14:35 -05:00
Isaac Connor d2dc23b4e9 fixes, better logging 2018-11-13 16:35:09 -05:00
Isaac Connor 73c52705f2 Merge branch 'fix_32bit_alignment' into storageareas 2018-11-13 14:22:06 -05:00
Isaac Connor e8ed1367d7 Merge branch 'master' into storageareas 2018-11-13 14:22:00 -05:00
Isaac Connor 798bf68df1 add function time_of_youngest_file to determine the youngest file in an event dir, so as to guess the starttime of the event. 2018-11-13 14:13:32 -05:00
Isaac Connor 31b0ed107d remove epadding2, to restore the 64bit alignment of startup_time. A proper fix instead of #2258 2018-11-13 14:02:44 -05:00
Isaac Connor 07d6d799ce Merge branch 'master' of github.com:ZoneMinder/ZoneMinder 2018-11-13 10:30:58 -05:00
Isaac Connor 993da131f1 tidy up and use Error instead of Carp::croak 2018-11-13 10:29:19 -05:00
Isaac Connor 1e98ecb595 Sort keys in to_string 2018-11-09 12:14:39 -05:00
Isaac Connor 5f81e9111f Add Scheme and SaveJPEGs to Event fields, and fix setting Scheme 2018-11-09 12:14:05 -05:00
Andrew Bauer d6877b763d
Merge pull request #2298 from connortechnology/log_use_global_dbh
Use the global dbh in ZoneMinder::Database instead of keeping our own…
2018-11-07 12:29:11 -06:00
Isaac Connor 0e3eb0df17 remove extra quotes, google code style, update pod docs 2018-11-07 11:26:48 -05:00
Isaac Connor 0ebcef7324 in poddoc and over needs a =back 2018-11-07 11:01:12 -05:00
Isaac Connor 56bdd53757 Use the global dbh in ZoneMinder::Database instead of keeping our own copy of it in Logger 2018-11-07 10:40:44 -05:00
Isaac Connor 93bf05be4e Merge branch 'zmrecover' into storageareas 2018-11-06 20:37:35 -05:00
Isaac Connor 9a96785fa4 Add in Frame.php 2018-11-06 20:37:00 -05:00
Isaac Connor 5a6ffe758a Merge branch 'zmrecover' into storageareas 2018-11-06 15:29:02 -05:00
Isaac Connor 181a8c29e1 Add SaveJPEGs to Event 2018-11-06 15:28:37 -05:00
Isaac Connor 6d6d25261f Merge branch 'zmrecover' into storageareas 2018-11-06 12:14:54 -05:00
Isaac Connor 3cd1887d54 Cleanup POSIX use. Fix conflict between POSIX and Date::Format. 2018-11-06 12:14:42 -05:00
Isaac Connor aa9bb81b61 Merge branch 'zmrecover' into storageareas 2018-11-06 09:57:01 -05:00
Isaac Connor e0bc0484d4 Add empty string default for DefaultVideo 2018-11-06 09:56:29 -05:00
Isaac Connor 18b327b4ac Turn off massive debugging 2018-11-06 09:55:53 -05:00
Isaac Connor e1a5940254 Merge branch 'zmrecover' into storageareas 2018-11-05 16:53:01 -05:00
Isaac Connor 451c42ddf5 Implement rmrecover script. Flush out Object code to support find, find_one, find_sql, improve to_string, etc. 2018-11-05 16:52:34 -05:00
Isaac Connor 4b24bf4e36 merge from storageareas, fully specify Module for zmDbDisconnect as we havn't 'used' it 2018-11-02 11:48:35 -04:00
Isaac Connor 372c6b7f69 explicitly call ZoneMinder::Database::zmDbDisconnect 2018-10-17 20:57:24 -04:00
Isaac Connor 7149576a7c Merge branch 'smarter_packetqueue' into storageareas 2018-10-15 10:59:50 -04:00
Andrew Bauer 7ffc5ab266
Merge branch 'master' into control_plugin_psia 2018-10-11 09:32:06 -05:00
Isaac Connor 1958351a13 Merge branch 'master' into storageareas 2018-10-09 10:24:24 -04:00
Isaac Connor 56b31becb2 Add explicit db disconnect in Fatal(). If we don't disconnect then we leave sockets hanging around in TIME_WAIT (I think). 2018-10-04 10:47:38 -04:00
Isaac Connor 33bd30fbbd Merge branch 'master' into storageareas 2018-09-28 13:40:18 -04:00
Isaac Connor d45406bce7 ode style and some more debug 2018-09-28 11:50:34 -04:00
Isaac Connor e6f366c5cb Merge branch 'master' of github.com:zoneminder/ZoneMinder 2018-09-28 09:48:37 -04:00
Isaac Connor 5fd1034b0b Add ServerId to perl Logging to DB 2018-09-25 13:53:50 -04:00
Isaac Connor af69dab9c5 Merge branch 'master' of github.com:zoneminder/ZoneMinder 2018-09-22 14:58:28 -04:00
Isaac Connor 6aa71dfc11 Fix calculation of LinkPath, as it was using RelativePath instead of Path 2018-09-21 10:31:11 -04:00
Jonathan Lassoff c7e1e7b901 Control plugin for Dahua PTZ cameras (#2192)
* Control plugin for Dahua PTZ cameras

* Update http/https protocol handling

* Update doc and license

* Remove license from top of file

* Use named regex capture groups for ControlAddress parsing

* Remove trailing whitespace in Trendnet.pm
2018-09-20 12:29:54 -04:00
Isaac Connor f2a117c85b fix undefined $event 2018-09-14 11:06:08 -04:00
Isaac Connor ca3fd5ddf8 get rid of deleteEventFiles function. People should use the object method 2018-09-14 10:08:35 -04:00
Isaac Connor 11137d271e Create utility functions in event for creating linkPath and idPath. Replace the code in Generate::createEventPath with using these nice new functions 2018-09-14 10:06:36 -04:00
Isaac Connor 63bed3af10 replace all uses of getEventPath with object function event->Path(). Remove getEventPath 2018-09-14 09:23:09 -04:00
Jonathan Lassoff 7bcf9d59e1 Use named regex capture groups. 2018-09-12 12:55:31 +00:00
Isaac Connor 684f48979a Merge branch 'master' of github.com:ZoneMinder/ZoneMinder 2018-09-11 14:30:19 -04:00