KWeb  6.4
KWebSession Class Reference
Inheritance diagram for KWebSession:
KVarBase

Public Member Functions

 __destruct ()
 isInitialized ()
 getCurrentUser ($object=true)
 getSessionUser ($object=true)
 getAnonymousUserId ()
 isUserAnonymous ($userId=false)
 isUserAdmin ($userId=false)
 isUserEditor ($userId=false)
 getSessionKey ()
 getSessionId ()
 Zwraca skróconą wersję klucza na potrzeby identyfikacji sesji.
 getSessionIP ()
 getSessionCookie ()
 Return session cookie (Identifier passed by cookies)
 getBrowserKey ()
 Returns the browser key - independent from session key stored on the browser through cookies.
 isContinuedSession ()
 setCookie ($name, $value, $time=0)
 resumeSession ($sess)
 Reads specified session ...
 makeStoreable ()
 Sesja zostanie zapisana na koniec renderowania strony.
 storeSession ($force=false)
 Zapisuje sesje w bazie i ustawia ludkowi cookie.
 createSessionCookie ()
 createSessionKey ($cookie)
 Klucz sesji to połączenie cookie (przekazywanego do usera w cookie) i danych z nagłówka HTTP.
 userLogout ()
 userLogin ($login, $pass, $allowLoginByEmail=false)
 Login using login and password.
 userLoginHash ($login, $passHash, $allowLoginByEmail=false)
 Login using login and a simple password hash.
 userLoginObject ($user, $markLogon=true)
 Sets user object as session's user.
 setCurrentUser ($obj)
 Ustawia aktywnego użytkownika Czyści stos...
 pushCurrentUser ($user)
 Tymczasowo ustawia innego użytkownika.
 popCurrentUser ()
 Pops user pushed by pushCurrentUser() and returns it.
 clearCurrentUserStack ()
 makePasswordHash ($pass, $salt=false)
 Generates simple hash to obfuscate the password.
 makeSaltedHash ($passHash, $salt)
 Generates proper hash for password storing using phpass.
 checkSaltedHash ($passHash, $fullHash, $salt)
 Returns true if the password is ok.
 makePasswordSalt ()
 set ($name, $value)
 setRef ($name, &$value)
 reset ($name, $useDefault=true)
 Resets specified property.
 importArray ($data, $merge=false)
 loginWithFacebook (Facebook $fb, $connectToExisting=false, $newUserType=ITEMT_USER, $newUserGroup=SPECIALID_GROUP_USERS, $newUserOwnerId=SPECIALID_USER_SITEBOT)
 Logins with facebook session.
 setFutureRequestData ($data)
 Sets data, that will be available in KWebRequest::data() in the subsequent request.
 onKwebFinish (KWebEvent $event)

Static Public Member Functions

static instance ($create=true)
static getUserAgent ()

Data Fields

const DATA_FUTURE_REQUEST_DATA = 'future_request_data'
const DATA_ERRORSTACKS = 'errorstacks'

Static Public Attributes

static $cookiesEnabled = false
static $inst = null

Protected Member Functions

 __construct ()
 _initialize ()
 readSession ($cookie=false)
 createSession ($reuseCookie=false)
 restoreSessionData ()

Protected Attributes

 $needStore
 $cookie
 $sessionKey
 $browserKey
 Klucz definiujacy uzytkownika pomiedzy sesjami (trzymany w cookie na długo)
 $continued = false
 $user = null
 $sessionUser = null
 $userStack = array()
 $needRefresh = false
 $storeCookies = array()
 $id = 0
 $sessionReady = false
 $localProperties = array()

Constructor & Destructor Documentation

KWebSession::__construct ( ) [protected]

Reimplemented from KVarBase.

KWebSession::__destruct ( )

Reimplemented from KVarBase.


Member Function Documentation

KWebSession::_initialize ( ) [protected]
KWebSession::checkSaltedHash ( passHash,
fullHash,
salt 
)

Returns true if the password is ok.

Parameters:
$passHash- simple hash of a password (from makePasswordHash())
$fullHash- full hash of a password (from database)
KWebSession::clearCurrentUserStack ( )
KWebSession::createSession ( reuseCookie = false) [protected]
KWebSession::createSessionCookie ( )
KWebSession::createSessionKey ( cookie)

Klucz sesji to połączenie cookie (przekazywanego do usera w cookie) i danych z nagłówka HTTP.

KWebSession::getAnonymousUserId ( )
KWebSession::getBrowserKey ( )

Returns the browser key - independent from session key stored on the browser through cookies.

KWebSession::getCurrentUser ( object = true)
Returns:
KWebItem_User
KWebSession::getSessionCookie ( )

Return session cookie (Identifier passed by cookies)

Returns:
string
KWebSession::getSessionId ( )

Zwraca skróconą wersję klucza na potrzeby identyfikacji sesji.

KWebSession::getSessionIP ( )
KWebSession::getSessionKey ( )
KWebSession::getSessionUser ( object = true)
Returns:
KWebItem_User
static KWebSession::getUserAgent ( ) [static]
KWebSession::importArray ( data,
merge = false 
)

Reimplemented from KVarBase.

static KWebSession::instance ( create = true) [static]
Returns:
KWebSession
KWebSession::isContinuedSession ( )
KWebSession::isInitialized ( )
KWebSession::isUserAdmin ( userId = false)
KWebSession::isUserAnonymous ( userId = false)
KWebSession::isUserEditor ( userId = false)
KWebSession::loginWithFacebook ( Facebook $  fb,
connectToExisting = false,
newUserType = ITEMT_USER,
newUserGroup = SPECIALID_GROUP_USERS,
newUserOwnerId = SPECIALID_USER_SITEBOT 
)

Logins with facebook session.

Creates local account if necessary

Parameters:
Facebook$fb- facebook object
$connectToExisting- TRUE if existing user can be connected with FB account
$newUserType- type of new user object
KWebSession::makePasswordHash ( pass,
salt = false 
)

Generates simple hash to obfuscate the password.

This hash is then used as a base for proper hashing. This way we can send those simple hashes, instead of plaintext.

Yes, I know it's also unsafe, but it's legacy code... HTTPS will mitigate that problem...

Parameters:
$pass- plaintext password
$salt- additional salt
Returns:
string
KWebSession::makePasswordSalt ( )
KWebSession::makeSaltedHash ( passHash,
salt 
)

Generates proper hash for password storing using phpass.

Parameters:
$passHash- simple hash of a password (from makePasswordHash())
$salt- salt stored in database (currently not needed)
Returns:
string
KWebSession::makeStoreable ( )

Sesja zostanie zapisana na koniec renderowania strony.

KWebSession::onKwebFinish ( KWebEvent event)
KWebSession::popCurrentUser ( )

Pops user pushed by pushCurrentUser() and returns it.

Returns:
KWebItem_User
KWebSession::pushCurrentUser ( user)

Tymczasowo ustawia innego użytkownika.

Przed zapisaniem sesji stos użytkowników jest czyszczony...

KWebSession::readSession ( cookie = false) [protected]
KWebSession::reset ( name,
useDefault = true 
)

Resets specified property.

If useDefault is TRUE, class's default value will be used, otherwise, the value will be unset

Reimplemented from KVarBase.

KWebSession::restoreSessionData ( ) [protected]
KWebSession::resumeSession ( sess)

Reads specified session ...

Parameters:
string$sessSession cookie key
Returns:
boolean
KWebSession::set ( name,
value 
)

Reimplemented from KVarBase.

KWebSession::setCookie ( name,
value,
time = 0 
)
KWebSession::setCurrentUser ( obj)

Ustawia aktywnego użytkownika Czyści stos...

Parameters:
KWebItem_User$obj
KWebSession::setFutureRequestData ( data)

Sets data, that will be available in KWebRequest::data() in the subsequent request.

KWebSession::setRef ( name,
&$  value 
)

Reimplemented from KVarBase.

KWebSession::storeSession ( force = false)

Zapisuje sesje w bazie i ustawia ludkowi cookie.

Zapisuje tylko gdy zostana ustawione jakies zmienne sesyjne. Ew. wydłuża ważność sesji...

$this->user->isUserAnonymous() &&

KWebSession::userLogin ( login,
pass,
allowLoginByEmail = false 
)

Login using login and password.

Parameters:
unknown_type$login
unknown_type$pass
KWebSession::userLoginHash ( login,
passHash,
allowLoginByEmail = false 
)

Login using login and a simple password hash.

Parameters:
unknown_type$login
unknown_type$passHash
Returns:
boolean
KWebSession::userLoginObject ( user,
markLogon = true 
)

Sets user object as session's user.

Parameters:
KWebItem_User$user
KWebSession::userLogout ( )

Field Documentation

KWebSession::$browserKey [protected]

Klucz definiujacy uzytkownika pomiedzy sesjami (trzymany w cookie na długo)

KWebSession::$continued = false [protected]
KWebSession::$cookie [protected]
KWebSession::$cookiesEnabled = false [static]
KWebSession::$id = 0 [protected]
KWebSession::$inst = null [static]
KWebSession::$localProperties = array() [protected]
KWebSession::$needRefresh = false [protected]
KWebSession::$needStore [protected]
KWebSession::$sessionKey [protected]
KWebSession::$sessionReady = false [protected]
KWebSession::$sessionUser = null [protected]
KWebSession::$storeCookies = array() [protected]
KWebSession::$user = null [protected]
KWebSession::$userStack = array() [protected]
const KWebSession::DATA_ERRORSTACKS = 'errorstacks'
const KWebSession::DATA_FUTURE_REQUEST_DATA = 'future_request_data'

The documentation for this class was generated from the following file: