User.object
上传用户:xiao730204
上传日期:2007-01-04
资源大小:141k
文件大小:2k
- <?php
- class User extends BaseObject {
- var $user_id;
- var $domain_id;
- var $user_name;
- var $password;
- var $login_deny;
- var $last_update;
- var $debug;
- Function User() {
- $this->BaseObject( 'User' );
- $this->user_id = -1;
- $this->domain_id = 0;
- $this->user_name = undef;
- $this->password = undef;
- $this->login_deny = true;
- $this->last_update = undef;
- $this->debug = new Debug;
- $this->debug->Off();
- }
- Function Copy( $source_obj ) {
- $this->user_id = $source_obj->user_id;
- $this->user_name = $source_obj->user_name;
- $this->password = $source_obj->password;
- $this->login_deny = $source_obj->login_deny;
- $this->debug = $source_obj->debug;
- $this->domain_id = $source_obj->domain_id;
- $this->last_updated = $source_obj->last_updated;
- }
- Function DumpVars() {
- $this->debug->Message( 'USER ID : ' . $this->user_id );
- $this->debug->Message( 'User Name : ' . $this->user_name );
- $this->debug->Message( 'Password : ' . $this->password );
- $this->debug->Message( 'Login Deny : ' . $this->login_deny );
- }
- Function EncryptPassword( $salt = '' ) {
- if ( $salt == '' ) {
- return crypt( $this->password );
- } else {
- $useable_salt = $salt;
- if ( ereg( '^$1$', $salt ) ) {
- $useable_salt = substr( $salt, 0, 12 );
- } else {
- $useable_salt = substr( $salt, 0, 2 );
- }
- return crypt( $this->password, $useable_salt );
- }
- }
- }
- ?>