Code style clceanup in server action
parent
abb4230f86
commit
c1b32b79a2
|
@ -19,17 +19,14 @@
|
|||
//
|
||||
|
||||
// System edit actions
|
||||
if ( ! canEdit('System') ) {
|
||||
if (!canEdit('System')) {
|
||||
ZM\Warning('Need System permissions to add servers');
|
||||
return;
|
||||
}
|
||||
|
||||
if ( $action == 'save' ) {
|
||||
if ( !empty($_REQUEST['id']) ) {
|
||||
$dbServer = dbFetchOne(
|
||||
'SELECT * FROM Servers WHERE Id=?',
|
||||
NULL,
|
||||
array($_REQUEST['id']) );
|
||||
if ($action == 'save') {
|
||||
if (!empty($_REQUEST['id'])) {
|
||||
$dbServer = dbFetchOne('SELECT * FROM Servers WHERE Id=?', NULL, [$_REQUEST['id']]);
|
||||
} else {
|
||||
$dbServer = array();
|
||||
}
|
||||
|
@ -37,8 +34,8 @@ if ( $action == 'save' ) {
|
|||
$types = array();
|
||||
$changes = getFormChanges($dbServer, $_REQUEST['newServer'], $types);
|
||||
|
||||
if ( count($changes) ) {
|
||||
if ( !empty($_REQUEST['id']) ) {
|
||||
if (count($changes)) {
|
||||
if (!empty($_REQUEST['id'])) {
|
||||
dbQuery('UPDATE Servers SET '.implode(', ', $changes).' WHERE Id = ?',
|
||||
array($_REQUEST['id']) );
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue