]> andersk Git - sql-web.git/blobdiff - lib/proc.lib.php
bug fix: signup/db-create for class lockers
[sql-web.git] / lib / proc.lib.php
index 55a3d8f8daa2805af7bd5a06be5de20f176750e5..f9ebc8d6bd9a659a1c673aedc9867f0cdb99274a 100644 (file)
@@ -5,9 +5,12 @@ require_once('mitsql.lib.php');
 define('MAXDBS', 20);
 
 class proc {
-       static function newdb(&$User, $i_newdb) {
+       static function newdb(&$User, &$i_newdb) {
+               // return through $i_newdb the full name of the created db
                $msg1 = $err1 = array();
-               $dbname = $User->getUsername().DELIMETER.$i_newdb;
+               $uname = $User->getUsername();
+               $uname = str_replace('.','',$uname);
+               $dbname = $uname.DELIMETER.$i_newdb;
                if ($User->isOverQuota()) {
                        $err1[] = 'You are over your quota. You may not add more databases.';
                } elseif (count($User->getDBList())>MAXDBS) {
@@ -23,6 +26,7 @@ class proc {
                } else {
                        $msg1[] = 'Database `'.$dbname.'` created.';
                }
+               $i_newdb = $dbname;
                return array($msg1, $err1);
        }
        static function drop(&$User, $i_drop) {
This page took 0.479278 seconds and 4 git commands to generate.