X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=admin%2Fcreate_coy.php;h=999f376c8fb93e80d5c6e77629ed2a59d36abda0;hb=e3004d8581b1ea3c02bfe2b1e880990309c4459e;hp=66d01d1d347d773a21bb7bdeae1780d37ef6574f;hpb=1ec8a5ea3c868d0f31fbb9c64d655fe2a077e904;p=fa-stable.git diff --git a/admin/create_coy.php b/admin/create_coy.php index 66d01d1d..999f376c 100644 --- a/admin/create_coy.php +++ b/admin/create_coy.php @@ -25,11 +25,11 @@ $comp_subdirs = array('images', 'pdf_files', 'backup','js_cache', 'reporting', ' //--------------------------------------------------------------------------------------------- if (isset($_GET['selected_id'])) { - $selected_id = $_GET['selected_id']; + $selected_id = (int)$_GET['selected_id']; } elseif (isset($_POST['selected_id'])) { - $selected_id = $_POST['selected_id']; + $selected_id = (int)$_POST['selected_id']; } else $selected_id = -1; @@ -130,9 +130,13 @@ function handle_submit() if (!db_import($path_to_root.'/sql/'.get_post('coa'), $conn, $selected_id)) { display_error(_('Cannot create new company due to bugs in sql file.')); $error = true; - } else - if (isset($_POST['admpassword']) && $_POST['admpassword'] != "") - update_admin_password($conn, md5($_POST['admpassword'])); + } + else + { + if (!isset($_POST['admpassword']) || $_POST['admpassword'] == "") + $_POST['admpassword'] = "password"; + update_admin_password($conn, md5($_POST['admpassword'])); + } } set_global_connection(); if ($error) { @@ -168,7 +172,7 @@ function handle_delete() { global $def_coy, $db_connections, $comp_subdirs, $path_to_root; - $id = $_GET['id']; + $id = (int)$_GET['id']; // First make sure all company directories from the one under removal are writable. // Without this after operation we end up with changed per-company owners! @@ -237,9 +241,9 @@ function display_companies() $coyno = $_SESSION["wa_current_user"]->company; echo " -