Skip to content

MirLach/adminer-forced-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

adminer-forced-server

Plugin for Adminer, restricted login to config-defined server

Based on official (but not working at this time) login-servers for Adminer with enhancements.
And inspired by CrazyMax's login-servers-enhanced

Features

  • This plugin restricts user to connect only to ONE predefined server.
  • User cannot choose anything. Only fill username and password. (other fields are not displayed nor send over network)
  • User cannot (ab)use your server with your Adminer to connect somewhere else.

Installation

Copy plugins/forced-server.php in the plugins folder.

Getting started

Follow the instructions on the official plugins page.
Then just add new AdminerForcedServer to the $plugins array :

<?php
if (! isset($_SERVER['HTTPS'])) {
	header('Location: https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']);
}

function adminer_object() {
	// required to run any plugin
	include_once "./plugins/plugin.php";

	// autoloader
	foreach (glob("plugins/*.php") as $filename) {
		include_once "./$filename";
	}

	$plugins = array(
		// specify enabled plugins here
		new AdminerForcedServer(array('driver' => 'server', 'server' => 'localhost')),
	);

	return new AdminerPlugin($plugins);
}

// include original Adminer or Adminer Editor
include "./adminer.php";
?>

You must set array with keys 'driver' and 'server'.
Value for the driver is usually 'server'.
Value for server can be localhost, IP address or hostname of target server.

License

Apache-2.0. See LICENSE for more details.

About

Plugin for Adminer, force login to specified server

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages