Changeset 6 for trunk/www/user.php
- Timestamp:
- Jun 10, 2009, 4:57:51 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/www/user.php
r4 r6 21 21 define('USER_PASSWORD_RECOVERY_CONFIRMED', 'Nové heslo bylo aktivováno.'); 22 22 23 define('USER_BAD_ROLE', 'Nemáte dostatečná oprávnění'); 24 23 25 define('USER_EVENT_REGISTER', 1); 24 26 define('USER_EVENT_LOGIN', 2); 25 27 define('USER_EVENT_LOGOUT', 3); 26 28 define('USER_EVENT_OPTIONS_CHANGED', 4); 29 30 define('USER_ROLE_ANONYMOUS', 1); 31 define('USER_ROLE_USER', 2); 32 define('USER_ROLE_ADMINISTRATOR', 3); 27 33 28 34 class User extends Module … … 75 81 } 76 82 77 function Register($Login, $Password, $Password2, $Email, $Name , $PhoneNumber, $ICQ)83 function Register($Login, $Password, $Password2, $Email, $Name) 78 84 { 79 85 global $Options, $Config; … … 96 102 else 97 103 { 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')); 101 104 $this->Database->insert('User', array('Name' => $Name, 'Login' => $Login, 'Password' => sha1($Password), 'Email' => $Email, 'RegistrationTime' => 'NOW()', 'Locked' => 1, 'Role' => 2)); 105 102 106 $Subject = FromUTF8('Registrace nového účtu', 'iso2'); 103 107 $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."; … … 144 148 // načtení stavu stromu 145 149 $Result = USER_LOGGED_IN; 146 //$this->System->Modules['Log']->NewRecord('User', 'Login', 'Login='.$Login.',Host='.gethostbyaddr(GetRemoteAddress()));150 $this->System->Modules['Log']->NewRecord('User', 'Login', 'Login='.$Login.',Host='.gethostbyaddr(GetRemoteAddress())); 147 151 } 148 152 } else $Result = USER_NOT_REGISTRED;
Note:
See TracChangeset
for help on using the changeset viewer.