:100644 100644 b355bfdba 000000000 M app/DataTables/CredentialsDataTable.php :100644 100644 32442d26c 000000000 M app/Models/Credential.php :100644 100644 301b6ddd2 000000000 M app/Models/SnmpCredential.php :100644 100644 e849c6be8 000000000 M app/Scopes/CredentialTypeScope.php :100644 100644 5e6838d3b 000000000 M lang/en/credentials.php diff --git a/app/DataTables/CredentialsDataTable.php b/app/DataTables/CredentialsDataTable.php index b355bfdba21db368a795fd1cb799bf89b71c71af..9aeb3c714f755ce38416fc1a149eb252dcb79334 100644 --- a/app/DataTables/CredentialsDataTable.php +++ b/app/DataTables/CredentialsDataTable.php @@ -12,7 +12,7 @@ class CredentialsDataTable extends DataTable /** * Build DataTable class. * - * @param mixed $query Results from query() method. + * @param mixed $query Results from query() method. * @return \Yajra\DataTables\DataTableAbstract */ public function dataTable($query) @@ -25,7 +25,7 @@ class CredentialsDataTable extends DataTable /** * Get query source of dataTable. * - * @param \App\Models\Credential $model + * @param \App\Models\Credential $model * @return \Illuminate\Database\Eloquent\Builder */ public function query(Credential $model) @@ -48,8 +48,8 @@ class CredentialsDataTable extends DataTable 'bAutoWidth' => false, 'language' => [ 'search' => '', - 'searchPlaceholder' => __('Search') - ] + 'searchPlaceholder' => __('Search'), + ], ]) ->dom('Bfrtip') ->orderBy(1) diff --git a/app/Models/Credential.php b/app/Models/Credential.php index 32442d26cc78c67483c3b6da84a3237014553f53..6d5607c0a63ae3f4b728833fa854c4ff101fb8dc 100644 --- a/app/Models/Credential.php +++ b/app/Models/Credential.php @@ -46,7 +46,8 @@ class Credential extends Model { try { return \Crypt::decrypt($value); - } catch (DecryptException $e) {} + } catch (DecryptException $e) { + } return []; } @@ -55,6 +56,7 @@ class Credential extends Model { try { $this->attributes['credentials'] = \Crypt::encrypt($credentials); - } catch (EncryptException $e) {} + } catch (EncryptException $e) { + } } } diff --git a/app/Models/SnmpCredential.php b/app/Models/SnmpCredential.php index 301b6ddd242ef8b91008c10f85c92b04f42312eb..eb59c6a0e97251a5a7ea430a330c118d503a0b2a 100644 --- a/app/Models/SnmpCredential.php +++ b/app/Models/SnmpCredential.php @@ -80,7 +80,7 @@ class SnmpCredential extends Credential return $new; } - public static function makeV3(string $level, string $auth_name = 'root', string $auth_pass = null, string $auth_algo = null, string $crypto_pass = null, string $crypto_algo = null, string $transport = 'udp', int $port = 161): SnmpCredential + public static function makeV3(string $level, string $auth_name = 'root', ?string $auth_pass = null, ?string $auth_algo = null, ?string $crypto_pass = null, ?string $crypto_algo = null, string $transport = 'udp', int $port = 161): SnmpCredential { $new = new static; $new->credentials = [ @@ -118,18 +118,22 @@ class SnmpCredential extends Credential // fallthrough case 'noauthnopriv': array_push($options, '-u', $this->auth_name); + return $options; default: \Log::debug("Unsupported SNMPv3 AuthLevel: {$this->auth_level}"); + return $options; } case 'v1': // fallthrough case 'v2c': array_push($options, '-' . $this->version, '-c', $context ? "{$this->community}@$context" : $this->community); + return $options; default: \Log::debug("Unsupported SNMP Version: {$this->version}"); + return $options; } } diff --git a/app/Scopes/CredentialTypeScope.php b/app/Scopes/CredentialTypeScope.php index e849c6be854fb07a367b8fa6a9eee17644cca09a..3fbdbee71adb83be7ba3326ed837da0270163ed3 100644 --- a/app/Scopes/CredentialTypeScope.php +++ b/app/Scopes/CredentialTypeScope.php @@ -1,4 +1,5 @@ 'Credential Manager' + 'title' => 'Credential Manager', ];