Creating a new company without a Database script causes unpredictable errors
authorJoe Hunt <joe.hunt.consulting@gmail.com>
Thu, 8 Apr 2010 22:14:04 +0000 (22:14 +0000)
committerJoe Hunt <joe.hunt.consulting@gmail.com>
Thu, 8 Apr 2010 22:14:04 +0000 (22:14 +0000)
CHANGELOG.txt
admin/create_coy.php

index 0412a84da891f1d15b4dde3e51e3dda91f512a5a..86433b440f1ba23c3d97584e6ae24ffaf2d5e7ab 100644 (file)
@@ -19,6 +19,10 @@ Legend:
 ! -> Note
 $ -> Affected files
 
+09-Apr-2010 Joe Hunt
+# Creating a new company without a Database script causes unpredictable errors.
+$ /admin/create_coy.php
+
 06-Apr-2010 Joe Hunt/Albin
 # Inactive items should not show in Price List Report. In Item lists they are
   stamped (Inactive) after the description.
index 0a39697a1e6c294443f2872025d6fe36934a57fb..a0d4c61cf58ebc3cc4f9aba085b6bfea20443e96 100644 (file)
@@ -42,6 +42,11 @@ function check_data()
 
        if ($_POST['name'] == "" || $_POST['host'] == "" || $_POST['dbuser'] == "" || $_POST['dbname'] == "")
                return false;
+       if ($selected_id == -1 && (!isset($_GET['ul']) || $_GET['ul'] != 1))
+       {
+               display_error(_("When creating a new company, you must provide a Database script file."));
+               return false;
+       }
        foreach($db_connections as $id=>$con)
        {
         if($id != $selected_id && $_POST['host'] == $con['host']