Commit Graph

56 Commits

Author SHA1 Message Date
Tony Murray
fc54718a5e Focus and select location on override (#9503)
* Focus and select location on override

* Submit location on enter key
2018-12-05 07:33:32 -06:00
Tony Murray
3e35ee0e7d Refactored and update Location Geocoding (#9359)
- Fix location so it is a regular database relation (this allows multiple devices to be accurately linked to one location and saves api calls)
- Parse coordinates from the location more consistently
- Add settings to webui
- ~~Used [PHP Geocoder](http://geocoder-php.org/), which has lots of backends and is well tested. (also includes reverse and geoip)~~
- Google Maps, Bing, Mapquest, and OpenStreetMap supported initially.
- Default to OpenStreetMap, which doesn't require a key.  They will liberally hand out bans if you exceed 1 query per second though.
- All other Geocoding APIs require an API key. (Google requires a credit card on file, but seems to be the most accurate)
- Update all (I think) sql queries to handle the new structure
- Remove final vestiges of override_sysLocation as a device attribute
- Update existing device groups and rules in DB
- Tested all APIs with good/bad location, no/bad/good key, and no connection.
- Cannot fix advanced queries that use location

This blocks #8868

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.

- [x] 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`
After you are done testing, you can remove the changes with `./scripts/github-remove`.  If there are schema changes, you can ask on discord how to revert.
2018-11-28 22:49:18 +00:00
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
Tony Murray
9bc0c542a5 Allow ping checks to be ran separately from polling (#8821)
Allows ping checks at intervals not tied to the poller.  Pointless if you are not alerting on device status.
I updated the rrdstep.php script to treat ping-perf files separately and made it so it only converts if needed.

Docs here: https://docs.librenms.org/Extensions/Fast-Ping-Check/

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.

- [x] 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-07-30 22:58:38 +01:00
Neil Lathwood
19cdad8a1b Stop allowing search text to be tagged for select2 (#8915) 2018-07-17 07:11:16 -05:00
Steven Barnes
93dbd94bfb Checking for 'none' as the only device relationship (#8837)
Per a discussion with @murrant in Discord, this change adds a check to make sure `None` is not the relationship that is being queried against on save.  'None' has an ID of '0' in the $_POST['parents_id'] array. 

Without this check added, the Librenms error log contains entries like this when you save an edit to a device if `none` is the relationship that is selected.

```2018-06-21 09:18:25 MySQL Error: Cannot add or update a child row: a foreign key constraint fails (`librenms`.`device_relationships`, CONSTRAINT `device_relationship_parent_device_id_fk` FOREIGN KEY (`parent_device_id`) REFERENCES `devices` (`device_id`) ON DELETE CASCADE) (INSERT INTO `device_relationships` (`parent_device_id`,`child_device_id`)  VALUES ('0','35'))```
2018-06-21 16:45:49 -05: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
Aldemir Akpinar
5880f06780 webui: Added sysNames to pulldowns and the main page (#8137)
* Add dependency info for api

* webui: made dev dependency list more like devices page. Also added sysNames to pulldowns and the manin page

* Create common function for sysname display

* A better function name
2018-02-10 13:18:53 +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
Aldemir Akpinar
56561aa4dc feature: Added support for Host dependencies (#7332)
* First draft of the modals and the config interfaces

* GUI part done

* Backend code and db schema addition

* Documentation added, fixed alerting bug

* Fix typos

* Do not try to push an older db_schame.yaml

* Small db fix

* More db fixes

* Travis CI fixes

* missed a line in the travis error

* Fixed dependency clearing bug, Manage Host dependencies button now shows current selections

* Removed unnecessary index

* Correct faulty query

* Fixed sql query as requested, and renamed sql file

* Added requested changes

* Removed debug code

* Renamed sql file

* More fixes as requested

* Trying to fix db_schema.yaml

* adding laf's diff

* Corrected a small bug

* Try to resolve scrutinizer issue

* Main page bootgrid ajax modifications

* Also corrected travis ci errors

* Added select2 for pull downs, removed a redundant debug output. Changed parent_id to text

* Add missing class in the device settings page

* Fix bug where a link wasn't added after save

* Better parent down detection

* Add missing comma

* Behold the multi-parent code

* Added lookup table

* Ready for testing

* Trying to fix documentation conflicts

* Fix copy paste errors, and possible sql injection

* indentation problems

* Modified db_schema.yaml as well

* Typos, typos

* This should correct alerts

* Try to fix travis ci error

* Fix the typo in index.php

* Changed to Tony's query

* function explanation text changed

* Updated db_schema.yaml

* Trying to make automated tests happy

* Changes as requested

* Added acknowledgment for select2

* Added laf's patch

* dbBulkInsert when adding parents
2017-12-20 14:17:52 +00:00
Tony Murray
d6db01abb5 refactor: Refactor fix php codesniffer 3.x issues (#7816)
We cannot use 3.x because it  requires php 5.4, so update to 2.9.1 or newer 2.x release.
2017-11-29 08:23:19 +00:00
Tony Murray
087dbbd173 webui: Hide rediscover button for ping only devices (#7594) 2017-10-31 19:48:15 +00:00
Zmegolaz
5441bafc81 fix: Fixed IPv6 host renaming (#7275)
* Fixed IPv6 host renaming

* Added get_rrd_dir() and modified other files to use it where appropriate.

* rrd_name() now uses the new function get_rrd_dir(), to make it simpler to modify the escaping in the future.

* Wrong function name in rrdstep.php
2017-09-02 13:45:31 -05:00
Neil Lathwood
32da1bceea fix: Changing device type now is persistant (#5529) 2017-01-22 09:49:13 +00:00
Neil Lathwood
d5296319fb refactor: MySQL strict and query fixes (#5338)
* refactor: MySQL strict and query fixes

* moved sql file
2017-01-13 06:47:16 -06:00
Neil Lathwood
f0fefcfe4f bug: fix editing device no longer attempts renaming if name not changed #5123 (#5125) 2016-12-07 22:16:05 -06:00
jonathon-k
0955d0271e webui: Allow admin users to modify hostnames in web UI #3445 2016-11-13 00:19:22 +00:00
Neil Lathwood
a2f2ccfd2c security: Fix some reported security issues (#4807) 2016-10-15 20:45:18 +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
David Bell
a33d16dafa Corrected inserting ' into overide syslocation string 2016-03-08 11:18:33 +00:00
Harm van Tilborg
09f03c0e52 Adapted device edit form to include larger purpose field 2016-02-24 13:36:42 +01:00
Arjit Chaudhary
68a4acd717 Update device.inc.php 2016-01-10 19:01:59 +05:30
Arjit Chaudhary
a827b3daab fix device.inc.php indents and switch to using offsets 2015-09-16 16:00:07 +05:30
Arjit Chaudhary
44042d99c3 UI cleanup and icons added 2015-09-15 01:41:39 +05:30
Michael Newton
f77c712bfc changes needed to run under web server subdirectory 2015-08-11 14:54:05 -07:00
Neil Lathwood
945ca7f2ea Revert "changes needed to run under web server subdirectory" 2015-08-11 21:25:23 +01:00
Michael Newton
cc0f449fc9 changes needed to run under web server subdirectory 2015-08-07 11:10:43 -07:00
laf
031a818c77 Removed references to location override 2015-07-20 16:52:33 +01:00
Job Snijders
d8693f05ae Fix coding style part 2 2015-07-15 11:04:22 +02:00
laf
3f2f78a993 Changed disable/enable option round 2014-10-02 22:56:28 +01:00
laf
ece190493d Added ability to disable rediscovery button for devices 2014-10-02 20:23:32 +01:00
laf
2be63b2041 Added an option to rediscover a device from the web page 2014-10-02 20:17:45 +01:00
laf
3e570a118e Tidied device setting pages 2014-06-19 23:00:17 +01:00
Tom Laermans
56b2b49089 allow multiple icons to be defined per OS, let user select one in the device settings
git-svn-id: http://www.observium.org/svn/observer/trunk@3146 61d68cd4-352d-0410-923a-c4978735b2b8
2012-05-07 15:39:48 +00:00
Tom Laermans
42d43c47e5 confirm device deletion, remove base_url
git-svn-id: http://www.observium.org/svn/observer/trunk@2647 61d68cd4-352d-0410-923a-c4978735b2b8
2011-10-05 10:15:48 +00:00
Tom Laermans
a369c442eb syntaxer run
git-svn-id: http://www.observium.org/svn/observer/trunk@2643 61d68cd4-352d-0410-923a-c4978735b2b8
2011-10-04 14:38:54 +00:00
Tom Laermans
40a9e83ee6 prettify device edit form, move foldersize() to functions.inc.php
git-svn-id: http://www.observium.org/svn/observer/trunk@2551 61d68cd4-352d-0410-923a-c4978735b2b8
2011-09-23 10:16:31 +00:00
Adam Amstrong
58034ce162 change styles a bit. put graphs on device header
git-svn-id: http://www.observium.org/svn/observer/trunk@2497 61d68cd4-352d-0410-923a-c4978735b2b8
2011-09-19 02:20:16 +00:00
Adam Amstrong
94115cb0f5 db*
git-svn-id: http://www.observium.org/svn/observer/trunk@2327 61d68cd4-352d-0410-923a-c4978735b2b8
2011-05-15 17:20:26 +00:00
Tom Laermans
6e5558db82 cleanups etc
git-svn-id: http://www.observium.org/svn/observer/trunk@2213 61d68cd4-352d-0410-923a-c4978735b2b8
2011-05-01 17:26:06 +00:00
Tom Laermans
7730d1ca58 now fix it
git-svn-id: http://www.observium.org/svn/observer/trunk@2097 61d68cd4-352d-0410-923a-c4978735b2b8
2011-04-18 14:32:13 +00:00
Tom Laermans
aeb7642528 unconfuse falz
git-svn-id: http://www.observium.org/svn/observer/trunk@2096 61d68cd4-352d-0410-923a-c4978735b2b8
2011-04-18 14:28:27 +00:00
Tom Laermans
f55a30f744 some formatting cleanups, introduce some more FIXMEs to look at, plus replace mysql_fetch_array by mysql_fetch_assoc, for great justice
git-svn-id: http://www.observium.org/svn/observer/trunk@2029 61d68cd4-352d-0410-923a-c4978735b2b8
2011-04-06 13:54:50 +00:00
Tom Laermans
8245752480 fix on da fix
git-svn-id: http://www.observium.org/svn/observer/trunk@2021 61d68cd4-352d-0410-923a-c4978735b2b8
2011-04-05 08:43:40 +00:00
Tom Laermans
ad49f54cbf ftfy hth hand
git-svn-id: http://www.observium.org/svn/observer/trunk@2020 61d68cd4-352d-0410-923a-c4978735b2b8
2011-04-05 08:40:22 +00:00
Adam Amstrong
3f9b72eb5f fix and improve device deletion pages
git-svn-id: http://www.observium.org/svn/observer/trunk@2019 61d68cd4-352d-0410-923a-c4978735b2b8
2011-04-05 08:35:50 +00:00
Tom Laermans
b7720135e9 small cleanups etc, plus allow sysLocation override
git-svn-id: http://www.observium.org/svn/observer/trunk@2000 61d68cd4-352d-0410-923a-c4978735b2b8
2011-03-31 17:19:54 +00:00
Tom Laermans
febdea231e move snmp options to separate form on device edit, also hide services link when services disabled
git-svn-id: http://www.observium.org/svn/observer/trunk@1928 61d68cd4-352d-0410-923a-c4978735b2b8
2011-03-18 16:49:15 +00:00
Tom Laermans
104a166d72 move device-edit into its proper file again, no longer set timeout and retries to 0 after saving device settings
git-svn-id: http://www.observium.org/svn/observer/trunk@1923 61d68cd4-352d-0410-923a-c4978735b2b8
2011-03-18 15:30:49 +00:00
Tom Laermans
1a477eebbe device subpages cleanup, remove dead code
git-svn-id: http://www.observium.org/svn/observer/trunk@1896 61d68cd4-352d-0410-923a-c4978735b2b8
2011-03-16 23:10:10 +00:00