Additional fields for user import
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<?php
|
||||
return array (
|
||||
'app_version' => 'v2.1.0-pre',
|
||||
'hash_version' => 'v2.1.0-pre-21-gce6b2f2',
|
||||
'hash_version' => 'v2.1.0-pre-22-g9800786',
|
||||
);
|
||||
@@ -810,7 +810,15 @@ class UsersController extends AdminController {
|
||||
$activated = '0';
|
||||
}
|
||||
|
||||
$pass = substr(str_shuffle("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"), 0, 10);
|
||||
$pass = substr(str_shuffle("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"), 0, 15);
|
||||
|
||||
// Location
|
||||
if (array_key_exists('4',$row)) {
|
||||
$user_location_id = trim($row[4]);
|
||||
if ($user_location_id=='') {
|
||||
$user_location_id = null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -821,6 +829,11 @@ class UsersController extends AdminController {
|
||||
$duplicates .= $row[2] . ', ';
|
||||
} else {
|
||||
|
||||
// echo '<pre>';
|
||||
// print_r($row);
|
||||
// echo '</pre>';
|
||||
// exit;
|
||||
|
||||
$newuser = array(
|
||||
'first_name' => $row[0],
|
||||
'last_name' => $row[1],
|
||||
@@ -828,8 +841,11 @@ class UsersController extends AdminController {
|
||||
'email' => $row[3],
|
||||
'password' => $pass,
|
||||
'activated' => $activated,
|
||||
'location_id' => $row[4],
|
||||
//'company_id' => Company::getIdForUser($row[5]),
|
||||
'location_id' => $user_location_id,
|
||||
'phone' => $row[5],
|
||||
'jobtitle' => $row[6],
|
||||
'employee_num' => $row[7],
|
||||
//'company_id' => Company::getIdForUser($row[8]),
|
||||
'permissions' => '{"user":1}',
|
||||
'notes' => 'Imported user'
|
||||
);
|
||||
|
||||
@@ -38,7 +38,11 @@ Create a User ::
|
||||
@endif
|
||||
|
||||
<p>
|
||||
Upload a CSV file with one or more users. Passwords will be auto-generated. The CSV should have the <strong>first</strong> fields as: <strong>firstName,lastName,username,email, location_id</strong>. Any additional fields to the right of those fields will be ignored. Email is optional, however users will not be able to recover their passwords or receive EULAs if you do not provide an email address.
|
||||
Upload a CSV file with one or more users. Passwords will be auto-generated. The CSV should have the <strong>first</strong> fields as: </p>
|
||||
|
||||
<p><strong>firstName,lastName, username, email, location_id, phone, jobtitle, employee_num</strong>. </p>
|
||||
|
||||
<p>Any additional fields to the right of those fields will be ignored. Email is optional, however users will not be able to recover their passwords or receive EULAs if you do not provide an email address.
|
||||
</p>
|
||||
|
||||
@if (Config::get('app.lock_passwords'))
|
||||
|
||||
Reference in New Issue
Block a user