Skip to content

Commit fc6ef26

Browse files
committed
Remove Swekey support
It is buggy and their servers are no longer working. Signed-off-by: Michal Čihař <michal@cihar.com>
1 parent 6aacd7d commit fc6ef26

16 files changed

Lines changed: 3 additions & 1204 deletions

.scrutinizer.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ imports:
33
- javascript
44
- php
55
filter:
6-
excluded_paths: [libraries/php-gettext/*, libraries/tcpdf/*, libraries/bfShapeFiles/*, libraries/phpseclib/*, libraries/plugins/auth/recaptchalib.php, libraries/plugins/auth/swekey/swekey.php, libraries/sql-formatter/*, js/jquery/*, js/jqplot/*, js/openlayers/*, js/codemirror/*, js/canvg/*, js/tracekit/*, js/OpenStreetMap.js, js/sprintf.js, test/libraries/php-gettext/*, test/libraries/sql-formatter/*]
6+
excluded_paths: [libraries/php-gettext/*, libraries/tcpdf/*, libraries/bfShapeFiles/*, libraries/phpseclib/*, libraries/plugins/auth/recaptchalib.php, libraries/sql-formatter/*, js/jquery/*, js/jqplot/*, js/openlayers/*, js/codemirror/*, js/canvg/*, js/tracekit/*, js/OpenStreetMap.js, js/sprintf.js, test/libraries/php-gettext/*, test/libraries/sql-formatter/*]
77
tools:
88
php_code_sniffer:
99
config:

build.xml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
<arg line="${source_comma_sep}
5656
xml
5757
codesize,design,naming,unusedcode
58-
--exclude test,build,tcpdf,php-gettext,bfShapeFiles,phpseclib,recaptchalib.php,swekey.php,vendor,sql-parser
58+
--exclude test,build,tcpdf,php-gettext,bfShapeFiles,phpseclib,recaptchalib.php,vendor,sql-parser
5959
--reportfile '${basedir}/build/logs/pmd.xml'" />
6060
</exec>
6161
</target>
@@ -71,7 +71,6 @@
7171
--exclude libraries/bfShapeFiles
7272
--exclude libraries/phpseclib
7373
--exclude libraries/plugins/auth/recaptcha/recaptchalib.php
74-
--exclude libraries/plugins/auth/swekey/swekey.php
7574
--exclude libraries/sql-parser
7675
${source}" />
7776
</exec>
@@ -88,7 +87,6 @@
8887
--exclude libraries/bfShapeFiles
8988
--exclude libraries/phpseclib
9089
--exclude libraries/plugins/auth/recaptcha/recaptchalib.php
91-
--exclude libraries/plugins/auth/swekey/swekey.php
9290
--exclude libraries/sql-parser
9391
${source}" />
9492
</exec>
@@ -103,7 +101,7 @@
103101
<target name="phpcs" description="Generate checkstyle.xml using PHP_CodeSniffer excluding third party libraries" depends="phpcs-config">
104102
<exec executable="phpcs">
105103
<arg line="
106-
--ignore=*/php-gettext/*,*/vendor/*,*/tcpdf/*,*/canvg/*,*/codemirror/*,*/openlayers/*,*/jquery/*,*/jqplot/*,*/build/*,*/bfShapeFiles/*,*/phpseclib/*,*/recaptcha/*,*/swekey/*,*/sql-parser/*
104+
--ignore=*/php-gettext/*,*/vendor/*,*/tcpdf/*,*/canvg/*,*/codemirror/*,*/openlayers/*,*/jquery/*,*/jqplot/*,*/build/*,*/bfShapeFiles/*,*/phpseclib/*,*/recaptcha/*,*/sql-parser/*
107105
--report=checkstyle
108106
--extensions=php
109107
--report-file='${basedir}/build/logs/checkstyle.xml'

config.sample.inc.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,6 @@
6464
// $cfg['Servers'][$i]['central_columns'] = 'pma__central_columns';
6565
// $cfg['Servers'][$i]['designer_settings'] = 'pma__designer_settings';
6666
// $cfg['Servers'][$i]['export_templates'] = 'pma__export_templates';
67-
/* Contrib / Swekey authentication */
68-
// $cfg['Servers'][$i]['auth_swekey_config'] = '/etc/swekey-pma.conf';
6967

7068
/**
7169
* End of servers configuration

doc/config.rst

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -414,15 +414,6 @@ Server connection settings
414414
"phpMyAdmin " and either :config:option:`$cfg['Servers'][$i]['verbose']` or
415415
:config:option:`$cfg['Servers'][$i]['host']` will be used.
416416

417-
.. _servers_auth_swekey_config:
418-
.. config:option:: $cfg['Servers'][$i]['auth_swekey_config']
419-
420-
:type: string
421-
:default: ``''``
422-
423-
The name of the file containing :ref:`swekey` ids and login names for hardware
424-
authentication. Leave empty to deactivate this feature.
425-
426417
.. _servers_user:
427418
.. config:option:: $cfg['Servers'][$i]['user']
428419

doc/setup.rst

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -711,40 +711,6 @@ Config authentication mode
711711
of which are beyond the scope of this manual but easily searchable
712712
with Google).
713713

714-
.. index:: pair: Swekey; Authentication mode
715-
716-
.. _swekey:
717-
718-
Swekey authentication mode
719-
--------------------------
720-
721-
The Swekey is a low cost authentication USB key that can be used in
722-
web applications. When Swekey authentication is activated, phpMyAdmin
723-
requires the users's Swekey to be plugged before entering the login
724-
page (currently supported for cookie authentication mode only). Swekey
725-
Authentication is disabled by default. To enable it, add the following
726-
line to :file:`config.inc.php`:
727-
728-
.. code-block:: php
729-
730-
$cfg['Servers'][$i]['auth_swekey_config'] = '/etc/swekey.conf';
731-
732-
You then have to create the ``swekey.conf`` file that will associate
733-
each user with their Swekey Id. It is important to place this file
734-
outside of your web server's document root (in the example, it is
735-
located in ``/etc``). Feel free to use it with your own users'
736-
information. If you want to purchase a Swekey please visit
737-
`https://www.phpmyadmin.net/auth\_key/ <https://www.phpmyadmin.net/auth_key/>`_
738-
since this link provides funding for phpMyAdmin.
739-
740-
A self documented sample file is provided in the
741-
file :file:`examples/swekey.sample.conf`:
742-
743-
.. literalinclude:: ../examples/swekey.sample.conf
744-
:language: sh
745-
746-
.. seealso:: :config:option:`$cfg['Servers'][$i]['auth_swekey_config']`
747-
748714

749715
Securing your phpMyAdmin installation
750716
+++++++++++++++++++++++++++++++++++++

examples/swekey.sample.conf

Lines changed: 0 additions & 44 deletions
This file was deleted.

libraries/config.default.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -236,14 +236,6 @@
236236
*/
237237
$cfg['Servers'][$i]['auth_http_realm'] = '';
238238

239-
/**
240-
* File containing Swekey ids and login names (see /contrib);
241-
* leave empty to deactivate Swekey hardware authentication
242-
*
243-
* @global string $cfg['Servers'][$i]['auth_swekey_config']
244-
*/
245-
$cfg['Servers'][$i]['auth_swekey_config'] = '';
246-
247239
/**
248240
* MySQL user
249241
*

libraries/config/messages.inc.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -632,12 +632,6 @@
632632
$strConfigServers_auth_http_realm_desc
633633
= __('HTTP Basic Auth Realm name to display when doing HTTP Auth.');
634634
$strConfigServers_auth_http_realm_name = __('HTTP Realm');
635-
$strConfigServers_auth_swekey_config_desc = __(
636-
'The path for the config file for SweKey hardware '
637-
. 'authentication (not located in your document root; suggested: '
638-
. '/etc/swekey.conf).'
639-
);
640-
$strConfigServers_auth_swekey_config_name = __('SweKey config file');
641635
$strConfigServers_auth_type_desc = __('Authentication method to use.');
642636
$strConfigServers_auth_type_name = __('Authentication type');
643637
$strConfigServers_bookmarktable_desc = __(

libraries/config/setup.forms.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,6 @@
4141
'user',
4242
'password',
4343
':group:end',
44-
':group:' . __('Cookie authentication'),
45-
'auth_swekey_config' => './swekey.conf',
46-
':group:end',
4744
':group:' . __('HTTP authentication'),
4845
'auth_http_realm',
4946
':group:end',

libraries/plugins/auth/AuthenticationCookie.php

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,6 @@
2727
$GLOBALS['target'] = basename(PMA_getenv('SCRIPT_NAME'));
2828
}
2929

30-
/**
31-
* Swekey authentication functions.
32-
*/
33-
require './libraries/plugins/auth/swekey/swekey.auth.lib.php';
34-
3530
/**
3631
* Handles the cookie authentication method
3732
*
@@ -229,10 +224,6 @@ public function auth()
229224
echo '</fieldset>
230225
</form>';
231226

232-
// BEGIN Swekey Integration
233-
Swekey_login('input_username', 'input_go');
234-
// END Swekey Integration
235-
236227
if ($GLOBALS['error_handler']->hasDisplayErrors()) {
237228
echo '<div id="pma_errors">';
238229
$GLOBALS['error_handler']->dispErrors();
@@ -279,12 +270,6 @@ public function authCheck()
279270
$GLOBALS['PHP_AUTH_USER'] = $GLOBALS['PHP_AUTH_PW'] = '';
280271
$GLOBALS['from_cookie'] = false;
281272

282-
// BEGIN Swekey Integration
283-
if (! Swekey_Auth_check()) {
284-
return false;
285-
}
286-
// END Swekey Integration
287-
288273
if (! empty($_REQUEST['pma_username'])) {
289274

290275
// Verify Captcha if it is required.

0 commit comments

Comments
 (0)