From 65fa6d624cc18cb58c83963bbcadcbb65c8b2662 Mon Sep 17 00:00:00 2001 From: Andre Lorbach Date: Thu, 9 Oct 2008 17:10:39 +0200 Subject: [PATCH] Made fields admin available to admins only --- src/admin/fields.php | 5 +++ .../msgparsers/msgparser.wireless.class.php | 12 +++---- src/lang/de/admin.php | 34 +++++++++++++++++++ src/lang/en/admin.php | 5 --- src/lang/pt_BR/admin.php | 34 +++++++++++++++++++ 5 files changed, 79 insertions(+), 11 deletions(-) diff --git a/src/admin/fields.php b/src/admin/fields.php index 1a14ee6..db91fc3 100644 --- a/src/admin/fields.php +++ b/src/admin/fields.php @@ -53,6 +53,11 @@ IncludeLanguageFile( $gl_root_path . '/lang/' . $LANG . '/admin.php' ); // --- // --- BEGIN Custom Code + +// Only if the user is an admin! +if ( !isset($_SESSION['SESSION_ISADMIN']) || $_SESSION['SESSION_ISADMIN'] == 0 ) + DieWithFriendlyErrorMsg( $content['LN_ADMIN_ERROR_NOTALLOWED'] ); + if ( isset($_GET['op']) ) { if ($_GET['op'] == "add") diff --git a/src/classes/msgparsers/msgparser.wireless.class.php b/src/classes/msgparsers/msgparser.wireless.class.php index 40947a7..d88361c 100644 --- a/src/classes/msgparsers/msgparser.wireless.class.php +++ b/src/classes/msgparsers/msgparser.wireless.class.php @@ -34,15 +34,14 @@ /* * NEEDED FIELDS! - INSERT INTO `logcon_fields` (`FieldID`, `FieldDefine`, `FieldCaption`, `FieldType`, `Sortable`, `DefaultWidth`, `FieldAlign`, `SearchField`, `SearchOnline`, `Trunscate`) VALUES ('net_interface', 'SYSLOG_NET_INTERFACE', 'Interface', 0, 0, 100, 'center', 'net_interface', 0, 0); -INSERT INTO `logcon_fields` (`FieldID`, `FieldDefine`, `FieldCaption`, `FieldType`, `Sortable`, `DefaultWidth`, `FieldAlign`, `SearchField`, `SearchOnline`, `Trunscate`) VALUES ('net_mac_address', 'SYSLOG_NET_MAC_ADDRESS', 'Mac Address', 0, 0, 100, 'left', 'net_mac_address', 0, 0); -INSERT INTO `logcon_fields` (`FieldID`, `FieldDefine`, `FieldCaption`, `FieldType`, `Sortable`, `DefaultWidth`, `FieldAlign`, `SearchField`, `SearchOnline`, `Trunscate`) VALUES ('net_lastip', 'SYSLOG_NET_LASTIP', 'Last IP Address', 0, 0, 85, 'center', 'net_lastip', 1, 0); -INSERT INTO `logcon_fields` (`FieldID`, `FieldDefine`, `FieldCaption`, `FieldType`, `Sortable`, `DefaultWidth`, `FieldAlign`, `SearchField`, `SearchOnline`, `Trunscate`) VALUES ('net_rxrate', 'SYSLOG_NET_RXRATE', 'RX Rate', 0, 0, 50, 'center', 'net_rxrate', 0, 0); -INSERT INTO `logcon_fields` (`FieldID`, `FieldDefine`, `FieldCaption`, `FieldType`, `Sortable`, `DefaultWidth`, `FieldAlign`, `SearchField`, `SearchOnline`, `Trunscate`) VALUES ('net_txrate', 'SYSLOG_NET_TXRATE', 'TX Rate', 0, 0, 50, 'center', 'net_txrate', 0, 0); +INSERT INTO `logcon_fields` (`FieldID`, `FieldDefine`, `FieldCaption`, `FieldType`, `Sortable`, `DefaultWidth`, `FieldAlign`, `SearchField`, `SearchOnline`, `Trunscate`) VALUES ('net_mac_address', 'SYSLOG_NET_MAC_ADDRESS', 'Mac Address', 0, 0, 125, 'left', 'net_mac_address', 0, 0); +INSERT INTO `logcon_fields` (`FieldID`, `FieldDefine`, `FieldCaption`, `FieldType`, `Sortable`, `DefaultWidth`, `FieldAlign`, `SearchField`, `SearchOnline`, `Trunscate`) VALUES ('net_lastip', 'SYSLOG_NET_LASTIP', 'Last IP Address', 0, 0, 100, 'left', 'net_lastip', 1, 0); +INSERT INTO `logcon_fields` (`FieldID`, `FieldDefine`, `FieldCaption`, `FieldType`, `Sortable`, `DefaultWidth`, `FieldAlign`, `SearchField`, `SearchOnline`, `Trunscate`) VALUES ('net_rxrate', 'SYSLOG_NET_RXRATE', 'RX Rate', 0, 0, 65, 'center', 'net_rxrate', 0, 0); +INSERT INTO `logcon_fields` (`FieldID`, `FieldDefine`, `FieldCaption`, `FieldType`, `Sortable`, `DefaultWidth`, `FieldAlign`, `SearchField`, `SearchOnline`, `Trunscate`) VALUES ('net_txrate', 'SYSLOG_NET_TXRATE', 'TX Rate', 0, 0, 65, 'center', 'net_txrate', 0, 0); INSERT INTO `logcon_fields` (`FieldID`, `FieldDefine`, `FieldCaption`, `FieldType`, `Sortable`, `DefaultWidth`, `FieldAlign`, `SearchField`, `SearchOnline`, `Trunscate`) VALUES ('net_uptime', 'SYSLOG_NET_UPTIME', 'System Uptime', 0, 0, 85, 'center', 'net_uptime', 0, 0); INSERT INTO `logcon_fields` (`FieldID`, `FieldDefine`, `FieldCaption`, `FieldType`, `Sortable`, `DefaultWidth`, `FieldAlign`, `SearchField`, `SearchOnline`, `Trunscate`) VALUES ('net_lastactivity', 'SYSLOG_NET_LASTACTIVITY', 'Last Activity', 0, 0, 80, 'center', 'net_lastactivity', 0, 0); -INSERT INTO `logcon_fields` (`FieldID`, `FieldDefine`, `FieldCaption`, `FieldType`, `Sortable`, `DefaultWidth`, `FieldAlign`, `SearchField`, `SearchOnline`, `Trunscate`) VALUES ('net_signalstrength', 'SYSLOG_NET_SIGNALSTRENGTH', 'Signal strength', 0, 0, 50, 'center', 'net_signalstrength', 0, 0); +INSERT INTO `logcon_fields` (`FieldID`, `FieldDefine`, `FieldCaption`, `FieldType`, `Sortable`, `DefaultWidth`, `FieldAlign`, `SearchField`, `SearchOnline`, `Trunscate`) VALUES ('net_signalstrength', 'SYSLOG_NET_SIGNALSTRENGTH', 'Signal strength', 0, 0, 100, 'center', 'net_signalstrength', 0, 0); INSERT INTO `logcon_fields` (`FieldID`, `FieldDefine`, `FieldCaption`, `FieldType`, `Sortable`, `DefaultWidth`, `FieldAlign`, `SearchField`, `SearchOnline`, `Trunscate`) VALUES ('net_signaltonoise', 'SYSLOG_NET_SIGNALTONOISE', 'Signal to noise', 1, 0, 50, 'center', 'net_signaltonoise', 0, 0); INSERT INTO `logcon_fields` (`FieldID`, `FieldDefine`, `FieldCaption`, `FieldType`, `Sortable`, `DefaultWidth`, `FieldAlign`, `SearchField`, `SearchOnline`, `Trunscate`) VALUES ('net_txccq', 'SYSLOG_NET_TXCCQ', 'TX CCQ', 1, 0, 50, 'center', 'net_txccq', 0, 0); INSERT INTO `logcon_fields` (`FieldID`, `FieldDefine`, `FieldCaption`, `FieldType`, `Sortable`, `DefaultWidth`, `FieldAlign`, `SearchField`, `SearchOnline`, `Trunscate`) VALUES ('net_bytesrecieved', 'SYSLOG_NET_BYTESRECIEVED', 'Bytes recieved', 1, 0, 50, 'left', 'net_bytesrecieved', 0, 0); @@ -51,6 +50,7 @@ INSERT INTO `logcon_fields` (`FieldID`, `FieldDefine`, `FieldCaption`, `FieldTyp INSERT INTO `logcon_fields` (`FieldID`, `FieldDefine`, `FieldCaption`, `FieldType`, `Sortable`, `DefaultWidth`, `FieldAlign`, `SearchField`, `SearchOnline`, `Trunscate`) VALUES ('net_packetssend', 'SYSLOG_NET_PACKETSSEND', 'Packets send', 1, 0, 50, 'left', 'net_packetssend', 0, 0); + */ // --- Avoid directly accessing this file! diff --git a/src/lang/de/admin.php b/src/lang/de/admin.php index f611788..e25f76d 100644 --- a/src/lang/de/admin.php +++ b/src/lang/de/admin.php @@ -252,4 +252,38 @@ $content['LN_CHARTS_WARNDELETESEARCH'] = "Are you sure that you want to delete t $content['LN_CHARTS_ERROR_DELCHART'] = "Deleting of the Chart with id '%1' failed!"; $content['LN_CHARTS_ERROR_HASBEENDEL'] = "The Chart '%1' has been successfully deleted!"; +// Fields Options +$content['LN_FIELDS_CENTER'] = "Fields Options"; +$content['LN_FIELDS_EDIT'] = "Edit Field"; +$content['LN_FIELDS_DELETE'] = "Delete Field"; +$content['LN_FIELDS_ADD'] = "Add new Field"; +$content['LN_FIELDS_ID'] = "FieldID"; +$content['LN_FIELDS_NAME'] = "Display Name"; +$content['LN_FIELDS_DEFINE'] = "Internal FieldID"; +$content['LN_FIELDS_DELETE_FROMDB'] = "Delete Field from DB"; +$content['LN_FIELDS_ADDEDIT'] = "Add / Edit a Field"; +$content['LN_FIELDS_TYPE'] = "Field Type"; +$content['LN_FIELDS_ALIGN'] = "Listview Alignment"; +$content['LN_FIELDS_SEARCHONLINE'] = "Enable online search"; +$content['LN_FIELDS_DEFAULTWIDTH'] = "Row width in Listview"; +$content['LN_FIELDS_ERROR_IDNOTFOUND'] = "The Field-ID could not be found in the database, or in the default constants."; +$content['LN_FIELDS_ERROR_INVALIDID'] = "The Field with ID '%1' is not a valid Field."; +$content['LN_FIELDS_SEARCHFIELD'] = "Name of Searchfilter"; +$content['LN_FIELDS_WARNDELETESEARCH'] = "Are you sure that you want to delete the Field '%1'? This cannot be undone!"; +$content['LN_FIELDS_ERROR_DELSEARCH'] = "The Field-ID could not be found in the database."; +$content['LN_FIELDS_ERROR_HASBEENDEL'] = "The Field '%1' has been successfully deleted!"; +$content['LN_FIELDS_ERROR_FIELDCAPTIONEMPTY'] = "The field caption was empty. "; +$content['LN_FIELDS_ERROR_FIELDIDEMPTY'] = "The field id was empty. "; +$content['LN_FIELDS_ERROR_SEARCHFIELDEMPTY'] = "The searchfilter was empty. "; +$content['LN_FIELDS_ERROR_FIELDDEFINEEMPTY'] = "The internal FieldID was empty. "; +$content['LN_FIELDS_HASBEENEDIT'] = "The configuration for the field '%1' has been successfully edited."; +$content['LN_FIELDS_HASBEENADDED'] = "The configuration for the field '%1' has been successfully added."; +$content['LN_FIELDS_'] = ""; +$content['LN_ALIGN_CENTER'] = "center"; +$content['LN_ALIGN_LEFT'] = "left"; +$content['LN_ALIGN_RIGHT'] = "right"; +$content['LN_FILTER_TYPE_STRING'] = "String"; +$content['LN_FILTER_TYPE_NUMBER'] = "Number"; +$content['LN_FILTER_TYPE_DATE'] = "Date"; + ?> \ No newline at end of file diff --git a/src/lang/en/admin.php b/src/lang/en/admin.php index c0dbfae..7828ac0 100644 --- a/src/lang/en/admin.php +++ b/src/lang/en/admin.php @@ -288,11 +288,6 @@ $content['LN_FIELDS_ERROR_FIELDDEFINEEMPTY'] = "The internal FieldID was empty. $content['LN_FIELDS_HASBEENEDIT'] = "The configuration for the field '%1' has been successfully edited."; $content['LN_FIELDS_HASBEENADDED'] = "The configuration for the field '%1' has been successfully added."; $content['LN_FIELDS_'] = ""; -$content['LN_FIELDS_'] = ""; -$content['LN_FIELDS_'] = ""; -$content['LN_FIELDS_'] = ""; -$content['LN_FIELDS_'] = ""; - $content['LN_ALIGN_CENTER'] = "center"; $content['LN_ALIGN_LEFT'] = "left"; $content['LN_ALIGN_RIGHT'] = "right"; diff --git a/src/lang/pt_BR/admin.php b/src/lang/pt_BR/admin.php index f611788..e25f76d 100644 --- a/src/lang/pt_BR/admin.php +++ b/src/lang/pt_BR/admin.php @@ -252,4 +252,38 @@ $content['LN_CHARTS_WARNDELETESEARCH'] = "Are you sure that you want to delete t $content['LN_CHARTS_ERROR_DELCHART'] = "Deleting of the Chart with id '%1' failed!"; $content['LN_CHARTS_ERROR_HASBEENDEL'] = "The Chart '%1' has been successfully deleted!"; +// Fields Options +$content['LN_FIELDS_CENTER'] = "Fields Options"; +$content['LN_FIELDS_EDIT'] = "Edit Field"; +$content['LN_FIELDS_DELETE'] = "Delete Field"; +$content['LN_FIELDS_ADD'] = "Add new Field"; +$content['LN_FIELDS_ID'] = "FieldID"; +$content['LN_FIELDS_NAME'] = "Display Name"; +$content['LN_FIELDS_DEFINE'] = "Internal FieldID"; +$content['LN_FIELDS_DELETE_FROMDB'] = "Delete Field from DB"; +$content['LN_FIELDS_ADDEDIT'] = "Add / Edit a Field"; +$content['LN_FIELDS_TYPE'] = "Field Type"; +$content['LN_FIELDS_ALIGN'] = "Listview Alignment"; +$content['LN_FIELDS_SEARCHONLINE'] = "Enable online search"; +$content['LN_FIELDS_DEFAULTWIDTH'] = "Row width in Listview"; +$content['LN_FIELDS_ERROR_IDNOTFOUND'] = "The Field-ID could not be found in the database, or in the default constants."; +$content['LN_FIELDS_ERROR_INVALIDID'] = "The Field with ID '%1' is not a valid Field."; +$content['LN_FIELDS_SEARCHFIELD'] = "Name of Searchfilter"; +$content['LN_FIELDS_WARNDELETESEARCH'] = "Are you sure that you want to delete the Field '%1'? This cannot be undone!"; +$content['LN_FIELDS_ERROR_DELSEARCH'] = "The Field-ID could not be found in the database."; +$content['LN_FIELDS_ERROR_HASBEENDEL'] = "The Field '%1' has been successfully deleted!"; +$content['LN_FIELDS_ERROR_FIELDCAPTIONEMPTY'] = "The field caption was empty. "; +$content['LN_FIELDS_ERROR_FIELDIDEMPTY'] = "The field id was empty. "; +$content['LN_FIELDS_ERROR_SEARCHFIELDEMPTY'] = "The searchfilter was empty. "; +$content['LN_FIELDS_ERROR_FIELDDEFINEEMPTY'] = "The internal FieldID was empty. "; +$content['LN_FIELDS_HASBEENEDIT'] = "The configuration for the field '%1' has been successfully edited."; +$content['LN_FIELDS_HASBEENADDED'] = "The configuration for the field '%1' has been successfully added."; +$content['LN_FIELDS_'] = ""; +$content['LN_ALIGN_CENTER'] = "center"; +$content['LN_ALIGN_LEFT'] = "left"; +$content['LN_ALIGN_RIGHT'] = "right"; +$content['LN_FILTER_TYPE_STRING'] = "String"; +$content['LN_FILTER_TYPE_NUMBER'] = "Number"; +$content['LN_FILTER_TYPE_DATE'] = "Date"; + ?> \ No newline at end of file