Changeset 189 for trunk


Ignore:
Timestamp:
Apr 12, 2009, 5:40:08 PM (16 years ago)
Author:
george
Message:
  • Upraveno: Údaje uživatele jméno a příjmení bylo sloušeno do údaje Zobrazované jméno. Upraveny patřičné sloupce a odkazy ze skriptů.
  • Opraveno: Registrace nových uživatelů.
Location:
trunk
Files:
1 added
14 edited

Legend:

Unmodified
Added
Removed
  • trunk/aktuality/index.php

    r183 r189  
    3131        {
    3232          if(array_key_exists('id', $_GET)) $Id = $_GET['id'] * 1;
    33           $DbResult = $this->Database->query('SELECT `news`.*, `User`.`Nick` FROM `news` LEFT JOIN `User` ON `User`.`Id`=`news`.`User` WHERE  `news`.`id`='.$Id);
     33          $DbResult = $this->Database->query('SELECT `news`.*, `User`.`Name` FROM `news` LEFT JOIN `User` ON `User`.`Id`=`news`.`User` WHERE  `news`.`id`='.$Id);
    3434          if($DbResult->num_rows > 0)
    3535          {
    3636            $Row = $DbResult->fetch_array();
    37             if($Row['Nick'] == '') $Author = $Row['author'];
    38               else $Author = $Row['Nick'];
     37            if($Row['Name'] == '') $Author = $Row['author'];
     38              else $Author = $Row['Name'];
    3939            $Output .= '<div style="border: thin dotted #97ADFF;        background: #F6F7FF; margin-top: 5px; padding: 0px 5px 5px 5px;"><div style="padding-bottom: 1px; border-bottom-width: 1; border-bottom-style: solid; border-bottom-color: silver;"><strong>'.$Row['title'].' ('.HumanDate($Row['date']).', '.$Author.')</strong>';
    4040            if($this->System->Modules['User']->User['Id'] == $Row['User'])
     
    105105
    106106          $_POST['content'] = str_replace("\n",'<br />',$_POST['content']);
    107           $this->Database->insert('news',array('category' => $Category, 'title' => $_POST['title'], 'content' => $_POST['content'], 'date' => 'NOW()', 'ip' => $RemoteAddr, 'enclosure' => $Enclosures, 'author' => $this->System->Modules['User']->User['Nick'], 'User' => $this->System->Modules['User']->User['Id']));
     107          $this->Database->insert('news',array('category' => $Category, 'title' => $_POST['title'], 'content' => $_POST['content'], 'date' => 'NOW()', 'ip' => $RemoteAddr, 'enclosure' => $Enclosures, 'author' => $this->System->Modules['User']->User['Name'], 'User' => $this->System->Modules['User']->User['Id']));
    108108          $Output .= 'Aktualita přidána!<br />Pokud budete chtít vaši aktualitu smazat, klikněte na odkaz Smazat v seznamu všech aktualit v kategorii.<br /><br />';
    109109          $Output .= '<a href="index.php?category='.$_POST['category'].'">Zpět na seznam aktualit</a>';
     
    173173
    174174          //echo(GetRemoteAddress().','.$_SERVER['HTTP_X_FORWARDED_FOR'].'<br />');
    175           $DbResult = $this->Database->query('SELECT `news`.*, `User`.`Nick` FROM `news` LEFT JOIN `User` ON `User`.`Id`=`news`.`User` WHERE `category`='.$Category.' ORDER BY `news`.`id` DESC LIMIT '.($Page * $PerPage).','.$PerPage);
     175          $DbResult = $this->Database->query('SELECT `news`.*, `User`.`Name` FROM `news` LEFT JOIN `User` ON `User`.`Id`=`news`.`User` WHERE `category`='.$Category.' ORDER BY `news`.`id` DESC LIMIT '.($Page * $PerPage).','.$PerPage);
    176176          while($Row = $DbResult->fetch_array())
    177177          {
    178             if($Row['Nick'] == '') $Author = $Row['author'];
    179               else $Author = $Row['Nick'];
     178            if($Row['Name'] == '') $Author = $Row['author'];
     179              else $Author = $Row['Name'];
    180180            $Output .= '<div style="border: thin dotted #97ADFF; background: #F6F7FF; margin-top: 5px; padding: 0px 5px 5px 5px;"><div style="padding-bottom: 1px; border-bottom-width: 1; border-bottom-style: solid; border-bottom-color: silver;"><strong><a href="?action=view&id='.$Row['id'].'">'.$Row['title'].'</a> ('.HumanDate($Row['date']).', '.$Author.')</strong>';
    181181            if($this->System->Modules['User']->User['Id'] == $Row['User'])
  • trunk/aktuality/news.php

    r183 r189  
    2727      $Output .= '<a href="aktuality/index.php?action=add&amp;category='.$Category.'">Přidat aktualitu</a>&nbsp;';
    2828    $Output .= '</td></tr><tr><td colspan="2">';
    29     $DbResult = $Database->query('SELECT `news`.*, `User`.`Nick` FROM `news` LEFT JOIN `User` ON `User`.`Id`=`news`.`User` WHERE (`news`.`category`='.$Category.') AND (DATE_SUB(NOW(), INTERVAL '.$DaysAgo.' DAY) < `news`.`date`) ORDER BY `news`.`date` DESC LIMIT 0,'.$ItemCount);
     29    $DbResult = $Database->query('SELECT `news`.*, `User`.`Name` FROM `news` LEFT JOIN `User` ON `User`.`Id`=`news`.`User` WHERE (`news`.`category`='.$Category.') AND (DATE_SUB(NOW(), INTERVAL '.$DaysAgo.' DAY) < `news`.`date`) ORDER BY `news`.`date` DESC LIMIT 0,'.$ItemCount);
    3030    //echo($Database->error.'<br />');
    3131    //echo($Database->LastQuery.'<br />');
     
    3838      while($Row = $DbResult->fetch_array())
    3939      {
    40         if($Row['Nick'] == '') $Author = $Row['author'];
    41           else $Author = $Row['Nick'];
     40        if($Row['Name'] == '') $Author = $Row['author'];
     41          else $Author = $Row['Name'];
    4242        $Output .= '<tr><td onclick="window.location=\'aktuality/index.php?action=view&amp;id='.$Row['id'].'\'" onmouseover="zobraz('."'new".$Category.$Index."'".')" style="cursor: pointer; margin: 0px;"><table cellspacing="0" cellpadding="0" style="padding: 0px; margin: 0px; font-size: small; color: red;" width="100%"><tr><td style="font-size: '.$FontSize.'pt"><strong>'.$Row['title'].'</strong></td><td align="right" style="font-size: '.$FontSize.'pt">'.$Author.' ('.HumanDate($Row['date']).')</td></tr></table>';
    4343        $Output .= '<div id="new'.$Category.$Index.'" class="NewsTableItem">'.$Row['content'];
  • trunk/config.sample.php

    r187 r189  
    3939    'MainUserId' => 1,
    4040  ),
    41   'Network' => array
    42   (
    43     'MaxSubnetCount' => 7,
    44         'InetInterface' => 'eth3',
    45   ),
    4641  'MainRouter' => array
    4742  (
  • trunk/finance/clenove.php

    r178 r189  
    2222    $TotalMonth = 0;
    2323    $TotalCash = 0;
    24     $DbResult = $this->Database->query('SELECT MonthlyTotal, Cash, Subject.Id, Subject.Name, NetworkDevice, InternetTariffCurrentMonth, InternetTariffNextMonth, CONCAT(User.SecondName, " ", User.FirstName) AS FullName FROM MemberPayment LEFT JOIN Member ON Member.Id=MemberPayment.Member LEFT JOIN Subject ON Subject.Id=Member.Subject JOIN User ON User.Id=Member.ResponsibleUser ORDER BY FullName');
     24    $DbResult = $this->Database->query('SELECT MonthlyTotal, Cash, Subject.Id, Subject.Name, NetworkDevice, InternetTariffCurrentMonth, InternetTariffNextMonth, User.Name AS FullName FROM MemberPayment LEFT JOIN Member ON Member.Id=MemberPayment.Member LEFT JOIN Subject ON Subject.Id=Member.Subject JOIN User ON User.Id=Member.ResponsibleUser ORDER BY FullName');
    2525    while($Row = $DbResult->fetch_assoc())
    2626    {
  • trunk/form_classes.php

    r183 r189  
    5252    'Table' => 'User',
    5353    'Items' => array(
    54       'Name' => array('Type' => 'String', 'Caption' => 'Přihlašovací jméno', 'Default' => ''),
     54      'Login' => array('Type' => 'String', 'Caption' => 'Přihlašovací jméno', 'Default' => ''),
    5555      'Password' => array('Type' => 'Password', 'Caption' => 'Heslo', 'Default' => ''),
    56       'Nick' => array('Type' => 'String', 'Caption' => 'Zobrazované jméno', 'Default' => ''),
    57       'FirstName' => array('Type' => 'String', 'Caption' => 'Křestní jméno', 'Default' => ''),
    58       'SecondName' => array('Type' => 'String', 'Caption' => 'Přijmení jméno', 'Default' => ''),
     56      'Name' => array('Type' => 'String', 'Caption' => 'Zobrazované jméno', 'Default' => ''),
    5957      'Email' => array('Type' => 'String', 'Caption' => 'E-mail', 'Default' => ''),
    6058      'PhoneNumber' => array('Type' => 'String', 'Caption' => 'Telefón', 'Default' => ''),
     
    6664    'Table' => 'User',
    6765    'Items' => array(
    68       'Name' => array('Type' => 'String', 'Caption' => 'Přihlašovací jméno', 'Default' => ''),
     66      'Login' => array('Type' => 'String', 'Caption' => 'Přihlašovací jméno', 'Default' => ''),
    6967      'Password' => array('Type' => 'Password', 'Caption' => 'Heslo', 'Default' => ''),
    7068      'Password2' => array('Type' => 'Password', 'Caption' => 'Potvrzení hesla', 'Default' => ''),
     69      'Name' => array('Type' => 'String', 'Caption' => 'Zobrazované jméno', 'Default' => ''),
    7170      'Email' => array('Type' => 'String', 'Caption' => 'E-mail', 'Default' => ''),
    72       'FirstName' => array('Type' => 'String', 'Caption' => 'Křestní jméno', 'Default' => ''),
    73       'SecondName' => array('Type' => 'String', 'Caption' => 'Přijmení jméno', 'Default' => ''),
     71      'PhoneNumber' => array('Type' => 'String', 'Caption' => 'Telefón', 'Default' => ''),
     72      'ICQ' => array('Type' => 'String', 'Caption' => 'ICQ', 'Default' => ''),
    7473    ),
    7574  ),
  • trunk/global.php

    r187 r189  
    5858$MonthNames = array('', 'Leden', 'Únor', 'Březen', 'Duben', 'Květen', 'Červen', 'Červenec', 'Srpen', 'Září', 'Říjen', 'Listopad', 'Prosinec');
    5959
    60 $MaxSubnet = $Config['Network']['MaxSubnetCount'];
    61 
    6260$UnitNames = array('B', 'kB', 'MB', 'GB', 'TB', 'PB', 'EB');
    6361 
  • trunk/hostlist.php

    r154 r189  
    1313    while($Host = $DbResult->fetch_array())
    1414    {
    15       $DbResult2 = $this->Database->select('User','*, CONCAT(SecondName, " ", FirstName) as FullName', 'Id='.$Host['user']);
    16       $User = $DbResult2->fetch_array();
     15      $DbResult2 = $this->Database->select('User','*', 'Id='.$Host['user']);
     16      $User = $DbResult2->fetch_assoc();
    1717      if($Host['online'] == 1) $Style = 'font-weight: bold; color: blue;'; else $Style = '';
    1818      if($Host['IP'] == '') $Host['IP'] = '&nbsp;';
    19       $Output .= '<tr><td style="text-align: left; '.$Style.'">'.$Host['name'].'</td><td>'.$Host['IP'].'</td><td style="text-align: right;">'.HumanDate($Host['last_online']).'</td><td style="text-align: right;">'.$User['FullName'].'</td></tr>';
     19      $Output .= '<tr><td style="text-align: left; '.$Style.'">'.$Host['name'].'</td><td>'.$Host['IP'].'</td><td style="text-align: right;">'.HumanDate($Host['last_online']).'</td><td style="text-align: right;">'.$User['Name'].'</td></tr>';
    2020    }
    2121    $Output .= '</table></div>';
  • trunk/index.php

    r187 r189  
    306306        $UserRegister = new Form('UserRegister', array());
    307307        $UserRegister->LoadValuesFromForm();
    308         $Output .= $this->SystemMessage('Nastavení', $this->System->Modules['User']->Register($UserRegister->Values['Name'], $UserRegister->Values['Password'], $UserRegister->Values['Password2'], $UserRegister->Values['Email'], $UserRegister->Values['FirstName'], $UserRegister->Values['SecondName']));
     308        $Output .= $this->SystemMessage('Nastavení', $this->System->Modules['User']->Register($UserRegister->Values['Login'], $UserRegister->Values['Password'], $UserRegister->Values['Password2'], $UserRegister->Values['Email'], $UserRegister->Values['Name'], $UserRegister->Values['PhoneNumber'], $UserRegister->Values['ICQ']));
    309309      } else
    310310      if($_GET['Action'] == 'MemberOptions')
  • trunk/page.php

    r187 r189  
    152152      if($this->System->Modules['User']->User['Id'] == $this->System->Modules['User']->AnonymousUserId)
    153153        $Output .= '<a href="'.$this->System->Config['Web']['RootFolder'].'/?Action=LoginForm">Přihlášení</a> <a href="'.$this->System->Config['Web']['RootFolder'].'/?Action=UserRegister">Registrace</a>';
    154         else $Output .= $this->System->Modules['User']->User['Nick'].' <a href="'.$this->System->Config['Web']['RootFolder'].'/?Action=Logout">Odhlásit</a>';
     154        else $Output .= $this->System->Modules['User']->User['Name'].' <a href="'.$this->System->Config['Web']['RootFolder'].'/?Action=Logout">Odhlásit</a>';
    155155   } else $Output .= '&nbsp;';
    156156// <a href="'.$this->System->Config['Web']['RootFolder'].'/?Action=UserOptions">Nastavení</a>';
  • trunk/sunrisechat/network.php

    r169 r189  
    44
    55$User = array(0 => array('Fullname' => ''));
    6 $DbResult = $Database->select('User', '*, CONCAT(SecondName, " ", FirstName) as Fullname');
     6$DbResult = $Database->select('User', '*');
    77while($Row = $DbResult->fetch_array())
    88{
     
    1313while($Row = $DbResult->fetch_array())
    1414{
    15   $Row = $Row['id'].':'.$Row['parent'].':'.$Row['name'].':'.$Row['IP'].':'.trim($User[$Row['user']]['Fullname']).':'.$Row['block']."\n";
     15  $Row = $Row['id'].':'.$Row['parent'].':'.$Row['name'].':'.$Row['IP'].':'.trim($User[$Row['user']]['Name']).':'.$Row['block']."\n";
    1616  $Row = FromUTF8($Row, 'win1250');
    1717  echo($Row);
  • trunk/system/generators/dhcp.php

    r161 r189  
    11<?php
     2/*
    23include_once('../../global.php');
    34
     
    3738}
    3839fclose($File);
     40*/
    3941
    4042?>
  • trunk/temp/transform.php

    r174 r189  
    11<?php
    22
     3/*
    34//$SessionDisable = true;
    45include('../global.php');
     
    281282$System->AddModule(new Transform());
    282283$System->Modules['Transform']->GetOutput();
     284*/
    283285
    284286?>
  • trunk/user.php

    r187 r189  
    11<?php
    22
    3 define('NICK_USED', 'Přihlašovací jméno již použito.');
     3define('LOGIN_USED', 'Přihlašovací jméno již použito.');
     4define('NAME_USED', 'Jméno uživatele již použito');
    45define('EMAIL_USED', 'Email je již použitý. Použijte jiný email nebo si můžete nechat zaslat nové heslo na email.');
    56define('USER_REGISTRATED', 'Uživatel registrován. Na zadanou emailovou adresu byl poslán mail s odkazem pro aktivování účtu.');
     
    5152    if($Row['User'] != $this->AnonymousUserId)
    5253    {
    53       $Query = $this->Database->select('User', '*', "Id=".$Row['User']."");
     54      $Query = $this->Database->select('User', '*', 'Id='.$Row['User']);
    5455      $this->User = $Query->fetch_assoc();
    5556      $Result = USER_LOGGED;
    5657    } else
    5758    {
    58       $Query = $this->Database->select('User', '*', "Id=".$this->AnonymousUserId);
     59      $Query = $this->Database->select('User', '*', 'Id='.$this->AnonymousUserId);
    5960      $this->User = $Query->fetch_assoc();
    6061      $Result = USER_NOT_LOGGED;
     
    7475  }
    7576
    76   function Register($Nick, $Password, $Password2, $Email, $FirstName, $SecondName)
     77  function Register($Login, $Password, $Password2, $Email, $Name, $PhoneNumber, $ICQ)
    7778  {
    7879    global $Options, $Config;
    7980
    80     if(($Email == '') || ($Nick == '') || ($Password == '') || ($Password2 == '')) $Result = DATA_MISSING;
     81    if(($Email == '') || ($Login == '') || ($Password == '') || ($Password2 == '')  || ($Name == '')) $Result = DATA_MISSING;
    8182    else if($Password != $Password2) $Result = PASSWORDS_UNMATCHED;
    8283    else
    8384    {
    8485      // Je uživatel registrován?
    85       $Query = $this->Database->select('User', '*', 'Name = "'.$Nick.'"');
    86       if($Query->num_rows > 0) $Result = NICK_USED;
     86      $Query = $this->Database->select('User', '*', 'Login = "'.$Login.'"');
     87      if($Query->num_rows > 0) $Result = LOGIN_USED;
    8788      else
    8889      {
    89         $Query = $this->Database->select('User', '*', 'Email = "'.$Email.'"');
    90         if($Query->num_rows > 0) $Result = EMAIL_USED;
     90        $Query = $this->Database->select('User', '*', 'Name = "'.$Name.'"');
     91        if($Query->num_rows > 0) $Result = NAME_USED;
    9192        else
    92         {
    93           $this->Database->insert('User', array('Name' => $Nick, 'FirstName' => $FirstName, 'SecondName' => $SecondName, 'Password' => sha1($Password), 'Email' => $Email, 'RegistrationTime' => 'NOW()', 'Locked' => 1));
    94           $UserId = $this->Database->insert_id;
    95                   $this->Database->insert('PermissionUserAssignment', array('User' => $UserId, 'GroupOrOperation' => 1, 'Type' => 'Group'));
     93        {
     94          $Query = $this->Database->select('User', '*', 'Email = "'.$Email.'"');
     95          if($Query->num_rows > 0) $Result = EMAIL_USED;
     96          else
     97          {
     98            $this->Database->insert('User', array('Name' => $Name, 'Login' => $Login, 'Password' => sha1($Password), 'Email' => $Email, 'RegistrationTime' => 'NOW()', 'Locked' => 1, 'PhoneNumber' => $PhoneNumber, 'ICQ' => $ICQ));
     99            $UserId = $this->Database->insert_id;
     100                        $this->Database->insert('PermissionUserAssignment', array('User' => $UserId, 'GroupOrOperation' => 2, 'Type' => 'Group'));
    96101         
    97           $Subject = FromUTF8('Registrace nového účtu', 'iso2');
    98           $Message = 'Provedli jste registraci nového účtu na serveru <a href="http://'.$Config['Web']['Host'].$Config['Web']['RootFolder'].'">http://'.$Config['Web']['Host'].$Config['Web']['RootFolder']."</a>.<br>\nPokud jste tak neučinili, měli by jste tento email ignorovat.<br><br>\n\nVáš účet je: ".$Nick."\n<br>Pro dokončení registrace klikněte na ".'<a href="http://'.$Config['Web']['Host'].$Config['Web']['RootFolder'].'/?Action=UserRegisterConfirm&User='.$UserId.'&H='.sha1($Password).'">tento odkaz</a>.'."\n<br> \n\n<br><br>Na tento email neodpovídejte.";
    99           $AdditionalHeaders = "To: ".$Nick." <".$Email.">\n"."From: ".FromUTF8($Config['Web']['Title'], 'iso2')." <noreplay@zdechov.net>\n"."MIME-Version: 1.0\n"."Content-type: text/html; charset=utf-8";
    100           mail($Email, $Subject, $Message, $AdditionalHeaders);
    101           $Result = USER_REGISTRATED;
    102           $this->System->Modules['Log']->NewRecord('User', 'NewRegistration', $Nick);
     102            $Subject = FromUTF8('Registrace nového účtu', 'iso2');
     103            $Message = 'Provedli jste registraci nového účtu na serveru <a href="http://'.$Config['Web']['Host'].$Config['Web']['RootFolder'].'">http://'.$Config['Web']['Host'].$Config['Web']['RootFolder']."</a>.<br>\nPokud jste tak neučinili, měli by jste tento email ignorovat.<br><br>\n\nVáš účet je: ".$Login."\n<br>Pro dokončení registrace klikněte na tento odkaz: ".'<a href="http://'.$Config['Web']['Host'].$Config['Web']['RootFolder'].'/?Action=UserRegisterConfirm&User='.$UserId.'&H='.sha1($Password).'">http://'.$Config['Web']['Host'].$Config['Web']['RootFolder'].'/?Action=UserRegisterConfirm&User='.$UserId.'&H='.sha1($Password).'</a>.'."\n<br> \n\n<br><br>Na tento email neodpovídejte.";
     104            $AdditionalHeaders = "To: ".$Name." <".$Email.">\n"."From: ".FromUTF8($Config['Web']['Title'], 'iso2')." <noreplay@zdechov.net>\n"."MIME-Version: 1.0\n"."Content-type: text/html; charset=utf-8";
     105            mail($Email, $Subject, $Message, $AdditionalHeaders);
     106            $Result = USER_REGISTRATED;
     107            $this->System->Modules['Log']->NewRecord('User', 'NewRegistration', $Login);
     108          }
    103109        }
    104110      }
     
    109115  function RegisterConfirm($Id, $Hash)
    110116  {
    111     $DbResult = $this->Database->select('User', 'Id, Name, Password', 'Id = '.$Id);
     117    $DbResult = $this->Database->select('User', 'Id, Login, Password', 'Id = '.$Id);
    112118    if($DbResult->num_rows > 0)
    113119    {
     
    117123        $this->Database->update('User', 'Id='.$Row['Id'], array('Locked' => 0));
    118124        $Output = USER_REGISTRATION_CONFIRMED;
    119         $this->System->Modules['Log']->NewRecord('User', 'RegisterConfirm', 'Username='.$Row['Name']);
     125        $this->System->Modules['Log']->NewRecord('User', 'RegisterConfirm', 'Login='.$Row['Login'].', Id='.$Row['Id']);
    120126      } else $Output = PASSWORDS_UNMATCHED;
    121127    } else $Output = USER_NOT_FOUND;
     
    123129  }
    124130
    125   function Login($Nick, $Password)
     131  function Login($Login, $Password)
    126132  {
    127133    $SID = session_id();
    128     $Query = $this->Database->select('User', '*', 'Name="'.$Nick.'"');
     134    $Query = $this->Database->select('User', '*', 'Login="'.$Login.'"');
    129135    if($Query->num_rows > 0)
    130136    {
     
    138144        // načtení stavu stromu
    139145        $Result = USER_LOGGED_IN;
    140         $this->System->Modules['Log']->NewRecord('User', 'Login', 'Nick='.$Nick.',Host='.gethostbyaddr(GetRemoteAddress()));
     146        $this->System->Modules['Log']->NewRecord('User', 'Login', 'Login='.$Login.',Host='.gethostbyaddr(GetRemoteAddress()));
    141147      }
    142148    } else $Result = USER_NOT_REGISTRED;
     
    149155    $SID = session_id();
    150156    $this->Database->update('UserOnline', 'SessionId="'.$SID.'"', array('User' => $this->AnonymousUserId));
    151     $this->System->Modules['Log']->NewRecord('User', 'Logout', $this->User['Name']);
     157    $this->System->Modules['Log']->NewRecord('User', 'Logout', $this->User['Login']);
    152158    $this->Check();
    153159    return(USER_LOGGED_OUT);
     
    222228  }
    223229
    224   function PasswordRecoveryRequest($Name, $Email)
     230  function PasswordRecoveryRequest($Login, $Email)
    225231  {
    226232    global $Config;
    227233
    228     $DbResult = $this->Database->select('User', 'Name, Id, Email, Password', '`Name`="'.$Name.'" AND `Email`="'.$Email.'"');
     234    $DbResult = $this->Database->select('User', 'Name, Id, Email, Password', '`Login`="'.$Login.'" AND `Email`="'.$Email.'"');
    229235    if($DbResult->num_rows > 0)
    230236    {
    231237      $Row = $DbResult->fetch_array();
    232       $NewPassword = substr(sha1(strtoupper($Row['Name'])), 0, 7);
     238      $NewPassword = substr(sha1(strtoupper($Row['Login'])), 0, 7);
    233239
    234240      $Subject = 'Obnova hesla';
    235       $Message = 'Požádali jste o zaslání nového hesla na serveru <a href="http://'.$Config['Web']['Host'].$Config['Web']['RootFolder'].'">http://'.$Config['Web']['Host'].$Config['Web']['RootFolder']."</a>.<br />\nPokud jste tak neučinili, měli by jste tento email ignorovat.<br /><br />\n\nVaše nové heslo k účtu ".$Row['Name']." je: ".$NewPassword."\n<br>Pro aktivaci tohoto hesla klikněte na ".'<a href="http://'.$Config['Web']['Host'].$Config['Web']['RootFolder'].'/?Action=PasswordRecoveryConfirm&User='.$Row['Id'].'&H='.$Row['Password'].'&P='.$NewPassword.'">tento odkaz</a>.'."\n<br /> Po přihlášení si prosím změňte heslo na nové.\n\n<br><br>Na tento email neodpovídejte.";
     241      $Message = 'Požádali jste o zaslání nového hesla na serveru <a href="http://'.$Config['Web']['Host'].$Config['Web']['RootFolder'].'">http://'.$Config['Web']['Host'].$Config['Web']['RootFolder']."</a>.<br />\nPokud jste tak neučinili, měli by jste tento email ignorovat.<br /><br />\n\nVaše nové heslo k účtu ".$Row['Login']." je: ".$NewPassword."\n<br>Pro aktivaci tohoto hesla klikněte na ".'<a href="http://'.$Config['Web']['Host'].$Config['Web']['RootFolder'].'/?Action=PasswordRecoveryConfirm&User='.$Row['Id'].'&H='.$Row['Password'].'&P='.$NewPassword.'">tento odkaz</a>.'."\n<br /> Po přihlášení si prosím změňte heslo na nové.\n\n<br><br>Na tento email neodpovídejte.";
    236242      $AdditionalHeaders = "To: ".$Row['Name']." <".$Row['Email'].">\n"."From: ".FromUTF8($Config['Web']['Title'], 'iso2')." <noreplay@zdechov.net>\n"."MIME-Version: 1.0\n"."Content-type: text/html; charset=utf-8";
    237243      mail($Row['Email'], $Subject, $Message, $AdditionalHeaders);
    238244      $Output = USER_PASSWORD_RECOVERY_SUCCESS;
    239       $this->System->Modules['Log']->NewRecord('User', 'PasswordRecoveryRequest', 'Username='.$Name.',Email='.$Email);
     245      $this->System->Modules['Log']->NewRecord('User', 'PasswordRecoveryRequest', 'Login='.$Login.',Email='.$Email);
    240246    } else $Output = USER_PASSWORD_RECOVERY_FAIL;
    241247    return($Output);
     
    244250  function PasswordRecoveryConfirm($Id, $Hash, $NewPassword)
    245251  {
    246     $DbResult = $this->Database->select('User', 'Id, Name, Password', 'Id = '.$Id);
     252    $DbResult = $this->Database->select('User', 'Id, Login, Password', 'Id = '.$Id);
    247253    if($DbResult->num_rows > 0)
    248254    {
    249255      $Row = $DbResult->fetch_array();
    250       $NewPassword2 = substr(sha1(strtoupper($Row['Name'])), 0, 7);
     256      $NewPassword2 = substr(sha1(strtoupper($Row['Login'])), 0, 7);
    251257      if(($NewPassword == $NewPassword2) and ($Hash == $Row['Password']))
    252258      {
    253259        $this->Database->update('User', 'Id='.$Row['Id'], array('Password' => sha1($NewPassword), 'Locked' => 0));
    254260        $Output = USER_PASSWORD_RECOVERY_CONFIRMED;
    255         $this->System->Modules['Log']->NewRecord('User', 'PasswordRecoveryConfirm', 'Username='.$Row['Name']);
     261        $this->System->Modules['Log']->NewRecord('User', 'PasswordRecoveryConfirm', 'Login='.$Row['Login']);
    256262      } else $Output = PASSWORDS_UNMATCHED;
    257263    } else $Output = USER_NOT_FOUND;
  • trunk/userlist.php

    r154 r189  
    1111    $Output = '<table class="WideTable" style="font-size: small;"><tr><th>Jméno uživatele</th><th>E-mail</th><th>ICQ</th><th>Telefon</th><th>Počítače</th></tr>';
    1212
    13     $DbResult = $this->Database->select('User', '*, TRIM(CONCAT(SecondName, " ", FirstName)) as FullName', 'Name != "Anonym" ORDER BY FullName');
     13    $DbResult = $this->Database->select('User', '*', 'Login != "Anonym" ORDER BY Name');
    1414    while($User = $DbResult->fetch_array())
    1515    {
     
    2525      }
    2626      if($Hosts != '') $Hosts = substr($Hosts, 0, -2);
    27       $Output .= '<tr><td>'.$User['FullName'].'</td><td>'.$User['Email'].'&nbsp;</td><td>'.$ICQ.'</td><td>'.$Phone.'</td><td>'.$Hosts.'</td></tr>';
     27      $Output .= '<tr><td>'.$User['Name'].'</td><td>'.$User['Email'].'&nbsp;</td><td>'.$ICQ.'</td><td>'.$Phone.'</td><td>'.$Hosts.'</td></tr>';
    2828    }
    2929    $Output .= '</table>';
Note: See TracChangeset for help on using the changeset viewer.