mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
@@ -26,9 +26,9 @@ namespace App;
|
||||
|
||||
use App\Models\Device;
|
||||
use App\Models\Notification;
|
||||
use Auth;
|
||||
use Cache;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use LibreNMS\Config;
|
||||
use Toastr;
|
||||
|
||||
|
@@ -24,7 +24,7 @@
|
||||
|
||||
namespace App\Facades;
|
||||
|
||||
use Auth;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use LibreNMS\Enum\Alert;
|
||||
|
||||
class LogManager extends \Illuminate\Log\LogManager
|
||||
|
@@ -5,11 +5,11 @@ namespace App\Http\Controllers;
|
||||
use App\Facades\DeviceCache;
|
||||
use App\Models\Device;
|
||||
use App\Models\Vminfo;
|
||||
use Auth;
|
||||
use Carbon\Carbon;
|
||||
use Gate;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Arr;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use LibreNMS\Config;
|
||||
use LibreNMS\Util\Graph;
|
||||
use LibreNMS\Util\Url;
|
||||
|
@@ -27,8 +27,8 @@ namespace App\Http\Controllers\Form;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Models\Dashboard;
|
||||
use App\Models\UserWidget;
|
||||
use Auth;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
|
||||
class CopyDashboardController extends Controller
|
||||
{
|
||||
|
@@ -11,8 +11,8 @@ use App\Models\Syslog;
|
||||
use App\Models\User;
|
||||
use App\Models\UserPref;
|
||||
use App\Models\Widget;
|
||||
use Auth;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use LibreNMS\Config;
|
||||
use Toastr;
|
||||
|
||||
|
@@ -27,6 +27,7 @@ namespace App\Http\Controllers\Table;
|
||||
use App\Models\Device;
|
||||
use App\Models\Location;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use LibreNMS\Config;
|
||||
use LibreNMS\Util\Rewrite;
|
||||
use LibreNMS\Util\Time;
|
||||
@@ -303,7 +304,7 @@ class DeviceController extends TableController
|
||||
|
||||
if ($server = Config::get('gateone.server')) {
|
||||
if (Config::get('gateone.use_librenms_user')) {
|
||||
$actions .= '<div class="col-xs-1"><a href="' . $server . '?ssh=ssh://' . \Auth::user()->username . '@' . $device->hostname . '&location=' . $device->hostname . '" target="_blank" rel="noopener"><i class="fa fa-lock fa-lg icon-theme" title="SSH to ' . $device->hostname . '"></i></a></div>';
|
||||
$actions .= '<div class="col-xs-1"><a href="' . $server . '?ssh=ssh://' . Auth::user()->username . '@' . $device->hostname . '&location=' . $device->hostname . '" target="_blank" rel="noopener"><i class="fa fa-lock fa-lg icon-theme" title="SSH to ' . $device->hostname . '"></i></a></div>';
|
||||
} else {
|
||||
$actions .= '<div class="col-xs-1"><a href="' . $server . '?ssh=ssh://' . $device->hostname . '&location=' . $device->hostname . '" target="_blank" rel="noopener"><i class="fa fa-lock fa-lg icon-theme" title="SSH to ' . $device->hostname . '"></i></a></div>';
|
||||
}
|
||||
|
@@ -27,8 +27,8 @@ namespace App\Http\Controllers;
|
||||
use App\Models\Dashboard;
|
||||
use App\Models\Device;
|
||||
use App\Models\UserPref;
|
||||
use Auth;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Validation\Rule;
|
||||
use LibreNMS\Authentication\LegacyAuth;
|
||||
use LibreNMS\Authentication\TwoFactor;
|
||||
|
@@ -29,11 +29,11 @@ use App\Models\Mempool;
|
||||
use App\Models\Port;
|
||||
use App\Models\Processor;
|
||||
use App\Models\Storage;
|
||||
use Auth;
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Collection;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\View\View;
|
||||
use LibreNMS\Util\Html;
|
||||
use LibreNMS\Util\StringHelpers;
|
||||
|
@@ -3,8 +3,8 @@
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use App\Models\User;
|
||||
use Auth;
|
||||
use Closure;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use LibreNMS\Authentication\LegacyAuth;
|
||||
|
||||
class LegacyExternalAuth
|
||||
|
@@ -36,7 +36,7 @@ use App\Models\User;
|
||||
use App\Models\UserPref;
|
||||
use App\Models\Vminfo;
|
||||
use App\Models\WirelessSensor;
|
||||
use Auth;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\View\View;
|
||||
use LibreNMS\Config;
|
||||
use LibreNMS\Util\ObjectCache;
|
||||
|
@@ -26,6 +26,7 @@ namespace App\Models;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use Illuminate\Database\Eloquent\Relations\MorphTo;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use LibreNMS\Enum\Alert;
|
||||
|
||||
class Eventlog extends DeviceRelatedModel
|
||||
@@ -54,7 +55,7 @@ class Eventlog extends DeviceRelatedModel
|
||||
'datetime' => Carbon::now(),
|
||||
'severity' => $severity,
|
||||
'message' => $text,
|
||||
'username' => (class_exists('\Auth') && \Auth::check()) ? \Auth::user()->username : '',
|
||||
'username' => (class_exists('\Auth') && Auth::check()) ? Auth::user()->username : '',
|
||||
]);
|
||||
|
||||
if ($device instanceof Device) {
|
||||
|
@@ -5,6 +5,7 @@ namespace App\Models;
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
|
||||
class Notification extends Model
|
||||
@@ -61,7 +62,7 @@ class Notification extends Model
|
||||
{
|
||||
if ($enabled === true) {
|
||||
$read = new NotificationAttrib;
|
||||
$read->user_id = \Auth::user()->user_id;
|
||||
$read->user_id = Auth::user()->user_id;
|
||||
$read->key = $name;
|
||||
$read->value = '1';
|
||||
$this->attribs()->save($read);
|
||||
|
@@ -3,8 +3,8 @@
|
||||
namespace App\Providers;
|
||||
|
||||
use App\Guards\ApiTokenGuard;
|
||||
use Auth;
|
||||
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\Gate;
|
||||
|
||||
class AuthServiceProvider extends ServiceProvider
|
||||
|
Reference in New Issue
Block a user