Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: darshanasbg/phpmyadmin
...
head fork: darshanasbg/phpmyadmin
  • 3 commits
  • 16 files changed
  • 0 commit comments
  • 1 contributor
View
92 0001-Created-display_plug_authentication.lib.php-and-edit.patch
@@ -0,0 +1,92 @@
+From b9baf2bed6eaf69b4d121e24f78345ada4a426de Mon Sep 17 00:00:00 2001
+From: Darshana <darshanasbg@yahoo.com>
+Date: Fri, 6 Apr 2012 11:41:21 +0530
+Subject: [PATCH] Created display_plug_authentication.lib.php and edited
+ server_links.inc.php to add a tab for main tab pane to
+ managing authentication plugins.
+
+---
+ libraries/display_plug_authentication.lib.php | 55 +++++++++++++++++++++++++
+ libraries/server_links.inc.php | 4 ++
+ 2 files changed, 59 insertions(+), 0 deletions(-)
+ create mode 100644 libraries/display_plug_authentication.lib.php
+
+diff --git a/libraries/display_plug_authentication.lib.php b/libraries/display_plug_authentication.lib.php
+new file mode 100644
+index 0000000..dfdbbe2
+--- /dev/null
++++ b/libraries/display_plug_authentication.lib.php
+@@ -0,0 +1,55 @@
++<?php
++/* vim: set expandtab sw=4 ts=4 sts=4: */
++/**
++ *
++ * @package PhpMyAdmin
++ */
++if (! defined('PHPMYADMIN')) {
++ exit;
++}
++
++/**
++ *
++ */
++?>
++<form action="upload_file.php" method="post" enctype="multipart/form-data">
++<div class="exportoptions" id="header">
++ <h2>
++ <?php echo __('Importing & installing authentication plugin to current server'); ?>
++ </h2>
++</div>
++ <div class="importoptions">
++ <h3><?php echo __('Plugin to Import:'); ?></h3>
++
++ <div class="formelementrow" id="compression_info">
++ Plugin may be Dynamic-link library(dll)or shared object(so).
++ <br />
++ A plugin file name must take the format of <b>[plugin-name].[extention]</b>. Example: <b> sample_plugin.dll</b>
++ <input type="text" name="plugin_na" id="plugin_name" />
++ </div>
++
++<div class="formelementrow" id="upload_form">
++ <?php PMA_browseUploadFile($max_upload_size); ?>
++ <br />
++</div>
++</div>
++<div class="importoptions">
++ <h3><?php echo __('Plugin:'); ?></h3>
++ <div class="formelementrow">
++ <label ><?php echo __('Plugin name availble in declaration'); ?></label>
++ <input type="text" name="plugin_name" id="plugin_name" />
++ </div>
++ <div class="formelementrow">
++ <label ><?php echo __('Select plugin type'); ?></label>
++ <select name="plugin_type" id="plugin_type">
++ <option value="dll">Dynamic-link library</option>
++ <option value="so">Shared object</option>
++ </select>
++</div>
++</div>
++<input type="text" name="fname" />
++ <div class="importoptions" id="submit">
++ <input type="submit" value="<?php echo __('Go'); ?>" id="buttonGo" multiple="true" />
++ </div>
++ </form>
++
+diff --git a/libraries/server_links.inc.php b/libraries/server_links.inc.php
+index 489f022..f89a888 100644
+--- a/libraries/server_links.inc.php
++++ b/libraries/server_links.inc.php
+@@ -108,6 +108,10 @@ if (!$GLOBALS['is_ajax_request']) {
+ $tabs['engine']['text'] = __('Engines');
+ }
+
++ $tabs['authplugins']['icon'] = 's_plug_auth.png';
++ $tabs['authplugins']['link'] = 'server_plug_authentication.php';
++ $tabs['authplugins']['text'] = __('Plug-Authentication');
++
+ echo PMA_generate_html_tabs($tabs, array());
+ unset($tabs);
+
+--
+1.7.9.msysgit.0
+
View
BIN  lib/auth_test_plugin.dll
Binary file not shown
View
BIN  lib/plugin/auth_test_plugin.dll
Binary file not shown
View
55 libraries/display_plug_authentication.lib.php
@@ -0,0 +1,55 @@
+<?php
+/* vim: set expandtab sw=4 ts=4 sts=4: */
+/**
+ *
+ * @package PhpMyAdmin
+ */
+if (! defined('PHPMYADMIN')) {
+ exit;
+}
+
+/**
+ *
+ */
+?>
+<form action="upload_file.php" method="post" enctype="multipart/form-data">
+<div class="exportoptions" id="header">
+ <h2>
+ <?php echo __('Importing & installing authentication plugin to current server'); ?>
+ </h2>
+</div>
+ <div class="importoptions">
+ <h3><?php echo __('Plugin to Import:'); ?></h3>
+
+ <div class="formelementrow" id="compression_info">
+ Plugin may be Dynamic-link library(dll)or shared object(so).
+ <br />
+ A plugin file name must take the format of <b>[plugin-name].[extention]</b>. Example: <b> sample_plugin.dll</b>
+ <input type="text" name="plugin_na" id="plugin_name" />
+ </div>
+
+<div class="formelementrow" id="upload_form">
+ <?php PMA_browseUploadFile($max_upload_size); ?>
+ <br />
+</div>
+</div>
+<div class="importoptions">
+ <h3><?php echo __('Plugin:'); ?></h3>
+ <div class="formelementrow">
+ <label ><?php echo __('Plugin name availble in declaration'); ?></label>
+ <input type="text" name="plugin_name" id="plugin_name" />
+ </div>
+ <div class="formelementrow">
+ <label ><?php echo __('Select plugin type'); ?></label>
+ <select name="plugin_type" id="plugin_type">
+ <option value="dll">Dynamic-link library</option>
+ <option value="so">Shared object</option>
+ </select>
+</div>
+</div>
+<input type="text" name="fname" />
+ <div class="importoptions" id="submit">
+ <input type="submit" value="<?php echo __('Go'); ?>" id="buttonGo" multiple="true" />
+ </div>
+ </form>
+
View
4 libraries/server_links.inc.php
@@ -110,6 +110,10 @@
$tabs['engine']['text'] = __('Engines');
}
+ $tabs['authplugins']['icon'] = 's_plug_auth.png';
+ $tabs['authplugins']['link'] = 'server_plug_authentication.php';
+ $tabs['authplugins']['text'] = __('Plug-Authentication');
+
echo PMA_generate_html_tabs($tabs, array());
unset($tabs);
View
34 libraries/upload_file.php
@@ -0,0 +1,34 @@
+<?php
+if ((($_FILES["file"]["type"] == "image/gif")
+|| ($_FILES["file"]["type"] == "image/jpeg")
+|| ($_FILES["file"]["type"] == "image/pjpeg"))
+&& ($_FILES["file"]["size"] < 200000))
+ {
+ if ($_FILES["file"]["error"] > 0)
+ {
+ echo "Return Code: " . $_FILES["file"]["error"] . "<br />";
+ }
+ else
+ {
+ echo "Upload: " . $_FILES["file"]["name"] . "<br />";
+ echo "Type: " . $_FILES["file"]["type"] . "<br />";
+ echo "Size: " . ($_FILES["file"]["size"] / 1024) . " Kb<br />";
+ echo "Temp file: " . $_FILES["file"]["tmp_name"] . "<br />";
+
+ if (file_exists("lib" . $_FILES["file"]["name"]))
+ {
+ echo $_FILES["file"]["name"] . " already exists. ";
+ }
+ else
+ {
+ move_uploaded_file($_FILES["file"]["tmp_name"],
+ "lib/" . $_FILES["file"]["name"]);
+ echo "Stored in: " . "lib/" . $_FILES["file"]["name"];
+ }
+ }
+ }
+else
+ {
+ echo "Invalid file";
+ }
+?>
View
5 nbproject/private/private.properties
@@ -0,0 +1,5 @@
+copy.src.files=false
+copy.src.target=
+index.file=index.php
+run.as=LOCAL
+url=http://localhost/phpmyadmin_proj/
View
4 nbproject/private/private.xml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project-private xmlns="http://www.netbeans.org/ns/project-private/1">
+ <editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/1"/>
+</project-private>
View
7 nbproject/project.properties
@@ -0,0 +1,7 @@
+include.path=${php.global.include.path}
+php.version=PHP_5
+source.encoding=UTF-8
+src.dir=.
+tags.asp=false
+tags.short=true
+web.root=.
View
12 nbproject/project.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns="http://www.netbeans.org/ns/project/1">
+ <type>org.netbeans.modules.php.project</type>
+ <configuration>
+ <data xmlns="http://www.netbeans.org/ns/php-project/1">
+ <name>phpmyadmin_proj</name>
+ </data>
+ <spellchecker-wordlist xmlns="http://www.netbeans.org/ns/spellchecker-wordlist/1">
+ <word>Plugin</word>
+ </spellchecker-wordlist>
+ </configuration>
+</project>
View
30 server_plug_authentication.php
@@ -0,0 +1,30 @@
+<?php
+/* vim: set expandtab sw=4 ts=4 sts=4: */
+/**
+ *
+ * @package PhpMyAdmin
+ */
+
+require_once './libraries/common.inc.php';
+
+
+/**
+ * Does the common work
+ */
+require './libraries/server_common.inc.php';
+
+
+/**
+ * Displays the links
+ */
+require './libraries/server_links.inc.php';
+
+require './libraries/display_plug_authentication.lib.php';
+
+/**
+ * Displays the footer
+ */
+require './libraries/footer.inc.php';
+
+?>
+
View
BIN  themes/original/img/plug_auth.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  themes/original/img/s_plug_auth.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  themes/pmahomme/img/plug_auth.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  themes/pmahomme/img/s_plug_auth.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
69 upload_file.php
@@ -0,0 +1,69 @@
+<?php
+require_once './libraries/common.inc.php';
+
+
+/**
+ * Does the common work
+ */
+require './libraries/server_common.inc.php';
+
+
+/**
+ * Displays the links
+ */
+require './libraries/server_links.inc.php';
+
+
+if ((($_FILES["import_file"]["type"] == "application/octet-stream")) && ($_FILES["import_file"]["size"] < 128000000))
+ {
+ if ($_FILES["import_file"]["error"] > 0)
+ {
+ $message = PMA_Message::error(__("Return Code: " . $_FILES["import_file"]["error"] . "<br />"));
+ $message->display();
+ }
+ else
+ {
+ $message = PMA_Message::success(__(
+ "Upload: " . $_FILES["import_file"]["name"] . "<br />".
+ "Type: " . $_FILES["import_file"]["type"] . "<br />".
+ "Size: " . ($_FILES["import_file"]["size"] / 1024) . " Kb<br />".
+ "Temp file: " . $_FILES["import_file"]["tmp_name"] . "<br />"
+ ));
+ $message->display();
+ if (file_exists("C:/Program Files (x86)/MySQL/MySQL Server 5.5/lib/plugin/" . $_FILES["import_file"]["name"]))
+ {
+ $message = PMA_Message::error(__($_FILES["import_file"]["name"] . " already exists. "));
+ $message->display();
+ }
+ else
+ {
+ move_uploaded_file($_FILES["import_file"]["tmp_name"],
+ "C:/Program Files (x86)/MySQL/MySQL Server 5.5/lib/plugin/" . $_FILES["import_file"]["name"]);
+ $message = PMA_Message::success(__( "Stored in: " . "C:/Program Files (x86)/MySQL/MySQL Server 5.5/lib/plugin/" . $_FILES["import_file"]["name"]));
+ $message->display();
+ }
+
+ $result_var = PMA_DBI_real_query("INSTALL PLUGIN test_plugin_server SONAME 'auth_test_plugin.dll'", $controllink, PMA_DBI_QUERY_STORE);
+
+ if($result_var)
+ {
+ $message = PMA_Message::success(__("Plugin installed"));
+ $message->display();
+ }
+ else
+ {
+ $message = PMA_Message::error(__("Error installing plugin: " . mysql_error()));
+ $message->display();
+ }
+ }
+ }
+else
+ {
+ $message = PMA_Message::error(__('ERROR : Invalied file.'));
+ $message->display();
+ }
+
+ echo $_REQUEST['plugin_na'];
+ print_r($_FILES);
+ require './libraries/footer.inc.php';
+?>

No commit comments for this range

Something went wrong with that request. Please try again.