diff --git a/web/api/app/Config/core.php b/web/api/app/Config/core.php index 5902a2235..feb8779bf 100644 --- a/web/api/app/Config/core.php +++ b/web/api/app/Config/core.php @@ -216,19 +216,18 @@ * */ Configure::write('Session', array( - 'defaults' => 'php', - 'cookie'=>'ZMSESSID' + 'defaults' => 'php' )); /** * A random string used in security hashing methods. */ - Configure::write('Security.salt', 'Q0MjGG2xRQEhJVQR85WhFJKI7f2St8RYMlVR7GNQ'); + Configure::write('Security.salt', 'URWfoFspTQASBP8afw8enOLNCSMWZnrh2TRwoGaF'); /** * A random numeric string (digits only) used to encrypt/decrypt strings. */ - Configure::write('Security.cipherSeed', '02670120062639232092038865362'); + Configure::write('Security.cipherSeed', '07283205205652438276688533540'); /** * Apply timestamps with the last modified time to static assets (js, css, images). diff --git a/web/includes/Monitor.php b/web/includes/Monitor.php index 9ebe76c3e..983bbbd86 100644 --- a/web/includes/Monitor.php +++ b/web/includes/Monitor.php @@ -13,6 +13,9 @@ class Monitor { if ( $this->{'Controllable'} ) { $s = dbFetchOne( 'SELECT * FROM Controls WHERE Id=?', NULL, array( $this->{'ControlId'} ) ); foreach ($s as $k => $v) { + if ( $k == 'Id' ) { + continue; + } $this->{$k} = $v; } } @@ -33,7 +36,7 @@ class Monitor { public function getStreamSrc( $args, $querySep='&' ) { if ( isset($this->{'ServerId'}) and $this->{'ServerId'} ) { $Server = new Server( $this->{'ServerId'} ); - $streamSrc = ZM_BASE_PROTOCOL.'://'.$Server->Hostname.ZM_PATH_ZMS; + $streamSrc = ZM_BASE_PROTOCOL.'://'.$Server->Hostname().ZM_PATH_ZMS; } else { $streamSrc = ZM_BASE_URL.ZM_PATH_ZMS; } diff --git a/web/includes/Server.php b/web/includes/Server.php index ec01ea032..97361e544 100644 --- a/web/includes/Server.php +++ b/web/includes/Server.php @@ -21,6 +21,9 @@ class Server { return $this->{'Name'}; } public function Hostname() { + if ( ! isset( $this->{'Hostname'} ) ) { + return $this->{'Name'}; + } return $this->{'Hostname'}; } } diff --git a/web/skins/classic/includes/control_functions.php b/web/skins/classic/includes/control_functions.php index b09a53138..d77818fbf 100644 --- a/web/skins/classic/includes/control_functions.php +++ b/web/skins/classic/includes/control_functions.php @@ -30,13 +30,13 @@ function getControlCommands( $monitor ) $cmds['PresetGoto'] = "presetGoto"; $cmds['PresetHome'] = "presetHome"; - if ( !empty($monitor['CanZoom']) ) + if ( !empty($monitor->CanZoom) ) { - if ( $monitor['CanZoomCon'] ) + if ( $monitor->CanZoomCon ) $cmds['ZoomRoot'] = "zoomCon"; - elseif ( $monitor['CanZoomRel'] ) + elseif ( $monitor->CanZoomRel ) $cmds['ZoomRoot'] = "zoomRel"; - elseif ( $monitor['CanZoomAbs'] ) + elseif ( $monitor->CanZoomAbs ) $cmds['ZoomRoot'] = "zoomAbs"; $cmds['ZoomTele'] = $cmds['ZoomRoot']."Tele"; $cmds['ZoomWide'] = $cmds['ZoomRoot']."Wide"; @@ -45,13 +45,13 @@ function getControlCommands( $monitor ) $cmds['ZoomMan'] = "zoomMan"; } - if ( !empty($monitor['CanFocus']) ) + if ( !empty($monitor->CanFocus) ) { - if ( $monitor['CanFocusCon'] ) + if ( $monitor->CanFocusCon ) $cmds['FocusRoot'] = "focusCon"; - elseif ( $monitor['CanFocusRel'] ) + elseif ( $monitor->CanFocusRel ) $cmds['FocusRoot'] = "focusRel"; - elseif ( $monitor['CanFocusAbs'] ) + elseif ( $monitor->CanFocusAbs ) $cmds['FocusRoot'] = "focusAbs"; $cmds['FocusFar'] = $cmds['FocusRoot']."Far"; $cmds['FocusNear'] = $cmds['FocusRoot']."Near"; @@ -60,13 +60,13 @@ function getControlCommands( $monitor ) $cmds['FocusMan'] = "focusMan"; } - if ( !empty($monitor['CanIris']) ) + if ( !empty($monitor->CanIris) ) { - if ( $monitor['CanIrisCon'] ) + if ( $monitor->CanIrisCon ) $cmds['IrisRoot'] = "irisCon"; - elseif ( $monitor['CanIrisRel'] ) + elseif ( $monitor->CanIrisRel ) $cmds['IrisRoot'] = "irisRel"; - elseif ( $monitor['CanIrisAbs'] ) + elseif ( $monitor->CanIrisAbs ) $cmds['IrisRoot'] = "irisAbs"; $cmds['IrisOpen'] = $cmds['IrisRoot']."Open"; $cmds['IrisClose'] = $cmds['IrisRoot']."Close"; @@ -75,13 +75,13 @@ function getControlCommands( $monitor ) $cmds['IrisMan'] = "irisMan"; } - if ( !empty($monitor['CanWhite']) ) + if ( !empty($monitor->CanWhite) ) { - if ( $monitor['CanWhiteCon'] ) + if ( $monitor->CanWhiteCon ) $cmds['WhiteRoot'] = "whiteCon"; - elseif ( $monitor['CanWhiteRel'] ) + elseif ( $monitor->CanWhiteRel ) $cmds['WhiteRoot'] = "whiteRel"; - elseif ( $monitor['CanWhiteAbs'] ) + elseif ( $monitor->CanWhiteAbs ) $cmds['WhiteRoot'] = "whiteAbs"; $cmds['WhiteIn'] = $cmds['WhiteRoot']."In"; $cmds['WhiteOut'] = $cmds['WhiteRoot']."Out"; @@ -89,13 +89,13 @@ function getControlCommands( $monitor ) $cmds['WhiteMan'] = "whiteMan"; } - if ( !empty($monitor['CanGain']) ) + if ( !empty($monitor->CanGain) ) { - if ( $monitor['CanGainCon'] ) + if ( $monitor->CanGainCon ) $cmds['GainRoot'] = "gainCon"; - elseif ( $monitor['CanGainRel'] ) + elseif ( $monitor->CanGainRel ) $cmds['GainRoot'] = "gainRel"; - elseif ( $monitor['CanGainAbs'] ) + elseif ( $monitor->CanGainAbs ) $cmds['GainRoot'] = "gainAbs"; $cmds['GainUp'] = $cmds['GainRoot']."Up"; $cmds['GainDown'] = $cmds['GainRoot']."Down"; @@ -103,19 +103,19 @@ function getControlCommands( $monitor ) $cmds['GainMan'] = "gainMan"; } - if ( !empty($monitor['CanMove']) ) + if ( !empty($monitor->CanMove) ) { - if ( $monitor['CanMoveCon'] ) + if ( $monitor->CanMoveCon ) { $cmds['MoveRoot'] = "moveCon"; $cmds['Center'] = "moveStop"; } - elseif ( $monitor['CanMoveRel'] ) + elseif ( $monitor->CanMoveRel ) { $cmds['MoveRoot'] = "moveRel"; $cmds['Center'] = $cmds['PresetHome']; } - elseif ( $monitor['CanMoveAbs'] ) + elseif ( $monitor->CanMoveAbs ) { $cmds['MoveRoot'] = "moveAbs"; $cmds['Center'] = $cmds['PresetHome']; @@ -246,9 +246,9 @@ function controlPanTilt( $monitor, $cmds )