Prevent overwriting the database if it already exists

This commit is contained in:
Albert Santoni 2015-02-26 15:33:35 -05:00
parent 6047670dbd
commit ac3ad3d23b
1 changed files with 7 additions and 4 deletions

View File

@ -36,10 +36,13 @@ class ProvisioningHelper
$this->parsePostParams();
//For security, the Airtime Pro provisioning system creates the database for the user.
// $this->setNewDatabaseConnection();
//if ($this->checkDatabaseExists()) {
// throw new Exception("ERROR: Airtime database already exists");
//}
$this->setNewDatabaseConnection();
//We really want to do this check because all the Propel-generated SQL starts with "DROP TABLE IF EXISTS".
//If we don't check, then a second call to this API endpoint would wipe all the tables!
if ($this->checkDatabaseExists()) {
throw new Exception("ERROR: Airtime database already exists");
}
//$this->createDatabase();
//All we need to do is create the database tables.