mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-14 13:33:14 +00:00
fix [PHRAS-75] csv user import is broken
This commit is contained in:
@@ -667,7 +667,7 @@ class Users implements ControllerProviderInterface
|
||||
if ($loginToAdd === "") {
|
||||
$out['errors'][] = sprintf(_("Login line %d is empty"), $nbLine + 1);
|
||||
} elseif (in_array($loginToAdd, $loginNew)) {
|
||||
$out['errors'][] = sprintf(_("Login %s is already defined in the file at line %d"), $loginToAdd, $i);
|
||||
$out['errors'][] = sprintf(_("Login %s is already defined in the file at line %d"), $loginToAdd, $nbLine + 1);
|
||||
} else {
|
||||
if (\User_Adapter::get_usr_id_from_login($app, $loginToAdd)) {
|
||||
$out['errors'][] = sprintf(_("Login %s already exists in database"), $loginToAdd);
|
||||
@@ -693,7 +693,7 @@ class Users implements ControllerProviderInterface
|
||||
$passwordToVerif = $value;
|
||||
|
||||
if ($passwordToVerif === "") {
|
||||
$out['errors'][] = sprintf(_("Password is empty at line %d"), $i);
|
||||
$out['errors'][] = sprintf(_("Password is empty at line %d"), $nbLine + 1);
|
||||
} else {
|
||||
$pwdValid = true;
|
||||
}
|
||||
|
@@ -27,7 +27,7 @@ class CSVServiceProvider implements ServiceProviderInterface
|
||||
$app['csv.exporter.config'] = $app->share(function () {
|
||||
$config = new ExporterConfig();
|
||||
return $config
|
||||
->setDelimiter(",")
|
||||
->setDelimiter(";")
|
||||
->setEnclosure('"')
|
||||
->setEscape("\\")
|
||||
->setToCharset('UTF-8')
|
||||
@@ -40,7 +40,14 @@ class CSVServiceProvider implements ServiceProviderInterface
|
||||
});
|
||||
|
||||
$app['csv.lexer.config'] = $app->share(function ($app) {
|
||||
return new LexerConfig();
|
||||
$lexer = new LexerConfig();
|
||||
$lexer->setDelimiter(';')
|
||||
->setEnclosure('"')
|
||||
->setEscape("\\")
|
||||
->setToCharset('UTF-8')
|
||||
->setFromCharset('UTF-8');
|
||||
|
||||
return $lexer;
|
||||
});
|
||||
|
||||
$app['csv.lexer'] = $app->share(function ($app) {
|
||||
|
Reference in New Issue
Block a user