Changeset 577 for trunk/Modules/User
- Timestamp:
- Sep 11, 2013, 10:37:54 PM (11 years ago)
- Location:
- trunk/Modules/User
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/User/Options.php
r569 r577 5 5 function UserOptionsFrom() 6 6 { 7 global $User;8 9 7 $Output = '<form action="Options.php?action=save" method="post"> 10 8 <fieldset><legend>Nastavení uživatele</legend> 11 9 <table> 12 <tr><td>Email:</td><td><input type="text" name="Email" value="'.$ User->Email.'" /></td></tr>10 <tr><td>Email:</td><td><input type="text" name="Email" value="'.$this->System->User->Email.'" /></td></tr> 13 11 <tr><td>Původní heslo:</td><td><input type="password" name="OldPass" /></td></tr> 14 12 <tr><td>Nové heslo:</td><td><input type="password" name="NewPass" /></td></tr> 15 13 <tr><td>Nové heslo pro potvrzení: </td><td><input type="password" name="NewPass2" /></td></tr> 16 <tr><td>Normálně budu překládat do: </td><td>'.WriteLanguages($ User->Language).'</td></tr>14 <tr><td>Normálně budu překládat do: </td><td>'.WriteLanguages($this->System->User->Language).'</td></tr> 17 15 <tr><td>Po uložení překladu přesměrovat: </td><td>'; 18 16 $Output .= '<select name="redirecting">'. 19 17 '<option value="0">Nikam</option>'. 20 18 '<option value="1"'; 21 if($ User->Redirecting == '1') $Output .= ' selected="selected"';19 if($this->System->User->Redirecting == '1') $Output .= ' selected="selected"'; 22 20 $Output .= '>Na nepřeložené</option>'; 23 21 $Output .= '<option value="2"'; 24 if($ User->Redirecting == '2') $Output .= ' selected="selected"';22 if($this->System->User->Redirecting == '2') $Output .= ' selected="selected"'; 25 23 $Output .= '>Na další překlad</option>'; 26 24 $Output .= '<option value="3"'; 27 if($ User->Redirecting == '3') $Output .= ' selected="selected"';25 if($this->System->User->Redirecting == '3') $Output .= ' selected="selected"'; 28 26 $Output .= '>Na předchozí překlad</option>'; 29 27 $Output .= '</select>'; 30 28 31 29 $Output .= '</td></tr>'. 32 '<tr><td>Upřednostněná verze klienta: </td><td>'.ClientVersionSelection($ User->PreferredVersion).'</td></tr>'.30 '<tr><td>Upřednostněná verze klienta: </td><td>'.ClientVersionSelection($this->System->User->PreferredVersion).'</td></tr>'. 33 31 '<tr><td>Veřejný text profilu:</td><td>'. 34 '<textarea name="info" cols="60" rows="10">'.$ User->Info.'</textarea></td></tr>'.32 '<textarea name="info" cols="60" rows="10">'.$this->System->User->Info.'</textarea></td></tr>'. 35 33 '<tr><td colspan="2"><input type="submit" value="Uložit" /></td></tr>'. 36 34 '</table></fieldset>'. … … 47 45 { 48 46 $Output .= '<option value="'.$LineTeam['Id'].'"'; 49 if ($LineTeam['Id'] == $ User->Team) $Output .= ' selected="selected"';47 if ($LineTeam['Id'] == $this->System->User->Team) $Output .= ' selected="selected"'; 50 48 $Output .= '>'.$LineTeam['Name'].'</option>'; 51 49 } … … 58 56 function UserOptionsSave() 59 57 { 60 global $User;61 62 58 $Output = ''; 63 59 if(array_key_exists('Email', $_POST)) … … 78 74 if($NewPass == $NewPass2) 79 75 { 80 $DbResult = $System->Database->query('SELECT `Pass`, '.$ User->CryptPasswordSQL('"'.$OldPass.'"', '`Salt`').' AS `Hash` FROM `User` WHERE `ID`= '.$User->Id);76 $DbResult = $System->Database->query('SELECT `Pass`, '.$this->System->User->CryptPasswordSQL('"'.$OldPass.'"', '`Salt`').' AS `Hash` FROM `User` WHERE `ID`= '.$this->System->User->Id); 81 77 $DbRow = $DbResult->fetch_assoc(); 82 78 if($DbRow['Hash'] == $DbRow['Pass']) 83 79 { 84 80 // Update password 85 $Salt = $ User->GetPasswordSalt();86 $this->Database->query('UPDATE `User` SET `Pass` = '.$ User->CryptPasswordSQL('"'.$NewPass.'"', '"'.$Salt.'"').', `Salt`="'.$Salt.'" WHERE `ID` = '.$User->Id);81 $Salt = $this->System->User->GetPasswordSalt(); 82 $this->Database->query('UPDATE `User` SET `Pass` = '.$this->System->User->CryptPasswordSQL('"'.$NewPass.'"', '"'.$Salt.'"').', `Salt`="'.$Salt.'" WHERE `ID` = '.$this->System->User->Id); 87 83 $Output .= ShowMessage('Heslo změněno.'); 88 84 } else $Output .= ShowMessage('Staré heslo neodpovídá.', MESSAGE_CRITICAL); 89 85 } else $Output .= ShowMessage('Hesla se neshodují.', MESSAGE_CRITICAL); 90 86 } 91 $this->Database->update('User', '`ID` = '.$ User->Id, array('Email' => $Email,92 93 94 $Output .= ShowMessage('Úprava nastavení proběhla v pořádku, Email: <b>'.$Email.'</b> Uživatel: <b>'.$ User->Name.'</b>');87 $this->Database->update('User', '`ID` = '.$this->System->User->Id, array('Email' => $Email, 88 'Language' => $Language, 'Redirecting' => $Redirecting, 'Info' => $Info, 89 'PreferredVersion' => $PreferredVersion)); 90 $Output .= ShowMessage('Úprava nastavení proběhla v pořádku, Email: <b>'.$Email.'</b> Uživatel: <b>'.$this->System->User->Name.'</b>'); 95 91 WriteLog('Úprava nastavení!', LOG_TYPE_USER); 96 $ User->Load();92 $this->System->User->Load(); 97 93 } else $Output .= ShowMessage('Nezadány údaje.', MESSAGE_CRITICAL); 98 94 return($Output); -
trunk/Modules/User/Profile.php
r572 r577 5 5 function SendMail() 6 6 { 7 global $Config, $User;8 9 7 $Output = ''; 10 8 if(array_key_exists('text', $_POST)) 11 if($ User->Licence(LICENCE_ADMIN))9 if($this->System->User->Licence(LICENCE_ADMIN)) 12 10 { 13 11 $Text = $_POST['text']; … … 18 16 'Text: <strong>'.$Text.'</strong><br />'; 19 17 20 if(@mail($Email, $Subject, $Text, 'From: '.$ Config['Web']['AdminEmail'].'\nReply-To: '.$Config['Web']['AdminEmail'].'\nX-Mailer: PHP/'))18 if(@mail($Email, $Subject, $Text, 'From: '.$this->System->Config['Web']['AdminEmail'].'\nReply-To: '.$this->System->Config['Web']['AdminEmail'].'\nX-Mailer: PHP/')) 21 19 { 22 20 $Output .= ShowMessage('Zpráva byla odeslána.'); -
trunk/Modules/User/User.php
r563 r577 21 21 function Start() 22 22 { 23 global $User; 24 23 25 $this->System->User = new User($this->System); 24 26 $this->System->RegisterPage('userlist.php', 'PageUserList'); 25 27 $this->System->RegisterPage('Options.php', 'PageUserOptions'); 26 28 $this->System->RegisterPage('registrace.php', 'PageUserRegistration'); … … 87 89 $this->Id = $User['ID']; 88 90 $this->Load(); 89 WriteLog('Login: '.$Name, LOG_TYPE_USER);91 $this->System->ModuleManager->Modules['Log']->WriteLog('Login: '.$Name, LOG_TYPE_USER); 90 92 $this->UpdateState(); 91 93 } else $this->Role = LICENCE_ANONYMOUS; -
trunk/Modules/User/UserList.php
r547 r577 1 1 <?php 2 2 3 4 include_once('img_level.php'); 3 include_once(dirname(__FILE__).'/../../img_level.php'); 5 4 6 5 class PageUserList extends Page
Note:
See TracChangeset
for help on using the changeset viewer.