- Timestamp:
- Apr 12, 2009, 5:40:08 PM (16 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/aktuality/index.php
r183 r189 31 31 { 32 32 if(array_key_exists('id', $_GET)) $Id = $_GET['id'] * 1; 33 $DbResult = $this->Database->query('SELECT `news`.*, `User`.`N ick` 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); 34 34 if($DbResult->num_rows > 0) 35 35 { 36 36 $Row = $DbResult->fetch_array(); 37 if($Row['N ick'] == '') $Author = $Row['author'];38 else $Author = $Row['N ick'];37 if($Row['Name'] == '') $Author = $Row['author']; 38 else $Author = $Row['Name']; 39 39 $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>'; 40 40 if($this->System->Modules['User']->User['Id'] == $Row['User']) … … 105 105 106 106 $_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['N ick'], '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'])); 108 108 $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 />'; 109 109 $Output .= '<a href="index.php?category='.$_POST['category'].'">Zpět na seznam aktualit</a>'; … … 173 173 174 174 //echo(GetRemoteAddress().','.$_SERVER['HTTP_X_FORWARDED_FOR'].'<br />'); 175 $DbResult = $this->Database->query('SELECT `news`.*, `User`.`N ick` 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); 176 176 while($Row = $DbResult->fetch_array()) 177 177 { 178 if($Row['N ick'] == '') $Author = $Row['author'];179 else $Author = $Row['N ick'];178 if($Row['Name'] == '') $Author = $Row['author']; 179 else $Author = $Row['Name']; 180 180 $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>'; 181 181 if($this->System->Modules['User']->User['Id'] == $Row['User']) -
trunk/aktuality/news.php
r183 r189 27 27 $Output .= '<a href="aktuality/index.php?action=add&category='.$Category.'">Přidat aktualitu</a> '; 28 28 $Output .= '</td></tr><tr><td colspan="2">'; 29 $DbResult = $Database->query('SELECT `news`.*, `User`.`N ick` 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); 30 30 //echo($Database->error.'<br />'); 31 31 //echo($Database->LastQuery.'<br />'); … … 38 38 while($Row = $DbResult->fetch_array()) 39 39 { 40 if($Row['N ick'] == '') $Author = $Row['author'];41 else $Author = $Row['N ick'];40 if($Row['Name'] == '') $Author = $Row['author']; 41 else $Author = $Row['Name']; 42 42 $Output .= '<tr><td onclick="window.location=\'aktuality/index.php?action=view&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>'; 43 43 $Output .= '<div id="new'.$Category.$Index.'" class="NewsTableItem">'.$Row['content']; -
trunk/config.sample.php
r187 r189 39 39 'MainUserId' => 1, 40 40 ), 41 'Network' => array42 (43 'MaxSubnetCount' => 7,44 'InetInterface' => 'eth3',45 ),46 41 'MainRouter' => array 47 42 ( -
trunk/finance/clenove.php
r178 r189 22 22 $TotalMonth = 0; 23 23 $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'); 25 25 while($Row = $DbResult->fetch_assoc()) 26 26 { -
trunk/form_classes.php
r183 r189 52 52 'Table' => 'User', 53 53 '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' => ''), 55 55 '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' => ''), 59 57 'Email' => array('Type' => 'String', 'Caption' => 'E-mail', 'Default' => ''), 60 58 'PhoneNumber' => array('Type' => 'String', 'Caption' => 'Telefón', 'Default' => ''), … … 66 64 'Table' => 'User', 67 65 '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' => ''), 69 67 'Password' => array('Type' => 'Password', 'Caption' => 'Heslo', 'Default' => ''), 70 68 'Password2' => array('Type' => 'Password', 'Caption' => 'Potvrzení hesla', 'Default' => ''), 69 'Name' => array('Type' => 'String', 'Caption' => 'Zobrazované jméno', 'Default' => ''), 71 70 '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' => ''), 74 73 ), 75 74 ), -
trunk/global.php
r187 r189 58 58 $MonthNames = array('', 'Leden', 'Únor', 'Březen', 'Duben', 'Květen', 'Červen', 'Červenec', 'Srpen', 'Září', 'Říjen', 'Listopad', 'Prosinec'); 59 59 60 $MaxSubnet = $Config['Network']['MaxSubnetCount'];61 62 60 $UnitNames = array('B', 'kB', 'MB', 'GB', 'TB', 'PB', 'EB'); 63 61 -
trunk/hostlist.php
r154 r189 13 13 while($Host = $DbResult->fetch_array()) 14 14 { 15 $DbResult2 = $this->Database->select('User','* , CONCAT(SecondName, " ", FirstName) as FullName', 'Id='.$Host['user']);16 $User = $DbResult2->fetch_a rray();15 $DbResult2 = $this->Database->select('User','*', 'Id='.$Host['user']); 16 $User = $DbResult2->fetch_assoc(); 17 17 if($Host['online'] == 1) $Style = 'font-weight: bold; color: blue;'; else $Style = ''; 18 18 if($Host['IP'] == '') $Host['IP'] = ' '; 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>'; 20 20 } 21 21 $Output .= '</table></div>'; -
trunk/index.php
r187 r189 306 306 $UserRegister = new Form('UserRegister', array()); 307 307 $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'])); 309 309 } else 310 310 if($_GET['Action'] == 'MemberOptions') -
trunk/page.php
r187 r189 152 152 if($this->System->Modules['User']->User['Id'] == $this->System->Modules['User']->AnonymousUserId) 153 153 $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['N ick'].' <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>'; 155 155 } else $Output .= ' '; 156 156 // <a href="'.$this->System->Config['Web']['RootFolder'].'/?Action=UserOptions">Nastavení</a>'; -
trunk/sunrisechat/network.php
r169 r189 4 4 5 5 $User = array(0 => array('Fullname' => '')); 6 $DbResult = $Database->select('User', '* , CONCAT(SecondName, " ", FirstName) as Fullname');6 $DbResult = $Database->select('User', '*'); 7 7 while($Row = $DbResult->fetch_array()) 8 8 { … … 13 13 while($Row = $DbResult->fetch_array()) 14 14 { 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"; 16 16 $Row = FromUTF8($Row, 'win1250'); 17 17 echo($Row); -
trunk/system/generators/dhcp.php
r161 r189 1 1 <?php 2 /* 2 3 include_once('../../global.php'); 3 4 … … 37 38 } 38 39 fclose($File); 40 */ 39 41 40 42 ?> -
trunk/temp/transform.php
r174 r189 1 1 <?php 2 2 3 /* 3 4 //$SessionDisable = true; 4 5 include('../global.php'); … … 281 282 $System->AddModule(new Transform()); 282 283 $System->Modules['Transform']->GetOutput(); 284 */ 283 285 284 286 ?> -
trunk/user.php
r187 r189 1 1 <?php 2 2 3 define('NICK_USED', 'Přihlašovací jméno již použito.'); 3 define('LOGIN_USED', 'Přihlašovací jméno již použito.'); 4 define('NAME_USED', 'Jméno uživatele již použito'); 4 5 define('EMAIL_USED', 'Email je již použitý. Použijte jiný email nebo si můžete nechat zaslat nové heslo na email.'); 5 6 define('USER_REGISTRATED', 'Uživatel registrován. Na zadanou emailovou adresu byl poslán mail s odkazem pro aktivování účtu.'); … … 51 52 if($Row['User'] != $this->AnonymousUserId) 52 53 { 53 $Query = $this->Database->select('User', '*', "Id=".$Row['User']."");54 $Query = $this->Database->select('User', '*', 'Id='.$Row['User']); 54 55 $this->User = $Query->fetch_assoc(); 55 56 $Result = USER_LOGGED; 56 57 } else 57 58 { 58 $Query = $this->Database->select('User', '*', "Id=".$this->AnonymousUserId);59 $Query = $this->Database->select('User', '*', 'Id='.$this->AnonymousUserId); 59 60 $this->User = $Query->fetch_assoc(); 60 61 $Result = USER_NOT_LOGGED; … … 74 75 } 75 76 76 function Register($ Nick, $Password, $Password2, $Email, $FirstName, $SecondName)77 function Register($Login, $Password, $Password2, $Email, $Name, $PhoneNumber, $ICQ) 77 78 { 78 79 global $Options, $Config; 79 80 80 if(($Email == '') || ($ Nick == '') || ($Password == '') || ($Password2== '')) $Result = DATA_MISSING;81 if(($Email == '') || ($Login == '') || ($Password == '') || ($Password2 == '') || ($Name == '')) $Result = DATA_MISSING; 81 82 else if($Password != $Password2) $Result = PASSWORDS_UNMATCHED; 82 83 else 83 84 { 84 85 // 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; 87 88 else 88 89 { 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; 91 92 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')); 96 101 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 } 103 109 } 104 110 } … … 109 115 function RegisterConfirm($Id, $Hash) 110 116 { 111 $DbResult = $this->Database->select('User', 'Id, Name, Password', 'Id = '.$Id);117 $DbResult = $this->Database->select('User', 'Id, Login, Password', 'Id = '.$Id); 112 118 if($DbResult->num_rows > 0) 113 119 { … … 117 123 $this->Database->update('User', 'Id='.$Row['Id'], array('Locked' => 0)); 118 124 $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']); 120 126 } else $Output = PASSWORDS_UNMATCHED; 121 127 } else $Output = USER_NOT_FOUND; … … 123 129 } 124 130 125 function Login($ Nick, $Password)131 function Login($Login, $Password) 126 132 { 127 133 $SID = session_id(); 128 $Query = $this->Database->select('User', '*', ' Name="'.$Nick.'"');134 $Query = $this->Database->select('User', '*', 'Login="'.$Login.'"'); 129 135 if($Query->num_rows > 0) 130 136 { … … 138 144 // načtení stavu stromu 139 145 $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())); 141 147 } 142 148 } else $Result = USER_NOT_REGISTRED; … … 149 155 $SID = session_id(); 150 156 $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']); 152 158 $this->Check(); 153 159 return(USER_LOGGED_OUT); … … 222 228 } 223 229 224 function PasswordRecoveryRequest($ Name, $Email)230 function PasswordRecoveryRequest($Login, $Email) 225 231 { 226 232 global $Config; 227 233 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.'"'); 229 235 if($DbResult->num_rows > 0) 230 236 { 231 237 $Row = $DbResult->fetch_array(); 232 $NewPassword = substr(sha1(strtoupper($Row[' Name'])), 0, 7);238 $NewPassword = substr(sha1(strtoupper($Row['Login'])), 0, 7); 233 239 234 240 $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."; 236 242 $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"; 237 243 mail($Row['Email'], $Subject, $Message, $AdditionalHeaders); 238 244 $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); 240 246 } else $Output = USER_PASSWORD_RECOVERY_FAIL; 241 247 return($Output); … … 244 250 function PasswordRecoveryConfirm($Id, $Hash, $NewPassword) 245 251 { 246 $DbResult = $this->Database->select('User', 'Id, Name, Password', 'Id = '.$Id);252 $DbResult = $this->Database->select('User', 'Id, Login, Password', 'Id = '.$Id); 247 253 if($DbResult->num_rows > 0) 248 254 { 249 255 $Row = $DbResult->fetch_array(); 250 $NewPassword2 = substr(sha1(strtoupper($Row[' Name'])), 0, 7);256 $NewPassword2 = substr(sha1(strtoupper($Row['Login'])), 0, 7); 251 257 if(($NewPassword == $NewPassword2) and ($Hash == $Row['Password'])) 252 258 { 253 259 $this->Database->update('User', 'Id='.$Row['Id'], array('Password' => sha1($NewPassword), 'Locked' => 0)); 254 260 $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']); 256 262 } else $Output = PASSWORDS_UNMATCHED; 257 263 } else $Output = USER_NOT_FOUND; -
trunk/userlist.php
r154 r189 11 11 $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>'; 12 12 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'); 14 14 while($User = $DbResult->fetch_array()) 15 15 { … … 25 25 } 26 26 if($Hosts != '') $Hosts = substr($Hosts, 0, -2); 27 $Output .= '<tr><td>'.$User[' FullName'].'</td><td>'.$User['Email'].' </td><td>'.$ICQ.'</td><td>'.$Phone.'</td><td>'.$Hosts.'</td></tr>';27 $Output .= '<tr><td>'.$User['Name'].'</td><td>'.$User['Email'].' </td><td>'.$ICQ.'</td><td>'.$Phone.'</td><td>'.$Hosts.'</td></tr>'; 28 28 } 29 29 $Output .= '</table>';
Note:
See TracChangeset
for help on using the changeset viewer.