Changeset 42 for trunk/Application/Model/User.php
- Timestamp:
- Nov 24, 2009, 9:13:38 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Application/Model/User.php
r40 r42 7 7 var $DefaultRole = 2; 8 8 var $OnlineStateTimeout = 600; // in seconds 9 var $AnonymousUserId = 1; 9 10 10 11 var $Roles = array('Unknown', 'Anonymous', 'User', 'Administrator'); … … 24 25 { 25 26 $this->System->Modules['User']->Data['Id'] = $DbRow['User']; 26 if($DbRow['User'] != $this-> Config['Web']['UserAnonymousId']) $this->System->Modules['Log']->NewRecord('User', 'Logout');27 if($DbRow['User'] != $this->AnonymousUserId) $this->System->Modules['Log']->NewRecord('User', 'Logout'); 27 28 $this->Database->delete('UserOnline', 'Id='.$DbRow['Id']); 28 29 } … … 31 32 $Query = $this->Database->select('UserOnline', '*', 'SessionId="'.$SID.'"'); 32 33 if($Query->num_rows == 0) 33 $this->Database->insert('UserOnline', array('SessionId' => $SID, 'User' => $this-> Config['Web']['UserAnonymousId'], 'LoginTime' => 'NOW()', 'ActivityTime' => 'NOW()', 'IpAddress' => GetRemoteAddress(), 'HostName' => gethostbyaddr(GetRemoteAddress()), 'ScriptName' => $_SERVER['PHP_SELF']));34 $this->Database->insert('UserOnline', array('SessionId' => $SID, 'User' => $this->AnonymousUserId, 'LoginTime' => 'NOW()', 'ActivityTime' => 'NOW()', 'IpAddress' => GetRemoteAddress(), 'HostName' => gethostbyaddr(GetRemoteAddress()), 'ScriptName' => $_SERVER['PHP_SELF'])); 34 35 //echo($this->Database->LastQuery); 35 36 … … 37 38 $Query = $this->Database->select('UserOnline', '*', 'SessionId="'.$SID.'"'); 38 39 $Row = $Query->fetch_assoc(); 39 if($Row['User'] != $this-> Config['Web']['UserAnonymousId'])40 if($Row['User'] != $this->AnonymousUserId) 40 41 { 41 42 $Query = $this->Database->select('User', '*', 'Id='.$Row['User']); … … 44 45 } else 45 46 { 46 $Query = $this->Database->select('User', '*', 'Id='.$this-> Config['Web']['UserAnonymousId']);47 $Query = $this->Database->select('User', '*', 'Id='.$this->AnonymousUserId); 47 48 $this->Data = $Query->fetch_assoc(); 48 49 $Result = $this->System->Translate('UserNotLogged'); … … 83 84 84 85 $Subject = FromUTF8('Registrace nového účtu', 'iso2'); 85 $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='.$this->PasswordHash($Login, $Password).'">http://'.$Config['Web']['Host'].$Config['Web']['RootFolder'].'/?Action=UserRegisterConfirm&User='.$UserId.'&H='.$this->PasswordHash($Login, $Password).'</a>.'."\n<br> \n\n<br><br>Na tento email neodpovídejte.";86 $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";86 $Message = 'Provedli jste registraci nového účtu na serveru <a href="http://'.$Config['System']['Host'].$Config['System']['RootFolder'].'/">http://'.$Config['System']['Host'].$Config['System']['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['System']['Host'].$Config['System']['RootFolder'].'/?Action=UserRegisterConfirm&User='.$UserId.'&H='.$this->PasswordHash($Login, $Password).'">http://'.$Config['System']['Host'].$Config['System']['RootFolder'].'/?Action=UserRegisterConfirm&User='.$UserId.'&H='.$this->PasswordHash($Login, $Password).'</a>.'."\n<br> \n\n<br><br>Na tento email neodpovídejte."; 87 $AdditionalHeaders = "To: ".$Name." <".$Email.">\n"."From: ".FromUTF8($Config['System']['Title'], 'iso2')." <noreplay@zdechov.net>\n"."MIME-Version: 1.0\n"."Content-type: text/html; charset=utf-8"; 87 88 mail($Email, $Subject, $Message, $AdditionalHeaders); 88 89 $Result = $this->System->Translate('UserRegistrated'); … … 136 137 { 137 138 $SID = session_id(); 138 $this->Database->update('UserOnline', 'SessionId="'.$SID.'"', array('User' => $this-> Config['Web']['UserAnonymousId']));139 $this->Database->update('UserOnline', 'SessionId="'.$SID.'"', array('User' => $this->AnonymousUserId)); 139 140 $this->System->Modules['Log']->NewRecord('User', 'Logout', $this->Data['Login']); 140 141 $this->Check(); … … 221 222 222 223 $Subject = 'Obnova hesla'; 223 $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.";224 $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";224 $Message = 'Požádali jste o zaslání nového hesla na serveru <a href="http://'.$Config['System']['Host'].$Config['System']['RootFolder'].'">http://'.$Config['System']['Host'].$Config['System']['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['System']['Host'].$Config['System']['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."; 225 $AdditionalHeaders = "To: ".$Row['Name']." <".$Row['Email'].">\n"."From: ".FromUTF8($Config['System']['Title'], 'iso2')." <noreplay@zdechov.net>\n"."MIME-Version: 1.0\n"."Content-type: text/html; charset=utf-8"; 225 226 mail($Row['Email'], $Subject, $Message, $AdditionalHeaders); 226 227 $Output = $this->System->Translate('UserPasswordRecoverySuccess');
Note:
See TracChangeset
for help on using the changeset viewer.