require_once('batch.inc.php');
-$callingUnix = posix_getpwuid(posix_getuid());
-
-$myUsername = escapeshellcmd($callingUnix['name']);
-$hesinfo = explode(':', trim(`hesinfo $myUsername passwd`));
+$myUsername = $argv[1];
+$myUID = $argv[3];
+$hescmd = "hesinfo $myUsername passwd";
+$hesinfo = explode(':', trim(exec($hescmd)));
if (count($hesinfo)>=4) {
$myName = explode(',', $hesinfo[4]);
$myName = array_shift($myName);
} else {
$myName = $myUsername;
}
-$myUID = $callingUnix['uid'];
$myEmail = $myUsername.'@mit.edu';
$myPassword = substr(uniqid(),0,7);
unset($_SESSION['LoginSSL']);
}
+ /*
if (isPost() || isset($i_refresh)) {
if (!empty($UserId)) {
checkQuotas($UserId);
}
- isset($i_refresh) && redirect('main');
+ isset($i_refresh) && redirect('main?r');
}
+ */
} // isOnline()
if (isset($i_drop)) {
list($msg1, $err1) = proc::drop($User, $i_drop);
}
- if (!count($err1))
- $User->refresh();
+}
+
+if (!count($err1)) {//&& !isset($i_r))
+ checkQuotas($Login->getUserID());
+ $User->refresh();
}
$myDBs = $User->getDBList();
<head>\r
<meta http-equiv="content-type" content="text/html; charset=utf-8" />\r
<title>MIT SIPB MySQL Service for Athena</title>\r
- <link rel="stylesheet" href="http://scripts.mit.edu/style.css" type="text/css" />\r
+ <link rel="stylesheet" href="/style.css" type="text/css" />\r
<link rel="stylesheet" href="<?=$BASE_URL?>mitsql.css" type="text/css" />\r
<base href="<?=$BASE_URL?>" />\r
</head>\r
<?php
include 'head.php';
?>
+<?/*
<h3>About</h3>
+*/?>
<p>
This service provides <a target="_blank" href="http://dev.mysql.com/doc">MySQL</a> databases to <a target="_blank" href="http://ca.mit.edu/">MIT certificate</a> holders.
You must choose a MySQL password (which should be different from your Athena account password) when you <a href="do/signup">sign up</a>, and you can
then use this interface to create and drop databases. All subsequent SQL commands can be issued from any host, client, and/or script of your choice;
-simply connect to the MySQL server at <b>sql.mit.edu</b> using your new MySQL username and password.
-You may want to consider running scripts using the <a target="_blank" href="http://scripts.mit.edu/web">web script service</a> or
+simply connect to the MySQL server at <b>sql.mit.edu</b> using your username and your new MySQL password.
+You may find it convenient to run scripts using the <a target="_blank" href="http://scripts.mit.edu/web">web script service</a> or
<a target="_blank" href="http://scripts.mit.edu/cron">shortjobs service</a>.
</p>
<p>
All uses of this service must comply with the <a target="_blank" href="http://web.mit.edu/olh/Welcome/rules.html">MITnet rules of use</a>.
-The SIPB MySQL Service is part of the <a target="_blank" href="http://scripts.mit.edu/">scripts.mit.edu</a> project.
</p>
+<?/*
<h3>Backups</h3>
<p>
Although we use various technical means to try to ensure the availability of your data (including hardware-level redundancy and real-time replication), we can make no guarantees about the reliability of the service and access to your data.
</p>
-<?/*
<h3>Quotas</h3>
<p>
<strong>Always use this interface to create and drop databases.</strong>
Although you can drop any of your databases outside this interface, doing so will not relinquish your rights to that database and will therefore still count against your quota.
</p>
-*/?>
<h3>Disclaimer</h3>
+*/?>
<p>
Although this service has been designed with reliability in mind, the SIPB MySQL service should not be used to host critical applications that cannot tolerate downtime.