diff --git a/db/zmalter-1.21.3.sql b/db/zmalter-1.21.3.sql index d5028b8ae..3e43906d3 100644 --- a/db/zmalter-1.21.3.sql +++ b/db/zmalter-1.21.3.sql @@ -11,6 +11,7 @@ alter table Monitors add column DefaultScale smallint unsigned after ReturnDelay alter table Monitors modify column Type enum('Local','Remote','File') NOT NULL default 'Local'; alter table Events add column Height smallint(5) unsigned not null default '0' after EndTime; alter table Events add column Width smallint(5) unsigned not null default '0' after EndTime; +alter table Users add column MaxBandwidth varchar(16) not null default '' after System; -- -- These are optional, but we might as well do it now -- diff --git a/web/zm_actions.php b/web/zm_actions.php index 70bd9f7ca..d345437df 100644 --- a/web/zm_actions.php +++ b/web/zm_actions.php @@ -1254,6 +1254,7 @@ if ( isset($action) ) if ( $new_control != $row['Control'] ) $changes[] = "Control = '$new_control'"; if ( $new_monitors != $row['Monitors'] ) $changes[] = "Monitors = '$new_monitors'"; if ( $new_system != $row['System'] ) $changes[] = "System = '$new_system'"; + if ( $new_max_bandwidth != $row['MaxBandwidth'] ) $changes[] = "MaxBandwidth = '$new_max_bandwidth'"; if ( $new_monitor_ids != $row['MonitorIds'] ) $changes[] = "MonitorIds = '$new_monitor_ids'"; if ( count( $changes ) ) diff --git a/web/zm_config.php.z b/web/zm_config.php.z index abd7c3cb6..a084e71d1 100644 --- a/web/zm_config.php.z +++ b/web/zm_config.php.z @@ -188,7 +188,7 @@ $jws = array( 'state' => array( 'w'=>300, 'h'=>120 ), 'stats' => array( 'w'=>680, 'h'=>200 ), 'timeline' => array( 'w'=>760, 'h'=>500 ), - 'user' => array( 'w'=>280, 'h'=>340 ), + 'user' => array( 'w'=>280, 'h'=>372 ), 'version' => array( 'w'=>320, 'h'=>140 ), 'video' => array( 'w'=>100, 'h'=>80 ), 'watch' => array( 'w'=>96, 'h'=>384 ), diff --git a/web/zm_html.php b/web/zm_html.php index 2dc4978fc..dfa6a0d21 100644 --- a/web/zm_html.php +++ b/web/zm_html.php @@ -102,6 +102,22 @@ if ( !isset($user) ) } } } +else +{ + // Bandwidth Limiter + if ( !empty($user['MaxBandwidth']) ) + { + if ( $user['MaxBandwidth'] == "low" ) + { + $bandwidth = "low"; + } + elseif ( $user['MaxBandwidth'] == "medium" && $bandwidth = "high" ) + { + $bandwidth = "medium"; + } + } +} + if ( !isset($view) ) { $view = "console"; diff --git a/web/zm_html_view_bandwidth.php b/web/zm_html_view_bandwidth.php index 7ad9711e9..1e1f1840b 100644 --- a/web/zm_html_view_bandwidth.php +++ b/web/zm_html_view_bandwidth.php @@ -20,6 +20,19 @@ $new_bandwidth = $bandwidth; +if ( $user && !empty($user['MaxBandwidth']) ) +{ + if ( $user['MaxBandwidth'] == "low" ) + { + unset( $bw_array['high'] ); + unset( $bw_array['medium'] ); + } + elseif ( $user['MaxBandwidth'] == "medium" ) + { + unset( $bw_array['high'] ); + } +} + ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> diff --git a/web/zm_html_view_console.php b/web/zm_html_view_console.php index 31448cc89..01da25fe6 100644 --- a/web/zm_html_view_console.php +++ b/web/zm_html_view_console.php @@ -235,7 +235,7 @@ else <?php } ?> - <a href="javascript: newWindow( '<?= $PHP_SELF ?>?view=bandwidth', 'zmBandwidth', <?= $jws['bandwidth']['w'] ?>, <?= $jws['bandwidth']['h'] ?>);"><?= strtolower( $bw_array[$bandwidth] ) ?></a> <?= strtolower( $zmSlangBandwidth ) ?></td> + <?= makeLink( "javascript: newWindow( '$PHP_SELF?view=bandwidth', 'zmBandwidth', ".$jws['bandwidth']['w'].", ".$jws['bandwidth']['h']." );", strtolower( $bw_array[$bandwidth] ), ($user && $user['MaxBandwidth'] != 'low' ) ) ?> <?= strtolower( $zmSlangBandwidth ) ?></td> <td class="smallhead" align="right"><table width="100%" border="0" cellpadding="0" cellspacing="0"><tr><td class="smallhead" align="left"> <?php if ( canView( 'Stream' ) && $cycle_count > 1 ) diff --git a/web/zm_html_view_options.php b/web/zm_html_view_options.php index bcb02ce3b..5c9eb0144 100644 --- a/web/zm_html_view_options.php +++ b/web/zm_html_view_options.php @@ -144,7 +144,7 @@ foreach ( $tabs as $name=>$value ) else { ?> -<td width="10" class="passivetab"><a href="<?= $PHP_SELF ?>?view=<?= $view ?>&tab=<?= $name ?>"?><?= $value ?></a></td> +<td width="10" class="passivetab"><a href="<?= $PHP_SELF ?>?view=<?= $view ?>&tab=<?= $name ?>"><?= $value ?></a></td> <?php } } @@ -171,6 +171,7 @@ if ( $tab == "users" ) <td align="left" class="smallhead"><?= $zmSlangControl ?></td> <td align="left" class="smallhead"><?= $zmSlangMonitors ?></td> <td align="left" class="smallhead"><?= $zmSlangSystem ?></td> +<td align="left" class="smallhead"><?= $zmSlangBandwidth ?></td> <td align="left" class="smallhead"><?= $zmSlangMonitor ?></td> <td align="left" class="smallhead"><?= $zmSlangMark ?></td> </tr> @@ -191,14 +192,15 @@ if ( $tab == "users" ) <td align="left" class="ruled"><?= $row['Control'] ?></td> <td align="left" class="ruled"><?= $row['Monitors'] ?></td> <td align="left" class="ruled"><?= $row['System'] ?></td> +<td align="left" class="ruled"><?= $row['MaxBandwidth']?$bw_array[$row['MaxBandwidth']]:' ' ?></td> <td align="left" class="ruled"><?= $row['MonitorIds']?$row['MonitorIds']:" " ?></td> <td align="center" class="ruled"><input type="checkbox" name="mark_uids[]" value="<?= $row['Id'] ?>" onClick="configureButton( document.user_form, 'mark_uids' );"<?php if ( !canEdit( 'System' ) ) { ?> disabled<?php } ?>></td> </tr> <?php } ?> -<tr><td colspan="10" class="ruled"> </td></tr> -<tr><td colspan="10" align="right"><input type="button" value="<?= $zmSlangAddNewUser ?>" class="form" onClick="javascript: newWindow( '<?= $PHP_SELF ?>?view=user&uid=-1', 'zmUser', <?= $jws['user']['w'] ?>, <?= $jws['user']['h'] ?> );"<?php if ( !canEdit( 'System' ) ) { ?> disabled<?php } ?>> <input type="submit" name="delete_btn" value="<?= $zmSlangDelete ?>" class="form" disabled> <input type="button" value="<?= $zmSlangCancel ?>" class="form" onClick="closeWindow();"></td></tr> +<tr><td colspan="12" class="ruled"> </td></tr> +<tr><td colspan="12" align="right"><input type="button" value="<?= $zmSlangAddNewUser ?>" class="form" onClick="javascript: newWindow( '<?= $PHP_SELF ?>?view=user&uid=-1', 'zmUser', <?= $jws['user']['w'] ?>, <?= $jws['user']['h'] ?> );"<?php if ( !canEdit( 'System' ) ) { ?> disabled<?php } ?>> <input type="submit" name="delete_btn" value="<?= $zmSlangDelete ?>" class="form" disabled> <input type="button" value="<?= $zmSlangCancel ?>" class="form" onClick="closeWindow();"></td></tr> </form> <?php } diff --git a/web/zm_html_view_user.php b/web/zm_html_view_user.php index 303b98136..316d86c31 100644 --- a/web/zm_html_view_user.php +++ b/web/zm_html_view_user.php @@ -119,6 +119,11 @@ $nve = array( 'None'=>$zmSlangNone, 'View'=>$zmSlangView, 'Edit'=>$zmSlangEdit ) <tr><td align="right" class="text"><?= $zmSlangControl ?></td><td align="left" class="text"><?= buildSelect( "new_control", $nve ) ?></td></tr> <tr><td align="right" class="text"><?= $zmSlangMonitors ?></td><td align="left" class="text"><?= buildSelect( "new_monitors", $nve ) ?></td></tr> <tr><td align="right" class="text"><?= $zmSlangSystem ?></td><td align="left" class="text"><?= buildSelect( "new_system", $nve ) ?></td></tr> +<?php +$new_max_bandwidth = $row['MaxBandwidth']; +$bandwidths = array_merge( array( ""=>"" ), $bw_array ); +?> +<tr><td align="right" class="text"><?= $zmSlangMaxBandwidth ?></td><td align="left" class="text"><?= buildSelect( "new_max_bandwidth", $bandwidths ) ?></td></tr> <tr><td align="right" class="text"><?= $zmSlangRestrictedCameraIds ?></td><td align="left" class="text"><input type="text" name="new_monitor_ids" value="<?= $row['MonitorIds'] ?>" size="16" class="form"></td></tr> <tr> <td align="right"><input type="submit" value="<?= $zmSlangSave ?>" class="form"></td><td align="left"><input type="button" value="<?= $zmSlangClose ?>" class="form" onClick="closeWindow()"></td> diff --git a/web/zm_lang_en_gb.php b/web/zm_lang_en_gb.php index 1c0789bcd..de75b1328 100644 --- a/web/zm_lang_en_gb.php +++ b/web/zm_lang_en_gb.php @@ -317,6 +317,7 @@ $zmSlangMain = 'Main'; $zmSlangMan = 'Man'; $zmSlangManual = 'Manual'; $zmSlangMark = 'Mark'; +$zmSlangMaxBandwidth = 'Max Bandwidth'; $zmSlangMaxBrScore = 'Max.<br/>Score'; $zmSlangMaxFocusRange = 'Max Focus Range'; $zmSlangMaxFocusSpeed = 'Max Focus Speed';