Skip to content

Commit 7c73961

Browse files
Merge branch 'master' of github.com:ZoneMinder/zoneminder
2 parents 67f9d75 + b2861d5 commit 7c73961

File tree

5 files changed

+24
-11
lines changed

5 files changed

+24
-11
lines changed

scripts/ZoneMinder/lib/ZoneMinder/Control/TapoC520WS_ONVIF.pm

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,11 @@ sub autoStop {
275275
my $iszoom = shift;
276276

277277
if ( $autostop ) {
278-
Debug('Auto Stop');
278+
my $duration = $autostop * $self->{Monitor}{AutoStopTimeout};
279+
$duration = ($duration < 1000) ? $duration * 1000 : int($duration/1000);
280+
# Change from microseconds to milliseconds or seconds to milliseconds
281+
Debug("Calculate duration $duration from autostop($autostop) and AutoStopTimeout ".$self->{Monitor}{AutoStopTimeout});
282+
279283
my $cmd = $controlUri;
280284
my $msg_body;
281285
if ( $iszoom) {
@@ -299,7 +303,7 @@ sub autoStop {
299303
}
300304

301305
my $content_type = 'application/soap+xml; charset=utf-8; action="http://www.onvif.org/ver20/ptz/wsdl/ContinuousMove"';
302-
usleep($autostop);
306+
usleep($duration);
303307
$self->sendCmd($cmd, $msg_body, $content_type);
304308
}
305309
}

web/ajax/modals/download.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@
3838
}
3939
if (isset($_REQUEST['maxTimeSecs'])) {
4040
}
41-
if (isset($_REQUEST['minTime'])) {
41+
if (isset($_REQUEST['minTime']) and !$filter->has_term('DateTime', '>='))) {
4242
$filter->addTerm(array('attr' => 'StartDateTime', 'op' => '>=', 'val' => $_REQUEST['minTime'], 'cnj' => 'and'));
4343
$exportFileName .= ' '.$_REQUEST['minTime'];
4444
}
45-
if (isset($_REQUEST['maxTime'])) {
45+
if (isset($_REQUEST['maxTime']) and !$filter->has_term('DateTime', '<='))) {
4646
$filter->addTerm(array('attr' => 'StartDateTime', 'op' => '<=', 'val' => $_REQUEST['maxTime'], 'cnj' => 'and'));
4747
$exportFileName .= ' '.$_REQUEST['maxTime'];
4848
}

web/includes/Filter.php

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1135,6 +1135,9 @@ public function simple_widget() {
11351135
#$html .= ($i == 0) ? '' : htmlSelect("filter[Query][terms][$i][cnj]", $conjunctionTypes, $term['cnj']).PHP_EOL;
11361136
$html .= ($i == 0) ? '' : html_input("filter[Query][terms][$i][cnj]", 'hidden', $term['cnj']).PHP_EOL;
11371137
if ( isset($term['attr']) ) {
1138+
if (($term['attr'] == 'Tags') and (count($availableTags)<=1)) {
1139+
continue;
1140+
}
11381141
$html .= '<span class="term '.$term['attr'].'"><span class="term-label-wrapper"><label>'.$attrTypes[$term['attr']].'</label>';
11391142
$html .= html_input("filter[Query][terms][$i][attr]", 'hidden', $term['attr']);
11401143
$html .= html_input("filter[Query][terms][$i][op]", 'hidden', $term['op']).PHP_EOL;
@@ -1160,10 +1163,10 @@ public function simple_widget() {
11601163
// echo '<div style="background-color:lightblue"><pre>selected: '; print_r($selected); echo '</pre></div>';
11611164
// echo '<div style="background-color:green"><pre>options: '; print_r($options); echo '</pre></div>';
11621165

1163-
$html .= '<span class="term-value-wrapper">';
1164-
$html .= htmlSelect("filter[Query][terms][$i][val]", $availableTags, $selected, $options).PHP_EOL;
1165-
$html .= $this->addButtonForFilterSelect("filter[Query][terms][$i][val]");
1166-
$html .= '</span>';
1166+
$html .= '<span class="term-value-wrapper">';
1167+
$html .= htmlSelect("filter[Query][terms][$i][val]", $availableTags, $selected, $options).PHP_EOL;
1168+
$html .= $this->addButtonForFilterSelect("filter[Query][terms][$i][val]");
1169+
$html .= '</span>';
11671170
// $html .= '<span>'.htmlSelect("filter[Query][terms][$i][val]", array_combine($availableTags,$availableTags), $term['val'],
11681171
// $options).'</span>'.PHP_EOL;
11691172
// $html .= '<span>'.htmlSelect("filter[Query][terms][$i][val]", $availableTags, $term['val'], $options).'</span>'.PHP_EOL;
@@ -1173,8 +1176,6 @@ public function simple_widget() {
11731176
// Debug('$selected: '.$selected);
11741177
// Debug('$options: '.$options);
11751178

1176-
1177-
11781179
} else if ( $term['attr'] == 'DateTime' || $term['attr'] == 'StartDateTime' || $term['attr'] == 'EndDateTime') {
11791180
$html .= '<span class="term-value-wrapper">';
11801181
$html .= '<input type="text" class="term-value datetimepicker" name="filter[Query][terms]['.$i.'][val]"';

web/includes/auth.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,14 @@ function get_auth_relay() {
414414

415415
if (ZM_AUTH_HASH_LOGINS && empty($user) && !empty($_REQUEST['auth'])) {
416416
$user = getAuthUser($_REQUEST['auth']);
417+
if ($user) {
418+
$remoteAddr = ZM_AUTH_HASH_IPS ? $_SESSION['remoteAddr'] : '';
419+
if (isset($_SESSION['AuthHash'.$remoteAddr]) and ($_SESSION['AuthHash'.$remoteAddr] != $_REQUEST['auth'])) {
420+
unset($_SESSION['AuthHashGeneratedAt']);
421+
unset($_SESSION['AuthHash'.$remoteAddr]);
422+
}
423+
$_SESSION['username'] = $user->Username();
424+
}
417425
} else if (!(empty($_REQUEST['user']) or empty($_REQUEST['pass']))) {
418426
# The shortened versions are used in auth_relay = PLAIN
419427
$ret = validateUser($_REQUEST['user'], $_REQUEST['pass']);

web/index.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,8 +292,8 @@
292292
}
293293

294294
if (!$view) {
295-
ZM\Debug(1, "Empty view, defaulting to home view");
296295
$view = getHomeView();
296+
ZM\Debug("Empty view, defaulting to home view".$view);
297297
header('Location: ?view='.$view);
298298
return;
299299
}

0 commit comments

Comments
 (0)