PHP 8.1.33
Preview: UserIdentity.php Size: 1.61 KB
/home/jambtst2015/public_html/protected/components/UserIdentity.php

<?php

/**
 * UserIdentity represents the data needed to identity a user.
 * It contains the authentication method that checks if the provided
 * data can identity the user.
 */
class UserIdentity extends CUserIdentity
{
	/**
	 * Authenticates a user.
	 * The example implementation makes sure if the username and password
	 * are both 'demo'.
	 * In practical applications, this should be changed to authenticate
	 * against some persistent user identity storage (e.g. database).
	 * @return boolean whether authentication succeeds.
	 */
	private $_userid;
	public function authenticate()
	{
		//exit("yes1");
		$record=Pinuser::model()->findByAttributes(array('userid'=>$this->username));
		//echo '<pre>';
		//print_r($record);
		//exit;
		
        if($record===null){
            $this->errorCode=self::ERROR_USERNAME_INVALID;
		}
        /*else if($record->password!==crypt($this->password,$record->password)){
            $this->errorCode=self::ERROR_PASSWORD_INVALID;
		}*/
		else if($record->password!==$this->password){
            $this->errorCode=self::ERROR_PASSWORD_INVALID;
		}
        else
        {
            $this->_userid=$record->id;
			$this->setState('isUser',$record->id);
            $this->setState('userName',$record->userid);
            //$this->setState('AdminNname',$record->username);
			//Yii::app()->user->isGuest = false;
            //$this->setState('title', $record->title);
            $this->errorCode=self::ERROR_NONE;
        }
        return !$this->errorCode;
	}
	
	public function getId()       //  override Id
    {
       return $this->_userid;
    }
}

Directory Contents

Dirs: 0 × Files: 12

Name Size Perms Modified Actions
2.16 KB lrw-r--r-- 2024-11-22 17:53:11
Edit Download
1.32 KB lrw-r--r-- 2024-11-22 17:53:11
Edit Download
2.88 KB lrw-r--r-- 2024-11-22 17:53:11
Edit Download
2.96 KB lrw-r--r-- 2024-11-22 17:53:11
Edit Download
2.63 KB lrw-r--r-- 2024-11-22 17:53:11
Edit Download
2.43 KB lrw-r--r-- 2024-11-22 17:53:11
Edit Download
42.64 KB lrw-r--r-- 2025-11-04 10:28:05
Edit Download
8.77 KB lrw-r--r-- 2024-11-22 17:53:11
Edit Download
8.17 KB lrw-r--r-- 2024-11-22 17:53:11
Edit Download
1.61 KB lrw-r--r-- 2024-11-22 17:53:11
Edit Download
1.61 KB lrw-r--r-- 2024-11-22 17:53:11
Edit Download
2.27 KB lrw-r--r-- 2024-11-22 17:53:11
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).