--- /dev/null
+<?php
+
+require_once('mitsql.cfg.php');
+require_once('mitsql.lib.php');
+
+include 'tpl/contact.php';
+
+?>
$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();
$Login = new Login('');
}
+## PROCESS CERTIFICATE
+
$SSLCred = getSSLCert();
$SSLName = '';
$SSLEmail = '';
$SSLUsername = $SSLCred['Username'];
$SSLEmail = $SSLCred['Email'];
}
+if (!is_a($LoginSSL, 'Login')) {
+ $LoginSSL = new Login($SSLUsername);
+}
+if (!isLoggedIn() && !$LoginSSL->exists()) {
+ addUser($SSLCred);
+ $LoginSSL->refresh();
+}
?>
require_once('mitsql.lib.php');
sess('Login', $Login);
+sess('LoginSSL', $LoginSSL);
echo '<pre>';
print_r($_SESSION);
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;
## 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);
$arr = $_NEW_USERSTAT;
$arr['UserId'] = $UserId;
- $sql = sprintf("INSERT INTO UserQuota %s",
+ $sql = sprintf("INSERT INTO UserStat %s",
buildSQLInsert($arr));
DBInsert($sql);
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);
- }
}
}
--- /dev/null
+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`;
require_once('mitsql.lib.php');
if (!isSSL())
- redirect('index',false);
+ redirect('signup',true);
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';
<?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';
?>
<?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>
?>
<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';
<div id="content1">
<?php if (isLoggedIn()): ?>
<div style="float:left">
+<a href="main">Main</a> |
<a href="logout">Logout</a>
</div>
Logged in as <em><?=$Username?></em> on <?=DBHOST?>
<?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>
<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: ?>