Changeset 376 for trunk


Ignore:
Timestamp:
Mar 11, 2010, 8:40:32 AM (15 years ago)
Author:
george
Message:
  • Upraveno: Informace o přihlášeném uživateli nově pročištěny a sjednoceny do třídy User. SQL pro kontrolu a generovány hesel dostupné přímo přes metodu CryptPasswordSQL. Přístup k Id přihlášeného uživatele přes globální proměnnou $User a vlastnost Id ($User->Id). Podobně přístup k dalším vlastnostem uživatele.
  • Opraveno: Některé chyby z předchozích předělávek.
Location:
trunk
Files:
2 added
21 edited

Legend:

Unmodified
Added
Removed
  • trunk/Options.php

    r374 r376  
    44ShowPage();
    55
    6 if(Licence(LICENCE_USER))
     6if($User->Licence(LICENCE_USER))
    77{
    8   $User = @$_SESSION['User'];
    9 
    108  if(array_key_exists('Email', $_POST))
    119  {
     
    1513    $NewPass2 = $_POST['NewPass2'];
    1614    $Language = $_POST['Language'];
    17     $redirecting = $_POST['redirecting'];
     15    $Redirecting = $_POST['redirecting'];
    1816
    19     if(($_SESSION['Pass'] == $OldPass) and ($NewPass == $NewPass2))
     17    if($NewPass == $NewPass2)
    2018    {
    21       // Update password
    22       $Salt = GetPasswordSalt();
    23       $Database->SQLCommand('UPDATE `User` SET `Pass` = sha1(CONCAT(sha1("'.$NewPass.'"), "'.$Salt.'")), `Salt`="'.$Salt.'" WHERE `ID` = '.$_SESSION['UserID']);
    24       echo('Heslo změněno!<br />');
     19      $DbResult = $Database->SQLCommand('SELECT `Pass`, '.$User->CryptPasswordSQL('"'.$OldPass.'"', '`Salt`').' AS `Hash` FROM `User` WHERE `ID`= '.$User->Id);
     20      $DbRow = mysql_fetch_assoc($DbResult);
     21      if($DbRow['Hash'] == $DbRow['Pass'])
     22      {     
     23        // Update password
     24        $Salt = $User->GetPasswordSalt();
     25        $Database->SQLCommand('UPDATE `User` SET `Pass` = '.$User->CryptPasswordSQL('"'.$NewPass.'"', '"'.$Salt.'"').', `Salt`="'.$Salt.'" WHERE `ID` = '.$User->Id);
     26        echo('Heslo změněno!<br />');
     27      } else echo('<br />Staré heslo neodpovídá!<br />');
    2528    } else echo('<br />Hesla se neshodují!<br />');
    2629   
    27     $Database->SQLCommand('UPDATE `User` SET `Email` = "'.$Email.'", `Language` = "'.$Language.'", `Redirecting` = "'.$redirecting.'" WHERE `ID` = '.$_SESSION['UserID']);
    28     echo('Úprava nastavení proběhla v pořádku, Email: <b>'.$Email.'</b> Uživatel: <b>'.$User.'</b><br />');
     30    $Database->SQLCommand('UPDATE `User` SET `Email` = "'.$Email.'", `Language` = "'.$Language.'", `Redirecting` = "'.$Redirecting.'" WHERE `ID` = '.$User->Id);
     31    echo('Úprava nastavení proběhla v pořádku, Email: <b>'.$Email.'</b> Uživatel: <b>'.$User->Name.'</b><br />');
    2932    WriteLog('Úprava nastavení!', LOG_TYPE_USER);
    3033  } else
    3134  {
    32     $Line = mysql_fetch_assoc($Database->SQLCommand('SELECT * FROM `User` WHERE `ID` = '.$_SESSION['UserID']));   
    3335    echo('<form action="Options.php" method="post">
    3436  <fieldset><legend>Nastavení uživatele</legend>
     
    3638    <tr>
    3739      <td>Email: </td>
    38       <td><input type="text" name="Email" value="'.$Line['Email'].'" /></td>
     40      <td><input type="text" name="Email" value="'.$User->Email.'" /></td>
    3941    </tr>
    4042    <tr>
     
    5355      <td>Normálně budu překládat do: </td>
    5456      <td>');
    55     WriteLanguages($Line['Language']);
     57    WriteLanguages($User->Language);
    5658    echo('</td>
    5759    </tr>
     
    6264   echo('<select name="redirecting">');
    6365   echo('<option value="0">Nikam</option>');
    64    echo('<option value="1"'); if ($Line['Redirecting'] == '1') echo(' selected="selected"'); echo('>Na nepřeložené</option>');
    65    echo('<option value="2"'); if ($Line['Redirecting'] == '2') echo(' selected="selected"'); echo('>Na další překlad</option>');
    66    echo('<option value="3"'); if ($Line['Redirecting'] == '3') echo(' selected="selected"'); echo('>Na předchozí překlad</option>');
     66   echo('<option value="1"');
     67   if($User->Redirecting == '1') echo(' selected="selected"');
     68   echo('>Na nepřeložené</option>');
     69   echo('<option value="2"');
     70   if($User->Redirecting == '2') echo(' selected="selected"');
     71   echo('>Na další překlad</option>');
     72   echo('<option value="3"');
     73   if($User->Redirecting == '3') echo(' selected="selected"');
     74   echo('>Na předchozí překlad</option>');
    6775   echo('</select>');   
    6876   
    69     echo('</td>
     77   echo('</td>
    7078    </tr>
    7179    <tr>
     
    8593    {
    8694      echo('<option value="'.$LineTeam['Id'].'"');
    87       if ($LineTeam['Id'] == $Line['Team']) echo(' selected="selected"');
     95      if ($LineTeam['Id'] == $User->Team) echo(' selected="selected"');
    8896        echo('>'.$LineTeam['Name'].'</option>');
    8997    }   
  • trunk/TranslationList.php

    r366 r376  
    111111function UserTranslated()
    112112{
    113   global $GroupId, $Table;
     113  global $GroupId, $Table, $User;
    114114 
    115115  echo('<a title="Zobrazit texty podle vlastního filtru" href="?group='.$GroupId.'&amp;action=filter">Filtr textů</a> ->
    116116        <a title="Přeložené questy přilášeného uživatele" href="?group='.$GroupId.'&amp;action=my">Moje překlady</a><br /><br />');
    117   WriteQuests('SELECT `'.$Table.'`.*, `User`.`Name` AS `UserName` FROM `'.$Table.'` JOIN `User` ON `User`.`id` = `'.$Table.'`.`User` WHERE `'.$Table.'`.`User` = '.$_SESSION['UserID']);
     117  WriteQuests('SELECT `'.$Table.'`.*, `User`.`Name` AS `UserName` FROM `'.$Table.'` JOIN `User` ON `User`.`id` = `'.$Table.'`.`User` WHERE `'.$Table.'`.`User` = '.$User->Id);
    118118}
    119119
    120120function UserUnfinished()
    121121{
    122   global $GroupId, $Table;
     122  global $GroupId, $Table, $User;
    123123
    124124  echo('<a title="Zobrazit texty podle vlastního filtru" href="?group='.$GroupId.'&amp;action=filter">Filtr textů</a> ->
    125125    <a title="Nedokončené texty" href="?group='.$GroupId.'&amp;action=mydevelop">Rozepsané překlady</a><br /><br />');
    126   WriteQuests('SELECT *, (SELECT `User`.`Name` FROM `User` WHERE `User`.`ID` = `'.$Table.'`.`User`) AS `UserName` FROM `'.$Table.'` WHERE `User` = '.$_SESSION['UserID'].' AND `Complete` = 0');
     126  WriteQuests('SELECT *, (SELECT `User`.`Name` FROM `User` WHERE `User`.`ID` = `'.$Table.'`.`User`) AS `UserName` FROM `'.$Table.'` WHERE `User` = '.$User->Id.' AND `Complete` = 0');
    127127}
    128128
     
    281281function TranslatedFilter()
    282282{
    283   global $Table, $GroupId, $Database;
     283  global $Table, $GroupId, $Database, $User;
    284284 
    285285  echo('<a title="Zobrazit texty podle vlastního filtru" href="?group='.$GroupId.'&amp;action=filter">Filtr textů</a><br /><br /><br />'.
     
    294294    '<td>Texty označené jako rozpracované.</td></tr>');
    295295
    296   if(Licence(LICENCE_USER))
     296  if($User->Licence(LICENCE_USER))
    297297  {
    298298    echo('<tr><td><a title="Nedokončené texty" href="?group='.$GroupId.'&amp;action=mydevelop">Rozepsané texty</a></td>
     
    350350else if($Action == 'nocomplete') Noncomplete();
    351351else if($Action == 'Translate') Translate();
    352 else if(($Action == 'my') and Licence(LICENCE_USER)) UserTranslated();
    353 else if(($Action == 'mydevelop') and Licence(LICENCE_USER)) UserUnfinished();
     352else if(($Action == 'my') and $User->Licence(LICENCE_USER)) UserTranslated();
     353else if(($Action == 'mydevelop') and $User->Licence(LICENCE_USER)) UserUnfinished();
    354354else if($Action == 'users') UserSelected();
    355355else if($Action == 'userall') UserAll();
  • trunk/action.php

    r366 r376  
    2727  }
    2828 
    29     $Line = mysql_fetch_row($Database->SQLCommand('SELECT count(*) FROM `User` WHERE `User` LIKE "%'.$Search.'%"'));
     29    $Line = mysql_fetch_row($Database->SQLCommand('SELECT count(*) FROM `User` WHERE `Name` LIKE "%'.$Search.'%"'));
    3030  echo('<tr><td><a href="userlist.php?search='.$Search.'">Uživatelé</a></td><td>'.$Line[0].'</td></tr>');
    3131    $Line = mysql_fetch_row($Database->SQLCommand('SELECT count(*) FROM `Team` WHERE `Name` LIKE "%'.$Search.'%" OR `Description` LIKE "%'.$Search.'%"'));
     
    4242function DatabaseKit()
    4343{
    44   global $Database, $TranslationTree;
    45  
    46   if(Licence(LICENCE_ADMIN))
     44  global $Database, $TranslationTree, $User;
     45 
     46  if($User->Licence(LICENCE_ADMIN))
    4747  {
    4848    echo('<form action="?action=dbkit" method="post">');
     
    172172function Delete()
    173173{
    174   global $Database;
    175  
    176   if(Licence(LICENCE_MODERATOR))
     174  global $Database, $User;
     175 
     176  if($User->Licence(LICENCE_MODERATOR))
    177177  {
    178178    $TextID = $_GET['ID'];       
     
    185185function ShoutBox()
    186186{
    187   global $Database;
     187  global $Database, $User;
    188188 
    189189  if(array_key_exists('shoutbox', $_GET)) $shoutbox = $_GET['shoutbox'];
     
    193193    echo('<form action="action.php?action=shoutbox&amp;shoutbox=1" method="post"><fieldset><legend>Nová zpráva kecátka</legend>
    194194      Uživatel: ');
    195     if(Licence(LICENCE_USER)) echo('<b>'.$_SESSION['User'].'</b><br />');
     195    if($User->Licence(LICENCE_USER)) echo('<b>'.$User->Name.'</b><br />');
    196196  else echo('<input type="text" name="user" /><br />');
    197197    echo('Text zprávy: <br>
     
    201201  } else
    202202  {
    203     if(Licence(LICENCE_USER)) $user = $_SESSION['User'];
    204   else die('Pro vkládaní musíte byt registrováni!');
    205     $text = $_POST['text'];
    206     $Database->SQLCommand('INSERT INTO `ShoutBox` ( `User` , `Text` , `Date` , `IP` )
    207     VALUES ("'.$user.'", "'.$text.'", NOW(), "'.$_SERVER['REMOTE_ADDR'].'")');
    208     echo('Zpráva vložena!<br>Budete přesměrováni...');   
    209     echo('
     203    if($User->Licence(LICENCE_USER))
     204    {
     205      $Text = $_POST['text'];
     206      $Database->SQLCommand('INSERT INTO `ShoutBox` ( `User` , `Text` , `Date` , `IP` ) '.
     207      ' VALUES ("'.$User->Name.'", "'.$Text.'", NOW(), "'.$_SERVER['REMOTE_ADDR'].'")');
     208      echo('Zpráva vložena!<br>Budete přesměrováni...');   
     209      echo('
    210210        <script type="text/javascript" language="JavaScript" charset="utf-8">
    211211            setTimeout("parent.location.href=\'index.php\'",1000)
    212212        </script>');
     213    } else echo('Pro vkládaní musíte byt registrováni!');
    213214  }
    214215}
     
    216217function ShoutBoxView()
    217218{
    218   global $Database;
     219  global $Database, $User;
    219220 
    220221  $DbResult = $Database->SQLCommand('SELECT COUNT(*) FROM `ShoutBox`');
     
    224225  echo('<h3>Kecátko</h3>');
    225226  echo($PageList['Output']);
    226   if(Licence(LICENCE_USER)) echo(' <a href="action.php?action=shoutbox">Vložit</a>');
     227  if($User->Licence(LICENCE_USER)) echo(' <a href="action.php?action=shoutbox">Vložit</a>');
    227228  echo('<div class="shoutbox">');
    228229  $ID = $Database->SQLCommand('SELECT * FROM `ShoutBox` ORDER BY `ID` DESC '.$PageList['SQLLimit']);
     
    235236function ShowNewsHistory()
    236237{
    237   global $Database;
     238  global $Database, $User;
    238239 
    239240  $DbResult = $Database->SQLCommand('SELECT COUNT(*) FROM `News`');
     
    243244  echo('<h3>Novinky</h3>');
    244245  echo($PageList['Output']);
    245   if(Licence(LICENCE_USER)) echo(' <a href="admin.php?action=addnew">Vložit</a>');
     246  if($User->Licence(LICENCE_USER)) echo(' <a href="admin.php?action=addnew">Vložit</a>');
    246247  echo('<div class="shoutbox">');
    247248  $ID = $Database->SQLCommand('SELECT `News`.`Time`, `News`.`Text`, `User`.`Name` AS `User` FROM `News` JOIN `User` ON `User`.`ID`=`News`.`User` ORDER BY `News`.`Time` DESC '.$PageList['SQLLimit']);
  • trunk/admin.php

    r365 r376  
    3030function ShowNewForm()
    3131{
    32   //global $User;
     32  global $User;
     33 
    3334  echo ('<form action="admin.php?action=addnew" method="POST">'.
    34   'Uživatel: '.$_SESSION['User'].'('.$_SESSION['UserID'].')<br/> '.
     35  'Uživatel: '.$User->Name.'('.$User->Id.')<br/> '.
    3536  '<input type="submit" value="Uložit"/><br/>'.
    3637  '<textarea rows="8" cols="40" onkeydown="ResizeTextArea(this)" class="textedit" id="Text" name="text"></textarea>'.
     
    4041function SaveNew()
    4142{
    42   global $Database, $Config;
     43  global $Database, $Config, $User;
    4344 
    4445  if(array_key_exists('text', $_POST))
    4546  {
    46     $querty = 'INSERT INTO `News` ( `Time` ,`User` ,`Text`) VALUES ( NOW( ) , '.$_SESSION['UserID'].', "'.$_POST['text'].'")';
     47    $querty = 'INSERT INTO `News` ( `Time` ,`User` ,`Text`) VALUES ( NOW( ) , '.$User->Id.', "'.$_POST['text'].'")';
    4748    $Database->SQLCommand($querty);
    4849    echo('Aktualita uložena!');
     
    6465    ' AND (NOT EXISTS (SELECT `ID` FROM `Dictionary` WHERE `User`.`ID` = `Dictionary`.`User`))'. // Without dictionary words
    6566    ' AND (NOT EXISTS (SELECT `Id` FROM `News` WHERE `User`.`ID` = `News`.`User`))'. // Without news
    66     ' AND (NOT EXISTS (SELECT `ID` FROM `ShoutBox` WHERE `User`.`User` = `ShoutBox`.`User`))'. // Without shoutbox messages
     67    ' AND (NOT EXISTS (SELECT `ID` FROM `ShoutBox` WHERE `User`.`Name` = `ShoutBox`.`User`))'. // Without shoutbox messages
    6768    '';
    6869  $DbResult = $Database->SQLCommand('SELECT COUNT(*) FROM `User`'.$Condition);
     
    112113}
    113114
    114 if(Licence(LICENCE_ADMIN))
     115if($User->Licence(LICENCE_ADMIN))
    115116{
    116117  if(array_key_exists('action', $_GET))
  • trunk/dictionary.php

    r366 r376  
    9191if(!isset($_SESSION['language']))
    9292{
    93   if(Licence(LICENCE_USER))
    94   {
    95     $DbResult = $Database->SQLCommand('SELECT `Language` FROM `User` WHERE `ID`='.$_SESSION['UserID']);
    96     $User = mysql_fetch_assoc($DbResult);
    97     $_SESSION['language'] = $User['Language'];
     93  if($User->Licence(LICENCE_USER))
     94  {
     95    $_SESSION['language'] = $User->Language;
    9896  } else $_SESSION['language'] = 1;
    9997}
     
    127125  if(array_key_exists('action', $_GET))
    128126  {
    129     if(($_GET['action'] == 'insert')  and Licence(LICENCE_USER))
     127    if(($_GET['action'] == 'insert')  and $User->Licence(LICENCE_USER))
    130128    {
    131129      echo('<form action="dictionary.php?action=save" method="post">'.
     
    140138      '</form>');   
    141139    } else
    142     if(($_GET['action'] == 'save') and Licence(LICENCE_USER))
     140    if(($_GET['action'] == 'save') and $User->Licence(LICENCE_USER))
    143141    {
    144142      if(array_key_exists('Original', $_POST) and array_key_exists('Translated', $_POST) and array_key_exists('Description', $_POST))
     
    157155        }
    158156     
    159         $DbResult = $Database->SQLCommand('SELECT `Id` FROM `Dictionary` WHERE `Entry` = '.$Entry.' AND `Language`='.$_SESSION['language'].' AND `User`='.$_SESSION['UserID']);
     157        $DbResult = $Database->SQLCommand('SELECT `Id` FROM `Dictionary` WHERE `Entry` = '.$Entry.' AND `Language`='.$_SESSION['language'].' AND `User`='.$User->Id);
    160158        if(mysql_num_rows($DbResult) > 0)
    161159        {
     
    163161          $Database->SQLCommand('UPDATE `Dictionary` SET `Text`="'.$_POST['Translated'].'", `Description` = "'.$_POST['Description'].'" WHERE Id='.$DbRow['Id']);
    164162        } else     
    165           $Database->SQLCommand('INSERT INTO `Dictionary` ( `Text` , `Entry` , `Description` , `User`, `Language` ) VALUES ("'.$_POST['Translated'].'", "'.$Entry.'", "'.$_POST['Description'].'", '.$_SESSION['UserID'].', '.$_SESSION['language'].')');
     163          $Database->SQLCommand('INSERT INTO `Dictionary` ( `Text` , `Entry` , `Description` , `User`, `Language` ) VALUES ("'.$_POST['Translated'].'", "'.$Entry.'", "'.$_POST['Description'].'", '.$User->Id.', '.$_SESSION['language'].')');
    166164        echo('Záznam byl uložen!');
    167165      } else echo('Nebyly zaslány všechny položky formuláře.');
    168166    } else
    169     if(($_GET['action'] == 'remove') and Licence(LICENCE_USER))
    170     {
    171       $Database->SQLCommand('DELETE FROM `Dictionary` WHERE `User`='.$_SESSION['UserID'].' AND `Language`='.$_SESSION['language'].' AND `Entry`='.$_GET['entry']);
     167    if(($_GET['action'] == 'remove') and $User->Licence(LICENCE_USER))
     168    {
     169      $Database->SQLCommand('DELETE FROM `Dictionary` WHERE `User`='.$User->Id.' AND `Language`='.$_SESSION['language'].' AND `Entry`='.$_GET['entry']);
    172170    } else
    173     if(($_GET['action'] == 'modify')  and Licence(LICENCE_USER))
    174     {
    175       $DbResult = $Database->SQLCommand('SELECT * FROM `Dictionary` WHERE `User`='.$_SESSION['UserID'].' AND `Entry`='.$_GET['entry'].' AND `Language`='.$_SESSION['language']);
     171    if(($_GET['action'] == 'modify')  and $User->Licence(LICENCE_USER))
     172    {
     173      $DbResult = $Database->SQLCommand('SELECT * FROM `Dictionary` WHERE `User`='.$User->Id.' AND `Entry`='.$_GET['entry'].' AND `Language`='.$_SESSION['language']);
    176174      $DbRow = mysql_fetch_assoc($DbResult);
    177175      $DbResult = $Database->SQLCommand('SELECT * FROM `Dictionary` WHERE `User`=0 AND `Entry`='.$_GET['entry'].' AND `Language`=0');
     
    199197    <input type="text" value="'.$Search.'" name="search" size="30" />
    200198    <input type="submit" value="Vyhledat" />');
    201   if(Licence(LICENCE_USER)) echo(' <a href="dictionary.php?action=insert">Vložit slovo</a>');
     199  if($User->Licence(LICENCE_USER)) echo(' <a href="dictionary.php?action=insert">Vložit slovo</a>');
    202200           
    203201  echo('</td></tr>');
     
    231229    array('Name' => 'UserName', 'Title' => 'Překladatel'),
    232230  );
    233   if(Licence(LICENCE_USER)) $TableColumns[] = array('Name' => '', 'Title' => 'Akce');
     231  if($User->Licence(LICENCE_USER)) $TableColumns[] = array('Name' => '', 'Title' => 'Akce');
    234232  $Order = GetOrderTableHeader($TableColumns, 'Original');
    235233  echo('<table width="98%" class="BaseTable">');
     
    245243    <td>'.$Line['Description'].'</td>
    246244    <td>'.$Line['UserName'].'</td>');
    247     if(Licence(LICENCE_USER))
    248     {
    249       if($Line['UserID'] == $_SESSION['UserID'])
     245    if($User->Licence(LICENCE_USER))
     246    {
     247      if($Line['UserID'] == $User->Id)
    250248        echo('<td><a href="?action=remove&amp;entry='.$Line['Entry'].'">Smazat</a> <a href="?action=modify&amp;entry='.$Line['Entry'].'">Upravit</a></td>');
    251249        else echo('<td></td>');
  • trunk/download.php

    r366 r376  
    2929
    3030  /*
    31    if (array_key_exists('createverse', $_GET) and Licence(LICENCE_ADMIN)) {
     31   if (array_key_exists('createverse', $_GET) and $User->Licence(LICENCE_ADMIN)) {
    3232    if (array_key_exists('verse', $_POST)) { //ukládání
    3333        $Database->SQLCommand('INSERT INTO `CzWoWPackageVersion` (`Version` ,`Date` ,`Text` ,`User`)
  • trunk/export/create_addon.php

    r366 r376  
    174174    $Group = $TranslationTree[14]; // client table
    175175    $Column['Column'] = 'Text';
    176     $Query = 'SELECT T2.'.$Column['Column'].' AS Translation, T3.'.$Column['Column'].' as Original, T3.ShortCut FROM (SELECT T1.entry, T1.'.$Column['Column'].' FROM (SELECT entry,'.$Column['Column'].' FROM '.$Group['TablePrefix'].' WHERE (Complete = 1) AND VersionStart <= '.$this->ClientVersion['BuildNumber'].' AND VersionEnd >= '.$this->ClientVersion['BuildNumber'].' AND '.$this->WhereLang.' AND '.$this->WhereUsers.$this->OrderByUserList.') AS T1 GROUP BY T1.entry) as T2 JOIN '.$Group['TablePrefix'].' AS T3 ON (T2.entry = T3.entry) AND (T3.Language = 0)';
     176    $Query = 'SELECT `T2`.`'.$Column['Column'].'` AS `Translation`, `T3`.`'.$Column['Column'].'` AS `Original`, `T3`.`ShortCut` FROM (SELECT `T1`.`Entry`, `T1`.`'.$Column['Column'].'` FROM (SELECT `Entry`,`'.$Column['Column'].'` FROM '.$Group['TablePrefix'].' WHERE (`Complete` = 1) AND (`VersionStart` <= '.$this->ClientVersion['BuildNumber'].') AND (`VersionEnd` >= '.$this->ClientVersion['BuildNumber'].') AND '.$this->WhereLang.' AND '.$this->WhereUsers.$this->OrderByUserList.') AS `T1` GROUP BY `T1`.`Entry`) AS `T2` JOIN `'.$Group['TablePrefix'].'` AS `T3` ON (`T2`.`Entry` = `T3`.`Entry`) AND (`T3`.`Language` = 0)';
    177177    $DbResult = $this->Database->query($Query);
    178178    while($Line = $DbResult->fetch_array())
  • trunk/export/export.php

    r375 r376  
    1111  var $SelectedUsers;
    1212  var $UserNames;
    13   var $User;
    1413  var $ClientVersion;
    1514  var $OrderByUserList;
     
    3837    $this->UserNames = '';
    3938    $DbResult = $this->Database->query('SELECT `ExportUser`.*, `User`.`Name`, `User`.`ID` FROM `ExportUser` LEFT JOIN `User` ON `User`.`ID`=`ExportUser`.`User` WHERE `ExportUser`.`Export`='.$this->Id.' ORDER BY `ExportUser`.`Sequence`');
    40     while($User = $DbResult->fetch_assoc())
    41     {
    42       $this->SelectedUsers .= ','.$User['ID'];
    43       $this->UserNames .= ','.$User['Name'];
     39    while($UserLine = $DbResult->fetch_assoc())
     40    {
     41      $this->SelectedUsers .= ','.$UserLine['ID'];
     42      $this->UserNames .= ','.$UserLine['Name'];
    4443    }
    4544    $this->SelectedUsers = substr($this->SelectedUsers, 1);
     
    5655    }
    5756   
    58     // Load logged user
    59     if(isset($_SESSION) and ($_SESSION['UserID'] != ''))
    60     {
    61       $DbResult = $this->Database->query('SELECT `Name` FROM `User` WHERE `ID`='.$_SESSION['UserID']);
    62       $this->User = $DbResult->fetch_assoc();
    63     } else $this->User = array('User' => 'Neznámý');
    64 
    65 
    6657    $DbResult = $this->Database->query('SELECT * FROM `ClientVersion` WHERE `Id`='.$this->Export['ClientVersion']);
    6758    $this->ClientVersion = $DbResult->fetch_assoc();   
     
    7061  function ExportToMangosSQL()
    7162  {
    72     global $TranslationTree, $LanguageList;
     63    global $TranslationTree, $LanguageList, $User, $Config;
    7364 
    7465    $this->LoadFilters();
     
    8273      "-- Znaková sada: ".$this->Config['Database']['Charset']." / ".$this->Config['Web']['Charset']."\n".
    8374      "-- Diakritika: ".$this->AnoNe[$this->Export['WithDiacritic']]."\n".
    84       "-- Vygeneroval uživatel: ".$this->User['Name']."\n".
     75      "-- Vygeneroval uživatel: ".$User->Name."\n".
    8576      "-- Vzato od uživatelů: ".$this->UserNames."\n".
    8677      "-- Generované tabulky: ";
     
    8980    while($Group = $DbResult->fetch_assoc())
    9081    {
    91        $Buffer .= $Group['MangosTable'].', ';
     82      $Buffer .= $Group['TablePrefix'].', ';
    9283    }
    9384    $Buffer .= "\n\n"; 
     
    146137      {
    147138        $Ori_text = $Line['name'];
    148         $DbResult2 = $Database2->query('SELECT `text` AS en,
    149         (SELECT `text` FROM `'.$Config['Database']['Database'].'`.`global_strings` AS `tabletran`
    150          WHERE `tableen`.`entry` = `tabletran`.`entry` AND (`Complete` = 1) AND '.$this->WhereLang.' AND '.$this->WhereUsers.$this->OrderByUserList.' LIMIT 1) AS `tran`
    151          FROM `'.$Config['Database']['Database'].'`.`global_strings` AS `tableen` WHERE
    152           `text` = "'.addslashes($Ori_text).'" LIMIT 1');
     139        $DbResult2 = $Database2->query('SELECT `Text` AS `En`,
     140        (SELECT `Text` FROM `'.$Config['Database']['Database'].'`.`TextGlobalString` AS `TableTran`
     141         WHERE `TableEn`.`Entry` = `TableTran`.`Entry` AND (`Complete` = 1) AND '.$this->WhereLang.' AND '.$this->WhereUsers.$this->OrderByUserList.' LIMIT 1) AS `Tran`
     142         FROM `'.$Config['Database']['Database'].'`.`TextGlobalString` AS `TableEn` WHERE
     143          `Text` = "'.addslashes($Ori_text).'" LIMIT 1');
    153144        $Tran = $DbResult2->fetch_assoc();
    154145        //echo ($Line['name'].'='.$Tran['tran']);
    155         if($Tran['tran'] == '')
     146        if($Tran['Tran'] == '')
    156147        {
    157           $DbResult2 = $Database2->query('SELECT `OptionText` AS `en`,
    158           (SELECT `OptionText` FROM `'.$this->Config['Database']['Database'].'`.`npc_option` AS `tabletran`
    159            WHERE `tableen`.`entry` = `tabletran`.`entry` AND (`Complete` = 1) AND '.$this->WhereLang.'
    160             AND '.$this->WhereUsers.$this->OrderByUserList.' LIMIT 1) AS `tran`
    161           FROM `'.$this->Config['Database']['Database'].'`.`npc_option` AS `tableen` WHERE
     148          $DbResult2 = $Database2->query('SELECT `OptionText` AS `En`,
     149          (SELECT `OptionText` FROM `'.$this->Config['Database']['Database'].'`.`TextNPCOption` AS `TableTran`
     150           WHERE `TableEn`.`Entry` = `TableTran`.`Entry` AND (`Complete` = 1) AND '.$this->WhereLang.'
     151            AND '.$this->WhereUsers.$this->OrderByUserList.' LIMIT 1) AS `Tran`
     152          FROM `'.$this->Config['Database']['Database'].'`.`TextNPCOption` AS `TableEn` WHERE
    162153            `OptionText` = "'.addslashes($Ori_text).'" LIMIT 1');
    163154          $Tran = $DbResult2->fetch_assoc();
    164155        }
    165156       
    166         if($Tran['tran'] <> '')
    167           $Buffer .= 'UPDATE `'.$AoWoWTable.'` SET `name` = "'.addslashes($Tran['tran']).'" WHERE '.$IndexColum.' = '.$Line[$IndexColum].' ;'."\n";
     157        if($Tran['Tran'] <> '')
     158          $Buffer .= 'UPDATE `'.$AoWoWTable.'` SET `name` = "'.addslashes($Tran['Tran']).'" WHERE '.$IndexColum.' = '.$Line[$IndexColum].' ;'."\n";
    168159      }
    169160      $Buffer .= "\n\n"; 
     
    176167  function ExportToXML()
    177168  {
    178     global $TranslationTree, $LanguageList;
     169    global $TranslationTree, $LanguageList, $User;
    179170 
    180171    $this->LoadFilters($this->Id);
     
    186177    "    <time>".date('r')."</time>\n".
    187178    "    <diacritics mode=".'"'.$this->Export['WithDiacritic'].'"'." />\n".
    188     "    <author>".$this->User['Name']."</author>\n".
     179    "    <author>".$User->Name."</author>\n".
    189180    "    <contributors>\n";
    190181    foreach(explode(',', $this->UserNames) as $UserName)
     
    209200      while($Line = $DbResult2->fetch_assoc())
    210201      {
    211         $Buffer .= '      <item id="'.$Line['entry'].'" user="'.$Line['UserName'].'">'."\n";
     202        $Buffer .= '      <item id="'.$Line['Entry'].'" user="'.$Line['UserName'].'">'."\n";
    212203        $Values = '';
    213204        foreach($TranslationTree[$Group['Id']]['Items'] as $GroupItem)
     
    242233         $columns = '';
    243234         foreach($TranslationTree[$Group['Id']]['Items'] as $Column) {
    244            $columns .= ' T.'.$Column['Column'].' as text'.$i.',';
     235           $columns .= ' `T`.`'.$Column['Column'].'` AS `Text`'.$i.',';
    245236           $i = $i+1;
    246237         }
    247238         
    248          $querty = '"SELECT '.$columns.' T.Entry as entry FROM (SELECT * FROM '.$Group['TablePrefix'].' WHERE (Complete = 1) AND '.$this->WhereLang.' AND '.$this->WhereUsers.' AND VersionStart <= '.$this->ClientVersion['BuildNumber'].' AND VersionEnd >= '.$this->ClientVersion['BuildNumber'].') AS T GROUP BY T.Entry"';
     239         $querty = '"SELECT '.$columns.' `T`.`Entry` AS `Entry` FROM (SELECT * FROM '.$Group['TablePrefix'].' WHERE (`Complete` = 1) AND '.$this->WhereLang.' AND '.$this->WhereUsers.' AND (`VersionStart` <= '.$this->ClientVersion['BuildNumber'].') AND (`VersionEnd` >= '.$this->ClientVersion['BuildNumber'].')) AS `T` GROUP BY `T`.`Entry`"';
    249240     
    250241       $params = '-u '.$Config['Database']['User'].' -p '.$Config['Database']['Password'].' -f ../source/'.$this->ClientVersion['Version'].'/dbc/'.$Group['DBCFileName'].'.dbc -n '.$this->TempDir.'dbc/'.$Group['DBCFileName'].'.dbc -c '.GetDBCColumns($this->ClientVersion['Version'], $Group['DBCFileName']).' -q '.$querty;
  • trunk/export/index.php

    r366 r376  
    66function ExportList()
    77{
    8   global $Database;
     8  global $Database, $User;
    99 
    1010  echo('<a href="?Action=ViewList">Všechny</a>');
    11   if(Licence(LICENCE_USER))
     11  if($User->Licence(LICENCE_USER))
    1212  {
    1313    echo(' <a href="?Action=ViewList&amp;Filter=Others">Ostatních</a>');
     
    1818  if(array_key_exists('Filter', $_GET))
    1919  {
    20     if($_GET['Filter'] == 'My') $Filter = ' WHERE `Export`.`User` = '.$_SESSION['UserID'];
    21     if($_GET['Filter'] == 'Others') $Filter = ' WHERE `Export`.`User` != '.$_SESSION['UserID'];
     20    if($_GET['Filter'] == 'My') $Filter = ' WHERE `Export`.`User` = '.$User->Id;
     21    if($_GET['Filter'] == 'Others') $Filter = ' WHERE `Export`.`User` != '.$User->Id;
    2222  }
    2323 
     
    4646  {
    4747    $Action = '<a href="?Action=View&amp;ExportId='.$Export['Id'].'">Zobrazit</a> <a href="?Action=View&amp;ExportId='.$Export['Id'].'&amp;Tab=6">Exportovat</a>';
    48     if($Export['User'] == $_SESSION['UserID']) $Action .= ' <a href="?Action=Delete&amp;ExportId='.$Export['Id'].'" onclick="return confirmAction(\'Opravdu smazat položku?\');">Smazat</a>';
     48    if($Export['User'] == $User->Id) $Action .= ' <a href="?Action=Delete&amp;ExportId='.$Export['Id'].'" onclick="return confirmAction(\'Opravdu smazat položku?\');">Smazat</a>';
    4949    echo('<tr><td>'.HumanDate($Export['TimeCreate']).'</td><td>'.$Export['UserName'].'</td><td>'.$Export['Title'].'</td><td>'.$Export['UsedCount'].'</td><td>'.$Export['UserCount'].'</td><td>'.$Export['GroupCount'].'</td><td>'.$Action.'</td></tr>');
    5050  }
     
    5252  echo($PageList['Output']);
    5353   
    54   if(Licence(LICENCE_USER)) echo('<br/><div style="text-align: center;"><a href="?Action=Create">Vytvořit nový export</a></div>');
     54  if($User->Licence(LICENCE_USER)) echo('<br/><div style="text-align: center;"><a href="?Action=Create">Vytvořit nový export</a></div>');
    5555}
    5656
    5757function ExportCreate()
    5858{
    59   global $Database, $Config;
    60  
    61   if(Licence(LICENCE_USER))
     59  global $Database, $Config, $User;
     60 
     61  if($User->Licence(LICENCE_USER))
    6262  {   
    63     $DbResult = $Database->SQLCommand('SELECT COUNT(*) FROM Export WHERE User='.$_SESSION['UserID']);
     63    $DbResult = $Database->SQLCommand('SELECT COUNT(*) FROM `Export` WHERE `User`='.$User->Id);
    6464    $DbRow = mysql_fetch_row($DbResult);
    6565    if($DbRow[0] < $Config['MaxExportPerUser'])
     
    7777function ExportCreateFinish()
    7878{
    79   global $Database, $Config;
    80  
    81   if(Licence(LICENCE_USER))
     79  global $Database, $Config, $User;
     80 
     81  if($User->Licence(LICENCE_USER))
    8282  {   
    8383    if(array_key_exists('Title', $_POST) and array_key_exists('Description', $_POST))
    8484    {
    85       $DbResult = $Database->SQLCommand('SELECT COUNT(*) FROM `Export` WHERE `User`='.$_SESSION['UserID']);
     85      $DbResult = $Database->SQLCommand('SELECT COUNT(*) FROM `Export` WHERE `User`='.$User->Id);
    8686      $DbRow = mysql_fetch_row($DbResult);
    8787      if($DbRow[0] < $Config['MaxExportPerUser'])
    8888      {
    89         $Database->SQLCommand('INSERT INTO `Export` (`Title`, `User`, `TimeCreate`, `WithDiacritic`, `Description`) VALUES ("'.$_POST['Title'].'", '.$_SESSION['UserID'].', NOW(), 1, "'.$_POST['Description'].'")');
     89        $Database->SQLCommand('INSERT INTO `Export` (`Title`, `User`, `TimeCreate`, `WithDiacritic`, `Description`) VALUES ("'.$_POST['Title'].'", '.$User->Id.', NOW(), 1, "'.$_POST['Description'].'")');
    9090        $ExportId = mysql_insert_id();
    9191        echo('Nový export vytvořen.<br/>Přímý odkaz na tento export: <a href="?Action=View&amp;ExportId='.$ExportId.'">zde</a><br/><br/>');
     
    100100function ExportDelete()
    101101{
    102   global $Database;
    103  
    104   if(Licence(LICENCE_USER))
     102  global $Database, $User;
     103 
     104  if($User->Licence(LICENCE_USER))
    105105  {   
    106106    if(array_key_exists('ExportId', $_GET))
    107107    {
    108       $DbResult = $Database->SQLCommand('SELECT * FROM Export WHERE Id='.$_GET['ExportId'].' AND User='.$_SESSION['UserID']);
     108      $DbResult = $Database->SQLCommand('SELECT * FROM `Export` WHERE `Id`='.$_GET['ExportId'].' AND `User`='.$User->Id);
    109109      if(mysql_num_rows($DbResult) > 0)
    110110      {
    111         $Database->SQLCommand('DELETE FROM Export WHERE Id='.$_GET['ExportId']);
     111        $Database->SQLCommand('DELETE FROM `Export` WHERE `Id`='.$_GET['ExportId']);
    112112        DeleteDirectory('../tmp/Export/'.$_GET['ExportId'].'/');
    113113        echo('Export smazán.<br/><br/>');
     
    122122function ExportViewTranslators()
    123123{
    124   global $Database, $TranslationTree, $Config;
     124  global $Database, $TranslationTree, $Config, $User;
    125125
    126126  $DisabledInput = array(false => ' disabled="disabled"', true => '');
     
    131131    {   
    132132      $Export = mysql_fetch_assoc($DbRows);
    133       if(Licence(LICENCE_USER) and ($_SESSION['UserID'] == $Export['User'])) $Editable = true;
     133      if($User->Licence(LICENCE_USER) and ($User->Id == $Export['User'])) $Editable = true;
    134134        else $Editable = false;
    135135       
     
    204204  $Database->SQLCommand('SET @I = 0');
    205205  $DbResult = $Database->SQLCommand($Query);
    206   while($User = mysql_fetch_assoc($DbResult))
    207   {
    208     $Checked = $User['Sequence'] != '';
    209     $Selection = CheckBox('sel'.$User['ID'], $Checked, '', 'CheckBox', !$Editable);
    210     $Sequence = '<input type="text" name="seq'.$User['ID'].'" style="text-align: center; width: 40px;" value="'.$User['Sequence2'].'"'.$DisabledInput[$Editable].'/>';
     206  while($UserLine = mysql_fetch_assoc($DbResult))
     207  {
     208    $Checked = $UserLine['Sequence'] != '';
     209    $Selection = CheckBox('sel'.$UserLine['ID'], $Checked, '', 'CheckBox', !$Editable);
     210    $Sequence = '<input type="text" name="seq'.$UserLine['ID'].'" style="text-align: center; width: 40px;" value="'.$UserLine['Sequence2'].'"'.$DisabledInput[$Editable].'/>';
    211211    echo('<tr>
    212     <td><a href="'.$Config['Web']['BaseURL'].'/TranslationList.php?user='.$User['ID'].'&amp;action=userall" title="Zobrazit všechny jeho přeložené texty">'.$User['Name'].'</a></td>
    213     <td>'.$User['TranslatedCount'].'</td>
    214       <td><img src="'.$Config['Web']['TempFolder'].'/user/'.$User['Name'].'/level.png" alt="Úroveň uživatele" /></td>
     212    <td><a href="'.$Config['Web']['BaseURL'].'/TranslationList.php?user='.$UserLine['ID'].'&amp;action=userall" title="Zobrazit všechny jeho přeložené texty">'.$UserLine['Name'].'</a></td>
     213    <td>'.$UserLine['TranslatedCount'].'</td>
     214      <td><img src="'.$Config['Web']['TempFolder'].'/user/'.$UserLine['Name'].'/level.png" alt="Úroveň uživatele" /></td>
    215215    <td>'.$Selection.'</td><td>'.$Sequence.'</td></tr>');
    216216  }
     
    224224function ExportViewGeneral()
    225225{
    226   global $Database;
     226  global $Database, $User;
    227227 
    228228  $DisabledInput = array(false => ' disabled="disabled"', true => '');
     
    235235    {   
    236236      $Export = mysql_fetch_assoc($DbRows);
    237       if(Licence(LICENCE_USER) and ($_SESSION['UserID'] == $Export['User'])) $Editable = true;
     237      if($User->Licence(LICENCE_USER) and ($User->Id == $Export['User'])) $Editable = true;
    238238        else $Editable = false;
    239239      if($Editable and array_key_exists('Title', $_POST) and array_key_exists('Description', $_POST))
     
    264264function ExportViewLanguages()
    265265{
    266   global $Database, $TranslationTree, $Config;
     266  global $Database, $TranslationTree, $Config, $User;
    267267
    268268  $DisabledInput = array(false => ' disabled="disabled"', true => '');
     
    273273    {   
    274274      $Export = mysql_fetch_assoc($DbRows);
    275       if(Licence(LICENCE_USER) and ($_SESSION['UserID'] == $Export['User'])) $Editable = true;
     275      if($User->Licence(LICENCE_USER) and ($User->Id == $Export['User'])) $Editable = true;
    276276        else $Editable = false;
    277277       
     
    357357function ExportViewGroups()
    358358{
    359   global $Database, $TranslationTree, $Config;
     359  global $Database, $TranslationTree, $Config, $User;
    360360
    361361  $DisabledInput = array(false => ' disabled="disabled"', true => '');
     
    366366    {   
    367367      $Export = mysql_fetch_assoc($DbRows);
    368       if(Licence(LICENCE_USER) and ($_SESSION['UserID'] == $Export['User'])) $Editable = true;
     368      if($User->Licence(LICENCE_USER) and ($User->Id == $Export['User'])) $Editable = true;
    369369        else $Editable = false;
    370370       
     
    446446function ExportViewOutputFormat()
    447447{
    448   global $Database;
     448  global $Database, $User;
    449449 
    450450  $DisabledInput = array(false => ' disabled="disabled"', true => '');
     
    455455    {   
    456456      $Export = mysql_fetch_assoc($DbRows);
    457       if(Licence(LICENCE_USER) and ($_SESSION['UserID'] == $Export['User'])) $Editable = true;
     457      if($User->Licence(LICENCE_USER) and ($User->Id == $Export['User'])) $Editable = true;
    458458        else $Editable = false;
    459459 
     
    485485function ExportViewVersion()
    486486{
    487   global $Database, $Config;
     487  global $Database, $Config, $User;
    488488
    489489  $DisabledInput = array(false => ' disabled="disabled"', true => '');
     
    494494    {   
    495495      $Export = mysql_fetch_assoc($DbRows);
    496       if(Licence(LICENCE_USER) and ($_SESSION['UserID'] == $Export['User'])) $Editable = true;
     496      if($User->Licence(LICENCE_USER) and ($User->Id == $Export['User'])) $Editable = true;
    497497        else $Editable = false;
    498498       
     
    572572  $Export = mysql_fetch_assoc($DbResult);
    573573  $DbResult = $Database->SQLCommand('SELECT * FROM `User` WHERE `ID`='.$Export['User']);
    574   $User = mysql_fetch_assoc($DbResult);
    575   echo('Export <strong><a href="?Action=View&amp;Tab=6&amp;ExportId='.$Export['Id'].'">'.$_GET['ExportId'].'</a></strong> překladatele <strong>'.$User['Name'].'</strong> s označením <strong>'.$Export['Title'].'</strong>');
     574  $UserLine = mysql_fetch_assoc($DbResult);
     575  echo('Export <strong><a href="?Action=View&amp;Tab=6&amp;ExportId='.$Export['Id'].'">'.$_GET['ExportId'].'</a></strong> překladatele <strong>'.$UserLine['Name'].'</strong> s označením <strong>'.$Export['Title'].'</strong>');
    576576  ShowTabs(array('Obecné', 'Překladatelé', 'Překlady', 'Jazyky', 'Formát', 'Verze', 'Výstup'));
    577577  echo('<div id="content">');
  • trunk/form.php

    r365 r376  
    2121  if(!$Line) die('Anglický originál k překladu nenalezen.');
    2222 
    23   $User = @$_SESSION['User'];
    2423  $IDUser = $Database->SQLCommand('SELECT * FROM `User` WHERE `ID` = '.$Line['User']);
    2524  $LineUser = mysql_fetch_array($IDUser);
     
    7776//    Speciální znaky: $B - Odřádkování, $N - Jméno, $C - povolání
    7877  echo('<form action="save.php?group='.$GroupId.'" method="post"><div>');
    79   if(Licence(LICENCE_USER))
     78  if($User->Licence(LICENCE_USER))
    8079  {
    8180    if(($GroupId < 4) or ($GroupId == 10) or ($GroupId == 11)) echo('<a href="dictionary.php?group='.$GroupId.'&amp;ID='.$LineAJ['ID'].'" target="_blank"  title="Zobrazit přeložené názvy věci, postav, a herních objektů k tomuto překladu">Vyhledat v názvech</a>');
     
    9190 
    9291  echo('<input type="hidden" name="entry" value="'.$LineAJ['Entry'].'" />
    93     <input type="hidden" name="user" value="'.$User.'" />
     92    <input type="hidden" name="user" value="'.$User->Id.'" />
    9493    <input type="hidden" name="ID" value="'.$TextID.'" />
    9594    <table class="BaseTable">
     
    105104          Přeloženo do:');
    106105  if($Line['Language'] <> 0) $Language = $Line['Language'];
    107   else if($_SESSION['UserID'] != '')
     106  else if($User->Id != 0)
    108107  {
    109     $IDUser = $Database->SQLCommand('SELECT * FROM `User` WHERE `ID` = '.$_SESSION['UserID']);
    110     $LineUser = mysql_fetch_array($IDUser);
    111     $Language = $LineUser['Language'];  // jiný user vyčítám
     108    $Language = $User->Language;
    112109  } else $Language = 0;
    113110  WriteLanguages($Language);
  • trunk/includes/config.sample.php

    r319 r376  
    1414  'Style' => 'maron',
    1515  'Web' => array(
     16    'Title' => 'Projekt překládání textů WoW',
    1617    'Charset' => 'utf-8',
    1718    'BaseURL' => 'http://localhost/',
     
    2324    'ItemsPerPage' => 40,
    2425    'TempFolder' => '../tmp/',
    25     'GameVersion' => '3.0.3',
     26    'GameVersion' => '3.3.2',
    2627    'VisiblePagingItems' => 20,
    2728  ),
  • trunk/includes/global.php

    r365 r376  
    1414foreach($_GET as $Index => $Item) $_GET[$Index] = addslashes($_GET[$Index]);
    1515
    16 include_once('config.php');
    17 include_once('error.php');
    18 include_once('databaseconection.php');
    19 include_once('global_function.php');
    20 include_once('rss.php');
    21 include_once('system.php');
     16include_once(dirname(__FILE__).'/config.php');
     17include_once(dirname(__FILE__).'/error.php');
     18include_once(dirname(__FILE__).'/databaseconection.php');
     19include_once(dirname(__FILE__).'/global_function.php');
     20include_once(dirname(__FILE__).'/rss.php');
     21include_once(dirname(__FILE__).'/system.php');
     22include_once(dirname(__FILE__).'/user.php');
    2223
    2324$Database = new Database($Config['Database']['Host'], $Config['Database']['User'], $Config['Database']['Password']);
     
    3031$System = new System();
    3132$System->Init();
     33$User = new User();
     34$User->Restore();
    3235
    3336function GetMicrotime()
     
    3942function ShowShoutbox()
    4043{
    41   global $Database, $Config;
     44  global $Database, $Config, $User;
    4245 
    4346  echo('<strong><a href="'.$Config['Web']['BaseURL'].'action.php?action=ShoutBoxView">Kecátko:</a></strong>');
    44   if(Licence(LICENCE_USER)) echo(' <a href="'.$Config['Web']['BaseURL'].'action.php?action=shoutbox">Vložit</a>');
     47  if($User->Licence(LICENCE_USER))
     48    echo(' <a href="'.$Config['Web']['BaseURL'].'action.php?action=shoutbox">Vložit</a>');
    4549  echo('<div class="box"><table>');
    4650  $ID = $Database->SQLCommand('SELECT * FROM `ShoutBox` ORDER BY `ID` DESC LIMIT 20');
     
    5256function ShowTopBar()
    5357{
    54   global $Config, $Database;
     58  global $Config, $Database, $User;
    5559 
    5660  echo('<div class="Menu">');
    57     echo('<span class="MenuItem"></span>');
    58   if(Licence(LICENCE_USER))
    59   {
    60     $DbResult = $Database->SQLCommand('SELECT `Team`, `Name` FROM `User` WHERE ID='.$_SESSION['UserID']);
    61     $User = mysql_fetch_assoc($DbResult);
    62     $DbResult = $Database->SQLCommand('SELECT `Id`, `Name` FROM `Team` WHERE Id='.$User['Team']);
     61  echo('<span class="MenuItem"></span>');
     62  if($User->Licence(LICENCE_USER))
     63  {
     64    $DbResult = $Database->SQLCommand('SELECT `Id`, `Name` FROM `Team` WHERE `Id`='.$User->Team);
    6365    $Team = mysql_fetch_assoc($DbResult);
    6466
    6567    //echo('<span class="MenuItem">Moje překlady: <a href="">Dokončené</a> <a href="">Rozpracované</a> <a href="">Exporty</a> Tým: <a href="">'.$Team['name'].'</a></span>');
    66     echo('<span class="MenuItem2">'.$User['Name'].' <a href="'.$Config['Web']['BaseURL'].'?Logout">Odhlášení</a> <a href="'.$Config['Web']['BaseURL'].'Options.php">Nastavení</a></span>');
     68    echo('<span class="MenuItem2">'.$User->Name.' <a href="'.$Config['Web']['BaseURL'].'?action=logout">Odhlášení</a> <a href="'.$Config['Web']['BaseURL'].'Options.php">Nastavení</a></span>');
    6769  } else
    6870  {
    69     echo('<span class="MenuItem2"><form action="?" method="post"> Jméno: <input type="text" name="LoginUser" size="8 " /> Heslo: <td><input type="password" name="LoginPass" size="8" /> <input type="submit" value="Přihlásit" /></form> &nbsp; <a href="'.$Config['Web']['BaseURL'].'registrace.php">Registrace</a></span>');
     71    echo('<span class="MenuItem2"><form action="?action=login" method="post"> Jméno: <input type="text" name="LoginUser" size="8 " /> Heslo: <td><input type="password" name="LoginPass" size="8" /> <input type="submit" value="Přihlásit" /></form> &nbsp; <a href="'.$Config['Web']['BaseURL'].'registrace.php">Registrace</a></span>');
    7072  }
    7173  echo('</div>');
     
    7476function ShowLoginBox()
    7577{
    76   if(Licence(LICENCE_USER))
    77   {
    78      // echo 'Jste přihlášen jako: <b>'.$_SESSION['User'].'</b> <a href="index.php?Logout">Odhlásit</a>';
     78  global $User;
     79 
     80  if($User->Licence(LICENCE_USER))
     81  {
     82     // echo 'Jste přihlášen jako: <b>'.$User->Id.'</b> <a href="index.php?Logout">Odhlásit</a>';
    7983  } else
    8084  {
     
    116120function ShowMainMenu()
    117121{
    118   global $TranslationTree, $Config;
     122  global $TranslationTree, $Config, $User;
    119123 
    120124  $Menu = array
     
    140144 
    141145  echo('<strong>Hlavní menu:</strong>'.
    142     '<div class="verticalmenu"><ul>');
    143 
     146    '<div class="verticalmenu"><ul>');
    144147  foreach($Menu as $MenuTarget => $MenuItem)
    145148  {
    146   if(isset($MenuItem[3])) $OnClick = ' onclick="'.$MenuItem[3].'"'; else $OnClick = '';
    147   if(Licence($MenuItem[0])) echo('<li><a class="verticalmenua" title="'.$MenuItem[1].'" href="'.$MenuTarget.'"'.$OnClick.'>'.$MenuItem[2].'</a></li>');
     149    if(isset($MenuItem[3])) $OnClick = ' onclick="'.$MenuItem[3].'"';
     150      else $OnClick = '';
     151    if($User->Licence($MenuItem[0])) echo('<li><a class="verticalmenua" title="'.$MenuItem[1].'" href="'.$MenuTarget.'"'.$OnClick.'>'.$MenuItem[2].'</a></li>');
    148152  }   
    149153  echo('</ul></div>');
     
    152156function ShowTranslatedMenu()
    153157{
    154   global $TranslationTree, $Config, $Database;
     158  global $TranslationTree, $Config, $Database, $User;
    155159
    156160  echo('<strong>Překladové skupiny:</strong><br /><div id="TranslationMenu">');
    157   if(Licence(LICENCE_USER))
    158   {
    159     echo ('<a title="Všechny překlady, které jste přeložil" href="'.$Config['Web']['BaseURL'].'TranslationList.php?user='.$_SESSION['UserID'].'&amp;action=userall">Všechny moje texty</a><br />');
    160     echo ('<a title="Všechny překlady, které jste rozepsal a nedokončil" href="'.$Config['Web']['BaseURL'].'TranslationList.php?user='.$_SESSION['UserID'].'&amp;not&amp;action=userall">Rozpracované texty</a>');
     161  if($User->Licence(LICENCE_USER))
     162  {
     163    echo('<a title="Všechny překlady, které jste přeložil" href="'.$Config['Web']['BaseURL'].'TranslationList.php?user='.$User->Id.'&amp;action=userall">Všechny moje texty</a><br />');
     164    echo('<a title="Všechny překlady, které jste rozepsal a nedokončil" href="'.$Config['Web']['BaseURL'].'TranslationList.php?user='.$User->Id.'&amp;not&amp;action=userall">Rozpracované texty</a>');
    161165    //TODO: počet nedokončených 
    162     echo ('<br /><br />');
     166    echo('<br /><br />');
    163167  }
    164168  foreach($TranslationTree as $Group)
     
    169173    echo('&nbsp;<a title="Zde můžete začít překládat" href="'.$Config['Web']['BaseURL'].'TranslationList.php?group='.$Group['Id'].'&amp;action=notran">Nepřeložené</a><br />
    170174      &nbsp;<a title="Přeložené texty, můžete zde hlasovat, nebo opravovat překlady" href="'.$Config['Web']['BaseURL'].'TranslationList.php?group='.$Group['Id'].'&amp;action=Translate">Přeložené</a><br />');
    171   $ID = $Database->SQLCommand('SELECT * FROM connexion WHERE `Group` = '.$Group['Id']);
     175    $ID = $Database->SQLCommand('SELECT * FROM connexion WHERE `Group` = '.$Group['Id']);
    172176    if (mysql_num_rows($ID) > 0) 
    173177    echo('&nbsp;<a title="Vypsání souvislostí" href="'.$Config['Web']['BaseURL'].'TranslationList.php?group='.$Group['Id'].'&amp;action=connexion_list">Souvislosti</a><br />');
    174178 
    175   if(Licence(LICENCE_USER))
     179    if($User->Licence(LICENCE_USER))
    176180    {
    177181      echo('&nbsp;<a title="Nedokončené překlady" href="'.$Config['Web']['BaseURL'].'TranslationList.php?group='.$Group['Id'].'&amp;action=mydevelop">Rozepsané</a><br />
     
    186190function ShowOnlineUserList()
    187191{
    188   global $Database, $Moderators;
     192  global $Database, $Moderators, $User;
    189193 
    190194  echo('Online překladatelé:<br />');
    191195  $ID = $Database->SQLCommand('SELECT `Name`, `GM`, `ID` FROM `User` WHERE `LastLogin` >= NOW() - 300 AND ((`LastLogout` < `LastLogin`) OR (ISNULL(`LastLogout`)))');
    192   while($User = mysql_fetch_assoc($ID))
    193   {
    194     if(Licence(LICENCE_MODERATOR)) $Name = '<a href="user.php?user='.$User['ID'].'">'.$User['Name'].'</a>';
    195     else $Name = $User['Name'];
     196  while($DbUser = mysql_fetch_assoc($ID))
     197  {
     198    if($User->Licence(LICENCE_MODERATOR)) $Name = '<a href="user.php?user='.$DbUser['ID'].'">'.$DbUser['Name'].'</a>';
     199    else $Name = $DbUser['Name'];
    196200    $TextGM = '';
    197201    echo('<strong>'.$Name.'</strong>'.$TextGM.'<br />');
     
    199203}
    200204
    201 function CheckLogin()
    202 {
    203   global $Database;
    204  
    205   if(!array_key_exists('UserID', $_SESSION)) $_SESSION['UserID'] = '';
    206   if(!array_key_exists('User', $_SESSION)) $_SESSION['User'] = 'NotRegistred';
    207   if(!array_key_exists('Pass', $_SESSION)) $_SESSION['Pass'] = '';
    208 
    209   // Přihlášení
    210   if(array_key_exists('LoginUser', $_POST))
    211   {
    212     $_SESSION['User'] = $_POST['LoginUser'];
    213     $_SESSION['Pass'] = $_POST['LoginPass'];
    214 
    215     $DbResult = $Database->SQLCommand('SELECT * FROM `User` WHERE LOWER(`Name`) = LOWER("'.$_SESSION['User'].'") AND `Pass` = sha1(CONCAT(sha1("'.$_SESSION['Pass'].'"), `Salt`))');
    216     if(mysql_num_rows($DbResult) == 0)
    217     {
    218        echo('<script> alert("Jméno nebo heslo bylo zadáno špatně!"); </script>');
    219        $_SESSION['UserID'] = '';
    220        $_SESSION['User'] = '';
    221        $_SESSION['Pass'] = '';
    222     } else
    223     {
    224       $User = mysql_fetch_assoc($DbResult);
    225       $_SESSION['UserID'] = $User['ID'];
    226       $_SESSION['User'] = $User['Name'];
    227       WriteLog('Login: '.$_SESSION['User'], LOG_TYPE_USER);
    228     }
    229   }
    230 
    231   // Odhlášení
    232   if(array_key_exists('Logout', $_GET) and ($_SESSION['User'] != '')) 
    233   {
    234     WriteLog('Odhlášení', LOG_TYPE_USER);
    235     if(is_numeric($_SESSION['UserID']))
    236       $Database->SQLCommand('UPDATE `User` SET `LastLogout` = NOW() WHERE `ID` = '.$_SESSION['UserID']);
    237     $_SESSION['User'] = '';
    238     $_SESSION['Pass'] = '';
    239     $_SESSION['UserID'] = '';
    240   }
    241 
    242   // Záznam o aktivitě
    243   if(Licence(LICENCE_USER) and array_key_exists('REMOTE_ADDR', $_SERVER))
    244     $Database->SQLCommand('UPDATE `User` SET `LastIP` = "'.$_SERVER['REMOTE_ADDR'].'", `LastLogin` = NOW() WHERE `ID` = '.$_SESSION['UserID']);
    245 }
    246 
    247205function ShowPage()
    248206{
    249   global $Config, $Database, $RSSChannels, $PageFooterRequested; 
     207  global $User, $Config, $Database, $RSSChannels, $PageFooterRequested; 
    250208 
    251209  echo('<?xml version="1.0" encoding="'.$Config['Web']['Charset'].'"?>
     
    263221  foreach($RSSChannels as $Channel)
    264222    echo(' <link rel="alternate" title="'.$Channel['Title'].'" href="'.$Channel['URL'].'" type="application/rss+xml" />');
    265   echo('<title>Projekt překládání textů WoW</title>
     223  echo('<title>'.$Config['Web']['Title'].'</title>
    266224</head>
    267225<body>
    268226<table id="bannertable"><tr>
    269227  <td id="banner1"></td>
    270   <td id="banner"><div id="bannertitle">Projekt překládání textů WoW</div></td>
     228  <td id="banner"><div id="bannertitle">'.$Config['Web']['Title'].'</div></td>
    271229  <td id="banner2"></td></tr>
    272230</table>');
    273231
    274   CheckLogin();
     232  if(array_key_exists('action', $_GET))
     233  {
     234    if($_GET['action'] == 'login')
     235    {
     236      $User->Login($_POST['LoginUser'], $_POST['LoginPass']);
     237      if($User->Role == LICENCE_ANONYMOUS) echo('<script> alert("Jméno nebo heslo bylo zadáno špatně!"); </script>'); 
     238    } else
     239    if($_GET['action'] == 'logout')
     240    {
     241      if($User->Role != LICENCE_ANONYMOUS)
     242      {
     243        $User->Logout();
     244        WriteLog('Odhlášení', LOG_TYPE_USER);
     245      }
     246    }
     247  }
    275248  ShowTopBar();
    276249
    277250  echo('<table class="page"><tr><td class="menu">');
    278251  ShowMainMenu();
    279      
    280   // echo('<br />');   
    281   //ShowLoginBox();
    282   //echo('<br />');
    283252  ShowOnlineUserList();
    284253  echo('<br />');
     
    305274function ShowFooter()
    306275{
    307   global $Database, $Config, $ScriptStartTime, $PageFooterRequested;
     276  global $Database, $Config, $ScriptStartTime, $PageFooterRequested, $User;
    308277
    309278  if(isset($PageFooterRequested))
     
    333302      '</html>');
    334303    $Database->Disconnect();
     304    $User->Store();
    335305  }
    336306}
  • trunk/includes/global_function.php

    r369 r376  
    11<?php
    2 
    3 // User licence levels
    4 define('LICENCE_ANONYMOUS', -1);
    5 define('LICENCE_USER', 0);
    6 define('LICENCE_MODERATOR', 1);
    7 define('LICENCE_ADMIN', 2);
    82
    93// Log types
     
    213207}
    214208
    215 function Licence($Licence)
    216 {
    217   global $Database;
    218  
    219   if($Licence == -1) return(true);
    220   else
    221   if(isset($_SESSION['User']) and ($_SESSION['User'] <> '') and ($_SESSION['UserID'] != ''))
    222   {
    223     // $User = $_SESSION['User'];
    224     $Pass = $_SESSION['Pass'];
    225     $Line = mysql_fetch_array($Database->SQLCommand('SELECT * FROM `User` WHERE `ID` = '.$_SESSION['UserID'].' AND `GM` >= '.$Licence.' AND `Pass` = sha1(CONCAT(sha1("'.$Pass.'"), `Salt`))'));
    226     return($Line);
    227   } else
    228   {
    229     return(!isset($_SERVER['REMOTE_ADDR']));   
    230   }
    231 }
    232 
    233209function MysqlDateTimeToTime($Time)
    234210{
     
    274250function WriteLog($Text, $Type)
    275251{
    276   global $Database, $Config;
     252  global $Database, $Config, $User;
    277253 
    278   if(!isset($_SERVER['REMOTE_ADDR']))
    279   {
    280     $user = 0;
    281     $ip = 'Konzole';
    282   } else
    283   {
    284     if(array_key_exists('UserID', $_SESSION)) $user = $_SESSION['UserID'];
    285       else $user = 0;
    286     $ip = addslashes($_SERVER['REMOTE_ADDR']);
    287   }
     254  if(!isset($_SERVER['REMOTE_ADDR'])) $IP = 'Konzole';
     255    else $IP = addslashes($_SERVER['REMOTE_ADDR']);
    288256
    289257  $Database->SelectDatabase($Config['Database']['Database']);   
    290258  $Query = 'INSERT INTO `Log` ( `User` , `Type` , `Text` , `Date` , `IP` )
    291    VALUES ('.$user.', '.$Type.', "'.addslashes($Text).'", NOW(), "'.$ip.'")';
     259   VALUES ('.$User->Id.', '.$Type.', "'.addslashes($Text).'", NOW(), "'.$IP.'")';
    292260  $Database->SQLCommand($Query);
    293261}
     
    535503}
    536504
    537 function GetPasswordSalt()
    538 {
    539   return(substr(sha1(mt_rand()), 0, 8));
    540 }
    541 
    542505function ErrorMessage($Text)
    543506{
  • trunk/log.php

    r365 r376  
    4545  ShowPage();
    4646 
    47   if(Licence(LICENCE_MODERATOR))
     47  if($User->Licence(LICENCE_MODERATOR))
    4848  {
    4949    echo('<strong>Filtr: </strong>');
  • trunk/registrace.php

    r365 r376  
    22
    33include('includes/global.php');
    4 
    5 ShowPage();
    6  
     4 
    75if(array_key_exists('user', $_POST))
    86{
     
    1412  $Language = $_POST['Language'];
    1513 
    16   if($User == '') die('Nelze použít prázdné jméno');
    17   if($User == 'Addon') die('To jméno uživatele nemůžete použít');
     14  if($UserName != '')
     15  {
     16    if($UserName != 'Addon')
     17    {
    1818
    1919  if($Pass == $Pass2)
    2020  {
    21     $Line = mysql_fetch_row($Database->SQLCommand('SELECT * FROM `User` WHERE `User` = "'.$User.'"'));
     21    $Line = mysql_fetch_row($Database->SQLCommand('SELECT * FROM `User` WHERE `Name` = "'.$UserName.'"'));
    2222    if(!$Line)
    2323    {
    24       $Address = $_SERVER['REMOTE_ADDR'];
    25       $Salt = GetPasswordSalt();
     24      $Salt = $User->GetPasswordSalt();
    2625      $Database->SQLCommand('INSERT INTO `User` (`Name` , `Pass` , `Salt`, `LastIP` , `LastLogin` , `Email` , `Language` , `Team` , `NeedUpdate`, `RegistrationTime` )
    27       VALUES ("'.$UserName.'", sha1(CONCAT(sha1("'.$Pass.'"), "'.$Salt.'")), "'.$Salt.'", "'.$Address.'", NOW(), "'.$Email.'", '.$Language.', '.$Team.', 1, NOW())');
    28       echo('Registrace proběhla úspěšně.<br />');
    29      
    30       $_SESSION['User'] = $UserName;
    31       $_SESSION['Pass'] = $Pass;
    32    
    33       $Line = mysql_fetch_array($Database->SQLCommand('SELECT `ID` FROM `User` WHERE `Name` = "'.$_SESSION['User'].'"'));
    34       $_SESSION['UserID'] = $Line['ID'];
    35       WriteLog('Uživatel se zaregistroval: '.$User, LOG_TYPE_USER);
    36      
    37  // echo $Database->id_connection;
    38     } else echo('Uživatel s touto přezdívkou již existuje. <a href="?">Zpět</a>');
    39   } else echo('Hesla se neshodují. <a href="?">Zpět</a>');
     26      VALUES ("'.$UserName.'", '.$User->CryptPasswordSQL('"'.$Pass.'"', '"'.$Salt.'"').', "'.$Salt.'", "'.$_SERVER['REMOTE_ADDR'].'", NOW(), "'.$Email.'", '.$Language.', '.$Team.', 1, NOW())');
     27      $Message = 'Registrace proběhla úspěšně.<br />';
     28      $User->Login($UserName, $Pass);
     29      WriteLog('Uživatel se zaregistroval: '.$UserName, LOG_TYPE_USER);     
     30    } else $Message = 'Uživatel se zadanou přezdívkou již existuje. <a href="?">Zpět</a>';
     31  } else $Message = 'Hesla se neshodují. <a href="?">Zpět</a>';
     32    } else $Message = 'To jméno uživatele nemůžete použít';
     33  } else $Message = 'Nelze použít prázdné jméno';
     34  ShowPage();
     35  echo($Message);
     36  ShowFooter();     
    4037} else
    4138{
     39  ShowPage();
    4240  echo('<form action="?" method="post">
    4341  <fieldset><legend>Registrace nového uživatele</legend>
  • trunk/save.php

    r373 r376  
    66
    77// Ochrana proti neoprávněnému přístupu
    8 //if(Licence(LICENCE_USER) == false) die('Nemáte přístup do této sekce! Je nutné se přihásit.');
     8// if($User->Licence(LICENCE_USER) == false) die('Nemáte přístup do této sekce! Je nutné se přihásit.');
    99
    1010$GroupId = LoadGroupIdParameter();
    1111$Table = $TranslationTree[$GroupId]['TablePrefix'];
    12 if(array_key_exists('entry', $_POST) and Licence(LICENCE_USER))
     12if(array_key_exists('entry', $_POST) and $User->Licence(LICENCE_USER))
    1313{
    14   $entry = $_POST['entry'] * 1; // Make numeric 
    15   $UserID = $_SESSION['UserID'];
     14  $Entry = $_POST['entry'] * 1; // Make numeric 
    1615  $TextID = $_POST['ID'] * 1;
    1716  $Language = $_POST['Language'] * 1;
    18   if(array_key_exists('End', $_POST)) $complete = 1;
     17  if(array_key_exists('End', $_POST)) $Complete = 1;
    1918    else $complete = 0;
    2019             
    21   $DbResult = $Database->SQLCommand('SELECT * FROM `'.$Table.'` WHERE (`Language` = 0) AND (`Entry` = '.$entry.')');
     20  $DbResult = $Database->SQLCommand('SELECT * FROM `'.$Table.'` WHERE (`Language` = 0) AND (`Entry` = '.$Entry.')');
    2221  if(mysql_num_rows($DbResult) == 0) ErrorMessage('Neznámé Id položky');
    2322  $LineAJ = mysql_fetch_array($DbResult);
    2423  $LineTake = mysql_fetch_array($Database->SQLCommand('SELECT `VersionEnd`, `VersionStart` FROM `'.$Table.'` WHERE `ID` = '.$TextID));
    2524  if(mysql_num_rows($DbResult) == 0) ErrorMessage('Neznámé Id položky');
    26   $DbResult = $Database->SQLCommand('SELECT * FROM `'.$Table.'` WHERE (`User`='.$UserID.') AND (`Entry` = '.$entry.') AND (`VersionStart` = '.$LineTake['VersionStart'].') AND (`VersionEnd` = '.$LineTake['VersionEnd'].')');
     25  $DbResult = $Database->SQLCommand('SELECT * FROM `'.$Table.'` WHERE (`User`='.$User->Id.') AND (`Entry` = '.$Entry.') AND (`VersionStart` = '.$LineTake['VersionStart'].') AND (`VersionEnd` = '.$LineTake['VersionEnd'].')');
    2726  $Line = mysql_fetch_array($DbResult);
    2827  if(!$Line)
    2928  {
    3029    $Columns = '`Language` , `User` , `Complete` , `Take` , `VersionStart` , `VersionEnd`';
    31     $Values = $Language.','.$UserID.','.$complete.','.$TextID.','.$LineTake['VersionStart'].','.$LineTake['VersionEnd'];
     30    $Values = $Language.','.$User->Id.','.$Complete.','.$TextID.','.$LineTake['VersionStart'].','.$LineTake['VersionEnd'];
    3231    foreach($TranslationTree[$GroupId]['Items'] as $GroupItem)
    3332    {
     
    4241    } 
    4342    //echo('INSERT INTO `'.$Table.'` ('.$Columns.') VALUES ('.$Values.')');
    44     //  $Database->SQLCommand('INSERT INTO `'.$Table.'` (`entry`, '.$Columns.') VALUES ('.$entry.','.$Values.')');
     43    //  $Database->SQLCommand('INSERT INTO `'.$Table.'` (`Entry`, '.$Columns.') VALUES ('.$Entry.','.$Values.')');
    4544    //  $LastID = mysql_insert_id();
    4645
     
    6968    while($SameTranLine = mysql_fetch_assoc($SameTranID))
    7069    {
    71       $Line = mysql_fetch_array($Database->SQLCommand('SELECT * FROM `'.$Table.'` WHERE (`User`='.$UserID.') AND (`Entry` = '.$SameTranLine['Entry'].') AND (`VersionStart` = '.$LineTake['VersionStart'].') AND (`VersionEnd` = '.$LineTake['VersionEnd'].')'));
     70      $Line = mysql_fetch_array($Database->SQLCommand('SELECT * FROM `'.$Table.'` WHERE (`User`='.$User->Id.') AND (`Entry` = '.$SameTranLine['Entry'].') AND (`VersionStart` = '.$LineTake['VersionStart'].') AND (`VersionEnd` = '.$LineTake['VersionEnd'].')'));
    7271      if(!$Line)
    7372      {
     
    9493    // Konec kontrolování stejných textů   
    9594       
    96     echo('Překlad <a href="form.php?group='.$GroupId.'&amp;ID='.$TextID.'">'.$TextID.'</a> ('.$entry.') uložen!<br />');
     95    echo('Překlad <a href="form.php?group='.$GroupId.'&amp;ID='.$TextID.'">'.$TextID.'</a> ('.$Entry.') uložen!<br />');
    9796    foreach($LastIDs as $LastID)
    9897    {
     
    102101  } else
    103102  {
    104     $sql = 'UPDATE '.$Table.' SET `Complete` = '.$complete;
     103    $sql = 'UPDATE '.$Table.' SET `Complete` = '.$Complete;
    105104    foreach($TranslationTree[$GroupId]['Items'] as $GroupItem)
    106105    if(array_key_exists($GroupItem['Column'], $_POST))
     
    110109    $Database->SQLCommand($sql);
    111110    //  echo $sql.'<br />';     
    112     echo('Změny v překladu <a href="form.php?group='.$GroupId.'&amp;ID='.$TextID.'">'.$TextID.'</a> ('.$entry.') uloženy!<br />');
    113     WriteLog('Změny v překladu <a href="form.php?group='.$GroupId.'&amp;ID='.$TextID.'">'.$TextID.'</a> ('.$entry.') uloženy!', LOG_TYPE_TRANSLATION);
     111    echo('Změny v překladu <a href="form.php?group='.$GroupId.'&amp;ID='.$TextID.'">'.$TextID.'</a> ('.$Entry.') uloženy!<br />');
     112    WriteLog('Změny v překladu <a href="form.php?group='.$GroupId.'&amp;ID='.$TextID.'">'.$TextID.'</a> ('.$Entry.') uloženy!', LOG_TYPE_TRANSLATION);
    114113  }
    115114  // Address and redirecting
     
    119118  $next = FollowingTran($TextID, $Table, $GroupId);
    120119  echo('<br /><br />');
    121   $redirecting = mysql_fetch_assoc($Database->SQLCommand('SELECT `Redirecting` FROM `User` WHERE `ID`='.$UserID));
     120  $redirecting = mysql_fetch_assoc($Database->SQLCommand('SELECT `Redirecting` FROM `User` WHERE `ID`='.$User->Id));
    122121   
    123122  switch($redirecting['Redirecting'])
     
    145144   
    146145  // Aktualizace informace o nutnosti načíst XP
    147   $Database->SQLCommand('UPDATE `User` SET `NeedUpdate` = 1 WHERE `ID` = '.$UserID);
     146  $Database->SQLCommand('UPDATE `User` SET `NeedUpdate` = 1 WHERE `ID` = '.$User->Id);
    148147} else
    149148{
  • trunk/sql/structure.sql

    r351 r376  
    44--
    55-- Počítač: localhost
    6 -- Vygenerováno: Středa 03. března 2010, 12:56
     6-- Vygenerováno: Čtvrtek 11. března 2010, 08:27
    77-- Verze MySQL: 5.1.42
    88-- Verze PHP: 5.3.1
     
    1717
    1818--
    19 -- Struktura tabulky `achievement`
    20 --
    21 
    22 CREATE TABLE IF NOT EXISTS `achievement` (
    23   `ID` int(11) unsigned NOT NULL AUTO_INCREMENT,
    24   `entry` int(11) NOT NULL,
    25   `Language` int(11) NOT NULL DEFAULT '0',
    26   `User` int(11) NOT NULL,
    27   `Complete` int(11) NOT NULL,
    28   `Take` int(11) NOT NULL,
    29   `Name` text NOT NULL,
    30   `Description` text NOT NULL,
    31   `Reward` text NOT NULL,
    32   `VersionStart` int(11) NOT NULL DEFAULT '8606',
    33   `VersionEnd` int(11) NOT NULL DEFAULT '8606',
    34   PRIMARY KEY (`ID`),
    35   KEY `entry` (`entry`),
    36   KEY `User` (`User`),
    37   KEY `Take` (`Take`),
    38   KEY `Language` (`Language`),
    39   KEY `Complete` (`Complete`),
    40   KEY `VersionStart` (`VersionStart`),
    41   KEY `VersionEnd` (`VersionEnd`)
    42 ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=2718 ;
    43 
    44 -- --------------------------------------------------------
    45 
    46 --
    47 -- Struktura tabulky `achievement_category`
    48 --
    49 
    50 CREATE TABLE IF NOT EXISTS `achievement_category` (
    51   `ID` int(11) unsigned NOT NULL AUTO_INCREMENT,
    52   `entry` int(11) NOT NULL,
    53   `Language` int(11) NOT NULL DEFAULT '0',
    54   `User` int(11) NOT NULL,
    55   `Complete` int(11) NOT NULL,
    56   `Take` int(11) NOT NULL,
    57   `Name` text NOT NULL,
    58   `VersionStart` int(11) NOT NULL DEFAULT '8606',
    59   `VersionEnd` int(11) NOT NULL DEFAULT '8606',
    60   PRIMARY KEY (`ID`),
    61   KEY `entry` (`entry`),
    62   KEY `User` (`User`),
    63   KEY `Take` (`Take`),
    64   KEY `Language` (`Language`),
    65   KEY `Complete` (`Complete`),
    66   KEY `VersionStart` (`VersionStart`),
    67   KEY `VersionEnd` (`VersionEnd`)
    68 ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=205 ;
    69 
    70 -- --------------------------------------------------------
    71 
    72 --
    73 -- Struktura tabulky `achievement_criteria`
    74 --
    75 
    76 CREATE TABLE IF NOT EXISTS `achievement_criteria` (
    77   `ID` int(11) unsigned NOT NULL AUTO_INCREMENT,
    78   `entry` int(11) NOT NULL,
    79   `Language` int(11) NOT NULL DEFAULT '0',
    80   `User` int(11) NOT NULL,
    81   `Complete` int(11) NOT NULL,
    82   `Take` int(11) NOT NULL,
    83   `Text` text NOT NULL,
    84   `VersionStart` int(11) NOT NULL DEFAULT '8606',
    85   `VersionEnd` int(11) NOT NULL DEFAULT '8606',
    86   PRIMARY KEY (`ID`),
    87   KEY `entry` (`entry`),
    88   KEY `User` (`User`),
    89   KEY `Take` (`Take`),
    90   KEY `Language` (`Language`),
    91   KEY `Complete` (`Complete`),
    92   KEY `VersionStart` (`VersionStart`),
    93   KEY `VersionEnd` (`VersionEnd`)
    94 ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=10523 ;
    95 
    96 -- --------------------------------------------------------
    97 
    98 --
    99 -- Struktura tabulky `areatrigger_tavern`
    100 --
    101 
    102 CREATE TABLE IF NOT EXISTS `areatrigger_tavern` (
    103   `ID` int(11) unsigned NOT NULL AUTO_INCREMENT,
    104   `entry` int(11) NOT NULL,
    105   `Language` int(11) NOT NULL DEFAULT '0',
    106   `User` int(11) NOT NULL,
    107   `Complete` int(11) NOT NULL,
    108   `Take` int(11) NOT NULL,
    109   `Name` text NOT NULL,
    110   `VersionStart` int(11) NOT NULL DEFAULT '8606',
    111   `VersionEnd` int(11) NOT NULL DEFAULT '8606',
    112   PRIMARY KEY (`ID`),
    113   KEY `entry` (`entry`),
    114   KEY `User` (`User`),
    115   KEY `Take` (`Take`),
    116   KEY `Language` (`Language`),
    117   KEY `Complete` (`Complete`),
    118   KEY `VersionStart` (`VersionStart`),
    119   KEY `VersionEnd` (`VersionEnd`)
    120 ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=210 ;
    121 
    122 -- --------------------------------------------------------
    123 
    124 --
    125 -- Struktura tabulky `areatrigger_teleport`
    126 --
    127 
    128 CREATE TABLE IF NOT EXISTS `areatrigger_teleport` (
    129   `ID` int(11) unsigned NOT NULL AUTO_INCREMENT,
    130   `entry` int(11) NOT NULL,
    131   `Language` int(11) NOT NULL DEFAULT '0',
    132   `User` int(11) NOT NULL,
    133   `Complete` int(11) NOT NULL,
    134   `Take` int(11) NOT NULL,
    135   `Name` text NOT NULL,
    136   `VersionStart` int(11) NOT NULL DEFAULT '8606',
    137   `VersionEnd` int(11) NOT NULL DEFAULT '8606',
    138   PRIMARY KEY (`ID`),
    139   KEY `entry` (`entry`),
    140   KEY `User` (`User`),
    141   KEY `Take` (`Take`),
    142   KEY `Language` (`Language`),
    143   KEY `Complete` (`Complete`),
    144   KEY `VersionStart` (`VersionStart`),
    145   KEY `VersionEnd` (`VersionEnd`)
    146 ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=454 ;
    147 
    148 -- --------------------------------------------------------
    149 
    150 --
    151 -- Struktura tabulky `banner`
    152 --
    153 
    154 CREATE TABLE IF NOT EXISTS `banner` (
     19-- Struktura tabulky `Banner`
     20--
     21
     22CREATE TABLE IF NOT EXISTS `Banner` (
    15523  `DateFirst` datetime NOT NULL,
    15624  `DateLast` datetime NOT NULL,
     
    16634
    16735--
    168 -- Struktura tabulky `connexion`
    169 --
    170 
    171 CREATE TABLE IF NOT EXISTS `connexion` (
    172   `Id` int(11) NOT NULL AUTO_INCREMENT,
    173   `Name` text NOT NULL,
    174   `Group` int(11) NOT NULL,
    175   PRIMARY KEY (`Id`),
    176   KEY `Group` (`Group`)
    177 ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1502 ;
    178 
    179 -- --------------------------------------------------------
    180 
    181 --
    182 -- Struktura tabulky `connexion_item`
    183 --
    184 
    185 CREATE TABLE IF NOT EXISTS `connexion_item` (
    186   `Id` int(11) NOT NULL AUTO_INCREMENT,
    187   `connexion` int(11) NOT NULL,
    188   `entry` int(11) NOT NULL,
    189   PRIMARY KEY (`Id`),
    190   KEY `connexion` (`connexion`,`entry`)
    191 ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=7029 ;
    192 
    193 -- --------------------------------------------------------
    194 
    195 --
    196 -- Struktura tabulky `creature`
    197 --
    198 
    199 CREATE TABLE IF NOT EXISTS `creature` (
    200   `ID` int(11) unsigned NOT NULL AUTO_INCREMENT,
    201   `entry` int(11) NOT NULL,
    202   `name` text NOT NULL,
    203   `subname` text NOT NULL,
    204   `Language` int(11) NOT NULL DEFAULT '0',
    205   `User` int(11) NOT NULL,
    206   `Complete` int(11) NOT NULL,
    207   `Take` int(11) NOT NULL,
    208   `VersionStart` int(11) NOT NULL DEFAULT '8606',
    209   `VersionEnd` int(11) NOT NULL DEFAULT '8606',
    210   PRIMARY KEY (`ID`),
    211   KEY `entry` (`entry`),
    212   KEY `User` (`User`),
    213   KEY `Take` (`Take`),
    214   KEY `Complete` (`Complete`),
    215   KEY `Language` (`Language`),
    216   KEY `VersionStart` (`VersionStart`),
    217   KEY `VersionEnd` (`VersionEnd`)
    218 ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=58460 ;
    219 
    220 -- --------------------------------------------------------
    221 
    222 --
    223 -- Struktura tabulky `dictionary`
    224 --
    225 
    226 CREATE TABLE IF NOT EXISTS `dictionary` (
    227   `ID` int(11) NOT NULL AUTO_INCREMENT,
    228   `Entry` int(11) NOT NULL,
    229   `Text` varchar(255) NOT NULL,
    230   `Language` int(11) NOT NULL,
    231   `Description` text NOT NULL,
    232   `User` int(11) NOT NULL,
    233   PRIMARY KEY (`ID`),
    234   KEY `Language` (`Language`),
    235   KEY `Entry` (`Entry`),
    236   KEY `User` (`User`)
    237 ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=411 ;
    238 
    239 -- --------------------------------------------------------
    240 
    241 --
    242 -- Struktura tabulky `Export`
    243 --
    244 
    245 CREATE TABLE IF NOT EXISTS `Export` (
    246   `Id` int(11) NOT NULL AUTO_INCREMENT,
    247   `User` int(11) NOT NULL,
    248   `TimeCreate` datetime NOT NULL,
    249   `Title` varchar(255) NOT NULL,
    250   `WithDiacritic` tinyint(1) NOT NULL,
    251   `UsedCount` int(11) NOT NULL,
    252   `ClientVersion` int(11) NOT NULL,
    253   `OutputType` int(11) NOT NULL,
    254   `Description` text NOT NULL,
    255   PRIMARY KEY (`Id`),
    256   KEY `User` (`User`),
    257   KEY `TimeCreate` (`TimeCreate`)
    258 ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=55 ;
    259 
    260 -- --------------------------------------------------------
    261 
    262 --
    263 -- Struktura tabulky `ExportGroup`
    264 --
    265 
    266 CREATE TABLE IF NOT EXISTS `ExportGroup` (
    267   `Id` int(11) NOT NULL AUTO_INCREMENT,
    268   `Export` int(11) NOT NULL,
    269   `Group` int(11) NOT NULL,
    270   PRIMARY KEY (`Id`),
    271   KEY `Export` (`Export`)
    272 ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=527 ;
    273 
    274 -- --------------------------------------------------------
    275 
    276 --
    277 -- Struktura tabulky `ExportLanguage`
    278 --
    279 
    280 CREATE TABLE IF NOT EXISTS `ExportLanguage` (
    281   `Id` int(11) NOT NULL AUTO_INCREMENT,
    282   `Export` int(11) NOT NULL,
    283   `Language` int(11) NOT NULL,
    284   `Sequence` int(11) NOT NULL,
    285   PRIMARY KEY (`Id`)
    286 ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=39 ;
    287 
    288 -- --------------------------------------------------------
    289 
    290 --
    291 -- Struktura tabulky `ExportOutputType`
    292 --
    293 
    294 CREATE TABLE IF NOT EXISTS `ExportOutputType` (
    295   `Id` int(11) NOT NULL AUTO_INCREMENT,
    296   `Name` varchar(255) NOT NULL,
    297   PRIMARY KEY (`Id`)
    298 ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=10 ;
    299 
    300 -- --------------------------------------------------------
    301 
    302 --
    303 -- Struktura tabulky `ExportTask`
    304 --
    305 
    306 CREATE TABLE IF NOT EXISTS `ExportTask` (
    307   `Id` int(11) NOT NULL AUTO_INCREMENT,
    308   `TimeStart` datetime NOT NULL,
    309   `TimeFinish` datetime DEFAULT NULL,
    310   `Export` int(11) NOT NULL,
    311   PRIMARY KEY (`Id`),
    312   KEY `Export` (`Export`)
    313 ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=7 ;
    314 
    315 -- --------------------------------------------------------
    316 
    317 --
    318 -- Struktura tabulky `ExportUser`
    319 --
    320 
    321 CREATE TABLE IF NOT EXISTS `ExportUser` (
    322   `Id` int(11) NOT NULL AUTO_INCREMENT,
    323   `Export` int(11) NOT NULL,
    324   `User` int(11) NOT NULL,
    325   `Sequence` int(11) NOT NULL,
    326   PRIMARY KEY (`Id`),
    327   KEY `Export` (`Export`),
    328   KEY `User` (`User`)
    329 ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=3926 ;
    330 
    331 -- --------------------------------------------------------
    332 
    333 --
    334 -- Struktura tabulky `ExportVersion`
    335 --
    336 
    337 CREATE TABLE IF NOT EXISTS `ExportVersion` (
    338   `Id` int(11) NOT NULL AUTO_INCREMENT,
    339   `ExportType` int(11) NOT NULL,
    340   `ClientVersion` int(11) NOT NULL,
    341   PRIMARY KEY (`Id`),
    342   KEY `ExportType` (`ExportType`),
    343   KEY `ClientVersion` (`ClientVersion`)
    344 ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=50 ;
    345 
    346 -- --------------------------------------------------------
    347 
    348 --
    349 -- Struktura tabulky `gameobject`
    350 --
    351 
    352 CREATE TABLE IF NOT EXISTS `gameobject` (
    353   `ID` int(11) unsigned NOT NULL AUTO_INCREMENT,
    354   `entry` int(11) NOT NULL,
    355   `Name` text NOT NULL,
    356   `castbarcaption` text NOT NULL,
    357   `Language` int(11) NOT NULL DEFAULT '0',
    358   `User` int(11) NOT NULL,
    359   `Complete` int(11) NOT NULL,
    360   `Take` int(11) NOT NULL,
    361   `VersionStart` int(11) NOT NULL DEFAULT '8606',
    362   `VersionEnd` int(11) NOT NULL DEFAULT '8606',
    363   PRIMARY KEY (`ID`),
    364   KEY `entry` (`entry`),
    365   KEY `User` (`User`),
    366   KEY `Take` (`Take`),
    367   KEY `Complete` (`Complete`),
    368   KEY `Language` (`Language`),
    369   KEY `VersionStart` (`VersionStart`),
    370   KEY `VersionEnd` (`VersionEnd`)
    371 ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=96122 ;
    372 
    373 -- --------------------------------------------------------
    374 
    375 --
    376 -- Struktura tabulky `gametips`
    377 --
    378 
    379 CREATE TABLE IF NOT EXISTS `gametips` (
    380   `ID` int(11) unsigned NOT NULL AUTO_INCREMENT,
    381   `entry` int(11) NOT NULL,
    382   `Text` text NOT NULL,
    383   `Language` int(11) NOT NULL DEFAULT '0',
    384   `User` int(11) NOT NULL,
    385   `Complete` int(11) NOT NULL,
    386   `Take` int(11) NOT NULL,
    387   `VersionStart` int(11) NOT NULL DEFAULT '8606',
    388   `VersionEnd` int(11) NOT NULL DEFAULT '8606',
    389   PRIMARY KEY (`ID`),
    390   KEY `entry` (`entry`),
    391   KEY `User` (`User`),
    392   KEY `Take` (`Take`),
    393   KEY `Language` (`Language`),
    394   KEY `Complete` (`Complete`),
    395   KEY `VersionStart` (`VersionStart`),
    396   KEY `VersionEnd` (`VersionEnd`)
    397 ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=416 ;
    398 
    399 -- --------------------------------------------------------
    400 
    401 --
    402 -- Struktura tabulky `global_strings`
    403 --
    404 
    405 CREATE TABLE IF NOT EXISTS `global_strings` (
    406   `ID` int(11) unsigned NOT NULL AUTO_INCREMENT,
    407   `entry` int(11) NOT NULL,
    408   `Language` int(11) NOT NULL DEFAULT '0',
    409   `User` int(11) NOT NULL,
    410   `Complete` int(11) NOT NULL,
    411   `Take` int(11) NOT NULL,
    412   `ShortCut` varchar(255) NOT NULL,
    413   `Text` text NOT NULL,
    414   `Comment` text NOT NULL,
    415   `VersionStart` int(11) NOT NULL DEFAULT '8606',
    416   `VersionEnd` int(11) NOT NULL DEFAULT '8606',
    417   PRIMARY KEY (`ID`),
    418   KEY `entry` (`entry`),
    419   KEY `User` (`User`),
    420   KEY `Take` (`Take`),
    421   KEY `Language` (`Language`),
    422   KEY `Complete` (`Complete`),
    423   KEY `ShortCut` (`ShortCut`),
    424   KEY `VersionStart` (`VersionStart`),
    425   KEY `VersionEnd` (`VersionEnd`)
    426 ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=26671 ;
    427 
    428 -- --------------------------------------------------------
    429 
    430 --
    431 -- Struktura tabulky `glue_strings`
    432 --
    433 
    434 CREATE TABLE IF NOT EXISTS `glue_strings` (
    435   `ID` int(11) unsigned NOT NULL AUTO_INCREMENT,
    436   `entry` int(11) NOT NULL,
    437   `Language` int(11) NOT NULL DEFAULT '0',
    438   `User` int(11) NOT NULL,
    439   `Complete` int(11) NOT NULL,
    440   `Take` int(11) NOT NULL,
    441   `ShortCut` varchar(255) NOT NULL,
    442   `Text` text NOT NULL,
    443   `Comment` text NOT NULL,
    444   `VersionStart` int(11) NOT NULL DEFAULT '8606',
    445   `VersionEnd` int(11) NOT NULL DEFAULT '8606',
    446   PRIMARY KEY (`ID`),
    447   KEY `entry` (`entry`),
    448   KEY `User` (`User`),
    449   KEY `Take` (`Take`),
    450   KEY `Language` (`Language`),
    451   KEY `Complete` (`Complete`),
    452   KEY `ShortCut` (`ShortCut`),
    453   KEY `VersionStart` (`VersionStart`),
    454   KEY `VersionEnd` (`VersionEnd`)
    455 ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=2068 ;
    456 
    457 -- --------------------------------------------------------
    458 
    459 --
    460 -- Struktura tabulky `group`
    461 --
    462 
    463 CREATE TABLE IF NOT EXISTS `group` (
    464   `Id` int(11) NOT NULL AUTO_INCREMENT,
    465   `Name` varchar(255) COLLATE utf8_czech_ci NOT NULL,
    466   `TablePrefix` varchar(255) COLLATE utf8_czech_ci NOT NULL,
    467   `MangosDatabase` varchar(255) COLLATE utf8_czech_ci NOT NULL,
    468   `MangosTable` varchar(255) COLLATE utf8_czech_ci NOT NULL,
    469   `MangosTableIndex` varchar(255) COLLATE utf8_czech_ci NOT NULL,
    470   `DBCFileName` varchar(255) COLLATE utf8_czech_ci NOT NULL,
    471   `DBCColumns` text COLLATE utf8_czech_ci NOT NULL,
    472   `WowheadName` varchar(255) COLLATE utf8_czech_ci NOT NULL,
    473   `LuaFileName` varchar(255) COLLATE utf8_czech_ci NOT NULL,
    474   `LuaMPQFolder` varchar(255) COLLATE utf8_czech_ci NOT NULL,
    475   `LastImport` datetime NOT NULL,
    476   `LastVersion` int(11) NOT NULL,
    477   PRIMARY KEY (`Id`)
    478 ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=23 ;
    479 
    480 -- --------------------------------------------------------
    481 
    482 --
    483 -- Struktura tabulky `group_item`
    484 --
    485 
    486 CREATE TABLE IF NOT EXISTS `group_item` (
    487   `Id` int(11) NOT NULL AUTO_INCREMENT,
    488   `Group` int(11) NOT NULL,
    489   `Name` varchar(255) COLLATE utf8_czech_ci NOT NULL,
    490   `Column` varchar(255) COLLATE utf8_czech_ci NOT NULL,
    491   `Visible` tinyint(1) NOT NULL DEFAULT '1',
    492   `MangosColumn` varchar(255) COLLATE utf8_czech_ci NOT NULL,
    493   `AddonFileName` varchar(255) COLLATE utf8_czech_ci NOT NULL,
    494   `DBCColumnIndex` int(11) NOT NULL DEFAULT '0',
    495   PRIMARY KEY (`Id`),
    496   KEY `Group` (`Group`),
    497   KEY `Visible` (`Visible`)
    498 ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=63 ;
    499 
    500 -- --------------------------------------------------------
    501 
    502 --
    503 -- Struktura tabulky `item`
    504 --
    505 
    506 CREATE TABLE IF NOT EXISTS `item` (
    507   `ID` int(11) unsigned NOT NULL AUTO_INCREMENT,
    508   `entry` int(11) NOT NULL,
    509   `Name` text NOT NULL,
    510   `Description` text NOT NULL,
    511   `Language` int(11) NOT NULL DEFAULT '0',
    512   `User` int(11) NOT NULL,
    513   `Complete` int(11) NOT NULL,
    514   `Take` int(11) NOT NULL,
    515   `VersionStart` int(11) NOT NULL DEFAULT '8606',
    516   `VersionEnd` int(11) NOT NULL DEFAULT '8606',
    517   PRIMARY KEY (`ID`),
    518   KEY `entry` (`entry`),
    519   KEY `User` (`User`),
    520   KEY `Take` (`Take`),
    521   KEY `Complete` (`Complete`),
    522   KEY `Language` (`Language`),
    523   KEY `VersionStart` (`VersionStart`),
    524   KEY `VersionEnd` (`VersionEnd`)
    525 ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=70300 ;
    526 
    527 -- --------------------------------------------------------
    528 
    529 --
    530 -- Struktura tabulky `language`
    531 --
    532 
    533 CREATE TABLE IF NOT EXISTS `language` (
    534   `Id` int(11) NOT NULL AUTO_INCREMENT,
    535   `Name` varchar(255) COLLATE utf8_czech_ci NOT NULL,
    536   `Enabled` tinyint(1) NOT NULL DEFAULT '1',
    537   PRIMARY KEY (`Id`),
    538   KEY `Enabled` (`Enabled`)
    539 ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=4 ;
    540 
    541 -- --------------------------------------------------------
    542 
    543 --
    544 -- Struktura tabulky `log`
    545 --
    546 
    547 CREATE TABLE IF NOT EXISTS `log` (
    548   `ID` int(11) NOT NULL AUTO_INCREMENT,
    549   `user` int(11) NOT NULL,
    550   `type` int(11) NOT NULL,
    551   `text` text CHARACTER SET latin2 COLLATE latin2_czech_cs NOT NULL,
    552   `date` datetime NOT NULL,
    553   `IP` text CHARACTER SET latin2 COLLATE latin2_czech_cs NOT NULL,
    554   PRIMARY KEY (`ID`),
    555   KEY `user` (`user`),
    556   KEY `type` (`type`),
    557   KEY `date` (`date`)
    558 ) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=532628 ;
    559 
    560 -- --------------------------------------------------------
    561 
    562 --
    563 -- Struktura tabulky `mangos_command`
    564 --
    565 
    566 CREATE TABLE IF NOT EXISTS `mangos_command` (
    567   `ID` int(11) unsigned NOT NULL AUTO_INCREMENT,
    568   `entry` int(11) NOT NULL,
    569   `help` text NOT NULL,
    570   `Language` int(11) NOT NULL DEFAULT '0',
    571   `User` int(11) NOT NULL,
    572   `Complete` int(11) NOT NULL,
    573   `Take` int(11) NOT NULL,
    574   `Name` varchar(255) NOT NULL,
    575   `VersionStart` int(11) NOT NULL DEFAULT '8606',
    576   `VersionEnd` int(11) NOT NULL DEFAULT '8606',
    577   PRIMARY KEY (`ID`),
    578   KEY `entry` (`entry`),
    579   KEY `User` (`User`),
    580   KEY `Take` (`Take`),
    581   KEY `Complete` (`Complete`),
    582   KEY `Language` (`Language`),
    583   KEY `Name` (`Name`),
    584   KEY `VersionStart` (`VersionStart`),
    585   KEY `VersionEnd` (`VersionEnd`)
    586 ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=853 ;
    587 
    588 -- --------------------------------------------------------
    589 
    590 --
    591 -- Struktura tabulky `mangos_string`
    592 --
    593 
    594 CREATE TABLE IF NOT EXISTS `mangos_string` (
    595   `ID` int(11) unsigned NOT NULL AUTO_INCREMENT,
    596   `entry` int(11) NOT NULL,
    597   `content_default` text NOT NULL,
    598   `Language` int(11) NOT NULL DEFAULT '0',
    599   `User` int(11) NOT NULL,
    600   `Complete` int(11) NOT NULL,
    601   `Take` int(11) NOT NULL,
    602   `VersionStart` int(11) NOT NULL DEFAULT '8606',
    603   `VersionEnd` int(11) NOT NULL DEFAULT '8606',
    604   PRIMARY KEY (`ID`),
    605   KEY `entry` (`entry`),
    606   KEY `User` (`User`),
    607   KEY `Take` (`Take`),
    608   KEY `Complete` (`Complete`),
    609   KEY `Language` (`Language`),
    610   KEY `VersionStart` (`VersionStart`),
    611   KEY `VersionEnd` (`VersionEnd`)
    612 ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=2404 ;
    613 
    614 -- --------------------------------------------------------
    615 
    616 --
    617 -- Struktura tabulky `news`
    618 --
    619 
    620 CREATE TABLE IF NOT EXISTS `news` (
    621   `Id` int(11) NOT NULL AUTO_INCREMENT,
    622   `Time` datetime NOT NULL,
    623   `User` int(11) NOT NULL,
    624   `Text` text NOT NULL,
    625   PRIMARY KEY (`Id`),
    626   KEY `Time` (`Time`)
    627 ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=37 ;
    628 
    629 -- --------------------------------------------------------
    630 
    631 --
    632 -- Struktura tabulky `npc`
    633 --
    634 
    635 CREATE TABLE IF NOT EXISTS `npc` (
    636   `ID` int(11) unsigned NOT NULL AUTO_INCREMENT,
    637   `entry` int(11) NOT NULL,
    638   `Text0_0` text CHARACTER SET latin2 COLLATE latin2_czech_cs,
    639   `Text0_1` text CHARACTER SET latin2 COLLATE latin2_czech_cs,
    640   `Text1_0` text CHARACTER SET latin2 COLLATE latin2_czech_cs,
    641   `Text1_1` text CHARACTER SET latin2 COLLATE latin2_czech_cs,
    642   `Text2_0` text CHARACTER SET latin2 COLLATE latin2_czech_cs,
    643   `Text2_1` text CHARACTER SET latin2 COLLATE latin2_czech_cs,
    644   `Text3_0` text CHARACTER SET latin2 COLLATE latin2_czech_cs,
    645   `Text3_1` text CHARACTER SET latin2 COLLATE latin2_czech_cs,
    646   `Text4_0` text CHARACTER SET latin2 COLLATE latin2_czech_cs,
    647   `Text4_1` text CHARACTER SET latin2 COLLATE latin2_czech_cs,
    648   `Text5_0` text CHARACTER SET latin2 COLLATE latin2_czech_cs,
    649   `Text5_1` text CHARACTER SET latin2 COLLATE latin2_czech_cs,
    650   `Text6_0` text CHARACTER SET latin2 COLLATE latin2_czech_cs,
    651   `Text6_1` text CHARACTER SET latin2 COLLATE latin2_czech_cs,
    652   `Text7_0` text CHARACTER SET latin2 COLLATE latin2_czech_cs,
    653   `Text7_1` text CHARACTER SET latin2 COLLATE latin2_czech_cs,
    654   `Language` int(11) NOT NULL DEFAULT '0',
    655   `User` int(11) NOT NULL,
    656   `Complete` int(11) NOT NULL,
    657   `Take` int(11) NOT NULL,
    658   `VersionStart` int(11) NOT NULL DEFAULT '8606',
    659   `VersionEnd` int(11) NOT NULL DEFAULT '8606',
    660   PRIMARY KEY (`ID`),
    661   KEY `entry` (`entry`),
    662   KEY `User` (`User`),
    663   KEY `Take` (`Take`),
    664   KEY `Complete` (`Complete`),
    665   KEY `Language` (`Language`),
    666   KEY `VersionStart` (`VersionStart`),
    667   KEY `VersionEnd` (`VersionEnd`)
    668 ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=16781037 ;
    669 
    670 -- --------------------------------------------------------
    671 
    672 --
    673 -- Struktura tabulky `npc_option`
    674 --
    675 
    676 CREATE TABLE IF NOT EXISTS `npc_option` (
    677   `ID` int(11) unsigned NOT NULL AUTO_INCREMENT,
    678   `entry` int(11) NOT NULL,
    679   `Language` int(11) NOT NULL DEFAULT '0',
    680   `User` int(11) NOT NULL,
    681   `Complete` int(11) NOT NULL,
    682   `Take` int(11) NOT NULL,
    683   `OptionText` text NOT NULL,
    684   `VersionStart` int(11) NOT NULL DEFAULT '8606',
    685   `VersionEnd` int(11) NOT NULL DEFAULT '8606',
    686   PRIMARY KEY (`ID`),
    687   KEY `entry` (`entry`),
    688   KEY `User` (`User`),
    689   KEY `Take` (`Take`),
    690   KEY `Language` (`Language`),
    691   KEY `Complete` (`Complete`),
    692   KEY `VersionStart` (`VersionStart`),
    693   KEY `VersionEnd` (`VersionEnd`)
    694 ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=129 ;
    695 
    696 -- --------------------------------------------------------
    697 
    698 --
    699 -- Struktura tabulky `page`
    700 --
    701 
    702 CREATE TABLE IF NOT EXISTS `page` (
    703   `ID` int(11) NOT NULL AUTO_INCREMENT,
    704   `entry` int(11) unsigned NOT NULL DEFAULT '0',
    705   `Text` text CHARACTER SET latin2 COLLATE latin2_czech_cs,
    706   `Language` int(11) NOT NULL,
    707   `User` int(11) NOT NULL,
    708   `Complete` int(11) NOT NULL,
    709   `Take` int(11) NOT NULL,
    710   `VersionStart` int(11) NOT NULL DEFAULT '8606',
    711   `VersionEnd` int(11) NOT NULL DEFAULT '8606',
    712   PRIMARY KEY (`ID`),
    713   KEY `entry` (`entry`),
    714   KEY `User` (`User`),
    715   KEY `Take` (`Take`),
    716   KEY `Complete` (`Complete`),
    717   KEY `Language` (`Language`),
    718   KEY `VersionStart` (`VersionStart`),
    719   KEY `VersionEnd` (`VersionEnd`)
    720 ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COMMENT='Item System' AUTO_INCREMENT=2469 ;
    721 
    722 -- --------------------------------------------------------
    723 
    724 --
    725 -- Struktura tabulky `quests`
    726 --
    727 
    728 CREATE TABLE IF NOT EXISTS `quests` (
    729   `ID` int(11) NOT NULL AUTO_INCREMENT,
    730   `entry` int(11) NOT NULL DEFAULT '0',
    731   `Title` text CHARACTER SET latin2 COLLATE latin2_czech_cs NOT NULL,
    732   `Details` text CHARACTER SET latin2 COLLATE latin2_czech_cs NOT NULL,
    733   `Objectives` text CHARACTER SET latin2 COLLATE latin2_czech_cs NOT NULL,
    734   `OfferRewardText` text CHARACTER SET latin2 COLLATE latin2_czech_cs NOT NULL,
    735   `RequestItemsText` text CHARACTER SET latin2 COLLATE latin2_czech_cs NOT NULL,
    736   `EndText` text CHARACTER SET latin2 COLLATE latin2_czech_cs NOT NULL,
    737   `ObjectiveText1` text CHARACTER SET latin2 COLLATE latin2_czech_cs NOT NULL,
    738   `ObjectiveText2` text CHARACTER SET latin2 COLLATE latin2_czech_cs NOT NULL,
    739   `ObjectiveText3` text CHARACTER SET latin2 COLLATE latin2_czech_cs NOT NULL,
    740   `ObjectiveText4` text CHARACTER SET latin2 COLLATE latin2_czech_cs NOT NULL,
    741   `Language` int(11) NOT NULL DEFAULT '1',
    742   `User` int(11) NOT NULL,
    743   `Complete` int(11) NOT NULL DEFAULT '1',
    744   `Take` int(11) NOT NULL,
    745   `VersionStart` int(11) NOT NULL DEFAULT '8606',
    746   `VersionEnd` int(11) NOT NULL DEFAULT '8606',
    747   PRIMARY KEY (`ID`),
    748   KEY `entry` (`entry`),
    749   KEY `User` (`User`),
    750   KEY `complete` (`Complete`),
    751   KEY `Language` (`Language`),
    752   KEY `VersionStart` (`VersionStart`),
    753   KEY `VersionEnd` (`VersionEnd`)
    754 ) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=14408 ;
    755 
    756 -- --------------------------------------------------------
    757 
    758 --
    759 -- Struktura tabulky `sd2_eventai_texts`
    760 --
    761 
    762 CREATE TABLE IF NOT EXISTS `sd2_eventai_texts` (
    763   `ID` int(11) unsigned NOT NULL AUTO_INCREMENT,
    764   `entry` int(11) NOT NULL,
    765   `content_default` text NOT NULL,
    766   `comment` text NOT NULL,
    767   `Language` int(11) NOT NULL DEFAULT '0',
    768   `User` int(11) NOT NULL,
    769   `Complete` int(11) NOT NULL,
    770   `Take` int(11) NOT NULL,
    771   `VersionStart` int(11) NOT NULL DEFAULT '8606',
    772   `VersionEnd` int(11) NOT NULL DEFAULT '8606',
    773   PRIMARY KEY (`ID`),
    774   KEY `entry` (`entry`),
    775   KEY `User` (`User`),
    776   KEY `Take` (`Take`),
    777   KEY `Complete` (`Complete`),
    778   KEY `Language` (`Language`),
    779   KEY `VersionStart` (`VersionStart`),
    780   KEY `VersionEnd` (`VersionEnd`)
    781 ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=767 ;
    782 
    783 -- --------------------------------------------------------
    784 
    785 --
    786 -- Struktura tabulky `sd2_script_texts`
    787 --
    788 
    789 CREATE TABLE IF NOT EXISTS `sd2_script_texts` (
    790   `ID` int(11) unsigned NOT NULL AUTO_INCREMENT,
    791   `entry` int(11) NOT NULL,
    792   `content_default` text NOT NULL,
    793   `comment` text NOT NULL,
    794   `Language` int(11) NOT NULL DEFAULT '0',
    795   `User` int(11) NOT NULL,
    796   `Complete` int(11) NOT NULL,
    797   `Take` int(11) NOT NULL,
    798   `VersionStart` int(11) NOT NULL DEFAULT '8606',
    799   `VersionEnd` int(11) NOT NULL DEFAULT '8606',
    800   PRIMARY KEY (`ID`),
    801   KEY `entry` (`entry`),
    802   KEY `User` (`User`),
    803   KEY `Take` (`Take`),
    804   KEY `Complete` (`Complete`),
    805   KEY `Language` (`Language`),
    806   KEY `VersionStart` (`VersionStart`),
    807   KEY `VersionEnd` (`VersionEnd`)
    808 ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1969 ;
    809 
    810 -- --------------------------------------------------------
    811 
    812 --
    813 -- Struktura tabulky `shoutbox`
    814 --
    815 
    816 CREATE TABLE IF NOT EXISTS `shoutbox` (
    817   `ID` int(11) NOT NULL AUTO_INCREMENT,
    818   `user` text CHARACTER SET latin2 COLLATE latin2_czech_cs NOT NULL,
    819   `text` text CHARACTER SET latin2 COLLATE latin2_czech_cs NOT NULL,
    820   `date` datetime NOT NULL,
    821   `IP` text CHARACTER SET latin2 COLLATE latin2_czech_cs NOT NULL,
    822   PRIMARY KEY (`ID`),
    823   KEY `date` (`date`)
    824 ) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=1086 ;
    825 
    826 -- --------------------------------------------------------
    827 
    828 --
    829 -- Struktura tabulky `spell`
    830 --
    831 
    832 CREATE TABLE IF NOT EXISTS `spell` (
    833   `ID` int(11) unsigned NOT NULL AUTO_INCREMENT,
    834   `entry` int(11) NOT NULL,
    835   `Name` text NOT NULL,
    836   `Description` text NOT NULL,
    837   `ToolTip` text NOT NULL,
    838   `Rank` text NOT NULL,
    839   `Language` int(11) NOT NULL DEFAULT '0',
    840   `User` int(11) NOT NULL,
    841   `Complete` int(11) NOT NULL,
    842   `Take` int(11) NOT NULL,
    843   `VersionStart` int(11) NOT NULL DEFAULT '8606',
    844   `VersionEnd` int(11) NOT NULL DEFAULT '8606',
    845   PRIMARY KEY (`ID`),
    846   KEY `entry` (`entry`),
    847   KEY `User` (`User`),
    848   KEY `Take` (`Take`),
    849   KEY `Language` (`Language`),
    850   KEY `Complete` (`Complete`),
    851   KEY `VersionStart` (`VersionStart`),
    852   KEY `VersionEnd` (`VersionEnd`)
    853 ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=67580 ;
    854 
    855 -- --------------------------------------------------------
    856 
    857 --
    858 -- Struktura tabulky `Team`
    859 --
    860 
    861 CREATE TABLE IF NOT EXISTS `Team` (
    862   `Id` int(11) NOT NULL AUTO_INCREMENT,
    863   `Name` varchar(255) CHARACTER SET utf8 COLLATE utf8_czech_ci NOT NULL,
    864   `Description` text CHARACTER SET utf8 COLLATE utf8_czech_ci NOT NULL,
    865   `URL` varchar(255) NOT NULL,
    866   `TimeCreate` datetime NOT NULL,
    867   `Leader` int(11) NOT NULL,
    868   PRIMARY KEY (`Id`),
    869   KEY `Leader` (`Leader`),
    870   KEY `TimeCreate` (`TimeCreate`)
    871 ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=37 ;
    872 
    873 -- --------------------------------------------------------
    874 
    875 --
    876 -- Struktura tabulky `transports`
    877 --
    878 
    879 CREATE TABLE IF NOT EXISTS `transports` (
    880   `ID` int(11) unsigned NOT NULL AUTO_INCREMENT,
    881   `entry` int(11) NOT NULL,
    882   `Language` int(11) NOT NULL DEFAULT '0',
    883   `User` int(11) NOT NULL,
    884   `Complete` int(11) NOT NULL,
    885   `Take` int(11) NOT NULL,
    886   `Name` text NOT NULL,
    887   `VersionStart` int(11) NOT NULL DEFAULT '8606',
    888   `VersionEnd` int(11) NOT NULL DEFAULT '8606',
    889   PRIMARY KEY (`ID`),
    890   KEY `entry` (`entry`),
    891   KEY `User` (`User`),
    892   KEY `Take` (`Take`),
    893   KEY `Language` (`Language`),
    894   KEY `Complete` (`Complete`),
    895   KEY `VersionStart` (`VersionStart`),
    896   KEY `VersionEnd` (`VersionEnd`)
    897 ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=43 ;
    898 
    899 -- --------------------------------------------------------
    900 
    901 --
    902 -- Struktura tabulky `user`
    903 --
    904 
    905 CREATE TABLE IF NOT EXISTS `user` (
    906   `ID` int(11) NOT NULL AUTO_INCREMENT,
    907   `user` varchar(64) CHARACTER SET latin2 COLLATE latin2_czech_cs NOT NULL,
    908   `pass` text CHARACTER SET latin2 COLLATE latin2_czech_cs NOT NULL,
    909   `Salt` varchar(255) COLLATE utf8_czech_ci NOT NULL,
    910   `gm` int(11) NOT NULL DEFAULT '0',
    911   `LastIP` text CHARACTER SET latin2 COLLATE latin2_czech_cs NOT NULL,
    912   `LastLogin` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
    913   `LastLogout` datetime DEFAULT NULL,
    914   `Email` text CHARACTER SET latin2 COLLATE latin2_czech_cs NOT NULL,
    915   `Language` int(11) NOT NULL DEFAULT '1',
    916   `XP` int(11) NOT NULL,
    917   `TranslatedCount` int(11) NOT NULL,
    918   `NeedUpdate` int(11) NOT NULL,
    919   `team` int(11) NOT NULL,
    920   `redirecting` int(11) NOT NULL,
    921   `RegistrationTime` datetime DEFAULT NULL,
    922   PRIMARY KEY (`ID`),
    923   KEY `team` (`team`),
    924   KEY `user` (`user`)
    925 ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=881 ;
    926 
    927 -- --------------------------------------------------------
    928 
    929 --
    930 -- Struktura tabulky `verseclient`
    931 --
    932 
    933 CREATE TABLE IF NOT EXISTS `verseclient` (
    934   `ID` int(11) NOT NULL AUTO_INCREMENT,
    935   `verse` text COLLATE utf8_czech_ci NOT NULL,
    936   `date` datetime NOT NULL,
    937   `text` text COLLATE utf8_czech_ci NOT NULL,
    938   `user` int(11) NOT NULL,
    939   PRIMARY KEY (`ID`),
    940   KEY `user` (`user`)
    941 ) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=11 ;
    942 
    943 -- --------------------------------------------------------
    944 
    945 --
    946 -- Struktura tabulky `wow_client_version`
    947 --
    948 
    949 CREATE TABLE IF NOT EXISTS `wow_client_version` (
     36-- Struktura tabulky `ClientVersion`
     37--
     38
     39CREATE TABLE IF NOT EXISTS `ClientVersion` (
    95040  `Id` int(11) NOT NULL AUTO_INCREMENT,
    95141  `Version` varchar(16) NOT NULL,
     
    97363  KEY `ReleaseDate` (`ReleaseDate`)
    97464) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=81 ;
     65
     66-- --------------------------------------------------------
     67
     68--
     69-- Struktura tabulky `connexion`
     70--
     71
     72CREATE TABLE IF NOT EXISTS `connexion` (
     73  `Id` int(11) NOT NULL AUTO_INCREMENT,
     74  `Name` text NOT NULL,
     75  `Group` int(11) NOT NULL,
     76  PRIMARY KEY (`Id`),
     77  KEY `Group` (`Group`)
     78) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1502 ;
     79
     80-- --------------------------------------------------------
     81
     82--
     83-- Struktura tabulky `connexion_item`
     84--
     85
     86CREATE TABLE IF NOT EXISTS `connexion_item` (
     87  `Id` int(11) NOT NULL AUTO_INCREMENT,
     88  `connexion` int(11) NOT NULL,
     89  `entry` int(11) NOT NULL,
     90  PRIMARY KEY (`Id`),
     91  KEY `connexion` (`connexion`,`entry`)
     92) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=7029 ;
     93
     94-- --------------------------------------------------------
     95
     96--
     97-- Struktura tabulky `CzWoWPackageVersion`
     98--
     99
     100CREATE TABLE IF NOT EXISTS `CzWoWPackageVersion` (
     101  `ID` int(11) NOT NULL AUTO_INCREMENT,
     102  `Version` text COLLATE utf8_czech_ci NOT NULL,
     103  `Date` datetime NOT NULL,
     104  `Text` text COLLATE utf8_czech_ci NOT NULL,
     105  `User` int(11) NOT NULL,
     106  PRIMARY KEY (`ID`),
     107  KEY `user` (`User`)
     108) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=11 ;
     109
     110-- --------------------------------------------------------
     111
     112--
     113-- Struktura tabulky `Dictionary`
     114--
     115
     116CREATE TABLE IF NOT EXISTS `Dictionary` (
     117  `ID` int(11) NOT NULL AUTO_INCREMENT,
     118  `Entry` int(11) NOT NULL,
     119  `Text` varchar(255) NOT NULL,
     120  `Language` int(11) NOT NULL,
     121  `Description` text NOT NULL,
     122  `User` int(11) NOT NULL,
     123  PRIMARY KEY (`ID`),
     124  KEY `Language` (`Language`),
     125  KEY `Entry` (`Entry`),
     126  KEY `User` (`User`)
     127) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=413 ;
     128
     129-- --------------------------------------------------------
     130
     131--
     132-- Struktura tabulky `Export`
     133--
     134
     135CREATE TABLE IF NOT EXISTS `Export` (
     136  `Id` int(11) NOT NULL AUTO_INCREMENT,
     137  `User` int(11) NOT NULL,
     138  `TimeCreate` datetime NOT NULL,
     139  `Title` varchar(255) NOT NULL,
     140  `WithDiacritic` tinyint(1) NOT NULL,
     141  `UsedCount` int(11) NOT NULL,
     142  `ClientVersion` int(11) NOT NULL,
     143  `OutputType` int(11) NOT NULL,
     144  `Description` text NOT NULL,
     145  PRIMARY KEY (`Id`),
     146  KEY `User` (`User`),
     147  KEY `TimeCreate` (`TimeCreate`)
     148) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=58 ;
     149
     150-- --------------------------------------------------------
     151
     152--
     153-- Struktura tabulky `ExportGroup`
     154--
     155
     156CREATE TABLE IF NOT EXISTS `ExportGroup` (
     157  `Id` int(11) NOT NULL AUTO_INCREMENT,
     158  `Export` int(11) NOT NULL,
     159  `Group` int(11) NOT NULL,
     160  PRIMARY KEY (`Id`),
     161  KEY `Export` (`Export`)
     162) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=580 ;
     163
     164-- --------------------------------------------------------
     165
     166--
     167-- Struktura tabulky `ExportLanguage`
     168--
     169
     170CREATE TABLE IF NOT EXISTS `ExportLanguage` (
     171  `Id` int(11) NOT NULL AUTO_INCREMENT,
     172  `Export` int(11) NOT NULL,
     173  `Language` int(11) NOT NULL,
     174  `Sequence` int(11) NOT NULL,
     175  PRIMARY KEY (`Id`)
     176) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=44 ;
     177
     178-- --------------------------------------------------------
     179
     180--
     181-- Struktura tabulky `ExportOutputType`
     182--
     183
     184CREATE TABLE IF NOT EXISTS `ExportOutputType` (
     185  `Id` int(11) NOT NULL AUTO_INCREMENT,
     186  `Name` varchar(255) NOT NULL,
     187  PRIMARY KEY (`Id`)
     188) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=10 ;
     189
     190-- --------------------------------------------------------
     191
     192--
     193-- Struktura tabulky `ExportTask`
     194--
     195
     196CREATE TABLE IF NOT EXISTS `ExportTask` (
     197  `Id` int(11) NOT NULL AUTO_INCREMENT,
     198  `TimeStart` datetime NOT NULL,
     199  `TimeFinish` datetime DEFAULT NULL,
     200  `Export` int(11) NOT NULL,
     201  PRIMARY KEY (`Id`),
     202  KEY `Export` (`Export`)
     203) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=7 ;
     204
     205-- --------------------------------------------------------
     206
     207--
     208-- Struktura tabulky `ExportUser`
     209--
     210
     211CREATE TABLE IF NOT EXISTS `ExportUser` (
     212  `Id` int(11) NOT NULL AUTO_INCREMENT,
     213  `Export` int(11) NOT NULL,
     214  `User` int(11) NOT NULL,
     215  `Sequence` int(11) NOT NULL,
     216  PRIMARY KEY (`Id`),
     217  KEY `Export` (`Export`),
     218  KEY `User` (`User`)
     219) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=4280 ;
     220
     221-- --------------------------------------------------------
     222
     223--
     224-- Struktura tabulky `ExportVersion`
     225--
     226
     227CREATE TABLE IF NOT EXISTS `ExportVersion` (
     228  `Id` int(11) NOT NULL AUTO_INCREMENT,
     229  `ExportType` int(11) NOT NULL,
     230  `ClientVersion` int(11) NOT NULL,
     231  PRIMARY KEY (`Id`),
     232  KEY `ExportType` (`ExportType`),
     233  KEY `ClientVersion` (`ClientVersion`)
     234) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=50 ;
     235
     236-- --------------------------------------------------------
     237
     238--
     239-- Struktura tabulky `Group`
     240--
     241
     242CREATE TABLE IF NOT EXISTS `Group` (
     243  `Id` int(11) NOT NULL AUTO_INCREMENT,
     244  `Name` varchar(255) COLLATE utf8_czech_ci NOT NULL,
     245  `TablePrefix` varchar(255) COLLATE utf8_czech_ci NOT NULL,
     246  `MangosDatabase` varchar(255) COLLATE utf8_czech_ci NOT NULL,
     247  `MangosTable` varchar(255) COLLATE utf8_czech_ci NOT NULL,
     248  `MangosTableIndex` varchar(255) COLLATE utf8_czech_ci NOT NULL,
     249  `DBCFileName` varchar(255) COLLATE utf8_czech_ci NOT NULL,
     250  `DBCColumns` text COLLATE utf8_czech_ci NOT NULL,
     251  `WowheadName` varchar(255) COLLATE utf8_czech_ci NOT NULL,
     252  `LuaFileName` varchar(255) COLLATE utf8_czech_ci NOT NULL,
     253  `LuaMPQFolder` varchar(255) COLLATE utf8_czech_ci NOT NULL,
     254  `LastImport` datetime NOT NULL,
     255  `LastVersion` int(11) NOT NULL,
     256  PRIMARY KEY (`Id`)
     257) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=23 ;
     258
     259-- --------------------------------------------------------
     260
     261--
     262-- Struktura tabulky `GroupItem`
     263--
     264
     265CREATE TABLE IF NOT EXISTS `GroupItem` (
     266  `Id` int(11) NOT NULL AUTO_INCREMENT,
     267  `Group` int(11) NOT NULL,
     268  `Name` varchar(255) COLLATE utf8_czech_ci NOT NULL,
     269  `Column` varchar(255) COLLATE utf8_czech_ci NOT NULL,
     270  `Visible` tinyint(1) NOT NULL DEFAULT '1',
     271  `MangosColumn` varchar(255) COLLATE utf8_czech_ci NOT NULL,
     272  `AddonFileName` varchar(255) COLLATE utf8_czech_ci NOT NULL,
     273  `DBCColumnIndex` int(11) NOT NULL DEFAULT '0',
     274  PRIMARY KEY (`Id`),
     275  KEY `Group` (`Group`),
     276  KEY `Visible` (`Visible`)
     277) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=63 ;
     278
     279-- --------------------------------------------------------
     280
     281--
     282-- Struktura tabulky `Language`
     283--
     284
     285CREATE TABLE IF NOT EXISTS `Language` (
     286  `Id` int(11) NOT NULL AUTO_INCREMENT,
     287  `Name` varchar(255) COLLATE utf8_czech_ci NOT NULL,
     288  `Enabled` tinyint(1) NOT NULL DEFAULT '1',
     289  PRIMARY KEY (`Id`),
     290  KEY `Enabled` (`Enabled`)
     291) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=4 ;
     292
     293-- --------------------------------------------------------
     294
     295--
     296-- Struktura tabulky `Log`
     297--
     298
     299CREATE TABLE IF NOT EXISTS `Log` (
     300  `ID` int(11) NOT NULL AUTO_INCREMENT,
     301  `User` int(11) NOT NULL,
     302  `Type` int(11) NOT NULL,
     303  `Text` text NOT NULL,
     304  `Date` datetime NOT NULL,
     305  `IP` text NOT NULL,
     306  PRIMARY KEY (`ID`),
     307  KEY `user` (`User`),
     308  KEY `type` (`Type`),
     309  KEY `date` (`Date`)
     310) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=570788 ;
     311
     312-- --------------------------------------------------------
     313
     314--
     315-- Struktura tabulky `LogType`
     316--
     317
     318CREATE TABLE IF NOT EXISTS `LogType` (
     319  `Id` int(11) NOT NULL AUTO_INCREMENT,
     320  `Name` varchar(255) NOT NULL,
     321  `Color` varchar(255) NOT NULL,
     322  `Description` varchar(255) NOT NULL,
     323  PRIMARY KEY (`Id`)
     324) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=15 ;
     325
     326-- --------------------------------------------------------
     327
     328--
     329-- Struktura tabulky `News`
     330--
     331
     332CREATE TABLE IF NOT EXISTS `News` (
     333  `Id` int(11) NOT NULL AUTO_INCREMENT,
     334  `Time` datetime NOT NULL,
     335  `User` int(11) NOT NULL,
     336  `Text` text NOT NULL,
     337  PRIMARY KEY (`Id`),
     338  KEY `Time` (`Time`)
     339) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=41 ;
     340
     341-- --------------------------------------------------------
     342
     343--
     344-- Struktura tabulky `ShoutBox`
     345--
     346
     347CREATE TABLE IF NOT EXISTS `ShoutBox` (
     348  `ID` int(11) NOT NULL AUTO_INCREMENT,
     349  `User` text NOT NULL,
     350  `Text` text NOT NULL,
     351  `Date` datetime NOT NULL,
     352  `IP` text NOT NULL,
     353  PRIMARY KEY (`ID`),
     354  KEY `date` (`Date`)
     355) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1087 ;
     356
     357-- --------------------------------------------------------
     358
     359--
     360-- Struktura tabulky `Team`
     361--
     362
     363CREATE TABLE IF NOT EXISTS `Team` (
     364  `Id` int(11) NOT NULL AUTO_INCREMENT,
     365  `Name` varchar(255) CHARACTER SET utf8 COLLATE utf8_czech_ci NOT NULL,
     366  `Description` text CHARACTER SET utf8 COLLATE utf8_czech_ci NOT NULL,
     367  `URL` varchar(255) NOT NULL,
     368  `TimeCreate` datetime NOT NULL,
     369  `Leader` int(11) NOT NULL,
     370  PRIMARY KEY (`Id`),
     371  KEY `Leader` (`Leader`),
     372  KEY `TimeCreate` (`TimeCreate`)
     373) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=38 ;
     374
     375-- --------------------------------------------------------
     376
     377--
     378-- Struktura tabulky `TextAchievement`
     379--
     380
     381CREATE TABLE IF NOT EXISTS `TextAchievement` (
     382  `ID` int(11) unsigned NOT NULL AUTO_INCREMENT,
     383  `Entry` int(11) NOT NULL,
     384  `Language` int(11) NOT NULL DEFAULT '0',
     385  `User` int(11) NOT NULL,
     386  `Complete` int(11) NOT NULL,
     387  `Take` int(11) NOT NULL,
     388  `Name` text NOT NULL,
     389  `Description` text NOT NULL,
     390  `Reward` text NOT NULL,
     391  `VersionStart` int(11) NOT NULL DEFAULT '8606',
     392  `VersionEnd` int(11) NOT NULL DEFAULT '8606',
     393  PRIMARY KEY (`ID`),
     394  KEY `entry` (`Entry`),
     395  KEY `User` (`User`),
     396  KEY `Take` (`Take`),
     397  KEY `Language` (`Language`),
     398  KEY `Complete` (`Complete`),
     399  KEY `VersionStart` (`VersionStart`),
     400  KEY `VersionEnd` (`VersionEnd`)
     401) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=2767 ;
     402
     403-- --------------------------------------------------------
     404
     405--
     406-- Struktura tabulky `TextAchievementCategory`
     407--
     408
     409CREATE TABLE IF NOT EXISTS `TextAchievementCategory` (
     410  `ID` int(11) unsigned NOT NULL AUTO_INCREMENT,
     411  `Entry` int(11) NOT NULL,
     412  `Language` int(11) NOT NULL DEFAULT '0',
     413  `User` int(11) NOT NULL,
     414  `Complete` int(11) NOT NULL,
     415  `Take` int(11) NOT NULL,
     416  `Name` text NOT NULL,
     417  `VersionStart` int(11) NOT NULL DEFAULT '8606',
     418  `VersionEnd` int(11) NOT NULL DEFAULT '8606',
     419  PRIMARY KEY (`ID`),
     420  KEY `entry` (`Entry`),
     421  KEY `User` (`User`),
     422  KEY `Take` (`Take`),
     423  KEY `Language` (`Language`),
     424  KEY `Complete` (`Complete`),
     425  KEY `VersionStart` (`VersionStart`),
     426  KEY `VersionEnd` (`VersionEnd`)
     427) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=205 ;
     428
     429-- --------------------------------------------------------
     430
     431--
     432-- Struktura tabulky `TextAchievementCriteria`
     433--
     434
     435CREATE TABLE IF NOT EXISTS `TextAchievementCriteria` (
     436  `ID` int(11) unsigned NOT NULL AUTO_INCREMENT,
     437  `Entry` int(11) NOT NULL,
     438  `Language` int(11) NOT NULL DEFAULT '0',
     439  `User` int(11) NOT NULL,
     440  `Complete` int(11) NOT NULL,
     441  `Take` int(11) NOT NULL,
     442  `Text` text NOT NULL,
     443  `VersionStart` int(11) NOT NULL DEFAULT '8606',
     444  `VersionEnd` int(11) NOT NULL DEFAULT '8606',
     445  PRIMARY KEY (`ID`),
     446  KEY `entry` (`Entry`),
     447  KEY `User` (`User`),
     448  KEY `Take` (`Take`),
     449  KEY `Language` (`Language`),
     450  KEY `Complete` (`Complete`),
     451  KEY `VersionStart` (`VersionStart`),
     452  KEY `VersionEnd` (`VersionEnd`)
     453) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=10589 ;
     454
     455-- --------------------------------------------------------
     456
     457--
     458-- Struktura tabulky `TextAreaTriggerTavern`
     459--
     460
     461CREATE TABLE IF NOT EXISTS `TextAreaTriggerTavern` (
     462  `ID` int(11) unsigned NOT NULL AUTO_INCREMENT,
     463  `Entry` int(11) NOT NULL,
     464  `Language` int(11) NOT NULL DEFAULT '0',
     465  `User` int(11) NOT NULL,
     466  `Complete` int(11) NOT NULL,
     467  `Take` int(11) NOT NULL,
     468  `Name` text NOT NULL,
     469  `VersionStart` int(11) NOT NULL DEFAULT '8606',
     470  `VersionEnd` int(11) NOT NULL DEFAULT '8606',
     471  PRIMARY KEY (`ID`),
     472  KEY `entry` (`Entry`),
     473  KEY `User` (`User`),
     474  KEY `Take` (`Take`),
     475  KEY `Language` (`Language`),
     476  KEY `Complete` (`Complete`),
     477  KEY `VersionStart` (`VersionStart`),
     478  KEY `VersionEnd` (`VersionEnd`)
     479) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=210 ;
     480
     481-- --------------------------------------------------------
     482
     483--
     484-- Struktura tabulky `TextAreaTriggerTeleport`
     485--
     486
     487CREATE TABLE IF NOT EXISTS `TextAreaTriggerTeleport` (
     488  `ID` int(11) unsigned NOT NULL AUTO_INCREMENT,
     489  `Entry` int(11) NOT NULL,
     490  `Language` int(11) NOT NULL DEFAULT '0',
     491  `User` int(11) NOT NULL,
     492  `Complete` int(11) NOT NULL,
     493  `Take` int(11) NOT NULL,
     494  `Name` text NOT NULL,
     495  `VersionStart` int(11) NOT NULL DEFAULT '8606',
     496  `VersionEnd` int(11) NOT NULL DEFAULT '8606',
     497  PRIMARY KEY (`ID`),
     498  KEY `entry` (`Entry`),
     499  KEY `User` (`User`),
     500  KEY `Take` (`Take`),
     501  KEY `Language` (`Language`),
     502  KEY `Complete` (`Complete`),
     503  KEY `VersionStart` (`VersionStart`),
     504  KEY `VersionEnd` (`VersionEnd`)
     505) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=454 ;
     506
     507-- --------------------------------------------------------
     508
     509--
     510-- Struktura tabulky `TextCreature`
     511--
     512
     513CREATE TABLE IF NOT EXISTS `TextCreature` (
     514  `ID` int(11) unsigned NOT NULL AUTO_INCREMENT,
     515  `Entry` int(11) NOT NULL,
     516  `name` text NOT NULL,
     517  `subname` text NOT NULL,
     518  `Language` int(11) NOT NULL DEFAULT '0',
     519  `User` int(11) NOT NULL,
     520  `Complete` int(11) NOT NULL,
     521  `Take` int(11) NOT NULL,
     522  `VersionStart` int(11) NOT NULL DEFAULT '8606',
     523  `VersionEnd` int(11) NOT NULL DEFAULT '8606',
     524  PRIMARY KEY (`ID`),
     525  KEY `entry` (`Entry`),
     526  KEY `User` (`User`),
     527  KEY `Take` (`Take`),
     528  KEY `Complete` (`Complete`),
     529  KEY `Language` (`Language`),
     530  KEY `VersionStart` (`VersionStart`),
     531  KEY `VersionEnd` (`VersionEnd`)
     532) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=58460 ;
     533
     534-- --------------------------------------------------------
     535
     536--
     537-- Struktura tabulky `TextGameObject`
     538--
     539
     540CREATE TABLE IF NOT EXISTS `TextGameObject` (
     541  `ID` int(11) unsigned NOT NULL AUTO_INCREMENT,
     542  `Entry` int(11) NOT NULL,
     543  `Name` text NOT NULL,
     544  `castbarcaption` text NOT NULL,
     545  `Language` int(11) NOT NULL DEFAULT '0',
     546  `User` int(11) NOT NULL,
     547  `Complete` int(11) NOT NULL,
     548  `Take` int(11) NOT NULL,
     549  `VersionStart` int(11) NOT NULL DEFAULT '8606',
     550  `VersionEnd` int(11) NOT NULL DEFAULT '8606',
     551  PRIMARY KEY (`ID`),
     552  KEY `entry` (`Entry`),
     553  KEY `User` (`User`),
     554  KEY `Take` (`Take`),
     555  KEY `Complete` (`Complete`),
     556  KEY `Language` (`Language`),
     557  KEY `VersionStart` (`VersionStart`),
     558  KEY `VersionEnd` (`VersionEnd`)
     559) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=99412 ;
     560
     561-- --------------------------------------------------------
     562
     563--
     564-- Struktura tabulky `TextGameTip`
     565--
     566
     567CREATE TABLE IF NOT EXISTS `TextGameTip` (
     568  `ID` int(11) unsigned NOT NULL AUTO_INCREMENT,
     569  `Entry` int(11) NOT NULL,
     570  `Text` text NOT NULL,
     571  `Language` int(11) NOT NULL DEFAULT '0',
     572  `User` int(11) NOT NULL,
     573  `Complete` int(11) NOT NULL,
     574  `Take` int(11) NOT NULL,
     575  `VersionStart` int(11) NOT NULL DEFAULT '8606',
     576  `VersionEnd` int(11) NOT NULL DEFAULT '8606',
     577  PRIMARY KEY (`ID`),
     578  KEY `entry` (`Entry`),
     579  KEY `User` (`User`),
     580  KEY `Take` (`Take`),
     581  KEY `Language` (`Language`),
     582  KEY `Complete` (`Complete`),
     583  KEY `VersionStart` (`VersionStart`),
     584  KEY `VersionEnd` (`VersionEnd`)
     585) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=416 ;
     586
     587-- --------------------------------------------------------
     588
     589--
     590-- Struktura tabulky `TextGlobalString`
     591--
     592
     593CREATE TABLE IF NOT EXISTS `TextGlobalString` (
     594  `ID` int(11) unsigned NOT NULL AUTO_INCREMENT,
     595  `Entry` int(11) NOT NULL,
     596  `Language` int(11) NOT NULL DEFAULT '0',
     597  `User` int(11) NOT NULL,
     598  `Complete` int(11) NOT NULL,
     599  `Take` int(11) NOT NULL,
     600  `ShortCut` varchar(255) NOT NULL,
     601  `Text` text NOT NULL,
     602  `Comment` text NOT NULL,
     603  `VersionStart` int(11) NOT NULL DEFAULT '8606',
     604  `VersionEnd` int(11) NOT NULL DEFAULT '8606',
     605  PRIMARY KEY (`ID`),
     606  KEY `entry` (`Entry`),
     607  KEY `User` (`User`),
     608  KEY `Take` (`Take`),
     609  KEY `Language` (`Language`),
     610  KEY `Complete` (`Complete`),
     611  KEY `ShortCut` (`ShortCut`),
     612  KEY `VersionStart` (`VersionStart`),
     613  KEY `VersionEnd` (`VersionEnd`)
     614) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=26762 ;
     615
     616-- --------------------------------------------------------
     617
     618--
     619-- Struktura tabulky `TextGlueString`
     620--
     621
     622CREATE TABLE IF NOT EXISTS `TextGlueString` (
     623  `ID` int(11) unsigned NOT NULL AUTO_INCREMENT,
     624  `Entry` int(11) NOT NULL,
     625  `Language` int(11) NOT NULL DEFAULT '0',
     626  `User` int(11) NOT NULL,
     627  `Complete` int(11) NOT NULL,
     628  `Take` int(11) NOT NULL,
     629  `ShortCut` varchar(255) NOT NULL,
     630  `Text` text NOT NULL,
     631  `Comment` text NOT NULL,
     632  `VersionStart` int(11) NOT NULL DEFAULT '8606',
     633  `VersionEnd` int(11) NOT NULL DEFAULT '8606',
     634  PRIMARY KEY (`ID`),
     635  KEY `entry` (`Entry`),
     636  KEY `User` (`User`),
     637  KEY `Take` (`Take`),
     638  KEY `Language` (`Language`),
     639  KEY `Complete` (`Complete`),
     640  KEY `ShortCut` (`ShortCut`),
     641  KEY `VersionStart` (`VersionStart`),
     642  KEY `VersionEnd` (`VersionEnd`)
     643) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=2098 ;
     644
     645-- --------------------------------------------------------
     646
     647--
     648-- Struktura tabulky `TextItem`
     649--
     650
     651CREATE TABLE IF NOT EXISTS `TextItem` (
     652  `ID` int(11) unsigned NOT NULL AUTO_INCREMENT,
     653  `Entry` int(11) NOT NULL,
     654  `Name` text NOT NULL,
     655  `Description` text NOT NULL,
     656  `Language` int(11) NOT NULL DEFAULT '0',
     657  `User` int(11) NOT NULL,
     658  `Complete` int(11) NOT NULL,
     659  `Take` int(11) NOT NULL,
     660  `VersionStart` int(11) NOT NULL DEFAULT '8606',
     661  `VersionEnd` int(11) NOT NULL DEFAULT '8606',
     662  PRIMARY KEY (`ID`),
     663  KEY `entry` (`Entry`),
     664  KEY `User` (`User`),
     665  KEY `Take` (`Take`),
     666  KEY `Complete` (`Complete`),
     667  KEY `Language` (`Language`),
     668  KEY `VersionStart` (`VersionStart`),
     669  KEY `VersionEnd` (`VersionEnd`)
     670) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=70332 ;
     671
     672-- --------------------------------------------------------
     673
     674--
     675-- Struktura tabulky `TextMangosCommand`
     676--
     677
     678CREATE TABLE IF NOT EXISTS `TextMangosCommand` (
     679  `ID` int(11) unsigned NOT NULL AUTO_INCREMENT,
     680  `Entry` int(11) NOT NULL,
     681  `help` text NOT NULL,
     682  `Language` int(11) NOT NULL DEFAULT '0',
     683  `User` int(11) NOT NULL,
     684  `Complete` int(11) NOT NULL,
     685  `Take` int(11) NOT NULL,
     686  `Name` varchar(255) NOT NULL,
     687  `VersionStart` int(11) NOT NULL DEFAULT '8606',
     688  `VersionEnd` int(11) NOT NULL DEFAULT '8606',
     689  PRIMARY KEY (`ID`),
     690  KEY `entry` (`Entry`),
     691  KEY `User` (`User`),
     692  KEY `Take` (`Take`),
     693  KEY `Complete` (`Complete`),
     694  KEY `Language` (`Language`),
     695  KEY `Name` (`Name`),
     696  KEY `VersionStart` (`VersionStart`),
     697  KEY `VersionEnd` (`VersionEnd`)
     698) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=853 ;
     699
     700-- --------------------------------------------------------
     701
     702--
     703-- Struktura tabulky `TextMangosString`
     704--
     705
     706CREATE TABLE IF NOT EXISTS `TextMangosString` (
     707  `ID` int(11) unsigned NOT NULL AUTO_INCREMENT,
     708  `Entry` int(11) NOT NULL,
     709  `content_default` text NOT NULL,
     710  `Language` int(11) NOT NULL DEFAULT '0',
     711  `User` int(11) NOT NULL,
     712  `Complete` int(11) NOT NULL,
     713  `Take` int(11) NOT NULL,
     714  `VersionStart` int(11) NOT NULL DEFAULT '8606',
     715  `VersionEnd` int(11) NOT NULL DEFAULT '8606',
     716  PRIMARY KEY (`ID`),
     717  KEY `entry` (`Entry`),
     718  KEY `User` (`User`),
     719  KEY `Take` (`Take`),
     720  KEY `Complete` (`Complete`),
     721  KEY `Language` (`Language`),
     722  KEY `VersionStart` (`VersionStart`),
     723  KEY `VersionEnd` (`VersionEnd`)
     724) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=2404 ;
     725
     726-- --------------------------------------------------------
     727
     728--
     729-- Struktura tabulky `TextNPC`
     730--
     731
     732CREATE TABLE IF NOT EXISTS `TextNPC` (
     733  `ID` int(11) unsigned NOT NULL AUTO_INCREMENT,
     734  `Entry` int(11) NOT NULL,
     735  `Text0_0` text CHARACTER SET latin2 COLLATE latin2_czech_cs,
     736  `Text0_1` text CHARACTER SET latin2 COLLATE latin2_czech_cs,
     737  `Text1_0` text CHARACTER SET latin2 COLLATE latin2_czech_cs,
     738  `Text1_1` text CHARACTER SET latin2 COLLATE latin2_czech_cs,
     739  `Text2_0` text CHARACTER SET latin2 COLLATE latin2_czech_cs,
     740  `Text2_1` text CHARACTER SET latin2 COLLATE latin2_czech_cs,
     741  `Text3_0` text CHARACTER SET latin2 COLLATE latin2_czech_cs,
     742  `Text3_1` text CHARACTER SET latin2 COLLATE latin2_czech_cs,
     743  `Text4_0` text CHARACTER SET latin2 COLLATE latin2_czech_cs,
     744  `Text4_1` text CHARACTER SET latin2 COLLATE latin2_czech_cs,
     745  `Text5_0` text CHARACTER SET latin2 COLLATE latin2_czech_cs,
     746  `Text5_1` text CHARACTER SET latin2 COLLATE latin2_czech_cs,
     747  `Text6_0` text CHARACTER SET latin2 COLLATE latin2_czech_cs,
     748  `Text6_1` text CHARACTER SET latin2 COLLATE latin2_czech_cs,
     749  `Text7_0` text CHARACTER SET latin2 COLLATE latin2_czech_cs,
     750  `Text7_1` text CHARACTER SET latin2 COLLATE latin2_czech_cs,
     751  `Language` int(11) NOT NULL DEFAULT '0',
     752  `User` int(11) NOT NULL,
     753  `Complete` int(11) NOT NULL,
     754  `Take` int(11) NOT NULL,
     755  `VersionStart` int(11) NOT NULL DEFAULT '8606',
     756  `VersionEnd` int(11) NOT NULL DEFAULT '8606',
     757  PRIMARY KEY (`ID`),
     758  KEY `entry` (`Entry`),
     759  KEY `User` (`User`),
     760  KEY `Take` (`Take`),
     761  KEY `Complete` (`Complete`),
     762  KEY `Language` (`Language`),
     763  KEY `VersionStart` (`VersionStart`),
     764  KEY `VersionEnd` (`VersionEnd`)
     765) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=16781038 ;
     766
     767-- --------------------------------------------------------
     768
     769--
     770-- Struktura tabulky `TextNPCOption`
     771--
     772
     773CREATE TABLE IF NOT EXISTS `TextNPCOption` (
     774  `ID` int(11) unsigned NOT NULL AUTO_INCREMENT,
     775  `Entry` int(11) NOT NULL,
     776  `Language` int(11) NOT NULL DEFAULT '0',
     777  `User` int(11) NOT NULL,
     778  `Complete` int(11) NOT NULL,
     779  `Take` int(11) NOT NULL,
     780  `OptionText` text NOT NULL,
     781  `VersionStart` int(11) NOT NULL DEFAULT '8606',
     782  `VersionEnd` int(11) NOT NULL DEFAULT '8606',
     783  PRIMARY KEY (`ID`),
     784  KEY `entry` (`Entry`),
     785  KEY `User` (`User`),
     786  KEY `Take` (`Take`),
     787  KEY `Language` (`Language`),
     788  KEY `Complete` (`Complete`),
     789  KEY `VersionStart` (`VersionStart`),
     790  KEY `VersionEnd` (`VersionEnd`)
     791) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=129 ;
     792
     793-- --------------------------------------------------------
     794
     795--
     796-- Struktura tabulky `TextPage`
     797--
     798
     799CREATE TABLE IF NOT EXISTS `TextPage` (
     800  `ID` int(11) NOT NULL AUTO_INCREMENT,
     801  `Entry` int(11) NOT NULL,
     802  `Text` text CHARACTER SET latin2 COLLATE latin2_czech_cs,
     803  `Language` int(11) NOT NULL,
     804  `User` int(11) NOT NULL,
     805  `Complete` int(11) NOT NULL,
     806  `Take` int(11) NOT NULL,
     807  `VersionStart` int(11) NOT NULL DEFAULT '8606',
     808  `VersionEnd` int(11) NOT NULL DEFAULT '8606',
     809  PRIMARY KEY (`ID`),
     810  KEY `entry` (`Entry`),
     811  KEY `User` (`User`),
     812  KEY `Take` (`Take`),
     813  KEY `Complete` (`Complete`),
     814  KEY `Language` (`Language`),
     815  KEY `VersionStart` (`VersionStart`),
     816  KEY `VersionEnd` (`VersionEnd`)
     817) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COMMENT='Item System' AUTO_INCREMENT=2469 ;
     818
     819-- --------------------------------------------------------
     820
     821--
     822-- Struktura tabulky `TextQuest`
     823--
     824
     825CREATE TABLE IF NOT EXISTS `TextQuest` (
     826  `ID` int(11) NOT NULL AUTO_INCREMENT,
     827  `Entry` int(11) NOT NULL,
     828  `Title` text CHARACTER SET latin2 COLLATE latin2_czech_cs NOT NULL,
     829  `Details` text CHARACTER SET latin2 COLLATE latin2_czech_cs NOT NULL,
     830  `Objectives` text CHARACTER SET latin2 COLLATE latin2_czech_cs NOT NULL,
     831  `OfferRewardText` text CHARACTER SET latin2 COLLATE latin2_czech_cs NOT NULL,
     832  `RequestItemsText` text CHARACTER SET latin2 COLLATE latin2_czech_cs NOT NULL,
     833  `EndText` text CHARACTER SET latin2 COLLATE latin2_czech_cs NOT NULL,
     834  `ObjectiveText1` text CHARACTER SET latin2 COLLATE latin2_czech_cs NOT NULL,
     835  `ObjectiveText2` text CHARACTER SET latin2 COLLATE latin2_czech_cs NOT NULL,
     836  `ObjectiveText3` text CHARACTER SET latin2 COLLATE latin2_czech_cs NOT NULL,
     837  `ObjectiveText4` text CHARACTER SET latin2 COLLATE latin2_czech_cs NOT NULL,
     838  `Language` int(11) NOT NULL DEFAULT '1',
     839  `User` int(11) NOT NULL,
     840  `Complete` int(11) NOT NULL DEFAULT '1',
     841  `Take` int(11) NOT NULL,
     842  `VersionStart` int(11) NOT NULL DEFAULT '8606',
     843  `VersionEnd` int(11) NOT NULL DEFAULT '8606',
     844  PRIMARY KEY (`ID`),
     845  KEY `entry` (`Entry`),
     846  KEY `User` (`User`),
     847  KEY `complete` (`Complete`),
     848  KEY `Language` (`Language`),
     849  KEY `VersionStart` (`VersionStart`),
     850  KEY `VersionEnd` (`VersionEnd`)
     851) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=14411 ;
     852
     853-- --------------------------------------------------------
     854
     855--
     856-- Struktura tabulky `TextSD2EventAI`
     857--
     858
     859CREATE TABLE IF NOT EXISTS `TextSD2EventAI` (
     860  `ID` int(11) unsigned NOT NULL AUTO_INCREMENT,
     861  `Entry` int(11) NOT NULL,
     862  `content_default` text NOT NULL,
     863  `comment` text NOT NULL,
     864  `Language` int(11) NOT NULL DEFAULT '0',
     865  `User` int(11) NOT NULL,
     866  `Complete` int(11) NOT NULL,
     867  `Take` int(11) NOT NULL,
     868  `VersionStart` int(11) NOT NULL DEFAULT '8606',
     869  `VersionEnd` int(11) NOT NULL DEFAULT '8606',
     870  PRIMARY KEY (`ID`),
     871  KEY `entry` (`Entry`),
     872  KEY `User` (`User`),
     873  KEY `Take` (`Take`),
     874  KEY `Complete` (`Complete`),
     875  KEY `Language` (`Language`),
     876  KEY `VersionStart` (`VersionStart`),
     877  KEY `VersionEnd` (`VersionEnd`)
     878) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=767 ;
     879
     880-- --------------------------------------------------------
     881
     882--
     883-- Struktura tabulky `TextSD2Script`
     884--
     885
     886CREATE TABLE IF NOT EXISTS `TextSD2Script` (
     887  `ID` int(11) unsigned NOT NULL AUTO_INCREMENT,
     888  `Entry` int(11) NOT NULL,
     889  `content_default` text NOT NULL,
     890  `comment` text NOT NULL,
     891  `Language` int(11) NOT NULL DEFAULT '0',
     892  `User` int(11) NOT NULL,
     893  `Complete` int(11) NOT NULL,
     894  `Take` int(11) NOT NULL,
     895  `VersionStart` int(11) NOT NULL DEFAULT '8606',
     896  `VersionEnd` int(11) NOT NULL DEFAULT '8606',
     897  PRIMARY KEY (`ID`),
     898  KEY `entry` (`Entry`),
     899  KEY `User` (`User`),
     900  KEY `Take` (`Take`),
     901  KEY `Complete` (`Complete`),
     902  KEY `Language` (`Language`),
     903  KEY `VersionStart` (`VersionStart`),
     904  KEY `VersionEnd` (`VersionEnd`)
     905) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=1969 ;
     906
     907-- --------------------------------------------------------
     908
     909--
     910-- Struktura tabulky `TextSpell`
     911--
     912
     913CREATE TABLE IF NOT EXISTS `TextSpell` (
     914  `ID` int(11) unsigned NOT NULL AUTO_INCREMENT,
     915  `Entry` int(11) NOT NULL,
     916  `Name` text NOT NULL,
     917  `Description` text NOT NULL,
     918  `ToolTip` text NOT NULL,
     919  `Rank` text NOT NULL,
     920  `Language` int(11) NOT NULL DEFAULT '0',
     921  `User` int(11) NOT NULL,
     922  `Complete` int(11) NOT NULL,
     923  `Take` int(11) NOT NULL,
     924  `VersionStart` int(11) NOT NULL DEFAULT '8606',
     925  `VersionEnd` int(11) NOT NULL DEFAULT '8606',
     926  PRIMARY KEY (`ID`),
     927  KEY `entry` (`Entry`),
     928  KEY `User` (`User`),
     929  KEY `Take` (`Take`),
     930  KEY `Language` (`Language`),
     931  KEY `Complete` (`Complete`),
     932  KEY `VersionStart` (`VersionStart`),
     933  KEY `VersionEnd` (`VersionEnd`)
     934) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=67832 ;
     935
     936-- --------------------------------------------------------
     937
     938--
     939-- Struktura tabulky `TextTransport`
     940--
     941
     942CREATE TABLE IF NOT EXISTS `TextTransport` (
     943  `ID` int(11) unsigned NOT NULL AUTO_INCREMENT,
     944  `Entry` int(11) NOT NULL,
     945  `Language` int(11) NOT NULL DEFAULT '0',
     946  `User` int(11) NOT NULL,
     947  `Complete` int(11) NOT NULL,
     948  `Take` int(11) NOT NULL,
     949  `Name` text NOT NULL,
     950  `VersionStart` int(11) NOT NULL DEFAULT '8606',
     951  `VersionEnd` int(11) NOT NULL DEFAULT '8606',
     952  PRIMARY KEY (`ID`),
     953  KEY `entry` (`Entry`),
     954  KEY `User` (`User`),
     955  KEY `Take` (`Take`),
     956  KEY `Language` (`Language`),
     957  KEY `Complete` (`Complete`),
     958  KEY `VersionStart` (`VersionStart`),
     959  KEY `VersionEnd` (`VersionEnd`)
     960) ENGINE=MyISAM  DEFAULT CHARSET=utf8 AUTO_INCREMENT=43 ;
     961
     962-- --------------------------------------------------------
     963
     964--
     965-- Struktura tabulky `User`
     966--
     967
     968CREATE TABLE IF NOT EXISTS `User` (
     969  `ID` int(11) NOT NULL AUTO_INCREMENT,
     970  `Name` varchar(64) CHARACTER SET latin2 COLLATE latin2_czech_cs NOT NULL,
     971  `Pass` text CHARACTER SET latin2 COLLATE latin2_czech_cs NOT NULL,
     972  `Salt` varchar(255) COLLATE utf8_czech_ci NOT NULL,
     973  `GM` int(11) NOT NULL DEFAULT '0',
     974  `LastIP` text CHARACTER SET latin2 COLLATE latin2_czech_cs NOT NULL,
     975  `LastLogin` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
     976  `LastLogout` datetime DEFAULT NULL,
     977  `Email` text CHARACTER SET latin2 COLLATE latin2_czech_cs NOT NULL,
     978  `Language` int(11) NOT NULL DEFAULT '1',
     979  `XP` int(11) NOT NULL,
     980  `TranslatedCount` int(11) NOT NULL,
     981  `NeedUpdate` int(11) NOT NULL,
     982  `Team` int(11) NOT NULL,
     983  `Redirecting` int(11) NOT NULL,
     984  `RegistrationTime` datetime DEFAULT NULL,
     985  PRIMARY KEY (`ID`),
     986  UNIQUE KEY `user` (`Name`),
     987  KEY `team` (`Team`)
     988) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_czech_ci AUTO_INCREMENT=891 ;
  • trunk/sql/text_table_init_structure.sql

    r119 r376  
    1 CREATE TABLE IF NOT EXISTS `text` (
     1CREATE TABLE IF NOT EXISTS `Text` (
    22  `ID` int(11) unsigned NOT NULL auto_increment,
    3   `entry` int(11) NOT NULL,
     3  `Entry` int(11) NOT NULL,
    44  `Language` int(11) NOT NULL default '0',
    55  `User` int(11) NOT NULL,
    66  `Complete` int(11) NOT NULL,
    77  `Take` int(11) NOT NULL,
     8  `VersionStart` int(11) NOT NULL DEFAULT '8606',
     9  `VersionEnd` int(11) NOT NULL DEFAULT '8606',
    810  PRIMARY KEY  (`ID`),
    9   KEY `entry` (`entry`),
     11  KEY `Entry` (`Entry`),
    1012  KEY `User` (`User`),
    1113  KEY `Take` (`Take`),
    1214  KEY `Language` ( `Language` ),
    1315  KEY `Complete` ( `Complete` )
     16  KEY `VersionStart` (`VersionStart`),
     17  KEY `VersionEnd` (`VersionEnd`)
    1418) ENGINE=MyISAM  DEFAULT CHARSET=utf8;
  • trunk/team.php

    r365 r376  
    88function ShowTeamList()
    99
    10   global $Config, $Database;
     10  global $Config, $Database, $User;
    1111 
    1212  echo('<h3>Seznam překladatelských týmů</h3>');
     
    2626    array('Name' => 'TimeCreate', 'Title' => 'Datum založení'),
    2727  );
    28   if(Licence(LICENCE_USER)) $TableColumns[] = array('Name' => '', 'Title' => 'Uživatelské akce');
     28  if($User->Licence(LICENCE_USER)) $TableColumns[] = array('Name' => '', 'Title' => 'Uživatelské akce');
    2929
    3030  $Order = GetOrderTableHeader($TableColumns, 'NumberUser', 1);
    3131  echo($Order['Output']);
    3232
    33   if(array_key_exists('search', $_GET))  $_SESSION['search'] = ' WHERE `Name` LIKE "%'.$_GET['search'].'%" OR `Description` LIKE "%'.$_GET['search'].'%"';
     33  if(array_key_exists('search', $_GET)) $_SESSION['search'] = ' WHERE `Name` LIKE "%'.$_GET['search'].'%" OR `Description` LIKE "%'.$_GET['search'].'%"';
    3434    else if(!array_key_exists('search', $_SESSION)) $_SESSION['search'] = '';
    3535    if (array_key_exists('search', $_GET) and ($_GET['search'] == '')) $_SESSION['search'] = '';
    36     /*
    37     if(array_key_exists('team', $_GET))
    38     {
    39       $_SESSION['team'] = $_GET['team'];
    40       if($_GET['team'] == '') $_SESSION['team'] = '';     
    41     } else if(!array_key_exists('team', $_SESSION)) $_SESSION['team'] = '';
    42    
    43     if(is_numeric($_SESSION['team'])) $Where = ' WHERE '.$_SESSION['team'];
    44       else $Where = '';
    45 
    46     if(!is_numeric($_SESSION['team'])) echo(' <a href="?Where">Zrušit filtr týmů</a><br />');
    47     */
    48     $DbResult = $Database->SQLCommand('SELECT `Team` FROM `User` WHERE `ID`='.$_SESSION['UserID']);
    49     $User = mysql_fetch_assoc($DbResult);   
    5036
    5137    $ID = $Database->SQLCommand('SELECT *, (SELECT COUNT(*) FROM `User` WHERE `User`.`Team` = `Team`.`Id`) AS `NumberUser`, (SELECT `Name` FROM `User` WHERE `User`.`ID`=`Team`.`Leader`) AS `LeaderName` FROM `Team` '.$_SESSION['search'].$Order['SQL'].$PageList['SQLLimit']);
     
    5844        '<td><a href="userlist.php?team='.$Team['Id'].'" title="Zobrazit členy týmu">'.$Team['NumberUser'].'</a></td>'.
    5945        '<td>'.HumanDate($Team['TimeCreate']).'</td>');
    60       if(Licence(LICENCE_USER))
    61       {
    62         if($Team['Leader'] == $_SESSION['UserID']) $Action = ' <a href="?action=modify&amp;id='.$Team['Id'].'">Upravit</a>';
     46      if($User->Licence(LICENCE_USER))
     47      {
     48        if($Team['Leader'] == $User->Id) $Action = ' <a href="?action=modify&amp;id='.$Team['Id'].'">Upravit</a>';
    6349          else $Action = '';
    64         if($Team['Id'] == $User['Team']) $Action = ' <a href="?action=leave">Opustit</a>';
     50        if($Team['Id'] == $User->Team) $Action = ' <a href="?action=leave">Opustit</a>';
    6551        echo('<td><a href="?action=gointeam&amp;id='.$Team['Id'].'">Vstoupit</a>'.$Action.'</td>');
    6652      }
     
    7056    echo($PageList['Output']);
    7157   
    72     if(Licence(LICENCE_USER)) echo('<br /><div style="text-align: center;"><a href="?action=create">Vytvořit překladatelský tým</a></div>');
     58    if($User->Licence(LICENCE_USER)) echo('<br /><div style="text-align: center;"><a href="?action=create">Vytvořit překladatelský tým</a></div>');
    7359}         
    7460
    7561function TeamJoin()
    7662{
    77   global $Database;
    78  
    79   if(Licence(LICENCE_USER))
     63  global $Database, $User;
     64 
     65  if($User->Licence(LICENCE_USER))
    8066  {   
    8167    if(array_key_exists('id', $_GET))
    8268    {
    83       $Database->SQLCommand('UPDATE `User` SET `Team` = '.$_GET['id'].' WHERE `ID` = '.$_SESSION['UserID']);
     69      $Database->SQLCommand('UPDATE `User` SET `Team` = '.$_GET['id'].' WHERE `ID` = '.$User->Id);
    8470      echo('<strong>Vstoupil jsi do týmu</strong><br /><br />');   
    8571      WriteLog('Uživatel vstoupil do týmu '.$_GET['id'], LOG_TYPE_USER);
     
    9884function TeamCreateFinish()
    9985{
    100   global $Database;
    101  
    102   if(Licence(LICENCE_USER))
     86  global $Database, $User;
     87 
     88  if($User->Licence(LICENCE_USER))
    10389  {   
    10490    if(array_key_exists('Name', $_POST) and array_key_exists('Description', $_POST))
     
    10995      if(($Count == 0) and ($_POST['Name'] != ''))
    11096      {
    111         $Database->SQLCommand('INSERT INTO `Team` (`Name` ,`Description`, `URL`, `TimeCreate`,`Leader`) VALUES ("'.trim($_POST['Name']).'", "'.trim($_POST['Description']).'", "'.$_POST['URL'].'", NOW(), '.$_SESSION['UserID'].')'); 
    112         $Database->SQLCommand('UPDATE `User` SET `Team` = '.mysql_insert_id().' WHERE `ID` = '.$_SESSION['UserID']);
     97        $Database->SQLCommand('INSERT INTO `Team` (`Name` ,`Description`, `URL`, `TimeCreate`,`Leader`) VALUES ("'.trim($_POST['Name']).'", "'.trim($_POST['Description']).'", "'.$_POST['URL'].'", NOW(), '.$User->Id.')'); 
     98        $Database->SQLCommand('UPDATE `User` SET `Team` = '.mysql_insert_id().' WHERE `ID` = '.$User->Id);
    11399        echo('<strong>Překladatelský tým vytvořen</strong><br /><br />');
    114100        WriteLog('Překladatelský tým vytvořen '.$_POST['Name'], LOG_TYPE_USER);
     
    124110function TeamModify()
    125111{
    126   global $Database;
    127  
    128   if(Licence(LICENCE_USER))
     112  global $Database, $User;
     113 
     114  if($User->Licence(LICENCE_USER))
    129115  {   
    130116    if(array_key_exists('id', $_GET))
    131117    {
    132       $DbResult = $Database->SQLCommand('SELECT * FROM `Team` WHERE `Id`='.$_GET['id'].' AND `Leader`='.$_SESSION['UserID']);
     118      $DbResult = $Database->SQLCommand('SELECT * FROM `Team` WHERE `Id`='.$_GET['id'].' AND `Leader`='.$User->Id);
    133119      if(mysql_num_rows($DbResult) > 0)
    134120      {
     
    148134function TeamModifyFinish()
    149135{
    150   global $Database;
    151  
    152   if(Licence(LICENCE_USER))
     136  global $Database, $User;
     137 
     138  if($User->Licence(LICENCE_USER))
    153139  {   
    154140    if(array_key_exists('id', $_GET) and array_key_exists('Name', $_POST) and array_key_exists('Description', $_POST) and array_key_exists('URL', $_POST))
    155141    {
    156       $DbResult = $Database->SQLCommand('SELECT * FROM `Team` WHERE `Id`='.$_GET['id'].' AND `Leader`='.$_SESSION['UserID']);
     142      $DbResult = $Database->SQLCommand('SELECT * FROM `Team` WHERE `Id`='.$_GET['id'].' AND `Leader`='.$User->Id);
    157143      if(mysql_num_rows($DbResult) > 0)
    158144      {
     
    175161function TeamCreate()
    176162{
    177   if(Licence(LICENCE_USER))
     163  global $User;
     164 
     165  if($User->Licence(LICENCE_USER))
    178166  {   
    179167    echo('<form action="?action=finish_create" method="post">'.
     
    189177function TeamShow()
    190178{
    191   global $Database, $TranslationTree;
     179  global $Database, $TranslationTree, $User;
    192180 
    193181  if(array_key_exists('id', $_GET))
     
    208196    $Team['Description'].'<br /><br />');
    209197    //echo('<a href="export/?team='.$Team['Id'].'">Exportovat překlad týmu</a> ');
    210     if(Licence(LICENCE_USER)) echo('<a href="?action=gointeam&amp;id='.$Team['Id'].'">Vstoupit do týmu</a><br /><br />');
     198    if($User->Licence(LICENCE_USER)) echo('<a href="?action=gointeam&amp;id='.$Team['Id'].'">Vstoupit do týmu</a><br /><br />');
    211199    echo('<fieldset><legend>Statistika</legend>'.
    212200      'Počet členů týmu: <a href="userlist.php?team='.$Team['Id'].'" title="Zobrazit členy týmu">'.$Team['NumberUser'].'</a><br />'.
     
    223211function TeamLeave()
    224212{
    225   global $Database;
    226  
    227   if(Licence(LICENCE_USER))
    228   {   
    229     $Database->SQLCommand('UPDATE `User` SET `Team` = 0 WHERE `ID` = '.$_SESSION['UserID']);
     213  global $Database, $User;
     214 
     215  if($User->Licence(LICENCE_USER))
     216  {   
     217    $Database->SQLCommand('UPDATE `User` SET `Team` = 0 WHERE `ID` = '.$User->Id);
    230218    echo('<strong>Nyní nejste členem žádného týmu</strong><br /><br />');   
    231219    WriteLog('Uživatel vystoupil z týmu', LOG_TYPE_USER);
  • trunk/user.php

    r365 r376  
    55ShowPage();
    66
    7 if(array_key_exists('text', $_POST) and Licence(LICENCE_ADMIN))
     7if(array_key_exists('text', $_POST) and $User->Licence(LICENCE_ADMIN))
    88{
    9   $text = $_POST['text'];
    10   $email = $_POST['email'];
    11   $subject = $_POST['subject'];
    12   echo('Email: <strong>'.$email.'</strong><br />');
    13   echo('Předmět: <strong>'.$subject.'</strong><br />');
    14   echo('Text: <strong>'.$text.'</strong><br />');
     9  $Text = $_POST['text'];
     10  $Email = $_POST['email'];
     11  $Subject = $_POST['subject'];
     12  echo('Email: <strong>'.$Email.'</strong><br />');
     13  echo('Předmět: <strong>'.$Subject.'</strong><br />');
     14  echo('Text: <strong>'.$Text.'</strong><br />');
    1515   
    16   if(@mail($email, $subject, $text, 'From: '.$Config['Web']['AdminEmail'].'\nReply-To: '.$Config['Web']['AdminEmail'].'\nX-Mailer: PHP/'))
     16  if(@mail($Email, $Subject, $Text, 'From: '.$Config['Web']['AdminEmail'].'\nReply-To: '.$Config['Web']['AdminEmail'].'\nX-Mailer: PHP/'))
    1717  {
    1818    echo('Zpráva byla odeslána.<br /><br />');
    1919  }
    20   else
    21   {
    22     echo('Nepodařilo se odesat E-mail.<br /><br />');
    23   }
     20  else echo('Nepodařilo se odesat E-mail.<br /><br />');
    2421}
    2522 
    26 if(array_key_exists('user', $_GET) and Licence(LICENCE_MODERATOR))
     23if(array_key_exists('user', $_GET) and $User->Licence(LICENCE_MODERATOR))
    2724
    2825  $Query = 'SELECT * FROM `User` WHERE `ID` = '.$_GET['user'];
    29   $User = mysql_fetch_array($Database->SQLCommand($Query));
     26  $UserLine = mysql_fetch_array($Database->SQLCommand($Query));
    3027   
    31   echo('ID: <strong>'.$User['ID'].'</strong><br />');
    32   echo('Jméno: <strong>'.$User['Name'].'</strong><br />');
    33   echo('Výchozí jazyk: <strong>'.$LanguageList[$User['Language']]['Name'].'</strong><br />');
    34   echo('Poslední připojení: <strong>'.$User['LastLogin'].'</strong><br />');
    35   echo('Poslední IP: <strong>'.$User['LastIP'].'</strong><br />');
    36   echo('Počet přeložených: <a href="TranslationList.php?user='.$User['ID'].'&amp;action=userall" title="Zobrazit Všechny jeho přeložené texty"><strong>'.$User['TranslatedCount'].'</strong></a><br />');
    37   echo('Email: <strong>'.$User['Email'].'</strong><br />');
     28  echo('ID: <strong>'.$UserLine['ID'].'</strong><br />');
     29  echo('Jméno: <strong>'.$UserLine['Name'].'</strong><br />');
     30  echo('Výchozí jazyk: <strong>'.$LanguageList[$UserLine['Language']]['Name'].'</strong><br />');
     31  echo('Poslední připojení: <strong>'.$UserLine['LastLogin'].'</strong><br />');
     32  echo('Poslední IP: <strong>'.$UserLine['LastIP'].'</strong><br />');
     33  echo('Počet přeložených: <a href="TranslationList.php?user='.$UserLine['ID'].'&amp;action=userall" title="Zobrazit Všechny jeho přeložené texty"><strong>'.$UserLine['TranslatedCount'].'</strong></a><br />');
     34  echo('Email: <strong>'.$UserLine['Email'].'</strong><br />');
    3835  echo('<br />
    3936
    4037<form action="user.php" method="post"><div>
    4138Napsat E-mail:
    42 <input type="text" name="email" value="'.$User['Email'].'" />
     39<input type="text" name="email" value="'.$UserLine['Email'].'" />
    4340Předmět:
    4441<input type="text" name="subject" value="Projekt překládání textů WoW" />
     
    4744<textarea name="text" rows="20" cols="62">
    4845
    49 S pozdravem '.$_SESSION['User'].'
     46S pozdravem '.$User->Name.'
    5047--------------------------------------------------------
    5148Projekt překládání textů WoW '.$Config['Web']['BaseURL'].'
  • trunk/userlist.php

    r365 r376  
    4949while($Line = mysql_fetch_assoc($ID))
    5050{
    51   if(Licence(LICENCE_MODERATOR))
     51  if($User->Licence(LICENCE_MODERATOR))
    5252    $Name = '<a href="user.php?user='.$Line['ID'].'">'.$Line['Name'].'</a>';
    5353    else $Name = $Line['Name'];
Note: See TracChangeset for help on using the changeset viewer.