Exemple #1
0
 } else {
     if ($_GET['op'] == "delete") {
         if (isset($_GET['id'])) {
             //PreInit these values
             $content['FieldID'] = DB_RemoveBadChars($_GET['id']);
             // Get UserInfo
             $result = DB_Query("SELECT FieldCaption FROM " . DB_FIELDS . " WHERE FieldID = '" . $content['FieldID'] . "'");
             $myrow = DB_GetSingleRow($result, true);
             if (!isset($myrow['FieldCaption'])) {
                 $content['ISERROR'] = true;
                 $content['ERROR_MSG'] = GetAndReplaceLangStr($content['LN_FIELDS_ERROR_IDNOTFOUND'], $content['FieldID']);
             }
             // --- Ask for deletion first!
             if (!isset($_GET['verify']) || $_GET['verify'] != "yes") {
                 // This will print an additional secure check which the user needs to confirm and exit the script execution.
                 PrintSecureUserCheck(GetAndReplaceLangStr($content['LN_FIELDS_WARNDELETESEARCH'], $myrow['FieldCaption']), $content['LN_DELETEYES'], $content['LN_DELETENO']);
             }
             // ---
             // do the delete!
             $result = DB_Query("DELETE FROM " . DB_FIELDS . " WHERE FieldID = '" . $content['FieldID'] . "'");
             if ($result == FALSE) {
                 $content['ISERROR'] = true;
                 $content['ERROR_MSG'] = GetAndReplaceLangStr($content['LN_FIELDS_ERROR_DELSEARCH'], $content['FieldID']);
             } else {
                 DB_FreeQuery($result);
             }
             // Do the final redirect
             RedirectResult(GetAndReplaceLangStr($content['LN_FIELDS_ERROR_HASBEENDEL'], $myrow['FieldCaption']), "fields.php");
         } else {
             $content['ISERROR'] = true;
             $content['ERROR_MSG'] = $content['LN_FIELDS_ERROR_INVALIDID'];
Exemple #2
0
 } else {
     if ($_GET['op'] == "delete") {
         if (isset($_GET['id'])) {
             //PreInit these values
             $content['SEARCHID'] = strip_tags(DB_RemoveBadChars($_GET['id']));
             // Get UserInfo
             $result = DB_Query("SELECT DisplayName FROM " . DB_SEARCHES . " WHERE ID = " . $content['SEARCHID']);
             $myrow = DB_GetSingleRow($result, true);
             if (!isset($myrow['DisplayName'])) {
                 $content['ISERROR'] = true;
                 $content['ERROR_MSG'] = GetAndReplaceLangStr($content['LN_SEARCH_ERROR_IDNOTFOUND'], $content['SEARCHID']);
             }
             // --- Ask for deletion first!
             if (!isset($_GET['verify']) || $_GET['verify'] != "yes") {
                 // This will print an additional secure check which the user needs to confirm and exit the script execution.
                 PrintSecureUserCheck(GetAndReplaceLangStr($content['LN_SEARCH_WARNDELETESEARCH'], $myrow['DisplayName']), $content['LN_DELETEYES'], $content['LN_DELETENO']);
             }
             // ---
             // do the delete!
             $result = DB_Query("DELETE FROM " . DB_SEARCHES . " WHERE ID = " . $content['SEARCHID']);
             if ($result == FALSE) {
                 $content['ISERROR'] = true;
                 $content['ERROR_MSG'] = GetAndReplaceLangStr($content['LN_SEARCH_ERROR_DELSEARCH'], $content['SEARCHID']);
             } else {
                 DB_FreeQuery($result);
             }
             // Do the final redirect
             RedirectResult(GetAndReplaceLangStr($content['LN_SEARCH_ERROR_HASBEENDEL'], $myrow['DisplayName']), "searches.php");
         } else {
             $content['ISERROR'] = true;
             $content['ERROR_MSG'] = $content['LN_SEARCH_ERROR_INVALIDID'];
 if ($_GET['op'] == "removesavedreport") {
     // Get SavedReportID!
     if (isset($_GET['savedreportid'])) {
         //PreInit these values
         $content['SavedReportID'] = DB_RemoveBadChars($_GET['savedreportid']);
         // Get GroupInfo
         $result = DB_Query("SELECT customTitle FROM " . DB_SAVEDREPORTS . " WHERE ID = " . $content['SavedReportID']);
         $myrow = DB_GetSingleRow($result, true);
         if (!isset($myrow['customTitle'])) {
             $content['ISERROR'] = true;
             $content['ERROR_MSG'] = GetAndReplaceLangStr($content['LN_REPORTS_ERROR_SAVEDREPORTIDNOTFOUND'], $content['SavedReportID']);
         } else {
             // --- Ask for deletion first!
             if (!isset($_GET['verify']) || $_GET['verify'] != "yes") {
                 // This will print an additional secure check which the user needs to confirm and exit the script execution.
                 PrintSecureUserCheck(GetAndReplaceLangStr($content['LN_REPORTS_WARNDELETESAVEDREPORT'], $myrow['customTitle']), $content['LN_DELETEYES'], $content['LN_DELETENO']);
             }
             // ---
             // do the delete!
             $result = DB_Query("DELETE FROM " . DB_SAVEDREPORTS . " WHERE ID = " . $content['SavedReportID']);
             if ($result == FALSE) {
                 $content['ISERROR'] = true;
                 $content['ERROR_MSG'] = GetAndReplaceLangStr($content['LN_REPORTS_ERROR_DELSAVEDREPORT'], $content['SavedReportID']);
             } else {
                 DB_FreeQuery($result);
             }
             // Do the final redirect
             RedirectResult(GetAndReplaceLangStr($content['LN_REPORTS_ERROR_HASBEENDEL'], $myrow['customTitle']), "reports.php");
         }
     } else {
         $content['ISERROR'] = true;
Exemple #4
0
 if ($_GET['op'] == "removeparser") {
     // --- 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['id'])) {
         //PreInit these values
         $content['ParserID'] = DB_RemoveBadChars($_GET['id']);
         if (isset($content['PARSERS'][$content['ParserID']])) {
             // Get Reference to parser!
             $myParser = $content['PARSERS'][$content['ParserID']];
             // --- Ask for deletion first!
             if (!isset($_GET['verify']) || $_GET['verify'] != "yes") {
                 // This will print an additional secure check which the user needs to confirm and exit the script execution.
                 PrintSecureUserCheck(GetAndReplaceLangStr($content['LN_PARSERS_WARNREMOVE'], $myParser['DisplayName']), $content['LN_DELETEYES'], $content['LN_DELETENO']);
             }
             // ---
             // Check if we have fields to delete
             if (isset($myParser['CustomFieldsList']) && count($myParser['CustomFieldsList']) > 0) {
                 // Helper counter
                 $deletedFields = 0;
                 // Loop through all custom fields!
                 foreach ($myParser['CustomFieldsList'] as $myField) {
                     // check if field is in define list!
                     if (array_key_exists($myField['FieldID'], $fields)) {
                         $result = DB_Query("DELETE FROM " . DB_FIELDS . " WHERE FieldID = '" . $myField['FieldID'] . "'");
                         DB_FreeQuery($result);
                         // increment counter
                         $deletedFields++;
                     }
Exemple #5
0
 } else {
     if ($_GET['op'] == "delete") {
         if (isset($_GET['id'])) {
             //PreInit these values
             $content['GROUPID'] = DB_RemoveBadChars($_GET['id']);
             // Get GroupInfo
             $result = DB_Query("SELECT groupname FROM " . DB_GROUPS . " WHERE ID = " . $content['GROUPID']);
             $myrow = DB_GetSingleRow($result, true);
             if (!isset($myrow['groupname'])) {
                 $content['ISERROR'] = true;
                 $content['ERROR_MSG'] = GetAndReplaceLangStr($content['LN_GROUP_ERROR_IDNOTFOUND'], $content['USERID']);
             } else {
                 // --- Ask for deletion first!
                 if (!isset($_GET['verify']) || $_GET['verify'] != "yes") {
                     // This will print an additional secure check which the user needs to confirm and exit the script execution.
                     PrintSecureUserCheck(GetAndReplaceLangStr($content['LN_GROUP_WARNDELETEGROUP'], $myrow['groupname']), $content['LN_DELETEYES'], $content['LN_DELETENO']);
                 }
                 // ---
                 // Delete User objects!
                 PerformSQLDelete("DELETE FROM " . DB_SOURCES . " WHERE groupid = " . $content['GROUPID'], 'LN_SOURCES_ERROR_DELSOURCE', $content['GROUPID']);
                 PerformSQLDelete("DELETE FROM " . DB_VIEWS . " WHERE groupid = " . $content['GROUPID'], 'LN_VIEWS_ERROR_DELSEARCH', $content['GROUPID']);
                 PerformSQLDelete("DELETE FROM " . DB_SEARCHES . " WHERE groupid = " . $content['GROUPID'], 'LN_SEARCH_ERROR_DELSEARCH', $content['GROUPID']);
                 PerformSQLDelete("DELETE FROM " . DB_CHARTS . " WHERE groupid = " . $content['GROUPID'], 'LN_CHARTS_ERROR_DELCHART', $content['GROUPID']);
                 PerformSQLDelete("DELETE FROM " . DB_GROUPMEMBERS . " WHERE groupid = " . $content['GROUPID'], 'LN_GROUP_ERROR_REMUSERFROMGROUP', $content['GROUPID']);
                 // Finally delete the Groupobject!
                 PerformSQLDelete("DELETE FROM " . DB_GROUPS . " WHERE ID = " . $content['GROUPID'], 'LN_GROUP_ERROR_DELGROUP', $content['GROUPID']);
                 // Do the final redirect
                 RedirectResult(GetAndReplaceLangStr($content['LN_GROUP_ERROR_HASBEENDEL'], $myrow['groupname']), "groups.php");
             }
         } else {
             $content['ISERROR'] = true;
     } else {
         // Get UserInfo
         $result = DB_Query("SELECT username FROM " . DB_USERS . " WHERE ID = " . $content['USERID']);
         $myrow = DB_GetSingleRow($result, true);
         if (!isset($myrow['username'])) {
             $content['ISERROR'] = true;
             $content['ERROR_MSG'] = GetAndReplaceLangStr($content['LN_USER_ERROR_IDNOTFOUND'], $content['USERID']);
         }
         if ($_SESSION['SESSION_USERNAME'] == $myrow['username']) {
             $content['ISERROR'] = true;
             $content['ERROR_MSG'] = GetAndReplaceLangStr($content['LN_USER_ERROR_DONOTDELURSLF'], $content['USERID']);
         } else {
             // --- Ask for deletion first!
             if (!isset($_GET['verify']) || $_GET['verify'] != "yes") {
                 // This will print an additional secure check which the user needs to confirm and exit the script execution.
                 PrintSecureUserCheck(GetAndReplaceLangStr($content['LN_USER_WARNDELETEUSER'], $myrow['username']), $content['LN_DELETEYES'], $content['LN_DELETENO']);
             }
             // ---
             // Delete User objects!
             PerformSQLDelete("DELETE FROM " . DB_SOURCES . " WHERE userid = " . $content['USERID'], 'LN_SOURCES_ERROR_DELSOURCE', $content['USERID']);
             PerformSQLDelete("DELETE FROM " . DB_VIEWS . " WHERE userid = " . $content['USERID'], 'LN_VIEWS_ERROR_DELSEARCH', $content['USERID']);
             PerformSQLDelete("DELETE FROM " . DB_SEARCHES . " WHERE userid = " . $content['USERID'], 'LN_SEARCH_ERROR_DELSEARCH', $content['USERID']);
             PerformSQLDelete("DELETE FROM " . DB_CHARTS . " WHERE userid = " . $content['USERID'], 'LN_CHARTS_ERROR_DELCHART', $content['USERID']);
             // Finally delete the Userobject!
             PerformSQLDelete("DELETE FROM " . DB_USERS . " WHERE ID = " . $content['USERID'], 'LN_USER_ERROR_DELUSER', $content['USERID']);
             // Do the final redirect
             RedirectResult(GetAndReplaceLangStr($content['LN_USER_ERROR_HASBEENDEL'], $myrow['username']), "users.php");
         }
     }
 } else {
     $content['ISERROR'] = true;
Exemple #7
0
 } else {
     if ($_GET['op'] == "delete") {
         if (isset($_GET['dbmpid'])) {
             //PreInit these values
             $content['DBMPID'] = DB_RemoveBadChars($_GET['dbmpid']);
             // Get UserInfo
             $result = DB_Query("SELECT DisplayName FROM " . DB_MAPPINGS . " WHERE ID = " . $content['DBMPID']);
             $myrow = DB_GetSingleRow($result, true);
             if (!isset($myrow['DisplayName'])) {
                 $content['ISERROR'] = true;
                 $content['ERROR_MSG'] = GetAndReplaceLangStr($content['LN_DBMP_ERROR_IDNOTFOUND'], $content['DBMPID']);
             }
             // --- Ask for deletion first!
             if (!isset($_GET['verify']) || $_GET['verify'] != "yes") {
                 // This will print an additional secure check which the user needs to confirm and exit the script execution.
                 PrintSecureUserCheck(GetAndReplaceLangStr($content['LN_DBMP_WARNDELETEMAPPING'], $myrow['DisplayName']), $content['LN_DELETEYES'], $content['LN_DELETENO']);
             }
             // ---
             // do the delete!
             $result = DB_Query("DELETE FROM " . DB_MAPPINGS . " WHERE ID = " . $content['DBMPID']);
             if ($result == FALSE) {
                 $content['ISERROR'] = true;
                 $content['ERROR_MSG'] = GetAndReplaceLangStr($content['LN_DBMP_ERROR_DELSEARCH'], $content['DBMPID']);
             } else {
                 DB_FreeQuery($result);
             }
             // Do the final redirect
             RedirectResult(GetAndReplaceLangStr($content['LN_DBMP_ERROR_HASBEENDEL'], $myrow['DisplayName']), "dbmappings.php");
         } else {
             $content['ISERROR'] = true;
             $content['ERROR_MSG'] = $content['LN_DBMP_ERROR_INVALIDID'];
Exemple #8
0
         // Take current time and subtract Seconds
         $nSecondsSubtract = $_POST['olderthan'];
         $timestamp = time() - $nSecondsSubtract;
     } else {
         if ($_POST['subop'] == "date" && isset($_POST['olderdate_year']) && isset($_POST['olderdate_month']) && isset($_POST['olderdate_day'])) {
             // Generate Timestamp
             $timestamp = mktime(0, 0, 0, intval($_POST['olderdate_month']), intval($_POST['olderdate_day']), intval($_POST['olderdate_year']));
         }
     }
 }
 // Continue with delete only inif wherequery is set!
 if (isset($timestamp)) {
     // --- Ask for deletion first!
     if (!isset($_GET['verify']) || $_GET['verify'] != "yes") {
         // This will print an additional secure check which the user needs to confirm and exit the script execution.
         PrintSecureUserCheck(GetAndReplaceLangStr($content['LN_SOURCES_WARNDELETEDATA'], $content['DisplayName']), $content['LN_DELETEYES'], $content['LN_DELETENO']);
     }
     // ---
     // Now perform the data cleanup!
     $content['affectedrows'] = $stream->CleanupLogdataByDate($timestamp);
     if (!isset($content['affectedrows'])) {
         $content['ISERROR'] = true;
         $content['ERROR_MSG'] = GetAndReplaceLangStr($content['LN_SOURCES_ERROR_DELDATA'], $content['SOURCEID']);
     } else {
         // Do the final redirect
         RedirectResult(GetAndReplaceLangStr($content['LN_SOURCES_HASBEENDELDATA'], $content['DisplayName'], $content['affectedrows']), "sources.php");
     }
 } else {
     $content['ISERROR'] = true;
     $content['ERROR_MSG'] = GetAndReplaceLangStr($content['LN_SOURCES_ERROR_INVALIDCLEANUP'], $content['DisplayName']);
 }