Skip to content

Commit

Permalink
[BF] - Server Error :: Add [peeringdb_id] to fillable property to all…
Browse files Browse the repository at this point in the history
…ow mass assignment on [IXP\Models\User] - fixes #720
  • Loading branch information
yannrobin committed Jul 15, 2021
1 parent dcb4bb9 commit cf144df
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions app/Models/Aggregators/UserAggregator.php
Original file line number Diff line number Diff line change
Expand Up @@ -180,13 +180,13 @@ public static function findOrCreateFromPeeringDb( array $pdbuser ): array
$int++;
$uname = $un . ( $int === 1 ? '' : "{$int}" );
} while( User::where( 'username', $uname )->first() );
$user = User::create([
'peeringdb_id' => $pdbuser['id'],
'username' => $uname,
'password' => Hash::make( Str::random() ),
'privs' => $priv,
'creator' => 'OAuth-PeeringDB',
]);
$user = new User();
$user->peeringdb_id = $pdbuser['id'];
$user->username = $uname;
$user->password = Hash::make( Str::random() );
$user->privs = $priv;
$user->creator = 'OAuth-PeeringDB';
$user->save();

$user_created = true;
Log::info( 'PeeringDB OAuth: created new user ' . $user->id . '/' . $user->username . ' for PeeringDB user: ' . $pdbuser[ 'name' ] . '/' . $pdbuser[ 'email' ] );
Expand Down

0 comments on commit cf144df

Please sign in to comment.