]> andersk Git - sql-web.git/blobdiff - main.php
check quotas function
[sql-web.git] / main.php
index 6d0e19b87a7d676a438865f32365760392cedc57..90bf2ea91a43798cd61bc76c4fb758e1e991dacf 100644 (file)
--- a/main.php
+++ b/main.php
@@ -10,10 +10,11 @@ $User = new User($Login->getUserID());
 if (isPost()) {
        if (isset($i_newdb)) {
                $dbname = $User->getUsername().DELIMETER.$i_newdb;
-               if ($User->addDB($dbname)==false) {
+               if ($User->isOverQuota()) {
+                       $err[] = 'You are over your quota. You may not add databases.';
+               } elseif ($User->addDB($dbname)==false) {
                        $err[] = mysql_error();
                } else {
-                       $User->refresh();
                        $msg[] = 'Database `'.$dbname.'` created.';
                }
        }
@@ -26,9 +27,9 @@ if (isPost()) {
                                $err[] = mysql_error();
                        }
                }
-               if (!count($err))
-                       $User->refresh();
        }
+       if (!count($err))
+               $User->refresh();
 }
 
 $myDBs = $User->getDBList();
This page took 0.025308 seconds and 4 git commands to generate.