*/ | */ | ||||
return [ | return [ | ||||
'adminEmail' => 'contact@laboiteapain.net', | |||||
'adminEmail' => 'contact@opendistrib.net', | |||||
]; | ]; |
$arrayLastnameschecked = []; | $arrayLastnameschecked = []; | ||||
$users = User::searchAll([ | $users = User::searchAll([ | ||||
'user_etablissement.id_etablissement' => 1 | |||||
'user_producer.id_producer' => 1 | |||||
]) ; | ]) ; | ||||
foreach ($users as $u) { | foreach ($users as $u) { | ||||
if ($u->email != 'boulanger@laboiteapain.net') { | |||||
if ($u->email != 'producer@opendistrib.net') { | |||||
do { | do { | ||||
$indexLastname = rand(0, count($arrayLastnames) - 1); | $indexLastname = rand(0, count($arrayLastnames) - 1); | ||||
$indexName = rand(0, count($arrayNames) - 1); | $indexName = rand(0, count($arrayNames) - 1); |
$model->generateAuthKey(); | $model->generateAuthKey(); | ||||
$model->username = $model->email; | $model->username = $model->email; | ||||
if (!strlen($model->email)) { | if (!strlen($model->email)) { | ||||
$model->username = 'inconnu@laboiteapain.net'; | |||||
$model->username = 'inconnu@opendistrib.net'; | |||||
} | } | ||||
$model->save(); | $model->save(); |
foreach($usersArray as $user) { | foreach($usersArray as $user) { | ||||
$body['Messages'][] = [ | $body['Messages'][] = [ | ||||
'From' => [ | 'From' => [ | ||||
'Email' => $producer->slug.'@laboiteapain.net', | |||||
'Email' => $producer->slug.'@opendistrib.net', | |||||
'Name' => $producer->name | 'Name' => $producer->name | ||||
], | ], | ||||
'To' => [ | 'To' => [ |