Changeset 554 for trunk/export/index.php


Ignore:
Timestamp:
Jul 29, 2013, 9:25:33 PM (11 years ago)
Author:
chronos
Message:
  • Fixed: Error in user profile page if user id is not given.
  • Fixed: Error in translation list view if translation group item filter is empty.
  • Fixed: SQL constraint error in case of export deletion which have records in related tables.
  • Fixed: Error when table ordering parameter contain invalid value.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/export/index.php

    r553 r554  
    116116  if($User->Licence(LICENCE_USER))
    117117  {   
    118     $System->Database->query('SELECT * FROM `Export` WHERE `Id`='.$_GET['ExportId'].' AND `User`='.$User->Id);
    119     $System->Database->query('DELETE FROM `Export` WHERE `Id`='.$_GET['ExportId']);
    120     DeleteDirectory('../tmp/Export/'.$_GET['ExportId'].'/');
    121     $Output = ShowMessage('Export smazán.');
    122     $_GET['Filter'] = 'my';
    123     WriteLog('Smazán export '.$_GET['ExportId'], LOG_TYPE_EXPORT);
    124     $Output .= ExportList();
     118    $DbResult = $System->Database->query('SELECT * FROM `Export` WHERE (`Id`='.($_GET['ExportId'] * 1).') AND (`User`='.$User->Id.')');
     119    if($DbResult->num_rows > 0)
     120    {
     121      $System->Database->query('DELETE FROM `ExportGroup` WHERE `Export`='.$_GET['ExportId']);
     122      $System->Database->query('DELETE FROM `ExportLanguage` WHERE `Export`='.$_GET['ExportId']);
     123      $System->Database->query('DELETE FROM `ExportTask` WHERE `Export`='.$_GET['ExportId']);
     124      $System->Database->query('DELETE FROM `ExportUser` WHERE `Export`='.$_GET['ExportId']);
     125      $System->Database->query('DELETE FROM `Export` WHERE `Id`='.$_GET['ExportId']);
     126      DeleteDirectory('../tmp/Export/'.$_GET['ExportId'].'/');
     127      $Output = ShowMessage('Export smazán.');
     128      $_GET['Filter'] = 'my';
     129      WriteLog('Smazán export '.$_GET['ExportId'], LOG_TYPE_EXPORT);
     130      $Output .= ExportList();
     131    } else $Output = ShowMessage('Export nenalezen.', MESSAGE_CRITICAL);
    125132  } else $Output = ShowMessage('Nemáte oprávnění.', MESSAGE_CRITICAL);
    126133  return($Output);
Note: See TracChangeset for help on using the changeset viewer.