]> andersk Git - sql-web.git/commitdiff
index.php: old stuff moved to attic
authorJoe Presbrey <presbrey@mit.edu>
Fri, 9 Sep 2005 18:47:38 +0000 (18:47 +0000)
committerJoe Presbrey <presbrey@mit.edu>
Fri, 9 Sep 2005 18:47:38 +0000 (18:47 +0000)
git-svn-id: svn://presbrey.mit.edu/sql/mitsql@60 a142d4bd-2cfb-0310-9673-cb33a7e74f58

index.php

index 7ab60495e3c6cc6792c4959ce4b8dd0639643da5..7cceea03cfd527c5a17489ad1d76cb07f2175a0e 100755 (executable)
--- a/index.php
+++ b/index.php
@@ -1,7 +1,6 @@
 <?php
 /*
        (c) 2005 Joe Presbrey
-       written for SIPB/MIT
 
        add switching of what owner to manage
        - to support group sql "lockers"
@@ -12,148 +11,8 @@ require_once('mitsql.lib.php');
 
 isLoggedIn() && redirect('main');
 //$LoginSSL->canSignup() && redirect('signup');
-
 //redirect('login');
 
 include 'tpl/index.php';
 
-exit;
-
-if (isset($_SESSION['owner'])) {
-       $owner = $_SESSION['owner'];
-       $dbm = new DBManage($owner);
-
-?><p><h2>SQL Databases: <?php echo $owner; ?></h2><?php
-if (isset($realuser)) {
-?><h4> [ <a href="?op=admin"><?php echo $realuser; ?></a> ]</h4><?php
-}
-?></p><?php
-
-$inputvars = array('initpw', 'op', 'name', 'owner');
-
-if (isset($i_op)) {
-       switch($i_op) {
-               case 'admin':
-                       if (isset($i_owner)) {
-                               $_SESSION['owner'] = $i_owner;
-                               $_SESSION['realuser'] = $_SESSION['owner'];
-                               redirectLocal('/');
-                       } else {
-                               redirectLocal('/admin/');
-                       }
-               case 'init':
-                       if (strlen($i_initpw)<PASS_MIN_LEN) {
-                               echo '<p class="err">',TEXT_REGPASSTOOSHORT,'</p>';
-                       } else {
-                               if (!$dbm->isInit()) {
-                                       $dbm->init($i_initpw);
-                                       redirectLocal('/');
-                               } else {
-                                       echo '<p class="err">Your account is already initialized.</p>';
-                               }
-                       }
-                       break;
-               case 'uninit':
-                       echo '<p>This operation will remove all the databases and accounts for: ',$owner,'.  Are you sure?</p>';
-                       echo '<form method="',FORM_METHOD,'"><tr><td><div align="left"><input type=hidden name="op" value="uninit2"><input type="submit" value="Remove My Account"></div></td></form>';
-                       exit();
-                       break;
-               case 'uninit2':
-                       $dbm->uninit();
-                       redirectLocal('/');
-                       break;
-               case 'adddb':
-                       if ($dbm->getNumDBs() < $dbm->getNumMaxDBs()) {
-                               $dbm->addDB($owner.DELIMETER.$i_name);
-                               redirectLocal('/');
-                       } else {
-                               echo '<p class="err">',TEXT_DBLIMIT,'</p>';
-                       }
-                       break;
-               case 'deldb':
-                       if ($dbm->isRegistered($i_name)) {
-                               $dbm->delDB($i_name);
-                               redirectLocal('/');
-                       } else {
-                               echo '<p class="err">',TEXT_NOTREG,'</p>';
-                       }
-                       break;
-               case 'createdb':
-                       if ($dbm->isRegistered($i_name)) {
-                               $dbm->createDB($i_name);
-                               redirectLocal('/');
-                       } else {
-                               echo '<p class="err">',TEXT_NOTREG,'</p>';
-                       }
-                       break;
-               case 'dropdb':
-                       if ($dbm->isRegistered($i_name)) {
-                               $dbm->dropDB($i_name);
-                               redirectLocal('/');
-                       } else {
-                               echo '<p class="err">',TEXT_NOTREG,'</p>';
-                       }
-                       break;
-               case 'grantdb':
-                       if ($dbm->isRegistered($i_name)) {
-                               $dbm->grantDB($i_name);
-                               redirectLocal('/');
-                       } else {
-                               echo '<p class="err">',TEXT_NOTREG,'</p>';
-                       }
-                       break;
-               case 'revokedb':
-                       if ($dbm->isRegistered($i_name)) {
-                               $dbm->revokeDB($i_name);
-                               redirectLocal('/');
-                       } else {
-                               echo '<p class="err">',TEXT_NOTREG,'</p>';
-                       }
-                       break;
-       }
-       $dbm = null;
-       $dbm = new DBManage($owner);
-}
-?>
-
-
-
-<?php
-       if ($dbm->getNumDBs()) {
-               echo '<table>';
-               $dbm->printOwnerDBs();
-               echo '</table>';
-       }
-       if ($dbm->isInit()) {
-               echo '<form method="',FORM_METHOD,'"><input type=text readonly value="',$owner.DELIMETER,'" style="text-align:right"><input type=text name="name"><input type=hidden name="op" value="adddb"><input type=submit value="Add Database"></form>';
-
-               $dbm->printOwner();
-               echo '<table width="100%" style="margin-top:20px;">';
-               echo '<form method="',FORM_METHOD,'"><tr><td><div align="left"><input type=hidden name="op" value="uninit"><input type="submit" value="Remove My Account"></div></td></form>';
-       } else {
-               echo '<h3>',TEXT_NOREG,'</h3>';
-               echo '<form method="',FORM_METHOD,'">';
-               echo '<table>';
-               echo '<tr><td>your SQL server:</td><td>',HOST,'</td></tr>';
-               echo '<tr><td>your SQL username:</td><td>',$owner,'</td></tr>';
-               echo '<tr><td>choose a SQL password:</td><td><input type=hidden name="op" value="init"><input type="password" name="initpw" value=""></td></tr></table>';
-               echo '<table width="100%" style="margin-top:20px;">';
-               echo '<tr><td></td><td><input type="submit" value="Activate My Account"></td></form>';
-       }
-       echo '<form method=get><td><div align="right"><input type=hidden name="reset" value=""><input type="submit" value="Restart"></div></td></form></tr></table>';
-
-       @mysql_close($cxn);
-
-       if (DEBUG) {
-               echo '<!--';
-               print_r($dbm);
-               echo '-->';
-       }
-?>
-<hr><div align="right">
-
-<address>MIT SQL Service Management v<?php echo VERSION; ?><br />
-Direct comments and bugs to: <a href="mailto:presbrey@mit.edu">presbrey@mit.edu</a></address></div>
-<?php
-}
 ?>
This page took 0.03878 seconds and 5 git commands to generate.