Changeset 884 for trunk/Modules


Ignore:
Timestamp:
Apr 8, 2020, 7:27:09 PM (4 years ago)
Author:
chronos
Message:
  • Fixed: Error during user registration.
  • Fixed: Error on user enter to new team.
Location:
trunk/Modules
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Modules/Admin/Admin.php

    r880 r884  
    127127      //  '(Select `ID` FROM `'.$Group['TablePrefix'].'` as `sub2` WHERE `sub2`.`Language` = 0 AND `T`.`Entry` = `sub2`.`Entry` AND `T`.`VersionStart` = `sub2`.`VersionStart`)'.
    128128      ' ';  //LIMIT 1000
    129       //echo $sql;
    130129      $DbResult = $this->System->Database->query($sql);
    131130      echo ': <br />'.$Group['TablePrefix'].': <br />';
     
    161160      ' WHERE `T`.`Language` = 0 '.
    162161      ' ORDER BY `T`.`VersionStart`';  //LIMIT 1000
    163       //echo $sql;
    164162      $DbResult = $this->System->Database->query($sql);
    165163      echo ': <br />'.$Group['TablePrefix'].': ';
     
    169167            ' WHERE  `T`.`Language` = 0 AND `T`.`VersionStart` > '.$line['VersionEnd'].' AND `T`.`Entry` = '.$line['Entry'].
    170168            ' ORDER BY `T`.`VersionStart` LIMIT 1';  //LIMIT 1000
    171         //   echo $sql;
    172169        $DbResult2 = $this->System->Database->query($sql);
    173         if ($DbResult2->num_rows > 0) {
     170        if ($DbResult2->num_rows > 0)
     171        {
    174172          $line2 = $DbResult2->fetch_assoc();
    175173
    176174          $Same = true;
    177           foreach ($TranslationTree[$Group['Id']]['Items'] as $Column) {
     175          foreach ($TranslationTree[$Group['Id']]['Items'] as $Column)
     176          {
    178177            if ($this->StripText($line[$Column['Column']]) <> $this->StripText($line2[$Column['Column']]))
    179178              $Same = false;
    180179          }
    181           if ($Same) {
     180          if ($Same)
     181          {
    182182            echo $line['ID'].'='.$line2['ID'].' (';
    183183            //       $this->System->Database->query('UPDATE `'.$Group['TablePrefix'].'` SET `Take` = NULL WHERE ID='.$line2['ID']);
     
    186186                ' WHERE `T`.`Entry` = '.$line['Entry'].' AND (`T`.`Take` = '.$line['ID'].' OR `T`.`Take` = '.$line2['ID'].') ';
    187187            $DbResult3 = $this->System->Database->query($sql);
    188             while ($line3 = $DbResult3->fetch_assoc()) {
     188            while ($line3 = $DbResult3->fetch_assoc())
     189            {
    189190              echo $line3['ID'].' ';
    190191              $this->System->Database->query('UPDATE `'.$Group['TablePrefix'].'` SET `VersionEnd` = '.$line2['VersionEnd'].', `VersionStart` = '.$line['VersionStart'].', `Take` = '.$line['ID'].' WHERE ID='.$line3['ID']);
     
    207208
    208209    $Output = '';
    209     if (array_key_exists('GameVersion', $_GET)) {
     210    if (array_key_exists('GameVersion', $_GET))
     211    {
    210212      $_SESSION['GameVersion'] = $_GET['GameVersion'];
    211213    }
     
    221223        $Output .= 'vloženo <br />';
    222224      }
    223       if (array_key_exists('id', $_GET)) {
     225      if (array_key_exists('id', $_GET))
     226      {
    224227        $Group = $TranslationTree[$_GET['id']];
    225228        //  $Output .= '<form action="?action=dbcstructure&amp;id='.$Group['Id'].'">';
     
    242245        $Line = $File->ReadLine();
    243246
    244         for ($i = 0; $i < substr_count($Line, ','); $i++) {
     247        for ($i = 0; $i < substr_count($Line, ','); $i++)
     248        {
    245249          $Output .= $i;
    246250          $Output .= '</td><td>';
    247251        }
    248252        $Output .= '</td></tr><tr><td>';
    249         for ($i = 0; $i < substr_count($Line, ','); $i++) {
     253        for ($i = 0; $i < substr_count($Line, ','); $i++)
     254        {
    250255          foreach ($Group['Items'] as $GroupItem)
    251256            $Output .=   ' <a href="'.$this->System->Link('/admin/?action=dbcstructure&amp;id='.
     
    259264        $Output .= str_replace(',', '</td><td>', $Line);
    260265        $Output .= '</td></tr><tr><td>';
    261         for ($i = 0; $i < 50; $i++) {
     266        for ($i = 0; $i < 50; $i++)
     267        {
    262268          $Line = $File->ReadLine();
    263269          $Output .= str_replace(',', '</td><td>', $Line);
     
    267273        $Output .= '</td></tr>';
    268274        $Output .= '</table>';
    269       } else {
     275      } else
     276      {
    270277        $DbResult = $this->System->Database->query('SELECT * FROM `ClientVersion`');
    271278        while ($Version = $DbResult->fetch_assoc())
  • trunk/Modules/Export/ProcessTask.php

    r880 r884  
    167167    echo('Packing files...'."\n");
    168168    $this->SetProgress(70);
    169     $workdir = str_replace('/',DIRECTORY_SEPARATOR, $Export->TempDir);
     169    $workdir = str_replace('/', DIRECTORY_SEPARATOR, $Export->TempDir);
    170170    $this->MPQPack($workdir.'lua');
    171171    $this->SetProgress(80);
  • trunk/Modules/Log/Log.php

    r881 r884  
    125125    $this->Title = T('System log');
    126126    $Output = '';
    127     if (array_key_exists('type', $_GET) and (is_numeric($_GET['type']))) $_SESSION['type'] = $_GET['type'] * 1;
    128     else if (!array_key_exists('type', $_SESSION)) $_SESSION['type'] = '';
     127    if (array_key_exists('type', $_GET))
     128    {
     129      if (is_numeric($_GET['type'])) $_SESSION['type'] = $_GET['type'] * 1;
     130        else $_SESSION['type'] = '';
     131    } else if (!array_key_exists('type', $_SESSION)) $_SESSION['type'] = '';
    129132
    130133    if (array_key_exists('group', $_GET)) $_SESSION['group'] = $_GET['group'];
  • trunk/Modules/User/Options.php

    r880 r884  
    5353        '</form>';
    5454
    55     $Output .= '  <fieldset><legend>'.T('Translation team').'</legend>';
     55    $Output .= '<fieldset><legend>'.T('Translation team').'</legend>';
    5656    $DbResult = $this->Database->query('SELECT `Id`, `Name` FROM `Team`');
    57     $Output .= '<a href="team/?action=create">'.T('Create team').'</a><br />'.
    58         '<a href="team/?action=leave">'.T('Leave team').'</a><br />'.
    59         '<br /><form action="team/" method="get">'.
     57    $Output .= '<a href="'.$this->System->Link('/team/?action=create').'">'.T('Create team').'</a><br />'.
     58        '<a href="'.$this->System->Link('/team/?action=leave').'">'.T('Leave team').'</a><br />'.
     59        '<br /><form action="'.$this->System->Link('/team/').'" method="get">'.
    6060        '<input type="hidden" name="action" value="gointeam"/>'.
    6161        '<select name="id">';
     
    6666      $Output .= '>'.htmlspecialchars($LineTeam['Name']).'</option>';
    6767    }
    68     $Output .= '</select> <input type="submit" value="'.T('Enter').'" />
    69     </form>';
    70     $Output .= '</fieldset>';
     68    $Output .= '</select>'.
     69      '<input type="submit" value="'.T('Enter').'" />'.
     70      '</form>';
     71      '</fieldset>';
    7172    return $Output;
    7273  }
  • trunk/Modules/User/Registration.php

    r880 r884  
    103103      if (array_key_exists('Language', $_POST)) $Language = $_POST['Language'] * 1;
    104104        else $Language = '';
    105       if (array_key_exists('ClientVersion', $_POST)) $PreferredVersion = $_POST['ClientVersion'] * 1;
     105      if (array_key_exists('ClientVersion', $_POST) and is_numeric($_POST['ClientVersion']))
     106        $PreferredVersion = $_POST['ClientVersion'] * 1;
    106107        else $PreferredVersion = '';
    107108      if ($PreferredVersion == '') $PreferredVersion = 'NULL';
  • trunk/Modules/User/User.php

    r880 r884  
    257257      // Refresh time of last access
    258258      $this->Database->update('UserOnline', 'SessionId="'.$SID.'"', array('ActivityTime' => 'NOW()'));
    259     } else {
     259    } else
     260    {
    260261      if (GetRemoteAddress() != '') $HostName = gethostbyaddr(GetRemoteAddress());
    261262        else $HostName = '';
     
    313314    $UserId = $this->Database->insert_id;
    314315    $this->Database->query('INSERT INTO `UserTrace` (`User`, `LastIP`, `UserAgent`) '.
    315         'VALUES ('.$UserId.', "'.GetRemoteAddress().'", '.
    316         '"'.$this->Database->real_escape_string($_SERVER['HTTP_USER_AGENT']).'")');
     316      'VALUES ('.$UserId.', "'.GetRemoteAddress().'", '.
     317      '"'.$this->Database->real_escape_string($_SERVER['HTTP_USER_AGENT']).'")');
    317318  }
    318319}
Note: See TracChangeset for help on using the changeset viewer.