fix code style

This commit is contained in:
Isaac Connor 2019-01-23 11:20:31 -05:00
parent b9584bb5d2
commit b1cc7bf837
1 changed files with 24 additions and 29 deletions

View File

@ -20,15 +20,14 @@
$selfEdit = ZM_USER_SELF_EDIT && $_REQUEST['uid'] == $user['Id'];
if ( !canEdit( 'System' ) && !$selfEdit )
{
$view = "error";
if ( !canEdit('System') && !$selfEdit ) {
$view = 'error';
return;
}
if ( $_REQUEST['uid'] ) {
if ( !($newUser = dbFetchOne( 'SELECT * FROM Users WHERE Id = ?', NULL, ARRAY($_REQUEST['uid'])) ) ) {
$view = "error";
if ( !($newUser = dbFetchOne('SELECT * FROM Users WHERE Id = ?', NULL, ARRAY($_REQUEST['uid']))) ) {
$view = 'error';
return;
}
} else {
@ -38,29 +37,28 @@ if ( $_REQUEST['uid'] ) {
$newUser['MonitorIds'] = '';
}
$monitorIds = array_flip(explode( ',', $newUser['MonitorIds'] ));
$monitorIds = array_flip(explode(',', $newUser['MonitorIds']));
$yesno = array( 0=>translate('No'), 1=>translate('Yes') );
$nv = array( 'None'=>translate('None'), 'View'=>translate('View') );
$nve = array( 'None'=>translate('None'), 'View'=>translate('View'), 'Edit'=>translate('Edit') );
$bandwidths = array_merge( array( ""=>"" ), $bandwidth_options );
$langs = array_merge( array( ""=>"" ), getLanguages() );
$bandwidths = array_merge( array( ''=>'' ), $bandwidth_options );
$langs = array_merge( array( ''=>'' ), getLanguages() );
$sql = "select Id,Name from Monitors order by Sequence asc";
$sql = 'SELECT Id,Name FROM Monitors ORDER BY Sequence ASC';
$monitors = array();
foreach( dbFetchAll( $sql ) as $monitor )
{
foreach( dbFetchAll($sql) as $monitor ) {
$monitors[] = $monitor;
}
$focusWindow = true;
xhtmlHeaders(__FILE__, translate('User')." - ".$newUser['Username'] );
xhtmlHeaders(__FILE__, translate('User').' - '.$newUser['Username']);
?>
<body>
<div id="page">
<div id="header">
<h2><?php echo translate('User')." - ".$newUser['Username'] ?></h2>
<h2><?php echo translate('User').' - '.$newUser['Username'] ?></h2>
</div>
<div id="content">
<form name="contentForm" method="post" action="<?php echo $_SERVER['PHP_SELF'] ?>" onsubmit="return validateForm( this, <?php echo empty($newUser['Password'])?'true':'false' ?> )">
@ -68,11 +66,10 @@ xhtmlHeaders(__FILE__, translate('User')." - ".$newUser['Username'] );
<input type="hidden" name="action" value="user"/>
<input type="hidden" name="uid" value="<?php echo validHtmlStr($_REQUEST['uid']) ?>"/>
<input type="hidden" name="newUser[MonitorIds]" value="<?php echo $newUser['MonitorIds'] ?>"/>
<table id="contentTable" class="major" cellspacing="0">
<table id="contentTable" class="major">
<tbody>
<?php
if ( canEdit( 'System' ) )
{
if ( canEdit('System') ) {
?>
<tr>
<th scope="row"><?php echo translate('Username') ?></th>
@ -83,19 +80,18 @@ if ( canEdit( 'System' ) )
?>
<tr>
<th scope="row"><?php echo translate('NewPassword') ?></th>
<td><input type="password" name="newUser[Password]" value=""/></td>
<td><input type="password" name="newUser[Password]"/></td>
</tr>
<tr>
<th scope="row"><?php echo translate('ConfirmPassword') ?></th>
<td><input type="password" name="conf_password" value=""/></td>
<td><input type="password" name="conf_password"/></td>
</tr>
<tr>
<th scope="row"><?php echo translate('Language') ?></th>
<td><?php echo buildSelect( "newUser[Language]", $langs ) ?></td>
</tr>
<?php
if ( canEdit( 'System' ) )
{
if ( canEdit('System') ) {
?>
<tr>
<th scope="row"><?php echo translate('Enabled') ?></th>
@ -134,12 +130,10 @@ if ( canEdit( 'System' ) )
<td>
<select name="monitorIds" size="4" multiple="multiple">
<?php
foreach ( $monitors as $monitor )
{
if ( visibleMonitor( $monitor['Id'] ) )
{
foreach ( $monitors as $monitor ) {
if ( visibleMonitor($monitor['Id']) ) {
?>
<option value="<?php echo $monitor['Id'] ?>"<?php if ( array_key_exists( $monitor['Id'], $monitorIds ) ) { ?> selected="selected"<?php } ?>><?php echo htmlentities($monitor['Name']) ?></option>
<option value="<?php echo $monitor['Id'] ?>"<?php if ( array_key_exists($monitor['Id'], $monitorIds) ) { ?> selected="selected"<?php } ?>><?php echo htmlentities($monitor['Name']) ?></option>
<?php
}
}
@ -153,7 +147,8 @@ if ( canEdit( 'System' ) )
</tbody>
</table>
<div id="contentButtons">
<input type="submit" value="<?php echo translate('Save') ?>"/><input type="button" value="<?php echo translate('Cancel') ?>" data-on-click="closeWindow"/>
<button type="submit" value="Save"><?php echo translate('Save') ?></button>
<button type="button" data-on-click="closeWindow"><?php echo translate('Cancel') ?></button>
</div>
</form>
</div>