mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2026-01-06 11:43:50 +00:00
Update extension_imports.php
This commit is contained in:
@@ -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-2018
|
||||
Portions created by the Initial Developer are Copyright (C) 2018
|
||||
the Initial Developer. All Rights Reserved.
|
||||
|
||||
Contributor(s):
|
||||
@@ -126,10 +126,11 @@
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
//echo "<pre>\n";
|
||||
//print_r($schema);
|
||||
//echo "</pre>\n";
|
||||
//exit;
|
||||
|
||||
$i++;
|
||||
$schema[$i]['table'] = 'extension_users';
|
||||
$schema[$i]['parent'] = 'extensions';
|
||||
$schema[$i]['fields'][] = 'username';
|
||||
}
|
||||
|
||||
//match the column names to the field names
|
||||
@@ -244,6 +245,12 @@
|
||||
//set the domain_uuid
|
||||
$domain_uuid = $_SESSION['domain_uuid'];
|
||||
|
||||
//get the users
|
||||
$sql = "select * from v_users where domain_uuid = '".$domain_uuid."' ";
|
||||
$prep_statement = $db->prepare($sql);
|
||||
$prep_statement->execute();
|
||||
$users = $prep_statement->fetchAll(PDO::FETCH_ASSOC);
|
||||
|
||||
//get the contents of the csv file and convert them into an array
|
||||
$handle = @fopen($_SESSION['file'], "r");
|
||||
if ($handle) {
|
||||
@@ -283,8 +290,21 @@
|
||||
$array[$table_name][$row_id][$field_name] = $result[$key];
|
||||
}
|
||||
else {
|
||||
$array[$parent][$row_id][$table_name][$y]['domain_uuid'] = $domain_uuid;
|
||||
$array[$parent][$row_id][$table_name][$y][$field_name] = $result[$key];
|
||||
if ($field_name != "username") {
|
||||
$array[$parent][$row_id][$table_name][$y]['domain_uuid'] = $domain_uuid;
|
||||
$array[$parent][$row_id][$table_name][$y][$field_name] = $result[$key];
|
||||
}
|
||||
}
|
||||
|
||||
if ($field_name == "username") {
|
||||
foreach ($users as $field) {
|
||||
if ($field['username'] == $result[$key]) {
|
||||
//$array[$parent][$row_id]['extension_users'][$y]['cextension_user_uuid'] = uuid();
|
||||
$array[$parent][$row_id]['extension_users'][$y]['domain_uuid'] = $domain_uuid;
|
||||
//$array[$parent][$row_id]['extension_users'] = $row['extension_uuid'];
|
||||
$array[$parent][$row_id]['extension_users'][$y]['user_uuid'] = $field['user_uuid'];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user