--- /dev/null
+../php.ini
\ No newline at end of file
$myEmail = $myUsername.'@mit.edu';
$myPassword = substr(md5(uniqid()),0,8);
-if ($myUID<1000) exit('bad UID');
+if ($myUID<100) exit('bad UID');
$Login = new Login($myUsername);
if (!$Login->exists() && !empty($myUsername)) {
--- /dev/null
+/afs/athena.mit.edu/contrib/sql/web_scripts/main/php.ini
\ No newline at end of file
--- /dev/null
+/afs/athena.mit.edu/contrib/sql/web_scripts/main/php.ini
\ No newline at end of file
require_once('mitsql.lib.php');
isOffline() && exit;
-define('MAX_PROC_TIME', 10);
+define('MAX_PROC_TIME', 30);
$baddbs = $badusers = $bad = array();
$result = mysql_query('SHOW FULL PROCESSLIST');
}
mysql_free_result($result);
+print_r($bad);
foreach($bad as $badproc) {
$mailtos = $mailnames = array();
$baddb = mysql_escape_string($badproc['db']);
+ if (empty($baddb)) continue;
$badtime = $badproc['Time'];
$badquery = $badproc['Info'];
- if (empty($baddb)) continue;
$sql = "SELECT User.UserId,User.Name,User.Email
FROM `User`
NATURAL JOIN DBOwner
$mailtos[] = $addy['Email'];
$mailnames[] = $addy['Name'];
}
- if (empty($mailtos)) continue;
+ if (empty($mailtos)) {
+ echo "No email found for $baddb\n";
+ continue;
+ }
$mailto = implode(', ',$mailtos);
$mailname = implode(', ',$mailnames);
- $mailsubj = "[sql] Slow Query on $baddb";
+ $mailsubj = "[sql.mit.edu] Slow Query on $baddb";
$mailbody = "Dear $mailname:
A slow query was found on your database: $baddb
queries to avoid having your queries killed in the future. If you have any
questions, please contact sql@mit.edu.
-This SQL Service is available at sql.mit.edu.
+The SQL Service
+Email: <sql@mit.edu>
+Web: http://sql.mit.edu/
---------------------------------------------------------------------------
--- /dev/null
+../php.ini
\ No newline at end of file
} else {
if (is_array($userId)) {
$sql_userId = sprintf("UserId IN ('%s')", implode("','",array_map('mysql_escape_string',$userId)));
- } elseif (is_numeric($userId)) {
+ } elseif ((string)intval($userId)===(string)$userId) {
$sql_userId = sprintf("UserId = '%s'", mysql_escape_string($userId));
} else {
die('userId parameter error in checkQuotas');
while ($r = mysql_fetch_assoc($rs)) {
$arr[] = $r;
}
- } elseif (is_numeric($key)) {
+ } elseif ((string)intval($key)===(string)$key) {
while ($r = mysql_fetch_row($rs)) {
$arr[$r[$key]] = $r;
}
--- /dev/null
+/afs/athena.mit.edu/contrib/sql/web_scripts/main/php.ini
\ No newline at end of file
if (empty($u)) return;
$this->u = $u;
$this->p = $p;
- if (is_numeric($u)) {
+ if ((string)intval($u)===(string)$u) {
$this->id = $u;
$opt = sprintf(" Username = '%s' OR UserId = '%s'", mysql_escape_string($u), mysql_escape_string($u));
} else {
--- /dev/null
+/afs/athena.mit.edu/contrib/sql/web_scripts/main/php.ini
\ No newline at end of file
<?php printErrors($err); ?>
<?php printMsgs($msg); ?>
-
<form method="post" action="<?=$URI?>">
<table>
<?/*
<tr><td align="right" colspan=2><br /><input name="chgpw" type="submit" value="change password"></td></tr>
</table>
</form>
+<br />
+<hr />
+Note: you need to also <a href="http://scripts.mit.edu/faq/59">update your .my.cnf file on Athena</a> if you want to use SIPB <a href="http://scripts.mit.edu/start/">scripts auto-installers</a> or access the MySQL service from the command-line.
<?php
include 'foot.php';