]> andersk Git - sql-web.git/commitdiff
mitsql: contact page, signup fixes, main info on index
authorJoe Presbrey <presbrey@mit.edu>
Mon, 18 Jul 2005 15:46:19 +0000 (15:46 +0000)
committerJoe Presbrey <presbrey@mit.edu>
Mon, 18 Jul 2005 15:46:19 +0000 (15:46 +0000)
git-svn-id: svn://presbrey.mit.edu/sql/mitsql@38 a142d4bd-2cfb-0310-9673-cb33a7e74f58

13 files changed:
contact.php [new file with mode: 0644]
global.act.php
global.done.php
index.php
lib/security.lib.php
login.php
reset.sql [new file with mode: 0644]
signup.php
tpl/index.php
tpl/login.php
tpl/main.php
tpl/menu.php
tpl/signup.php

diff --git a/contact.php b/contact.php
new file mode 100644 (file)
index 0000000..23fc076
--- /dev/null
@@ -0,0 +1,8 @@
+<?php
+
+require_once('mitsql.cfg.php');
+require_once('mitsql.lib.php');
+
+include 'tpl/contact.php';
+
+?>
index 21f9ad571c92261e1c8645e0bcb61944f7a338cf..7563b612b68e1d68717d7a10fbff47ad9f828b29 100644 (file)
@@ -21,9 +21,9 @@ $Name = '';
 $Email = '';
 $UL = 0;
 $Login = sess('Login');
+$LoginSSL = sess('LoginSSL');
 
-if (is_a($Login,'Login')) {
-//     $Login->refresh();
+if (is_a($Login, 'Login')) {
     $UserId = $Login->getUserId();
        $Username = $Login->getUsername();
        $Name = $Login->getName();
@@ -33,6 +33,8 @@ if (is_a($Login,'Login')) {
        $Login = new Login('');
 }
 
+## PROCESS CERTIFICATE
+
 $SSLCred = getSSLCert();
 $SSLName = '';
 $SSLEmail = '';
@@ -43,5 +45,12 @@ if (isSSL()) {
        $SSLUsername = $SSLCred['Username'];
        $SSLEmail = $SSLCred['Email'];
 }
+if (!is_a($LoginSSL, 'Login')) {
+       $LoginSSL = new Login($SSLUsername);
+}
+if (!isLoggedIn() && !$LoginSSL->exists()) {
+       addUser($SSLCred);
+       $LoginSSL->refresh();
+}
 
 ?>
index 3e1c2c1b3cce8ceac27c4ef56128681b72dd8efc..e02cc284e9aeaf0f0790d20746c4bd4de03e0a05 100644 (file)
@@ -4,6 +4,7 @@ require_once('mitsql.cfg.php');
 require_once('mitsql.lib.php');
 
 sess('Login', $Login);
+sess('LoginSSL', $LoginSSL);
 
 echo '<pre>';
 print_r($_SESSION);
index 9bdf89d12b8d2ffc552fd01cf1ba88998e24693c..7ab60495e3c6cc6792c4959ce4b8dd0639643da5 100755 (executable)
--- a/index.php
+++ b/index.php
 require_once('mitsql.cfg.php');
 require_once('mitsql.lib.php');
 
-isLoggedIn() || redirect('login');
+isLoggedIn() && redirect('main');
+//$LoginSSL->canSignup() && redirect('signup');
 
-redirect('main');
+//redirect('login');
+
+include 'tpl/index.php';
 
 exit;
 
index 8e7dcf329705d03bba0425f1620796fc105db596..44071d13d75442f20726aeefee9314294b974f55 100644 (file)
@@ -189,12 +189,12 @@ function getSSLCert() {
 
 ## 302 REDIRECTS
 
-function redirect($target=null,$secure=true) {
+function redirect($target=null,$secure=null) {
     $base = (is_null($target)||substr($target,0,1)=='?')?$_SERVER['REDIRECT_URL']:(dirname($_SERVER['REDIRECT_URL']).'/');
     redirectFull(is_null($target)?$base:($base.$target),$secure);
 }
 function redirectFull($target,$secure) {
-       redirect2((isSSL()&&$secure?'https://':'http://').$_SERVER['SERVER_NAME'].$target);
+       redirect2((((isSSL()&&is_null($secure))||$secure==true)?'https://':'http://').$_SERVER['SERVER_NAME'].$target);
 }
 function redirect2($target) {
        header('Location: '.$target);
@@ -222,7 +222,7 @@ function addUser($sslCredentials) {
 
        $arr = $_NEW_USERSTAT;
        $arr['UserId'] = $UserId;
-    $sql = sprintf("INSERT INTO UserQuota %s",
+    $sql = sprintf("INSERT INTO UserStat %s",
                     buildSQLInsert($arr));
        DBInsert($sql);
 
index 18f7531ef35bfb7758d81b4a475be4c18d94546c..2d684fafb0ee9ee856edf89f63856e3287020e90 100644 (file)
--- a/login.php
+++ b/login.php
@@ -4,14 +4,8 @@ require_once('mitsql.cfg.php');
 require_once('mitsql.lib.php');
 
 if (isSSL()) {
-       $Login2 = new Login($SSLUsername);
        if (is_null($SSLCred)) {
                $err[] = 'Please install a valid certificate.';
-       } else {
-           if (!(empty($SSLUsername) || $Login2->exists())) {
-               addUser($SSLCred);
-               $Login = new Login($SSLUsername);
-           }
        }
 }
 
diff --git a/reset.sql b/reset.sql
new file mode 100644 (file)
index 0000000..84c5573
--- /dev/null
+++ b/reset.sql
@@ -0,0 +1,10 @@
+TRUNCATE TABLE `DB`;
+TRUNCATE TABLE `DBOwner`;
+TRUNCATE TABLE `DBQuota`;
+TRUNCATE TABLE `Group`;
+TRUNCATE TABLE `GroupQuota`;
+TRUNCATE TABLE `GroupStat`;
+TRUNCATE TABLE `User`;
+TRUNCATE TABLE `UserGroup`;
+TRUNCATE TABLE `UserQuota`;
+TRUNCATE TABLE `UserStat`;
index 0b52815c42491d711d61079df0da4875e5e17591..fa93c8b8f5d185a01cbfe1685368b1283142389d 100644 (file)
@@ -4,7 +4,7 @@ require_once('mitsql.cfg.php');
 require_once('mitsql.lib.php');
 
 if (!isSSL())
-       redirect('index',false);
+       redirect('signup',true);
 
 if (isLoggedIn()) {
 
@@ -15,14 +15,14 @@ if (isLoggedIn()) {
        if (is_null($SSLCred)) {
                $err[] = 'Please install a valid certificate.';
        } else {
-       $Login2 = new Login($SSLUsername);
-       if (isPost() && $Login2->canSignup()) {
-               $u = new User($Login2->getUserId());
-               $u->signup($i_p1);
-               $Login2->refresh();
+               if (isPost() && $LoginSSL->canSignup()) {
+                       $u = new User($LoginSSL->getUserId());
+                       $u->signup($i_p1);
+                       $LoginSSL->refresh();
+                       sess('Login', $LoginSSL);
+                       redirect('login', true);
+               }
        }
-       }
-
 }
 
 include 'tpl/signup.php';
index 6f454e6107697409be0c84d9147156671e158dec..85b8d4d3d9c48d6216ae5bfdacf7e114823d82f6 100644 (file)
@@ -1,7 +1,50 @@
 <?php
 include 'head.php';
+?>
+
+<strong>Important Notice:</strong><p> This is a beta service and is not yet ready for use in data intensive applications.
+
+<hr />
+
+<br />
+
+<h2>About</h2>
+
+<p>
+This service provides <a href="http://www.mysql.com/">MySQL</a> databases to <a href="http://ca.mit.edu/">Athena account</a> holders.
+You must choose a MySQL password (independent of your Athena account) when you <a href="signup">Signup</a> and then use this interface to create and drop your MySQL databases.
+All subsequent SQL commands can be issued from any host, client, and/or script of your choosing.
+</p>
+
+<h2>Backups</h2>
 
+<p>
+As you work with your SQL data, it is automatically saved on an additional secondary SQL server for restoration in the event of a single server failure.
+<strong>We strongly recommend you keep your own backups for your own independent use in all other cases.</strong>
+Although we continually put forth our best efforts, we can make no guarantees on the reliability of the service and access to the data.</p>
 
+<h2>Quotas</h2>
 
+<p>
+By default, new users can create up to <strong>5 databases</strong>, consuming a total of <strong>25 megabytes</strong> of SQL data.
+The system will periodically check your database sizes and suspend creation of new data (INSERT statements) if your total usage exceeds your allotted quota.
+</p>
+
+<p>
+This service is not designed to store gratuitous amounts of information in the BLOB or BINARY formats. Extra quota space will not be allotted to users for this type of data.
+Users should instead store these types of data in AFS and use SQL tables only to catalogue it.
+</p>
+
+<h2>Disclaimer</h2>
+
+<p>
+We reserve the right to suspend or terminate your MySQL account at any time and for any or no reason.
+</p>
+
+<p>
+We maintain general usage statistics of this service by the MIT community at large.
+</p>
+
+<?php
 include 'foot.php';
 ?>
index 54abd2b8e2f4dbe5d50f3e27809ecbd9cf16cf2c..34dd8fefb4b64c03c86e1ff1e2bfc1a64aea32a3 100644 (file)
@@ -19,13 +19,13 @@ $otherTxt = isSSL()?' without a Certificate':' with a Certificate';
 <?php elseif (isSSL() && !empty($SSLCred)): ?>
 
 <form method=post>
-<h3>You are identifed as: <?=$SSLUsername?></h3>
+<h3>You are identified as: <?=$SSLUsername?></h3>
 <p><?=$SSLName?></p>
 <p><?=$SSLEmail?></p>
 
 <?php endif; ?>
 
-<?php if (!isSSL() || $Login2->canLogin()): ?>
+<?php if (!isSSL() || $LoginSSL->canLogin()): ?>
 
 <input type=submit value="Login<?=$thisTxt?>">
 </form>
index 717b51d4d1628c3ebfbbc6cc130b232561b89a22..2f7571345d4007984fbe9ef3d9a25d23b76b5cec 100644 (file)
@@ -4,6 +4,14 @@ include 'head.php';
 
 ?>
 <h2>Databases</h2>
+
+<p>
+Thanks for signing up.  This interface is nearly ready.  We will e-mail you as soon as this portion of the site is ready.
+<br />
+<br />
+- The MIT SQL Team
+</p>
+
 <?php
 
 include 'foot.php';
index 572e0d0b739414c55505770e030cb1279040a973..97f216e59e584b375b7c5f2bb43345d71c11cf61 100644 (file)
@@ -1,6 +1,7 @@
 <div id="content1">
 <?php if (isLoggedIn()): ?>
 <div style="float:left">
+<a href="main">Main</a> |
 <a href="logout">Logout</a>
 </div>&nbsp;
 Logged in as <em><?=$Username?></em> on <?=DBHOST?>
index f01aa182432ea077252c3bb036bd057751e75213..5be6e87ab7b31b3730ad6369af00a5645a1167e1 100644 (file)
@@ -8,13 +8,10 @@ $thisTxt = isSSL()?' with this Certificate':' via SQL';
 
 <?php printErrors($err); ?>
 
-<?php if (isset($Login2) && !$Login2->canLogin()): ?>
+<?php if ($LoginSSL->canSignup()): ?>
 <h3>You are registering as: <?=$Username?></h3>
 <p><?=$SSLName?></p>
 <p><?=$SSLEmail?></p>
-<?php endif; ?>
-
-<?php if (isset($Login2) && $Login2->canSignup()): ?>
 
 <form method=post>
 <p>password: <input type="password" name="p1"></p>
@@ -22,9 +19,9 @@ $thisTxt = isSSL()?' with this Certificate':' via SQL';
 <input type=submit value="Confirm Registration">
 </form>
 
-<?php elseif (isset($Login2) && $Login2->canLogin()): ?>
+<?php elseif ($LoginSSL->canLogin()): ?>
 
-<h3><a href="login">Login</a>. This account is signed up.</h3>
+<h3>This account is signed up. <a href="login">Login</a>.</h3>
 
 <?php else: ?>
 
This page took 0.049232 seconds and 5 git commands to generate.