tomgreen
04-25-2005, 03:45 PM
After reading several posts about this here is a php script that will change the default_user_size for all accounts..just save this code to a text file and rename it however you wish with a .php extension substituting the proper vaules for your server. this isn't much but it's useful:
**below has been corrected to allow for specification of database suffix**
<?PHP
function refresh(){
echo "<META HTTP-EQUIV='refresh' CONTENT='3; URL=$_SERVER[PHP_SELF]'>";
}
ob_start();
//connect to database
$dname=" "; //database name
$dhost=" "; //database host or ip address
$duser=" "; //database username
$dpass=" "; //database password
$dbsuff=" "; //change to your database suffix such as mess_ which is the default
mysql_connect("$dhost", "$duser", "$dpass") or die(mysql_error());
mysql_select_db("$dname") or die(mysql_error());
if ($_POST['size']=="" and $_POST['submit']){
echo "you must enter a value...redirecting";
refresh();
exit;
} elseif ($_POST['size']<="10000" and $_POST['submit']){
echo "the value entered is 10,000 or less. please increase this value...redirecting";
refresh();
exit;
}
if ($_POST['submit']){
$table = $dbsuff."registration";
$size = $_POST['size'];
$insert=mysql_db_query($dname,"UPDATE $table SET `max_mailbox`='$size'");
echo "settings changed to ".$size." Bytes...redirecting";
refresh();
exit;
}
ob_end_flush();
?>
<form method="POST" action="<?PHP $_SERVER['SELF']?>">
<p>size: <input type="text" name="size" size="20"></p>
<p><input type="submit" value="Submit" name="submit"><input type="reset" value="Reset" name="B2"></p>
</form>
**below has been corrected to allow for specification of database suffix**
<?PHP
function refresh(){
echo "<META HTTP-EQUIV='refresh' CONTENT='3; URL=$_SERVER[PHP_SELF]'>";
}
ob_start();
//connect to database
$dname=" "; //database name
$dhost=" "; //database host or ip address
$duser=" "; //database username
$dpass=" "; //database password
$dbsuff=" "; //change to your database suffix such as mess_ which is the default
mysql_connect("$dhost", "$duser", "$dpass") or die(mysql_error());
mysql_select_db("$dname") or die(mysql_error());
if ($_POST['size']=="" and $_POST['submit']){
echo "you must enter a value...redirecting";
refresh();
exit;
} elseif ($_POST['size']<="10000" and $_POST['submit']){
echo "the value entered is 10,000 or less. please increase this value...redirecting";
refresh();
exit;
}
if ($_POST['submit']){
$table = $dbsuff."registration";
$size = $_POST['size'];
$insert=mysql_db_query($dname,"UPDATE $table SET `max_mailbox`='$size'");
echo "settings changed to ".$size." Bytes...redirecting";
refresh();
exit;
}
ob_end_flush();
?>
<form method="POST" action="<?PHP $_SERVER['SELF']?>">
<p>size: <input type="text" name="size" size="20"></p>
<p><input type="submit" value="Submit" name="submit"><input type="reset" value="Reset" name="B2"></p>
</form>