mirror of
https://github.com/vrana/adminer.git
synced 2025-08-24 15:12:51 +02:00
MSSQL: Allow to set Encrypt and TrustServerCertificate with AdminerLoginSsl plugin (issue #5)
https://learn.microsoft.com/en-us/dotnet/framework/data/adonet/connection-string-syntax#use-trustservercertificate
This commit is contained in:
@@ -24,8 +24,15 @@ if (isset($_GET["mssql"])) {
|
||||
|
||||
function connect($server, $username, $password) {
|
||||
global $adminer;
|
||||
$db = $adminer->database();
|
||||
$connection_info = array("UID" => $username, "PWD" => $password, "CharacterSet" => "UTF-8");
|
||||
$ssl = $adminer->connectSsl();
|
||||
if (isset($ssl["Encrypt"])) {
|
||||
$connection_info["Encrypt"] = $ssl["Encrypt"];
|
||||
}
|
||||
if (isset($ssl["TrustServerCertificate"])) {
|
||||
$connection_info["TrustServerCertificate"] = $ssl["TrustServerCertificate"];
|
||||
}
|
||||
$db = $adminer->database();
|
||||
if ($db != "") {
|
||||
$connection_info["Database"] = $db;
|
||||
}
|
||||
|
@@ -2,15 +2,15 @@
|
||||
function adminer_object() {
|
||||
// required to run any plugin
|
||||
include_once "../plugins/plugin.php";
|
||||
|
||||
|
||||
// autoloader
|
||||
foreach (glob("../plugins/*.php") as $filename) {
|
||||
include_once $filename;
|
||||
}
|
||||
|
||||
|
||||
// enable extra drivers just by including them
|
||||
//~ include "../plugins/drivers/simpledb.php";
|
||||
|
||||
|
||||
$plugins = array(
|
||||
// specify enabled plugins here
|
||||
new AdminerDatabaseHide(array('information_schema')),
|
||||
@@ -32,13 +32,13 @@ function adminer_object() {
|
||||
new AdminerTablesFilter,
|
||||
new AdminerEditForeign,
|
||||
);
|
||||
|
||||
|
||||
/* It is possible to combine customization and plugins:
|
||||
class AdminerCustomization extends AdminerPlugin {
|
||||
}
|
||||
return new AdminerCustomization($plugins);
|
||||
*/
|
||||
|
||||
|
||||
return new AdminerPlugin($plugins);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user