Commit Graph

48 Commits

Author SHA1 Message Date
Tony Murray
32a7c50189 Use Laravel authentication (#8702)
* Use Laravel for authentication
Support legacy auth methods
Always create DB entry for users (segregate by auth method)

Port api auth to Laravel

restrict poller errors to devices the user has access to

Run checks on every page load.  But set a 5 minute (configurable) timer.
Only run some checks if the user is an admin

Move toastr down a few pixels so it isn't as annoying.

Fix menu not loaded on laravel pages when twofactor is enabled for the system, but disabled for the user.
Add two missing menu entries in the laravel menu

Rewrite 2FA code
Simplify some and verify code before applying

Get http-auth working
Handle legacy $_SESSION differently.  Allows Auth::once(), etc to work.

* Fix tests and mysqli extension check

* remove duplicate Toastr messages

* Fix new items

* Rename 266.sql to 267.sql
2018-09-11 07:51:35 -05:00
Klaas Tammling
20741e1b21 Disable autocomplete on pages with SNMPv3 settings (#8833)
We have noticed that some Firefox password managers try to autocomplete AuthUser, AuthPass and CryptoPass with user credentials. This can lead to a security issue as the credentials of users are stored in plaintext inside the LibreNMS database.

The autocomplete="off" should disable this behaviour.

DO NOT DELETE THIS TEXT

#### Please note

> Please read this information carefully. You can run `./scripts/pre-commit.php` to check your code before submitting.

- [ ] Have you followed our [code guidelines?](http://docs.librenms.org/Developing/Code-Guidelines/)

#### Testers

If you would like to test this pull request then please run: `./scripts/github-apply <pr_id>`, i.e `./scripts/github-apply 5926`
2018-06-23 20:48:03 +01:00
Tony Murray
7250376104 refactor: Don't access $_SESSION directly for Auth (#8513)
* Don't access $_SESSION directly for Auth

* fix style

* add property annotations
2018-04-07 21:55:28 +01:00
Tony Murray
9cc542bc6a webui: Adding invalid hostnames is no longer fatal. (#8233)
* Adding invalid hostnames is no longer fatal.
Will still fail if they are unpingable.

* Fix up snmp enable/disable handling
2018-02-09 07:55:18 +00:00
Rémy Jacquin
19a17ed348 Allow administrators to edit devices sysName (#8149)
* Allow administrators to edit devices sysName
Signed-off-by: Rémy Jacquin <remy@remyj.fr>

* Fix html/pages/device/edit/device.inc.php identation
Signed-off-by: Rémy Jacquin <remy@remyj.fr>

* Revert "Allow administrators to edit devices sysName"

This reverts commit 11b127b082.

* Moved sysName editing to snmp tab

Signed-off-by: Rémy Jacquin <remy@remyj.fr>
2018-02-06 23:35:00 -06:00
Tony Murray
ff0620c64e webui: Place hostname first on add device page. (#8029)
Not sure why but the existing order bothers me every time.
2018-01-04 22:08:42 +00:00
Neil Lathwood
27368a2d98 webui: Stop stripping html tags from snmp creds (#7951) 2017-12-25 09:51:31 -06:00
Zmegolaz
a7f42361ae Fix: Better sanity check of hostname when adding device. (#7582)
* Better sanity check of hostname when adding device.

* Style fix.

* clean() before hostname validity check. IP::isValid to support IPv6 addresses.

* Even more checks to catch invalid input.

* Long if-else, better error message.

* Code re-arranging
2017-11-01 11:06:39 -05:00
Zmegolaz
f8d7ccfe0d feature: Support for up/down detection of ping only devices.
* Added support for ping only devices.

* Renamed sql-schema/206 to 207.

* Discovery tried to detect the OS when it shouldn't.

* Updated db_schema.yaml

* Added ping icon.

* Don't show unused graphs and tabs when SNMP is disabled.

* Allow the user to specify OS of ping only devices.

* Removing custom OS now changes it to 'ping'.

* Removed unnecessary use of mres().

* UI select box for SNMP enable/disable.

* Hide device_ping_perf if ping is disable on device.

* Fixed SNMP settings update status messages.

* Added functionality to add ping only devices via the web ui.

* Added ping only option to addhost.php

* Added ping only support to snmp-scan.py

* Moved sql 208 to 211

* Fixed scrutinizer issues.

* Fixed broken ossearch.

* Added ping only support to the API.

* Updated API doc.

* Added (optional) to OS and hardware description. Hid Port Settings, Applications, Modules, Storage, Processors, Memory and Components from the edit menu

* Style fix.

* Updated ping icon.

* clean() instead of mres(). More escaping. Better help in snmp-scan.py and addhost.php

* Fixed scrutinizer issue.

* Always try SNMP in snmp-scan.py, new option for it in addhost.php. Slice instead of chunk in ajax_ossuggest.php. Other minor style changes.

* Updated sql modifications to insert the new column in the same place as in db_schema.yaml.
2017-10-27 22:59:25 -05:00
Tony Murray
bbf05feb90 webui: add link to recently added device (#5032) 2016-11-21 18:12:10 +00:00
Neil Lathwood
05b728bb80 Webui: Updated force add option for addhost.php to be present in all instances (#4428) 2016-09-13 20:32:45 -05:00
Tony Murray
b8e9b2d917 Implement an autoloader (#4140)
* Implement an autoloader

When cleaning up classes for psr2, things got a bit unwieldy, so I implemented a class autoloader.
I created a PSR-0 compliant LibreNMS directory and moved all classes there that made sense.
Implemented LibreNMS\ClassLoader which supports adding manual class mappings

This reduces the file includes needed and only loads classes when needed.

* Add teh autoloader to graph.php

* Add a small bit of docs
Fix incomplete class in includes/discovery/functions.inc.php
2016-08-21 14:07:14 +01:00
Tony Murray
8c639aa5a4 PSR2 Cleanup: /html edition
Travis tests for code conformance. Ignore warnings for now.
Fixed all errors, left most warnings.
2016-08-18 21:29:30 -05:00
Tony Murray
eadeeb9409 Fix addHost force_add logic
Use boolean where we can
Fixes #4001
2016-08-09 15:13:42 -05:00
Tony Murray
f3fc6f2906 Use Exceptions
Use exceptions for addHost()
Gets rid of silly mixed return and only returns the device_id.  Throwing an exception if we run into any issues.
Slightly modifies api add host output again to include device_id
2016-08-07 12:16:40 -05:00
Tony Murray
66bed276c2 Reconstruct addHost() so it is easier to understand
Update addHost() to return either device_id or a string
modify print_error(), print_message() to allow for $quiet variable
Only call addHost() once in addhost.php, if the snmp version isn't set, addHost will cope
Fix up snmp-scan.php and discovery-protocols.inc.php to detect when a device already exists
change in ip_exists() to make it more readable
2016-08-02 00:31:27 -05:00
Maximilian Wilhelm
2ae99e50f5 Add support for setting port association mode when adding a host.
This adds a '-p' switch to addhost.php and a select box to the WebUI to
  set the port association mode for newly added devices.

Signed-off-by: Maximilian Wilhelm <max@rfc2324.org>
2016-01-26 13:49:57 +01:00
Arjit Chaudhary
55e9457309 Minor UI changes
Screenshot: http://i.imgur.com/PwmyNNG.png
2015-08-29 18:50:57 +05:30
laf
4724c6bc30 Checks for v3 use lowercase first letter so changed drop down menu to reflext 2015-08-20 17:06:43 +00:00
Job Snijders
d8693f05ae Fix coding style part 2 2015-07-15 11:04:22 +02:00
Daniel Preussker
a236c2d12a Merge pull request #627 from laf/issue-laf-148
Updated adding devices for distributed poller
2015-03-23 16:29:32 +00:00
laf
a404082d51 Updated some of the main pages to no longer refresh 2015-03-21 21:30:55 +00:00
laf
ab82effa3b Updated adding devices for distributed poller 2015-03-19 22:06:13 +00:00
laf
ec595c3eda Added support for adding / editing with a poller group selected 2015-03-19 12:00:03 +00:00
laf
d74a37c078 Added support for managing poller groups and viewing poller stats 2015-03-15 21:44:35 +00:00
Paul Gear
39ed79c7e4 Merge pull request #318 from laf/issue-laf-64
Updated transport list to be generated from $config values
2014-10-22 21:58:07 +10:00
Neil Lathwood
7c23774cb2 Moved the Add Host button as it was hidden on snmp v1/v2c options 2014-10-11 17:01:44 +00:00
Neil Lathwood
a0b801f60d Updated transport list to be generated from $config values 2014-10-11 16:55:32 +00:00
laf
7e458d1f58 Updated addhost page to only show relevant snmp v1/v2c/v3 options 2014-10-02 23:14:45 +01:00
bohdan-s
df9a5ee65f Move SNMP Transport & Port check to common area 2014-06-23 20:20:48 -04:00
bohdan-s
f9a7441b4e Fix $transport not defined bug 2014-06-23 19:29:53 -04:00
bohdan-s
cb41d50094 Add IPv6 only host support 2014-06-21 08:02:27 -04:00
bohdan-s
ec94633f28 SNMP Default Port Support
Add support for SNMP v3 as well as SNMP v1/v2c
2014-06-20 21:12:52 +10:00
bohdan-s
955d5f45e9 SNMP Default Port Support
Fix Typo #1
2014-06-20 20:38:02 +10:00
bohdan-s
6836ee76f1 SNMP Default Port Support
Use configured SNMP port rather than hard coded.
2014-06-20 20:23:41 +10:00
laf
fc7404a3c4 Updates bringing forms / tables inline with Bootstrap v3, also adds Global search box 2014-01-13 10:08:59 +00:00
Tom Laermans
89c74e8604 fix sha1 -> sha
git-svn-id: http://www.observium.org/svn/observer/trunk@3193 61d68cd4-352d-0410-923a-c4978735b2b8
2012-05-16 08:03:47 +00:00
Tom Laermans
4985943822 syntaxer run
git-svn-id: http://www.observium.org/svn/observer/trunk@3185 61d68cd4-352d-0410-923a-c4978735b2b8
2012-05-15 15:18:57 +00:00
Adam Amstrong
790480769b snmpv3 support. for hipsters.
git-svn-id: http://www.observium.org/svn/observer/trunk@3156 61d68cd4-352d-0410-923a-c4978735b2b8
2012-05-09 16:18:23 +00:00
Tom Laermans
2667649d3c syntaxer run
git-svn-id: http://www.observium.org/svn/observer/trunk@2970 61d68cd4-352d-0410-923a-c4978735b2b8
2012-04-06 13:56:23 +00:00
Tom Laermans
a0a1939995 more title sets
git-svn-id: http://www.observium.org/svn/observer/trunk@2691 61d68cd4-352d-0410-923a-c4978735b2b8
2011-10-18 14:41:19 +00:00
Tom Laermans
83f335785b make addhost from the webinterface work correctly
git-svn-id: http://www.observium.org/svn/observer/trunk@2646 61d68cd4-352d-0410-923a-c4978735b2b8
2011-10-05 09:32:34 +00:00
Adam Amstrong
e8d37edaf9 fixes from mrobbert
git-svn-id: http://www.observium.org/svn/observer/trunk@2429 61d68cd4-352d-0410-923a-c4978735b2b8
2011-09-08 05:02:14 +00:00
Tom Laermans
9fd77cd884 allow disabling of alerting per device, allow override of syscontact, minor cleanups
git-svn-id: http://www.observium.org/svn/observer/trunk@1995 61d68cd4-352d-0410-923a-c4978735b2b8
2011-03-30 16:28:24 +00:00
Tom Laermans
ef6406d4c9 more cleanups, remove some FIXMEs
git-svn-id: http://www.observium.org/svn/observer/trunk@1983 61d68cd4-352d-0410-923a-c4978735b2b8
2011-03-28 10:39:55 +00:00
Tom Laermans
340c71b2e7 more code cleanups, modify renamehost to also take a source parameter so we can build a renamehost function into the web gui some day
git-svn-id: http://www.observium.org/svn/observer/trunk@1980 61d68cd4-352d-0410-923a-c4978735b2b8
2011-03-27 10:21:19 +00:00
Tom Laermans
834989df95 restructure/reindent/htmlfix html pages, remove dead code
git-svn-id: http://www.observium.org/svn/observer/trunk@1897 61d68cd4-352d-0410-923a-c4978735b2b8
2011-03-17 00:09:20 +00:00
Adam Amstrong
1a1750b0c3 inc.php plx
git-svn-id: http://www.observium.org/svn/observer/trunk@1336 61d68cd4-352d-0410-923a-c4978735b2b8
2010-07-10 12:52:04 +00:00