]> andersk Git - sql.git/commitdiff
git-svn-id: svn://presbrey.mit.edu/sql@115 a142d4bd-2cfb-0310-9673-cb33a7e74f58
authorJoe Presbrey <presbrey@mit.edu>
Fri, 27 Oct 2006 21:58:29 +0000 (21:58 +0000)
committerJoe Presbrey <presbrey@mit.edu>
Fri, 27 Oct 2006 21:58:29 +0000 (21:58 +0000)
12 files changed:
web/home/.htaccess [new file with mode: 0755]
web/home/index.php [new file with mode: 0755]
web/home/style.css [new file with mode: 0644]
web/home/style2.css [new symlink]
web/index.php [new file with mode: 0755]
web/phpMyAdmin.patch [new file with mode: 0644]
web/phpMyAdmin_config.inc.php [new file with mode: 0755]
web/tools/connect.php [new file with mode: 0755]
web/tools/list_dbs.php [new file with mode: 0755]
web/tools/mysql.err.php [new file with mode: 0755]
web/tools/mysql.inc.php [new file with mode: 0755]
web/tools/select_db.php [new file with mode: 0755]

diff --git a/web/home/.htaccess b/web/home/.htaccess
new file mode 100755 (executable)
index 0000000..b4da8ae
--- /dev/null
@@ -0,0 +1,8 @@
+RewriteEngine On
+
+RewriteRule ^phpMyAdmin/.*$    https://scripts.mit.edu/~sql/phpMyAdmin-HTTPS/  [R,L]
+RewriteRule style.css          http://scripts.mit.edu/~scripts/home/style.css  [R,L]
+RewriteRule images(.*)         http://scripts.mit.edu/~scripts/home/images$1   [R,L]
+
+RewriteCond %{SERVER_NAME}     sql\.mit\.edu
+RewriteRule ~sql/(.*)          https://scripts.mit.edu/~sql/$1 [R,L]
diff --git a/web/home/index.php b/web/home/index.php
new file mode 100755 (executable)
index 0000000..dcf3f48
--- /dev/null
@@ -0,0 +1,4 @@
+<?php
+
+chdir('/afs/athena.mit.edu/contrib/sql/web_scripts/main');
+require('/afs/athena.mit.edu/contrib/sql/web_scripts/main/index.php');
diff --git a/web/home/style.css b/web/home/style.css
new file mode 100644 (file)
index 0000000..5bf340b
--- /dev/null
@@ -0,0 +1,333 @@
+/* -------  Layout CSS (Centered Fixed Width) ------ */
+
+body {
+  font-family: 'Lucida Grande', 'Lucida Sans Unicode', Verdana, sans-serif;
+  font-size: 12px;
+  margin: 0;
+  padding: 0;
+  text-align: center; /* IE 5.5 hack */
+}
+#farouter {
+       background: #ffffff;
+       width: 760px;
+       border: 1px solid #3A291F;
+       margin: 20px auto 20px auto;
+       text-align: left; /* IE 5.5 hack part II */
+}
+#outer {}
+#rap {}
+#masthead {
+       letter-spacing: 0.2em;
+       margin: 8px 8px 0 8px;
+       padding: 0 10px 10px 60px;
+       font: normal 100% 'Lucida Grande', 'Lucida Sans Unicode', Verdana, sans-serif;
+       height: 85px;
+}
+#main { padding-left:35px; }
+#content { float: left; width: 490px; }
+#content_wide { padding-right:35px; }
+#content_home { float: left; width: 490px; padding-top: 0px; }
+#menu { float: right; width: 175px; margin-right: 10px; border-left: 1px dashed #2050A0; }
+#nav { padding-left: 10px; }
+#logo { padding-top: 25px; padding-left: 12px; }
+#hmenu { margin: 8px; height: 30px; }
+#hnav { margin: 0; padding: 0; }
+#clearer { clear: both; margin: 0; padding: 0; }
+#footer { margin: 8px 8px 8px 8px; }
+
+/* ----------------- Color CSS ------------------------ */
+
+body { background: #2050A0; color:#333; }
+#rap { background: #ffffff; }
+#masthead { background-image: url('/~scripts/home/images/sb.gif'); background-repeat: no-repeat; }
+#footer { background: #2050A0; }
+#hnav { background: #2050A0; }
+a { color: #2050A0; text-decoration: none; }
+a:visited { color: #2050A0; text-decoration: none; }
+a:hover { color: #2050A0; text-decoration: underline; }
+acronym, abbr { border-bottom: #333; }
+blockquote { border-left: #2F700F; color: #2F700F; }
+h2 { color: #17397A; font-size: 24px; font-weight: normal; }
+h3 a { color: #17397A; }
+h3 a:hover { color: #17397A; }
+h3 a:visited { color: #17397A; }
+.meta { color: #1F6710 }
+.meta a { color: #001700; }
+.feedback a { color: #001700; }
+
+/* -------- Core CSS --------- */
+
+
+a { text-decoration: none; font-weight:bold; }
+a img { border: none; }
+acronym, abbr { border-bottom: 1px dashed; }
+acronym, abbr, span.caps { cursor: help; font-size: 90%; letter-spacing: .07em; }
+blockquote { border-left: 3px solid #2F700F; border-bottom: 3px solid #2F700F; margin-left: 1.5em; padding-left: 5px; }
+cite { font-size: 90%; font-style: normal; }
+#header a:hover { text-decoration: underline; }
+h1 { margin: 0; padding: 20px; text-align: right; }
+#hidden {display:none;}
+
+h2 {
+       font: 100% 'Lucida Grande', 'Lucida Sans Unicode', Verdana, sans-serif;
+       letter-spacing: 0.2em;
+       margin: 0 20px 20px 0;
+       padding: 20px 0 0 0;
+}
+h2#tagline {
+       margin-right: 25px;
+       padding:0;
+       text-align: right;
+/*     color: #F2EEEC; */
+       border: 0px none;
+       margin-left:0;
+       margin-top:0;
+       margin-bottom:0
+}
+
+.post h2 {
+       font: 100% 'Lucida Grande', 'Lucida Sans Unicode', Verdana, sans-serif;
+       letter-spacing: 0.2em;
+       margin: 0 20px 0 30px;
+       padding: 20px 0 30px 0;
+}
+h3 {
+       font: 24px 'Lucida Grande', 'Lucida Sans Unicode', Verdana, sans-serif;
+       margin-left: 0;
+       margin-top: 30px;
+       color: #17397A;
+}
+h3#comments { margin-left: 20px; }
+h3#respond { margin-left: 20px; }
+h4 {
+       font-size: 16px;
+       font-weight: normal;
+}
+ol#comments li p { font-size: 100%; }
+img {
+       margin: 10px;
+       padding: 10px;
+       border: 0px solid #2F700F;
+}
+p, .feedback {
+       font: 100%/175% 'Lucida Grande', 'Lucida Sans Unicode', Verdana, sans-serif;
+}
+p {}
+.textarea { width:200px; margin:0; }
+#archvies {
+       font: 150% normal 'Lucida Grande', 'Lucida Sans Unicode', Verdana, sans-serif;
+}
+
+/* ------------------------- Classes used by the_meta() --------------------- */
+
+ul.post-meta {
+       list-style: none;
+}
+
+ul.post-meta span.post-meta-key {
+       font-weight: bold;
+}
+
+.credit {
+  color: #fff;
+  font-size: 90%;
+  margin: 10px 0 0 0;
+  padding: 3px;
+  text-align: center;
+}
+
+.credit a, .credit a:hover { color: #fff; text-decoration: none; }
+.feedback { text-align: right; clear: both; margin-right: 30px; font-size: 90% }
+.meta { font-size: .95em; }
+.meta li, ul.post-meta li { display: inline; }
+.meta ul { display: inline; list-style: none;margin: 0; padding: 0; }
+.meta, .meta a { font-weight: normal; letter-spacing: 0; }
+.post { margin: 35px 35px 20px 0; }
+.entrytext {margin-left: 30px; }
+.storytitle { margin-top: 10px; margin-bottom: 2px; }
+.storytitle a { text-decoration: none; }
+.storycontent { margin-bottom: 5px; border-bottom: 1px solid #2050A0; }
+#commentform { margin-left: 20px; }
+#commentform  #comment { width:450px; }
+#commentform #author, #commentform #email, #commentform #url, #commentform textarea {
+       background: #fff; padding: .2em;
+}
+#commentform textarea { width:100%; }
+#commentlist li { border: 2px solid #2050A0; margin-bottom: 20px; padding-left: 20px; }
+#commentlist li ul { border-left: 1px solid #ddd; font-size: 110%; list-style-type: none; }
+
+/* ----------  All menu styling except #menu itself (in layout above) ------- */
+
+#nav form {
+       margin: 0 0 0 13px;
+}
+
+#nav input#s {
+       width: 80%;
+       background: #eee;
+       border: 1px solid #999;
+       color: #000;
+}
+
+#nav ul li h2 {
+       font-family: 'Lucida Grande', 'Lucida Sans Unicode', Verdana, sans-serif;
+       font-weight: normal;
+       letter-spacing: 0.1em;
+       border: 0px none;
+       text-align: left;
+       padding-left:0;
+       margin-left: 0
+}
+
+#nav ul ul ul.children {
+       font-size: 100%;
+       padding-left: 4px;
+}
+
+#nav { width: 170px; }
+
+#nav ul {
+       margin-left: 0;
+       padding-left: 0;
+       padding-right: 4px;
+       list-style-type: none;
+       font-family: 'Lucida Grande', 'Lucida Sans Unicode', Verdana, sans-serif;
+       font-size: 95%;
+}
+
+#nav a {
+       display: block;
+       padding-left: 17px;
+       width: 130px;
+       background-color: #FFF;
+       background-image: url('/~scripts/home/images/icon.gif');
+       background-repeat: no-repeat;
+       background-position: 0 55%;
+       border-bottom: 1px dotted #2050A0;
+       padding-right:3px; padding-top:3px; padding-bottom:3px;
+}
+
+#nav a.nobutt {
+       background-image: none;
+       border-bottom: none;
+}
+
+#nav a.nobutt:hover {
+       background-image: none;
+       border-bottom: none;
+}
+
+#nav a:link, #navlist a:visited {
+       text-decoration: none;
+}
+
+#nav a:hover {
+       background-image: url('/~scripts/home/images/icon2.gif'); 
+       color: #000
+}
+
+#themeswitcher {
+       font-size: 8px;
+}
+
+/*------------- hnav------------*/
+
+#hnav ul {
+       text-align: center;
+       padding-bottom: 5px;
+       padding-top: 5px;
+       padding-left: 0;
+       margin-top: 0;
+       /* cancels gap caused by top padding in Opera 7.54 */
+       margin-left: 0;
+       background-color: #2050A0;
+       color: #F2EEEC;
+       width: 100%;
+       font-family: 'Lucida Grande', 'Lucida Sans Unicode', Verdana, sans-serif;
+       line-height: 18px;
+       /* fixes Firefox 0.9.3 */
+}
+
+#hnav ul li {
+       display: inline;
+       padding-left: 0;
+       padding-right: 0;
+       padding-bottom: 5px;
+       /* matches link padding except for left and right */
+       padding-top: 5px;
+}
+
+#hnav ul li a {
+       padding-left: 10px;
+       padding-right: 10px;
+       padding-bottom: 5px;
+       padding-top: 5px;
+       color: #F2EEEC;
+       text-decoration: none;
+       border-right: 1px solid #F2EEEC;
+}
+
+#hnav ul li a:hover {
+       background: #F2EEEC;
+       color: #3A291F;
+}
+
+#hnav #active { border-left: 1px solid #F2EEEC; }
+
+/*------------- added ------------*/
+
+.gravatar {
+       float:left;
+       padding: 3px;
+       margin-right: 5px;
+       margin-bottom: 5px;
+       border: 1px solid #2F700F;
+}      
+
+#commentbox {
+       background: #F2EEEC;
+       border: 1px solid #2F700F;
+       padding: 5px;
+       margin-bottom: 15px;
+}
+
+.commentby {
+       font-size: 14px;
+       text-transform: uppercase;
+}
+.commentinfo {
+       font-size: 10px;
+       margin-top: -10px;
+       border-bottom: 1px soild #1F6710;
+}
+
+.commentid {
+       float: right;
+       font-size: 24px;
+       font-style: italic;
+       padding-left: 10px;
+       padding-right: 5px;
+       padding-top: 5px;
+       padding-bottom: 5px;
+       color: #2050A0;
+}
+
+.commentid a {
+       color: #2050A0;
+       text-decoration: none;
+}
+
+.post ul li {
+       padding: 0px;
+       font-weight: normal;
+       list-style: url('/~scripts/home/images/icon.gif');
+       line-height: 1.5em;
+}
+
+.post ul li:hover {
+       padding: 0px;
+       font-weight: normal;
+       list-style: url('/~scripts/home/images/icon2.gif');
+       line-height: 1.5em;
+}
+
diff --git a/web/home/style2.css b/web/home/style2.css
new file mode 120000 (symlink)
index 0000000..5b04e8c
--- /dev/null
@@ -0,0 +1 @@
+/afs/athena.mit.edu/contrib/scripts/web_scripts/style.css
\ No newline at end of file
diff --git a/web/index.php b/web/index.php
new file mode 100755 (executable)
index 0000000..68402ce
--- /dev/null
@@ -0,0 +1,3 @@
+<?php
+
+header('Location: /~sql/main/do/index');
diff --git a/web/phpMyAdmin.patch b/web/phpMyAdmin.patch
new file mode 100644 (file)
index 0000000..4d2db0f
--- /dev/null
@@ -0,0 +1,12 @@
+diff -rNu phpMyAdmin-2.8.2.1/libraries/common.lib.php phpMyAdmin-2.8.2.1-patched/libraries/common.lib.php
+--- phpMyAdmin-2.8.2.1/libraries/common.lib.php        2006-08-01 10:18:28.000000000 -0400
++++ phpMyAdmin-2.8.2.1-patched/libraries/common.lib.php        2006-08-14 10:36:07.000000000 -0400
+@@ -175,7 +175,7 @@
+             $cut = false;
+         }
+         foreach ($dbs as $db) {
+-            $return .= '<option value="' . $db['name'] . '"'
++            $return .= '<option value="' . urlencode($db['name']) . '"'
+                 .' title="' . $db['comment'] . '"';
+             if ($db['name'] == $selected) {
+                 $return .= ' selected="selected"';
diff --git a/web/phpMyAdmin_config.inc.php b/web/phpMyAdmin_config.inc.php
new file mode 100755 (executable)
index 0000000..857558e
--- /dev/null
@@ -0,0 +1,65 @@
+<?php
+/*
+ * Generated configuration file
+ * Generated by: phpMyAdmin 2.8.1 setup script by Michal Čihař <michal@cihar.com>
+ * Version: $Id: setup.php,v 1.23.2.8.2.2 2006/05/15 07:57:09 nijel Exp $
+ * Date: Mon, 22 May 2006 14:44:41 GMT
+ */
+
+/* Servers configuration */
+$i = 0;
+
+/* Server sql.mit.edu (cookie) [1] */
+$i++;
+$cfg['Servers'][$i]['host'] = 'sql.mit.edu';
+$cfg['Servers'][$i]['extension'] = 'mysql';
+$cfg['Servers'][$i]['connect_type'] = 'tcp';
+$cfg['Servers'][$i]['compress'] = false;
+$cfg['Servers'][$i]['auth_type'] = 'cookie';
+
+/* End of servers configuration */
+
+$cfg['PmaAbsoluteUri'] = 'https://scripts.mit.edu/~sql/phpMyAdmin-HTTPS/';
+$cfg['blowfish_secret'] = '442edbaf575294.08808821';
+$cfg['LeftFrameLight'] = false;
+$cfg['LeftFrameDBTree'] = false;
+$cfg['LeftDisplayLogo'] = false;
+$cfg['LeftDisplayServers'] = false;
+//$cfg['DefaultTabServer'] = 'main.php';
+$cfg['DefaultTabServer'] = 'server_databases.php';
+$cfg['DefaultTabDatabase'] = 'db_details_structure.php';
+$cfg['DefaultTabTable'] = 'tbl_properties_structure.php';
+$cfg['LightTabs'] = true;
+$cfg['ForceSSL'] = true;
+$cfg['ShowPhpInfo'] = false;
+$cfg['ShowChgPassword'] = false;
+$cfg['MenuIconic'] = true;
+$cfg['ErrorIconic'] = false;
+$cfg['MainPageIconic'] = true;
+$cfg['MenuBarIconic'] = false;
+$cfg['AllowUserDropDatabase'] = false;
+$cfg['ShowStats'] = false;
+$cfg['ThemeManager'] = false;
+$cfg['ShowCreateDb'] = false;
+$cfg['ThemeDefault'] = 'original';
+$cfg['LoginCookieRecall'] = false;
+$cfg['OBGzip'] = 'auto';
+$cfg['PropertiesIconic'] = false;
+$cfg['lang'] = 'en-iso-8859-1';
+$cfg['Lang'] = 'en-iso-8859-1';
+$cfg['ShowHttpHostTitle'] = false;
+//$cfg['SetHttpHostTitle'] = 'sql.mit.edu';
+$cfg['LeftBgColor'] = '#2050A0';
+$cfg['ShowBlob'] = true;
+
+if (isset($_GET['db'])) $_GET['db'] = str_replace(' ', '+', $_GET['db']);
+if (isset($_COOKIE['db'])) $_COOKIE['db'] = str_replace(' ', '+', $_COOKIE['db']);
+if (isset($_POST['db'])) $_POST['db'] = str_replace(' ', '+', $_POST['db']);
+if (isset($_REQUEST['db'])) $_REQUEST['db'] = str_replace(' ', '+', $_REQUEST['db']);
+if (isset($_GLOBAL['db'])) $_GLOBAL['db'] = str_replace(' ', '+', $_GLOBAL['db']);
+if (isset($_SESSION['db'])) $_SESSION['db'] = str_replace(' ', '+', $_SESSION['db']);
+if (isset($GLOBALS['db'])) $GLOBALS['db'] = str_replace(' ', '+', $GLOBALS['db']);
+if (isset($url_params['db'])) $url_params['db'] = str_replace(' ', '+', $url_params['db']);
+if (isset($db)) $db = str_replace(' ', '+', $db);
+if (isset($db_start)) $db_start = str_replace(' ', '+', $db_start);
+?>
diff --git a/web/tools/connect.php b/web/tools/connect.php
new file mode 100755 (executable)
index 0000000..148b940
--- /dev/null
@@ -0,0 +1,9 @@
+<?php
+
+require_once('mysql.inc.php');
+
+$res = @mysql_connect($i_h,$i_u,$i_p);
+!is_resource($res) && die($_MYSQL_TOOLS_ERROR['LOGIN_ERROR']);
+die($_MYSQL_TOOLS_ERROR['NO_ERROR']);
+
+?>
diff --git a/web/tools/list_dbs.php b/web/tools/list_dbs.php
new file mode 100755 (executable)
index 0000000..f7dc240
--- /dev/null
@@ -0,0 +1,14 @@
+<?php
+
+require_once('mysql.inc.php');
+
+$res = @mysql_connect($i_h,$i_u,$i_p);
+!is_resource($res) && die($_MYSQL_TOOLS_ERROR['LOGIN_ERROR']);
+$r = mysql_list_dbs($res);
+$dbs = array();
+while($row = mysql_fetch_row($r)) {
+       $dbs[] = array_shift($row);
+}
+echo implode("\n",$dbs);
+
+?>
diff --git a/web/tools/mysql.err.php b/web/tools/mysql.err.php
new file mode 100755 (executable)
index 0000000..5d8fb39
--- /dev/null
@@ -0,0 +1,12 @@
+<?php
+
+$_MYSQL_TOOLS_ERROR[0] = 'No error';
+$_MYSQL_TOOLS_ERROR['NO_ERROR'] = '0';
+$_MYSQL_TOOLS_ERROR[-1] = 'Login failed';
+$_MYSQL_TOOLS_ERROR['LOGIN_ERROR'] = '-1';
+$_MYSQL_TOOLS_ERROR[-2] = 'Database does not exist';
+$_MYSQL_TOOLS_ERROR['DB_DNE'] = '-2';
+$_MYSQL_TOOLS_ERROR[-3] = 'Database already exists';
+$_MYSQL_TOOLS_ERROR['DB_EXISTS'] = '-3';
+
+?>
diff --git a/web/tools/mysql.inc.php b/web/tools/mysql.inc.php
new file mode 100755 (executable)
index 0000000..7f9f68e
--- /dev/null
@@ -0,0 +1,16 @@
+<?php
+
+require_once('mysql.err.php');
+
+import_request_variables('gp','i_');
+(!isset($i_h) || empty($i_h)) && $i_h = 'sql.mit.edu';
+(!isset($i_u) || empty($i_u)) && $i_u = '';
+(!isset($i_p) || empty($i_p)) && $i_p = '';
+(!isset($i_d) || empty($i_d)) && $i_d = '';
+(!isset($i_e) || empty($i_e)) && $i_e = '';
+
+$i_d = str_replace(' ', '+', $i_d);
+
+(!empty($i_e) && isset($_MYSQL_TOOLS_ERROR[$i_e])) && die($_MYSQL_TOOLS_ERROR[$i_e]);
+
+?>
diff --git a/web/tools/select_db.php b/web/tools/select_db.php
new file mode 100755 (executable)
index 0000000..2345a05
--- /dev/null
@@ -0,0 +1,11 @@
+<?php
+
+require_once('mysql.inc.php');
+
+$res = @mysql_connect($i_h,$i_u,$i_p);
+!is_resource($res) && die($_MYSQL_TOOLS_ERROR['LOGIN_ERROR']);
+@mysql_select_db($i_d);
+mysql_error() && die($_MYSQL_TOOLS_ERROR['DB_DNE']);
+die($_MYSQL_TOOLS_ERROR['NO_ERROR']);
+
+?>
This page took 0.296591 seconds and 5 git commands to generate.