Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
2b89a40
Initial plan
Copilot Jan 20, 2026
825590b
Remove deprecated get_magic_quotes_gpc() function calls
Copilot Jan 20, 2026
484005c
Initial plan
Copilot Jan 20, 2026
3e7b579
Merge pull request #40 from mariuz/copilot/fix-deprecated-function
mariuz Jan 20, 2026
fd62e26
Initial plan
Copilot Jan 20, 2026
c151133
Fix fb_lock_print to use mandatory -d parameter for Firebird 3+
Copilot Jan 20, 2026
1fbdc36
Apply code review feedback: use ibwa_escapeshellarg and fix typo
Copilot Jan 20, 2026
c2f0eaa
Merge pull request #41 from mariuz/copilot/fix-server-statistics-issue
mariuz Jan 20, 2026
07a744a
Fix XSS vulnerabilities with htmlspecialchars sanitization
Copilot Jan 20, 2026
de3f67a
Merge pull request #42 from mariuz/copilot/fix-xss-vulnerability
mariuz Jan 20, 2026
7782488
Initial plan
Copilot Jan 20, 2026
735daac
Merge pull request #43 from mariuz/copilot/fix-xss-vulnerability-again
mariuz Jan 20, 2026
0a97702
Initial plan
Copilot Jan 20, 2026
bc983c0
Fix XSS vulnerabilities in showblob.php and showimage.php
Copilot Jan 20, 2026
3d28a4e
Fix header injection vulnerability in settings.php
Copilot Jan 20, 2026
7474a15
Address code review feedback - improve SQL injection prevention and U…
Copilot Jan 20, 2026
76a57f3
Add warning comments for WHERE clause and support relative URLs in re…
Copilot Jan 20, 2026
15fd2c6
Merge pull request #44 from mariuz/copilot/fix-xss-vulnerability-anot…
mariuz Jan 20, 2026
72174b6
docs: improve README structure and content
mariuz Feb 24, 2026
90c6c9f
refactor: Replace XMLHttpRequestClient with fetch API
mariuz Feb 24, 2026
f573e73
feat(testing): Add Playwright E2E tests with GitHub Actions
mariuz Feb 24, 2026
2d8e0c3
fix docker-compose command not found
mariuz Feb 24, 2026
30eb78e
fix(ci): address obsolete docker-compose version and incorrect Firebi…
mariuz Feb 24, 2026
87d211e
fix(ci): install firebird extension from PECL for fbird_* functions
mariuz Feb 24, 2026
7656acf
fix(ci): compile firebird extension from source (GitHub)
mariuz Feb 24, 2026
d89ffff
fix(ci): use firebirdsql/firebird:v3.0 as tag 3.0 is missing
mariuz Feb 24, 2026
49f3d02
Update Firebird image version to 3
mariuz Feb 24, 2026
0fdf647
Replace firebird extension with interbase
mariuz Feb 24, 2026
388cb96
fix(ci): use FIREBIRD_ROOT_PASSWORD and improve healthcheck
mariuz Feb 25, 2026
9db881c
fix(ci): simplify firebird healthcheck
mariuz Feb 25, 2026
055e31c
fix(ci): use simpler port-based healthcheck for firebird
mariuz Feb 25, 2026
dd12f1a
fix(ci): improve healthcheck robustness and add debug info
mariuz Feb 25, 2026
b8c9269
fix(ci): use correct database path for healthcheck and config
mariuz Feb 25, 2026
93aa57c
fix(ci): use absolute isql path, 127.0.0.1, and add healthcheck debug…
mariuz Feb 25, 2026
b48d23d
fix(ci): decouple startup and improve healthcheck visibility
mariuz Feb 25, 2026
c483df6
fix(ci): fix PHP extension loading and title mismatch
mariuz Feb 25, 2026
314ebb2
fix(ci): enable interbase extension (filename produced by build)
mariuz Feb 25, 2026
64de2a4
fix(ci): fix TypeError in get_customize_defaults and modernize PHP tags
mariuz Feb 25, 2026
19a68a3
fix(ci): fix PHP 8.1 count() TypeErrors and more short tags
mariuz Feb 25, 2026
d33e05c
chore(ci): enable comprehensive PHP error logging and update tests
mariuz Feb 25, 2026
a7b54f3
fix(ci): fix ArgumentCountError in error_handler and undefined variable
mariuz Feb 25, 2026
01a8bd0
chore(ci): upgrade PHP to 8.3
mariuz Feb 25, 2026
897076d
fix(ci): define missing color constants
mariuz Feb 25, 2026
47a86ef
feat: add PHPUnit testing infrastructure and initial unit tests
mariuz Feb 25, 2026
eb30a96
fix(ci): define Firebird constants before loading configuration
mariuz Feb 25, 2026
a60e2aa
test(e2e): use form name instead of action for login form locator
mariuz Feb 25, 2026
3148e35
fix: remove undefined js_xml_http_request_client call and add footer …
mariuz Feb 25, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .github/docker/php-apache-firebird/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
FROM php:8.3-apache

RUN apt-get update && apt-get install -y \
firebird-dev \
git \
autoconf \
build-essential \
&& git clone https://github.com/FirebirdSQL/php-firebird.git /tmp/php-firebird \
&& cd /tmp/php-firebird \
&& phpize \
&& ./configure \
&& make \
&& make install \
&& docker-php-ext-install pdo_firebird \
&& docker-php-ext-enable interbase \
&& a2enmod rewrite \
&& rm -rf /tmp/php-firebird \
&& apt-get purge -y --auto-remove git autoconf build-essential \
&& rm -rf /var/lib/apt/lists/*

RUN { \
echo 'error_reporting = E_ALL'; \
echo 'display_errors = Off'; \
echo 'display_startup_errors = Off'; \
echo 'log_errors = On'; \
echo 'error_log = /dev/stderr'; \
} > /usr/local/etc/php/conf.d/docker-php-logging.ini
26 changes: 26 additions & 0 deletions .github/workflows/phpunit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: PHPUnit Tests

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
extensions: pdo_firebird, dom, xml, mbstring
coverage: none

- name: Install dependencies
run: composer install --prefer-dist --no-progress

- name: Run tests
run: vendor/bin/phpunit
83 changes: 83 additions & 0 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: Playwright Tests

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 18

- name: Install dependencies
run: npm ci

- name: Install Playwright browsers
run: npx playwright install --with-deps

- name: Configure application for testing
run: |
cp inc/configuration.inc.php inc/configuration.inc.php.bak
sed -i "s/define('DEFAULT_HOST', 'localhost');/define('DEFAULT_HOST', 'firebird');/" inc/configuration.inc.php
sed -i "s/define('DEFAULT_DB', 'employee.fdb');/define('DEFAULT_DB', 'test.fdb');/" inc/configuration.inc.php
sed -i "s|define('DEFAULT_PATH', '/var/lib/firebird/2.5/data/');|define('DEFAULT_PATH', '/var/lib/firebird/data/');|" inc/configuration.inc.php

- name: Start services
run: |
docker compose up -d || {
echo "Docker compose up failed!"
docker compose ps
docker compose logs
exit 1
}

- name: Wait for services to be healthy
run: |
echo "Waiting for services to become healthy..."
max_wait=300
current_wait=0
while [ $current_wait -lt $max_wait ]; do
firebird_status=$(docker inspect --format='{{.State.Health.Status}}' $(docker compose ps -q firebird) 2>/dev/null || echo "starting")
web_status=$(docker inspect --format='{{.State.Health.Status}}' $(docker compose ps -q web) 2>/dev/null || echo "starting")

echo "Status: Firebird=$firebird_status, Web=$web_status (${current_wait}s)"

if [ "$firebird_status" = "healthy" ] && [ "$web_status" = "healthy" ]; then
echo "All services are healthy!"
exit 0
fi

sleep 10
current_wait=$((current_wait + 10))
done

echo "ERROR: Services did not become healthy in time."
echo "--- Firebird Detailed Status ---"
docker inspect $(docker compose ps -q firebird)
echo "--- Web Detailed Status ---"
docker inspect $(docker compose ps -q web)
echo "--- Container Logs ---"
docker compose logs
exit 1

- name: Run Playwright tests
run: npx playwright test
env:
BASE_URL: http://localhost:8080

- name: Stop services
if: always()
run: docker compose down

- name: Restore config file
if: always()
run: |
mv inc/configuration.inc.php.bak inc/configuration.inc.php
13 changes: 12 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,15 @@
# git config --global core.excludesfile '~/.gitignore_global'

# PhpStorm
.idea/**/*

.idea/**/*



# Node dependencies

node_modules/

# PHP dependencies
vendor/
composer.lock
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# ChangeLog

## Version 3.4.2 (24.02.2026)

* [enhancement:] Refactored all AJAX calls to use the modern `fetch` API.
* [enhancement:] Removed the outdated and insecure `XMLHttpRequestClient.js` library.

## Version 3.4.1 (27.02.2020)

* [enhancement:] Adjust "Accessories" page UI.
Expand Down
139 changes: 82 additions & 57 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,85 +1,110 @@
# FirebirdWebAdmin is a web frontend for the Firebird database server
# FirebirdWebAdmin

**FirebirdWebAdmin** is a lightweight, powerful web-based administration tool for the Firebird database server. It provides an intuitive interface for managing databases, tables, and other database objects directly from your browser.

[![Crowdin](https://d322cqt584bo4o.cloudfront.net/firebirdwebadmin/localized.svg)](https://crowdin.com/project/firebirdwebadmin)
[![Code Climate](https://codeclimate.com/github/mariuz/firebirdwebadmin/badges/gpa.svg)](https://codeclimate.com/github/mariuz/firebirdwebadmin)
[![License: GPL v2](https://img.shields.io/badge/License-GPL%20v2-blue.svg)](https://opensource.org/licenses/GPL-2.0)
[![PHP Version](https://img.shields.io/badge/php-%3E%3D%205.5-8892bf.svg)](https://php.net)

---

## 🚀 Features

### 🛠 Database & Object Management
* **Database Operations:** Create, delete, and modify databases.
* **Schema Management:** Manage tables, views, triggers, domains, indices, and generators.
* **Business Logic:** Create and edit stored procedures and User Defined Functions (UDFs).
* **Security:** Manage database users and roles.
* **Exceptions:** Define and manage database exceptions.

### 🔍 Data Manipulation
* **SQL Console:** Execute SQL expressions and scripts with result display.
* **Data Browsing:** Browse table and view contents with real-time updates.
* **Editing:** Insert, edit, and delete data rows while browsing.
* **Blob Support:** Handle BLOB fields (display and edit contents).
* **Import/Export:** Seamlessly import and export data using CSV format.

### 📈 Administration & Maintenance
* **Maintenance:** Database backup and restore capabilities.
* **Monitoring:** Display database metadata and browse system tables.
* **Statistics:** Access database and server statistics (requires local access).
* **Maintenance Tools:** Integrated database maintenance functions.

By now it has the functionalities for

* creating, deleting, modifying databases, tables, generators, views, triggers, domains, indices, stored procedures, udf's, exceptions, roles and database users
* performing sql expressions on databases and display the results
* import and export of data through files in the csv format
* browsing through the contents of tables and views, watching them growing while typing in data
* selecting data for deleting and editing while browsing tables
* inserting, deleting, displaying the contents of blob fields
* diplaying database metadata, browsing the firebird system tables
* database backup and restore, database maintenance
> **Note:** Some administrative features (like backup/restore and statistics) require PHP to have access to Firebird command-line tools (`isql`, `gsec`, `gstat`, etc.) and may require the web server to run on the same machine as the database server.

Some of the features are only available if the database- and the web-server are running on the same machine. The reason is that php have to call the Firebird tools (isql, gsec, gstat, etc.) to perform certain actions.
---

## Overview
## 📋 Requirements

1. [Documentation](#documentation)
2. [Requirements](#requirements)
3. [ChangeLog](#requirements)
4. [Contributing](#contributing)
5. [Copyright notice](#copyright-notice)
* **PHP:** Version 5.5 or higher (PHP 7.x and 8.x recommended).
* Must be compiled with `pdo_firebird` or `interbase` support.
* `pcre` support enabled.
* **Database:** Firebird 2.x, 3.x, or 4.x.
* **Web Server:** Apache 2.x, Nginx, or any server with PHP support.
* **Operating System:** Linux (tested), Windows (compatible).

## Documentation
---

There is no documentation available yet, but if you are familiar with Firebird you will have no troubles using FirebirdWebAdmin.
## ⚙️ Installation & Configuration

For some basic configuration settings have a look to the file `./inc/configuration.inc.php` before you start the programm.
1. **Download:** Clone this repository or download the source code.
```bash
git clone https://github.com/mariuz/firebirdwebadmin.git
```
2. **Web Server Setup:** Place the directory in your web server's document root (e.g., `/var/www/html/`).
3. **Configuration:**
* Open `inc/configuration.inc.php`.
* Configure the `BINPATH` to point to your Firebird binaries (e.g., `/usr/bin/`).
* Set `TMPPATH` to a directory writable by the web server.
* Adjust default connection settings if necessary.
4. **Access:** Navigate to the directory in your browser (e.g., `http://localhost/firebirdwebadmin/`).

Here is how to use and install on Ubuntu <https://help.ubuntu.com/community/Firebird3.0>
---

Firebird documentation is located on this page <https://www.firebirdsql.org/en/documentation/>
## 📖 Documentation

## Requirements
While there is no exhaustive manual, users familiar with Firebird will find the interface intuitive.

This is the environment I'm using for the development. Other components are not or less tested. So if you got problems make sure you are not using older software components.
* **Configuration:** Check `inc/configuration.inc.php` for advanced settings.
* **Ubuntu Guide:** [How to install Firebird on Ubuntu](https://help.ubuntu.com/community/Firebird3.0)
* **Firebird Official Docs:** [Firebird Documentation](https://www.firebirdsql.org/en/documentation/)

PHP with compiled in support for Firebird/InterBase and pcre (but any version >= 5.5 should work)
## 🧪 Testing

Firebird 2.x.x for Linux,
Apache 2.x or any server with php support
### Unit Tests (PHPUnit)
The project uses PHPUnit for unit testing core functions.
1. Install dependencies: `composer install`
2. Run tests: `./vendor/bin/phpunit`

## ChangeLog
### End-to-End Tests (Playwright)
The project uses Playwright for E2E testing.
1. Install dependencies: `npm install`
2. Run tests: `npx playwright test`

### Version 3.4.1 (27.02.2020)
---

* [enhancement:] Adjust "Accessories" page UI.
* [enhancement:] Remove Crowdin badge from footer.
* [enhancement:] Update debug_funcs.inc.php
* [bugfix:] Don't warn if "isql" is "isql-fb" on Linux
* [typo:] Correct typo: firebirid -> firebird
* [bugfix] fix sql create database
* [enhancement:] Add Character Sets
* [enhancement:] Quiet PHP7.2 deprecation warning …
* [enhancement:] Further create_function refactor
* [enhancement:] Remove unused/outdated markableFbwaTable.
* [enhancement:] cosmetics
## 📄 ChangeLog

#### Further informations
See [CHANGELOG.md](CHANGELOG.md) for the full history of changes.

* See [CHANGELOG.md][changelog] to get the full changelog.
---

## Contributing
## 🤝 Contributing

1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request
We welcome contributions! To contribute:

## Copyright notice
1. Fork the repository.
2. Create a feature branch (`git checkout -b feature/amazing-feature`).
3. Commit your changes (`git commit -m 'Add amazing feature'`).
4. Push to the branch (`git push origin feature/amazing-feature`).
5. Open a Pull Request.

(C) 2000,2001,2002,2003,2004 Lutz Brueckner <irie@gmx.de>
Kapellenstr. 1A
22117 Hamburg, Germany
---

FirebirdWebAdmin is published under the terms of the [GNU GPL v.2][gnu_gpl_v2_license], please read the file LICENCE for details.
## ⚖️ License

This software is provided 'as-is', without any expressed or implied warranty. In no event will the author be held liable for any damages arising from the use of this software.
**FirebirdWebAdmin** is published under the terms of the [GNU GPL v.2](https://opensource.org/licenses/GPL-2.0).
See the `LICENSE` file for details.

[gnu_gpl_v2_license]: https://opensource.org/licenses/GPL-2.0
[changelog]: CHANGELOG.md
© 2000-2026 Lutz Brueckner and contributors.
4 changes: 1 addition & 3 deletions accessories.php
Original file line number Diff line number Diff line change
Expand Up @@ -506,9 +506,7 @@

// modify the View
if (isset($_POST['acc_modview_doit'])) {
$viewdefs['source'] = get_magic_quotes_gpc()
? stripslashes(trim($_POST['def_view_source']))
: $_POST['def_view_source'];
$viewdefs['source'] = $_POST['def_view_source'];
$viewdefs['check'] = (isset($_POST['def_view_check'])) ? 'yes' : 'no';

if (drop_view($s_viewdefs['name'])) {
Expand Down
7 changes: 5 additions & 2 deletions admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,12 @@
//
if (have_panel_permissions($s_login['user'], 'adm_server')) {
$exe = 'fb_lock_print';

// Construct database path with host if needed (required for Firebird 3+)
$db_path = !empty($s_login['host']) ? $s_login['host'].':'.$s_login['database'] : $s_login['database'];

// get the LOCK_HEADER BLOCK
list($iblockpr_output, $binary_error) = exec_command($exe, ' -o');
list($iblockpr_output, $binary_error) = exec_command($exe, ' -d ' . ibwa_escapeshellarg($db_path) . ' -o');

$lock_header = '';
unset($iblockpr_output[0]);
Expand All @@ -177,7 +180,7 @@
}

// get the server statistics
list($iblockpr_output, $binray_error) = exec_command($exe, ' -i');
list($iblockpr_output, $binary_error) = exec_command($exe, ' -d ' . ibwa_escapeshellarg($db_path) . ' -i');

if (count($iblockpr_output) > 3) {
$iblock['names'] = preg_split('/[\s,]+/', $iblockpr_output[0]);
Expand Down
11 changes: 11 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"name": "mariuz/firebirdwebadmin",
"description": "FirebirdWebAdmin is a web frontend for the Firebird database server",
"type": "project",
"license": "GPL-2.0",
"require-dev": {
"phpunit/phpunit": "^10.5"
},
"autoload": {
}
}
4 changes: 2 additions & 2 deletions database.php
Original file line number Diff line number Diff line change
Expand Up @@ -282,14 +282,14 @@
// determine the accessible databases for the login panel
//
$dbfiles = array();
if (isset($ALLOWED_FILES) && count($ALLOWED_FILES) > 0) {
if (isset($ALLOWED_FILES) && is_array($ALLOWED_FILES) && count($ALLOWED_FILES) > 0) {
foreach ($ALLOWED_FILES as $file) {
if ((strpos($file, '/') === false && strpos($file, '\\') === false) ||
is_file($file)) {
$dbfiles[] = $file;
}
}
} elseif (isset($ALLOWED_DIRS) && count($ALLOWED_DIRS) > 0) {
} elseif (isset($ALLOWED_DIRS) && is_array($ALLOWED_DIRS) && count($ALLOWED_DIRS) > 0) {
foreach ($ALLOWED_DIRS as $dir) {
if (!@is_readable($dir)) {
$warning .= sprintf($WARNINGS['CAN_NOT_ACCESS_DIR'], $dir);
Expand Down
Loading
Loading