Update user_imports.php for php 8.1
This commit is contained in:
parent
04dc606831
commit
01c3ed5c48
|
|
@ -17,7 +17,7 @@
|
|||
|
||||
The Initial Developer of the Original Code is
|
||||
Mark J Crane <markjcrane@fusionpbx.com>
|
||||
Portions created by the Initial Developer are Copyright (C) 2008-2020
|
||||
Portions created by the Initial Developer are Copyright (C) 2008-2023
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
|
|
@ -58,10 +58,10 @@
|
|||
}
|
||||
|
||||
//get the http get values and set them as php variables
|
||||
$action = $_POST["action"];
|
||||
$from_row = $_POST["from_row"];
|
||||
$delimiter = $_POST["data_delimiter"];
|
||||
$enclosure = $_POST["data_enclosure"];
|
||||
$action = $_POST["action"] ?? '';
|
||||
$from_row = $_POST["from_row"] ?? '';
|
||||
$delimiter = $_POST["data_delimiter"] ?? '';
|
||||
$enclosure = $_POST["data_enclosure"] ?? '';
|
||||
|
||||
//save the data to the csv file
|
||||
if (isset($_POST['data'])) {
|
||||
|
|
@ -73,8 +73,8 @@
|
|||
|
||||
//copy the csv file
|
||||
//$_POST['submit'] == "Upload" &&
|
||||
if (is_uploaded_file($_FILES['ulfile']['tmp_name']) && permission_exists('user_import')) {
|
||||
if ($_POST['type'] == 'csv') {
|
||||
if (!empty($_FILES['ulfile']['tmp_name']) && is_uploaded_file($_FILES['ulfile']['tmp_name']) && permission_exists('user_import')) {
|
||||
if (!empty($_POST['type']) && $_POST['type'] == 'csv') {
|
||||
$file = $_SESSION['server']['temp']['dir'].'/users-'.$_SESSION['domain_name'].'.csv';
|
||||
if (move_uploaded_file($_FILES['ulfile']['tmp_name'], $file)) {
|
||||
$_SESSION['file'] = $file;
|
||||
|
|
@ -115,6 +115,7 @@
|
|||
$schema[$i]['table'] = $table_name;
|
||||
$schema[$i]['parent'] = $parent_name;
|
||||
foreach($table['fields'] as $row) {
|
||||
$row['deprecated'] = $row['deprecated'] ?? '';
|
||||
if ($row['deprecated'] !== 'true') {
|
||||
if (is_array($row['name'])) {
|
||||
$field_name = $row['name']['text'];
|
||||
|
|
@ -378,7 +379,7 @@
|
|||
//exit;
|
||||
|
||||
//save to the data
|
||||
if (is_array($array)) {
|
||||
if (!empty($array)) {
|
||||
$database = new database;
|
||||
$database->app_name = 'users';
|
||||
$database->app_uuid = '4efa1a1a-32e7-bf83-534b-6c8299958a8e';
|
||||
|
|
@ -423,7 +424,7 @@
|
|||
echo " ".$text['label-import_data']."\n";
|
||||
echo "</td>\n";
|
||||
echo "<td width='70%' class='vtable' align='left'>\n";
|
||||
echo " <textarea name='data' id='data' class='formfld' style='width: 100%; min-height: 150px;' wrap='off'>$data</textarea>\n";
|
||||
echo " <textarea name='data' id='data' class='formfld' style='width: 100%; min-height: 150px;' wrap='off'></textarea>\n";
|
||||
echo "<br />\n";
|
||||
echo $text['description-import_data']."\n";
|
||||
echo "</td>\n";
|
||||
|
|
|
|||
Loading…
Reference in New Issue