diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index ce467330a..e72fb09bb 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -51,13 +51,19 @@ jobs: # Prefix the list here with "+" to use these queries and those in the config file. # queries: ./path/to/local/query, your-org/your-repo/queries@main + - name: Clean install dependencies and build + run: | + git submodule init + git submodule update --init --recursive + # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). # If this step fails, then you should remove it and run the build manually (see below) - name: Autobuild uses: github/codeql-action/autobuild@v1 # âšī¸ Command-line programs to run using the OS shell. - # đ https://git.io/JvXDl + # đ https://git.io/JvXDl- + # âī¸ If the Autobuild fails above, remove it and uncomment the following three lines # and modify them (or add more) to build your code if your project diff --git a/web/ajax/modals/device.php b/web/ajax/modals/device.php new file mode 100644 index 000000000..5a29785ef --- /dev/null +++ b/web/ajax/modals/device.php @@ -0,0 +1,54 @@ + "", + "Name" => "New Device", + "KeyString" => "" + ); +} + +?> +
diff --git a/web/includes/actions/device.php b/web/includes/actions/device.php index c1a882d89..29011dd73 100644 --- a/web/includes/actions/device.php +++ b/web/includes/actions/device.php @@ -28,15 +28,17 @@ if ( $action == 'device' ) { if ( !empty($_REQUEST['command']) ) { setDeviceStatusX10($_REQUEST['key'], $_REQUEST['command']); } else if ( isset($_REQUEST['newDevice']) ) { - if ( isset($_REQUEST['did']) ) { + if ( isset($_REQUEST['did']) && $_REQUEST['did'] ) { + ZM\Warning('did value is: '.$_REQUEST['did']); + ZM\Warning('newDevice array value is: '.print_r($_REQUEST['newDevice'],true)); dbQuery('UPDATE Devices SET Name=?, KeyString=? WHERE Id=?', array($_REQUEST['newDevice']['Name'], $_REQUEST['newDevice']['KeyString'], $_REQUEST['did']) ); } else { + dbQuery('INSERT INTO Devices SET Name=?, KeyString=?', array($_REQUEST['newDevice']['Name'], $_REQUEST['newDevice']['KeyString']) ); } - $refreshParent = true; - $view = 'none'; + $redirect = '?view=devices'; } } else { ZM\Error('Unknown action in device'); diff --git a/web/skins/classic/views/device.php b/web/skins/classic/views/device.php deleted file mode 100644 index fa1a6a9d4..000000000 --- a/web/skins/classic/views/device.php +++ /dev/null @@ -1,67 +0,0 @@ - "", - "Name" => "New Device", - "KeyString" => "" - ); -} - -xhtmlHeaders( __FILE__, translate('Device')." - ".$newDevice['Name'] ); -?> - -