Changeset 880 for trunk/Modules/User


Ignore:
Timestamp:
Apr 7, 2020, 10:15:48 PM (5 years ago)
Author:
chronos
Message:
  • Modified: Improved code formatting.
Location:
trunk/Modules/User
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Modules/User/Options.php

    r861 r880  
    1717        '<option value="0">'.T('Nowhere').'</option>'.
    1818        '<option value="1"';
    19     if($this->System->User->Redirecting == '1') $Output .= ' selected="selected"';
     19    if ($this->System->User->Redirecting == '1') $Output .= ' selected="selected"';
    2020    $Output .= '>'.T('To untranslated').'</option>';
    2121    $Output .= '<option value="2"';
    22     if($this->System->User->Redirecting == '2') $Output .= ' selected="selected"';
     22    if ($this->System->User->Redirecting == '2') $Output .= ' selected="selected"';
    2323    $Output .= '>'.T('To next translation').'</option>';
    2424    $Output .= '<option value="3"';
    25     if($this->System->User->Redirecting == '3') $Output .= ' selected="selected"';
     25    if ($this->System->User->Redirecting == '3') $Output .= ' selected="selected"';
    2626    $Output .= '>'.T('To previous translation').'</option>';
    2727    $Output .= '</select>';
     
    6060        '<input type="hidden" name="action" value="gointeam"/>'.
    6161        '<select name="id">';
    62     while($LineTeam = $DbResult->fetch_assoc())
     62    while ($LineTeam = $DbResult->fetch_assoc())
    6363    {
    6464      $Output .= '<option value="'.$LineTeam['Id'].'"';
     
    6969    </form>';
    7070    $Output .= '</fieldset>';
    71     return($Output);
     71    return $Output;
    7272  }
    7373
     
    7575  {
    7676    $Output = '';
    77     if(array_key_exists('Email', $_POST))
     77    if (array_key_exists('Email', $_POST))
    7878    {
    7979      $Email = $_POST['Email'];
     
    8484      $Redirecting = $_POST['redirecting'];
    8585      $PreferredVersion = $_POST['ClientVersion'];
    86       if($PreferredVersion == '') $PreferredVersion = null;
     86      if ($PreferredVersion == '') $PreferredVersion = null;
    8787      $Info = $_POST['info'];
    8888
    8989      // Do user want to change password?
    90       if(($OldPass != '') or ($NewPass != '') or ($NewPass2 != ''))
     90      if (($OldPass != '') or ($NewPass != '') or ($NewPass2 != ''))
    9191      {
    92         if($NewPass == $NewPass2)
     92        if ($NewPass == $NewPass2)
    9393        {
    9494          $DbResult = $this->System->Database->query('SELECT `Pass`, '.$this->System->User->CryptPasswordSQL('"'.$OldPass.'"', '`Salt`').' AS `Hash` FROM `User` WHERE `ID`= '.$this->System->User->Id);
    9595          $DbRow = $DbResult->fetch_assoc();
    96           if($DbRow['Hash'] == $DbRow['Pass'])
     96          if ($DbRow['Hash'] == $DbRow['Pass'])
    9797          {
    9898            // Update password
     
    130130      $this->System->User->Load();
    131131    } else $Output .= ShowMessage('Nezadány údaje.', MESSAGE_CRITICAL);
    132     return($Output);
     132    return $Output;
    133133  }
    134134
     
    137137    $this->Title = T('User settings');
    138138    $Output = '';
    139     if($this->System->User->Licence(LICENCE_USER))
     139    if ($this->System->User->Licence(LICENCE_USER))
    140140    {
    141       if(array_key_exists('action', $_GET) and ($_GET['action'] == 'save'))
     141      if (array_key_exists('action', $_GET) and ($_GET['action'] == 'save'))
    142142      {
    143143        $Output .= $this->UserOptionsSave();
     
    145145      $Output .= $this->UserOptionsFrom();
    146146    } else $Output .= ShowMessage('Nejste přihlášený.', MESSAGE_CRITICAL);
    147     return($Output);
     147    return $Output;
    148148  }
    149149}
  • trunk/Modules/User/Profile.php

    r861 r880  
    66  {
    77    $Output = '';
    8     if(array_key_exists('text', $_POST))
    9     if($this->System->User->Licence(LICENCE_ADMIN))
     8    if (array_key_exists('text', $_POST))
     9    if ($this->System->User->Licence(LICENCE_ADMIN))
    1010    {
    1111      $Text = $_POST['text'];
     
    1616        'Text: <strong>'.$Text.'</strong><br />';
    1717
    18       if(@mail($Email, $Subject, $Text, 'From: '.$this->System->Config['Web']['AdminEmail'].
     18      if (@mail($Email, $Subject, $Text, 'From: '.$this->System->Config['Web']['AdminEmail'].
    1919        '\nReply-To: '.$this->System->Config['Web']['AdminEmail'].'\nX-Mailer: PHP/'))
    2020      {
     
    2323      else $Output .= ShowMessage('Nepodařilo se odesat E-mail.', MESSAGE_CRITICAL);
    2424    } else $Output .= ShowMessage(T('Access denied'), MESSAGE_CRITICAL);
    25     return($Output);
     25    return $Output;
    2626  }
    2727
     
    5757      '(SELECT COUNT(*) FROM `ExportUser` WHERE `ExportUser`.`Export`=`Export`.`Id`) AS `UserCount` FROM `Export` '.
    5858      'LEFT JOIN `User` ON `User`.`ID`=`Export`.`User` '.$Filter.$Order['SQL'].$PageList['SQLLimit']);
    59     while($Export = $DbResult->fetch_assoc())
     59    while ($Export = $DbResult->fetch_assoc())
    6060    {
    6161      $Action = '<a href="'.$this->System->Link('/export/?Action=View&amp;ExportId='.$Export['Id'].'&amp;Tab=0').'">'.T('Show').'</a> '.
    6262        '<a href="'.$this->System->Link('/export/?Action=View&amp;ExportId='.$Export['Id'].'&amp;Tab=7').'">'.T('Export').'</a>';
    63       if($Export['User'] == $this->System->User->Id) $Action .= ' <a href="?Action=Delete&amp;ExportId='.$Export['Id'].'" onclick="return confirmAction(\''.T('Really remove item?').'\');">'.T('Remove').'</a>';
    64       if($this->System->User->Id != null) $Action .= ' <a href="'.$this->System->Link('/export/?Action=Clone&amp;ExportId='.$Export['Id']).'" onclick="return confirmAction(\''.T('Really clone item?').'\');">'.T('Clone').'</a>';
     63      if ($Export['User'] == $this->System->User->Id) $Action .= ' <a href="?Action=Delete&amp;ExportId='.$Export['Id'].'" onclick="return confirmAction(\''.T('Really remove item?').'\');">'.T('Remove').'</a>';
     64      if ($this->System->User->Id != null) $Action .= ' <a href="'.$this->System->Link('/export/?Action=Clone&amp;ExportId='.$Export['Id']).'" onclick="return confirmAction(\''.T('Really clone item?').'\');">'.T('Clone').'</a>';
    6565      $Output .= '<tr><td>'.HumanDate($Export['TimeCreate']).'</td>'.
    6666        '<td>'.htmlspecialchars($Export['Title']).'</td>'.
     
    7474
    7575    $Output .= '<div style="text-align: center;"><a href="'.$this->System->Link('/export/').'">'.T('Export page').'</a></div>';
    76     return($Output);
     76    return $Output;
    7777  }
    7878
     
    8686    $UnionItems = array();
    8787    $DbResult = $this->Database->query($GroupListQuery);
    88     if($DbResult->num_rows > 0)
    89     {
    90       while($DbRow = $DbResult->fetch_assoc())
     88    if ($DbResult->num_rows > 0)
     89    {
     90      while ($DbRow = $DbResult->fetch_assoc())
    9191      {
    9292        $UnionItems[] = 'SELECT `T`.`ID`, `T`.`Take`, `T`.`User`, `T`.`ModifyTime`, `T`.`Group`, `T`.`GroupName` '.
     
    106106      $Output .= '<table class="BaseTable"><tr>'.
    107107        '<th>'.T('Date').'</th><th>'.T('New').'</th><th>'.T('Source').'</th><th>'.T('Group').'</th></tr>';
    108       while($DbRow = $DbResult->fetch_assoc())
     108      while ($DbRow = $DbResult->fetch_assoc())
    109109      {
    110110        $Output .= '<tr><td>'.HumanDate($DbRow['ModifyTime']).'</td>'.
     
    115115      $Output .= '</table>';
    116116    }
    117     return($Output);
     117    return $Output;
    118118  }
    119119
     
    130130      'JOIN `ForumThread` ON `ForumThread`.`ID` = `ForumText`.`Thread` '.
    131131      'WHERE `ForumText`.`User` = '.($_GET['user'] * 1).' ORDER BY `ForumText`.`Date` DESC LIMIT '.$Count);
    132     while($Line = $DbResult->fetch_assoc())
     132    while ($Line = $DbResult->fetch_assoc())
    133133      $Output .= '<div><a href="'.$this->System->Link('/forum/?Thread='.$Line['Thread']).'">'.htmlspecialchars($Line['ThreadName']).'</a><br />'.
    134134        '<strong>'.$Line['UserName'].'</strong> ('.HumanDate($Line['Date']).'): '.$parser->qparse(htmlspecialchars($Line['Text'])).'</div> ';
    135135    $Output .= '</div>';
    136     return($Output);
     136    return $Output;
    137137  }
    138138
     
    151151      'WHERE `User`.`Id` = '.($_GET['user'] * 1);
    152152    $DbResult = $this->Database->query($Query);
    153     if($DbResult->num_rows > 0)
     153    if ($DbResult->num_rows > 0)
    154154    {
    155155      $UserLine = $DbResult->fetch_array();
     
    163163        T('Number of translated:').' <a href="'.$this->System->Link('/TranslationList.php?user='.$UserLine['ID'].'&amp;state=2&amp;group=0').'" title="Zobrazit Všechny jeho přeložené texty"><strong>'.$UserLine['TranslatedCount'].'</strong></a><br />'.
    164164        T('Level:').' <strong>'.$XP['Level'].'</strong> '.T('experience:').' '.ProgressBar(150, round($XP['XP'] / $XP['MaxXP'] * 100, 2), $XP['XP'].' / '.$XP['MaxXP']).'<br/>';
    165       if($this->System->ModuleManager->ModuleRunning('Team') and ($UserLine['TeamName'] != ''))
     165      if ($this->System->ModuleManager->ModuleRunning('Team') and ($UserLine['TeamName'] != ''))
    166166        $Output .= T('Member of team:').' <a href="'.$this->System->Link('/team/?action=team&amp;id='.$UserLine['Team']).'"><strong>'.htmlspecialchars($UserLine['TeamName']).'</strong></a><br />';
    167167
     
    187187      '</tr></table>';
    188188    $Output .= '<br />'.$this->ShowLastForum().'<br />';
    189     if($this->System->User->Licence(LICENCE_MODERATOR))
     189    if ($this->System->User->Licence(LICENCE_MODERATOR))
    190190    {
    191191      $Output .= '<fieldset><legend>Moderování</legend>';
     
    243243      }
    244244    } else $Output .= ShowMessage('Uživatel nenalezen', MESSAGE_CRITICAL);
    245     return($Output);
     245    return $Output;
    246246  }
    247247
     
    250250    $this->Title = T('User profile');
    251251    $Output = $this->SendMail();
    252     if(array_key_exists('user', $_GET))
     252    if (array_key_exists('user', $_GET))
    253253    {
    254254      $Output .= $this->ShowProfile();
    255255    } else $Output .= ShowMessage('Nevybrán uživatel', MESSAGE_CRITICAL);
    256     return($Output);
     256    return $Output;
    257257  }
    258258}
  • trunk/Modules/User/Registration.php

    r861 r880  
    55  function ShowForm()
    66  {
    7     if(array_key_exists('sc', $_POST)) $Human = true;
     7    if (array_key_exists('sc', $_POST)) $Human = true;
    88      else $Human = false;
    9     if(array_key_exists('user', $_POST)) $UserName = $_POST['user'];
     9    if (array_key_exists('user', $_POST)) $UserName = $_POST['user'];
    1010      else $UserName = '';
    11     if(array_key_exists('Email', $_POST)) $Email = $_POST['Email'];
     11    if (array_key_exists('Email', $_POST)) $Email = $_POST['Email'];
    1212      else $Email = '';
    13     if(array_key_exists('Team', $_POST)) $Team = $_POST['Team'];
     13    if (array_key_exists('Team', $_POST)) $Team = $_POST['Team'];
    1414      else $Team = '';
    15     if(array_key_exists('Language', $_POST)) $Language = $_POST['Language'];
     15    if (array_key_exists('Language', $_POST)) $Language = $_POST['Language'];
    1616      else $Language = 1;
    1717
     
    2424    <tr>
    2525    <th class="Left">'.T('Are you human?').'</th>';
    26     if($Human) $Checked = ' checked="checked"';
     26    if ($Human) $Checked = ' checked="checked"';
    2727      else $Checked = '';
    2828    $Output .= '<td><input type="checkbox" name="sc" '.$Checked.'/></td>
     
    5050    <tr>
    5151    <th class="Left">'.T('I belong to team').':</th>';
    52     if($Team == '') $Selected = ' selected="selected"';
     52    if ($Team == '') $Selected = ' selected="selected"';
    5353      else $Selected = '';
    5454    $Output .= '<td><select name="Team"><option value="0"'.$Selected.'>'.T('none').'</option>';
    5555    $DbResult = $this->Database->query('SELECT `Name`, `Id` FROM `Team`');
    56     while($Line = $DbResult->fetch_assoc())
     56    while ($Line = $DbResult->fetch_assoc())
    5757    {
    58       if($Team == $Line['Id']) $Selected = ' selected="selected"';
     58      if ($Team == $Line['Id']) $Selected = ' selected="selected"';
    5959      else $Selected = '';
    6060      $Output .= '<option value="0'.$Line['Id'].'"'.$Selected.'>'.htmlspecialchars($Line['Name']).'</option>';
     
    8181    </tr>
    8282    </table></fieldset></form>';
    83     return($Output);
     83    return $Output;
    8484  }
    8585
     
    9191    $ShowForm = true;
    9292
    93       if(array_key_exists('user', $_POST)) $UserName = $_POST['user'];
     93      if (array_key_exists('user', $_POST)) $UserName = $_POST['user'];
    9494        else $UserName = '';
    95       if(array_key_exists('pass', $_POST)) $Pass = $_POST['pass'];
     95      if (array_key_exists('pass', $_POST)) $Pass = $_POST['pass'];
    9696        else $Pass = '';
    97       if(array_key_exists('pass2', $_POST)) $Pass2 = $_POST['pass2'];
     97      if (array_key_exists('pass2', $_POST)) $Pass2 = $_POST['pass2'];
    9898        else $Pass2 = '';
    99       if(array_key_exists('Email', $_POST)) $Email = $_POST['Email'];
     99      if (array_key_exists('Email', $_POST)) $Email = $_POST['Email'];
    100100        else $Email = '';
    101       if(array_key_exists('Team', $_POST)) $Team = $_POST['Team'] * 1;
     101      if (array_key_exists('Team', $_POST)) $Team = $_POST['Team'] * 1;
    102102        else $Team = '';
    103       if(array_key_exists('Language', $_POST)) $Language = $_POST['Language'] * 1;
     103      if (array_key_exists('Language', $_POST)) $Language = $_POST['Language'] * 1;
    104104        else $Language = '';
    105       if(array_key_exists('ClientVersion', $_POST)) $PreferredVersion = $_POST['ClientVersion'] * 1;
     105      if (array_key_exists('ClientVersion', $_POST)) $PreferredVersion = $_POST['ClientVersion'] * 1;
    106106        else $PreferredVersion = '';
    107       if($PreferredVersion == '') $PreferredVersion = 'NULL';
    108       if(array_key_exists('sc', $_POST)) $SpamCheck = $_POST['sc'];
     107      if ($PreferredVersion == '') $PreferredVersion = 'NULL';
     108      if (array_key_exists('sc', $_POST)) $SpamCheck = $_POST['sc'];
    109109        else $SpamCheck = '';
    110110
    111       if($SpamCheck != '')
     111      if ($SpamCheck != '')
    112112      {
    113         if(($UserName != '') and ($Pass != '') and ($Pass2 != ''))
     113        if (($UserName != '') and ($Pass != '') and ($Pass2 != ''))
    114114        {
    115           if(!in_array(strtolower($UserName), $Config['ForbiddedUserNames']))
     115          if (!in_array(strtolower($UserName), $Config['ForbiddedUserNames']))
    116116          {
    117             if($Pass == $Pass2)
     117            if ($Pass == $Pass2)
    118118            {
    119119              $DbResult = $this->Database->query('SELECT * FROM `User` WHERE LOWER(`Name`) = LOWER("'.$UserName.'")');
    120120              $Line = $DbResult->fetch_row();
    121               if(!$Line)
     121              if (!$Line)
    122122              {
    123                 if($Team == 0) $Team = 'NULL';
     123                if ($Team == 0) $Team = 'NULL';
    124124                $this->System->User->Register($UserName, $Pass, $Email, $Language, $Team, $PreferredVersion);
    125125                $Output .= ShowMessage(T('Registration was successful'));
     
    154154      } else $Output = ShowMessage('Nejsi člověk. Strojům není dovoleno se registrovat.', MESSAGE_CRITICAL);
    155155
    156       if($ShowForm) $Output .= $this->ShowForm();
    157       return($Output);
     156      if ($ShowForm) $Output .= $this->ShowForm();
     157      return $Output;
    158158  }
    159159
     
    162162    $this->Title = T('User registration');
    163163    $Output = '';
    164     if(array_key_exists('user', $_POST))
     164    if (array_key_exists('user', $_POST))
    165165    {
    166166      $Output .= $this->CheckRegistration();
    167167    } else $Output .= $this->ShowForm();
    168     return($Output);
     168    return $Output;
    169169  }
    170170}
  • trunk/Modules/User/User.php

    r871 r880  
    3434      'Icon' => '',
    3535    ), 0);
    36     if(array_key_exists('Search', $this->System->ModuleManager->Modules))
     36    if (array_key_exists('Search', $this->System->ModuleManager->Modules))
    3737      $this->System->ModuleManager->Modules['Search']->RegisterSearch('user',
    3838      T('Translators'), array('Name'), '`User`', $this->System->Link('/users/?search='));
     
    4949      'WHERE (`ActivityTime` >= NOW() - 300) '.
    5050      'ORDER BY `ActivityTime` DESC ) AS `T` GROUP BY `Name`');
    51     while($DbUser = $DbResult->fetch_assoc())
     51    while ($DbUser = $DbResult->fetch_assoc())
    5252    {
    5353      $Name = '<a href="'.$this->System->Link('/user/?user='.$DbUser['ID']).'">'.$DbUser['Name'].'</a>';
    5454      $Output .= $Name.'<br />';
    5555    }
    56     return($Output);
     56    return $Output;
    5757  }
    5858
     
    6060  {
    6161    $Output = '';
    62     if($this->System->User->Licence(LICENCE_USER))
     62    if ($this->System->User->Licence(LICENCE_USER))
    6363    {
    6464      //$DbResult =$this->Database->query('SELECT `Id`, `Name` FROM `Team` WHERE `Id`='.$this->System->User->Team);
     
    7979        '<a href="'.$this->System->Link('/registration/').'">'.T('Registration').'</a>';
    8080    }
    81     return($Output);
     81    return $Output;
    8282  }
    8383}
     
    104104      </table>
    105105      </fieldset></form>';
    106       return($Output);
     106      return $Output;
    107107  }
    108108}
     
    132132    $this->Database = &$System->Database;
    133133    $this->OnlineStateTimeout = 600; // in seconds
    134     if(isset($_SESSION)) $this->Check();
     134    if (isset($_SESSION)) $this->Check();
    135135  }
    136136
     
    144144    $DbResult = $this->Database->query('SELECT `ID` FROM `User` WHERE '.
    145145      'LOWER(`Name`) = LOWER("'.$Name.'") AND `Pass` = '.$this->CryptPasswordSQL('"'.$Password.'"', '`Salt`'));
    146     if($DbResult->num_rows > 0)
     146    if ($DbResult->num_rows > 0)
    147147    {
    148148      $User = $DbResult->fetch_assoc();
     
    151151      // Prepare cookies for permanent login
    152152      $StayLoggedSalt = $this->GetPasswordSalt();
    153       if($StayLogged == true) $StayLoggedValue = 1; else $StayLoggedValue = 0;
     153      if ($StayLogged == true) $StayLoggedValue = 1; else $StayLoggedValue = 0;
    154154      $this->Database->update('UserOnline', '`SessionId`="'.$SID.'"', array(
    155155        'User' => $User['ID'], 'StayLogged' => $StayLoggedValue, 'StayLoggedHash' => $StayLoggedSalt));
    156       if($StayLogged)
     156      if ($StayLogged)
    157157      {
    158158        setcookie('LoginUserId', $User['ID'], time() + 365 * 24 * 60 * 60);
     
    176176  {
    177177    $SID = session_id();
    178     if($this->Role != LICENCE_ANONYMOUS)
     178    if ($this->Role != LICENCE_ANONYMOUS)
    179179    {
    180180      $this->Database->update('UserOnline', '`SessionId`="'.$SID.'"', array('User' => null));
     
    192192    'LEFT JOIN `ClientVersion` ON `ClientVersion`.`Id` = `User`.`PreferredVersion` '.
    193193    'WHERE `User`.`ID` = '.$this->Id);
    194     if($DbResult->num_rows > 0)
     194    if ($DbResult->num_rows > 0)
    195195    {
    196196      $User = $DbResult->fetch_assoc();
     
    222222  function Licence($Licence)
    223223  {
    224     if(GetRemoteAddress() == '') return(true); // Execution from command line
    225       else return($this->Role >= $Licence);
     224    if (GetRemoteAddress() == '') return true; // Execution from command line
     225      else return $this->Role >= $Licence;
    226226  }
    227227
     
    229229  {
    230230    $DbResult = $this->Database->select('APIToken', 'User', '`Token`="'.$Token.'"');
    231     if($DbResult->num_rows > 0)
     231    if ($DbResult->num_rows > 0)
    232232    {
    233233      $DbRow = $DbResult->fetch_assoc();
    234234      $DbResult2 = $this->Database->select('User', 'GM', '`ID`="'.$DbRow['User'].'"');
    235235      $DbRow2 = $DbResult2->fetch_assoc();
    236       return($DbRow2['GM'] >= $Licence);
    237     } else return(false);
     236      return $DbRow2['GM'] >= $Licence;
     237    } else return false;
    238238  }
    239239
    240240  function GetPasswordSalt()
    241241  {
    242     return(substr(sha1(mt_rand()), 0, 8));
     242    return substr(sha1(mt_rand()), 0, 8);
    243243  }
    244244
    245245  function CryptPasswordSQL($Password, $Salt)
    246246  {
    247     return('SHA1(CONCAT(SHA1('.$Password.'), '.$Salt.'))');
     247    return 'SHA1(CONCAT(SHA1('.$Password.'), '.$Salt.'))';
    248248  }
    249249
     
    253253    // Lookup user record
    254254    $Query = $this->Database->select('UserOnline', '*', 'SessionId="'.$SID.'"');
    255     if($Query->num_rows > 0)
     255    if ($Query->num_rows > 0)
    256256    {
    257257      // Refresh time of last access
    258258      $this->Database->update('UserOnline', 'SessionId="'.$SID.'"', array('ActivityTime' => 'NOW()'));
    259259    } else {
    260       if(GetRemoteAddress() != '') $HostName = gethostbyaddr(GetRemoteAddress());
     260      if (GetRemoteAddress() != '') $HostName = gethostbyaddr(GetRemoteAddress());
    261261        else $HostName = '';
    262262      $this->Database->insert('UserOnline', array('SessionId' => $SID,
     
    267267
    268268    // Logged permanently?
    269     if(array_key_exists('LoginHash', $_COOKIE))
     269    if (array_key_exists('LoginHash', $_COOKIE))
    270270    {
    271271      $DbResult = $this->Database->query('SELECT * FROM `UserOnline` WHERE `User`='.$_COOKIE['LoginUserId'].
    272272        ' AND `StayLogged`=1 AND SessionId!="'.$SID.'"');
    273       if($DbResult->num_rows > 0)
     273      if ($DbResult->num_rows > 0)
    274274      {
    275275        $DbRow = $DbResult->fetch_assoc();
    276         if(sha1($_COOKIE['LoginUserId'].$DbRow['StayLoggedHash']) == $_COOKIE['LoginHash'])
     276        if (sha1($_COOKIE['LoginUserId'].$DbRow['StayLoggedHash']) == $_COOKIE['LoginHash'])
    277277        {
    278278          $this->Database->query('DELETE FROM `UserOnline` WHERE `SessionId`="'.$SID.'"');
     
    285285    $Query = $this->Database->select('UserOnline', '*', '`SessionId`="'.$SID.'"');
    286286    $Row = $Query->fetch_assoc();
    287     if($Row['User'] != '')
     287    if ($Row['User'] != '')
    288288    {
    289289      $this->Id = $Row['User'];
     
    296296    // Remove nonactive users
    297297    $DbResult = $this->Database->select('UserOnline', '`Id`, `User`', '(`ActivityTime` < DATE_SUB(NOW(), INTERVAL '.$this->OnlineStateTimeout.' SECOND)) AND (`StayLogged` = 0)');
    298     while($DbRow = $DbResult->fetch_array())
     298    while ($DbRow = $DbResult->fetch_array())
    299299    {
    300300      $this->Database->delete('UserOnline', 'Id='.$DbRow['Id']);
     
    305305  {
    306306    $Salt = $this->GetPasswordSalt();
    307     if($Team == null) $Team = 'NULL';
    308     if($PreferredVersion == null) $PreferredVersion = 'NULL';
     307    if ($Team == null) $Team = 'NULL';
     308    if ($PreferredVersion == null) $PreferredVersion = 'NULL';
    309309    $this->Database->query('INSERT INTO `User` '.
    310310      '(`Name` , `Pass` , `Salt`, `Email` , `Language` , `Team` , `NeedUpdate`, `RegistrationTime`, `PreferredVersion` ) '.
  • trunk/Modules/User/UserList.php

    r851 r880  
    77    $this->Title = T('Translators');
    88    $Output = '';
    9     if(array_key_exists('search', $_GET)) $_SESSION['search'] = $_GET['search'];
    10     else if(!array_key_exists('search', $_SESSION)) $_SESSION['search'] = '';
    11     if(array_key_exists('search', $_GET) and ($_GET['search'] == '')) $_SESSION['search'] = '';
    12     if($_SESSION['search'] != '')
     9    if (array_key_exists('search', $_GET)) $_SESSION['search'] = $_GET['search'];
     10    else if (!array_key_exists('search', $_SESSION)) $_SESSION['search'] = '';
     11    if (array_key_exists('search', $_GET) and ($_GET['search'] == '')) $_SESSION['search'] = '';
     12    if ($_SESSION['search'] != '')
    1313    {
    1414      $SearchQuery = ' AND (`User`.`Name` LIKE "%'.$_SESSION['search'].'%")';
     
    1717
    1818    $TeamFilter = '';
    19     if(array_key_exists('team', $_GET))
     19    if (array_key_exists('team', $_GET))
    2020    {
    2121      $TeamId = $_GET['team'] * 1;
    2222      $DbResult = $this->Database->select('Team', 'Name', '`Id`='.$TeamId);
    23       if($DbResult->num_rows > 0)
     23      if ($DbResult->num_rows > 0)
    2424      {
    2525        $Team = $DbResult->fetch_assoc();
     
    5858
    5959    $DbResult = $this->Database->query($Query);
    60     while($Line = $DbResult->fetch_assoc())
     60    while ($Line = $DbResult->fetch_assoc())
    6161    {
    6262      $XP = GetLevelMinMax($Line['XP']);
     
    7171        $PageList['Output'];
    7272
    73     return($Output);
     73    return $Output;
    7474  }
    7575}
Note: See TracChangeset for help on using the changeset viewer.