fix code style
This commit is contained in:
parent
b9584bb5d2
commit
b1cc7bf837
|
@ -20,15 +20,14 @@
|
|||
|
||||
$selfEdit = ZM_USER_SELF_EDIT && $_REQUEST['uid'] == $user['Id'];
|
||||
|
||||
if ( !canEdit( 'System' ) && !$selfEdit )
|
||||
{
|
||||
$view = "error";
|
||||
return;
|
||||
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 )
|
||||
{
|
||||
$monitors[] = $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,14 +130,12 @@ 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
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
|
@ -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>
|
||||
|
|
Loading…
Reference in New Issue