PHP 클래스 PMA\libraries\plugins\auth\AuthenticationCookie

상속: extends PMA\libraries\plugins\AuthenticationPlugin
파일 보기 프로젝트 열기: phpmyadmin/phpmyadmin 1 사용 예제들

공개 메소드들

메소드 설명
auth ( ) : boolean | void Displays authentication form
authCheck ( ) : boolean Gets advanced authentication settings
authFails ( ) : void User is not allowed to login to MySQL -> authentication failed
authSetUser ( ) : boolean Set the user and password after last checkings if required
cookieDecrypt ( string $encdata, string $secret ) : string | boolean Decryption using openssl's AES or phpseclib's AES (phpseclib uses mcrypt when it is available)
cookieEncrypt ( string $data, string $secret ) : string Encryption using openssl's AES or phpseclib's AES (phpseclib uses mcrypt when it is available)
createIV ( ) : void Initialization Store the initialization vector because it will be needed for further decryption. I don't think necessary to have one iv per server so I don't put the server number in the cookie name.
enlargeSecret ( string $secret ) : string Concatenates secret in order to make it 16 bytes log
getAESSecret ( string $secret ) : string Derives AES secret from encryption secret.
getIVSize ( ) : integer Returns size of IV for encryption.
getMACSecret ( string $secret ) : string Derives MAC secret from encryption secret.
handlePasswordChange ( string $password ) : void Callback when user changes password.
logOut ( ) : void Perform logout
setIV ( string $vector ) : void Sets encryption IV to use
storePasswordCookie ( string $password ) : void Stores password in a cookie.
storeUserCredentials ( ) : void | boolean Stores user credentials after successful login.
storeUsernameCookie ( string $username ) : void Stores username in a cookie.
useOpenSSL ( ) : boolean Checks whether we should use openssl for encryption.

비공개 메소드들

메소드 설명
_getEncryptionSecret ( ) : string Returns blowfish secret or generates one if needed.
_getSessionEncryptionSecret ( ) : string Returns blowfish secret or generates one if needed.

메소드 상세

auth() 공개 메소드

this function MUST exit/quit the application
public auth ( ) : boolean | void
리턴 boolean | void

authCheck() 공개 메소드

this function DOES NOT check authentication - it just checks/provides authentication credentials required to connect to the MySQL server usually with $GLOBALS['dbi']->connect() it returns false if something is missing - which usually leads to auth() which displays login form it returns true if all seems ok which usually leads to auth_set_user() it directly switches to authFails() if user inactivity timeout is reached
public authCheck ( ) : boolean
리턴 boolean whether we get authentication settings or not

authFails() 공개 메소드

prepares error message and switches to auth() which display the error and the login form this function MUST exit/quit the application, currently done by call to auth()
public authFails ( ) : void
리턴 void

authSetUser() 공개 메소드

Set the user and password after last checkings if required
public authSetUser ( ) : boolean
리턴 boolean always true

cookieDecrypt() 공개 메소드

Decryption using openssl's AES or phpseclib's AES (phpseclib uses mcrypt when it is available)
public cookieDecrypt ( string $encdata, string $secret ) : string | boolean
$encdata string encrypted data
$secret string the secret
리턴 string | boolean original data, false on error

cookieEncrypt() 공개 메소드

Encryption using openssl's AES or phpseclib's AES (phpseclib uses mcrypt when it is available)
public cookieEncrypt ( string $data, string $secret ) : string
$data string original data
$secret string the secret
리턴 string the encrypted result

createIV() 공개 메소드

Initialization Store the initialization vector because it will be needed for further decryption. I don't think necessary to have one iv per server so I don't put the server number in the cookie name.
public createIV ( ) : void
리턴 void

enlargeSecret() 공개 메소드

This doesn't add any security, just ensures the secret is long enough by copying it.
public enlargeSecret ( string $secret ) : string
$secret string Original secret
리턴 string

getAESSecret() 공개 메소드

Derives AES secret from encryption secret.
public getAESSecret ( string $secret ) : string
$secret string the secret
리턴 string the AES secret

getIVSize() 공개 메소드

Returns size of IV for encryption.
public getIVSize ( ) : integer
리턴 integer

getMACSecret() 공개 메소드

Derives MAC secret from encryption secret.
public getMACSecret ( string $secret ) : string
$secret string the secret
리턴 string the MAC secret

handlePasswordChange() 공개 메소드

Callback when user changes password.
public handlePasswordChange ( string $password ) : void
$password string New password to set
리턴 void

logOut() 공개 메소드

Perform logout
public logOut ( ) : void
리턴 void

setIV() 공개 메소드

This is for testing only!
public setIV ( string $vector ) : void
$vector string The IV
리턴 void

storePasswordCookie() 공개 메소드

Stores password in a cookie.
public storePasswordCookie ( string $password ) : void
$password string Password
리턴 void

storeUserCredentials() 공개 메소드

Stores user credentials after successful login.
public storeUserCredentials ( ) : void | boolean
리턴 void | boolean

storeUsernameCookie() 공개 메소드

Stores username in a cookie.
public storeUsernameCookie ( string $username ) : void
$username string User name
리턴 void

useOpenSSL() 공개 정적인 메소드

Checks whether we should use openssl for encryption.
public static useOpenSSL ( ) : boolean
리턴 boolean