Bu teknik açıdan yapmak hem çok zor hem de güvenlik açığı oluştuyor.
Sentry'nin kaynak koduna bakabilirsin değişiklikler yapmak için.
//Cartalyst\Sentry\Sentry::check()
/**
* Check to see if the user is logged in and activated, and hasn't been banned or suspended.
*
* @return bool
*/
public function check()
{
if (is_null($this->user))
{
// Check session first, follow by cookie
if ( ! $userArray = $this->session->get() and ! $userArray = $this->cookie->get())
{
return false;
}
// Now check our user is an array with two elements,
// the username followed by the persist code
if ( ! is_array($userArray) or count($userArray) !== 2)
{
return false;
}
list($id, $persistCode) = $userArray;
// Let's find our user
try
{
$user = $this->getUserProvider()->findById($id);
}
catch (UserNotFoundException $e)
{
return false;
}
// Great! Let's check the session's persist code
// against the user. If it fails, somebody has tampered
// with the cookie / session data and we're not allowing
// a login
if ( ! $user->checkPersistCode($persistCode))
{
return false;
}
// Now we'll set the user property on Sentry
$this->user = $user;
}
Ben kabaca baktım. Session kaydı ve çerezler yoksa kullanıcı logout oluyor.. check() metodu üzerinde yeni bir method yazabilirsin. Am abu ne kadar sağlıklı olur bilinmez? Değişiklikler yapılmalı ve iyi test edilmeli..
Senin yerinde olsam, bunun çok maliyetli bir iş olduğunu ve güvenliğin kontrol edilemeyeceğini müşteriye anlatırım. İlla da olsun derlerse Sentry sınıfını inceleyerek bazı methodları Sentry'i extend ederek üzerine yazacaksın.
Daha önce böyle bir şeye ihtiyaç olmadığını böyle bir şeyle uğraşmadım..