Merhaba
Hazırladığım sitenin admin panelinde CKEditor ve CKFinder kullanıyorum. CKFinder'ın güvenlik sebebiyle dışarıdan girişlere kapalı olması gerekiyor. Onun için config.php dosyasında şöyle bir fonksiyonu var:
/**
* This function must check the user session to be sure that he/she is
* authorized to upload and access files in the File Browser.
*
* @return boolean
*/
function CheckAuthentication()
{
// WARNING : DO NOT simply return "true". By doing so, you are allowing
// "anyone" to upload and list the files in your server. You must implement
// some kind of session validation here. Even something very simple as...
// return isset($_SESSION['IsAuthorized']) && $_SESSION['IsAuthorized'];
// ... where $_SESSION['IsAuthorized'] is set to "true" as soon as the
// user logs in your system. To be able to use session variables don't
// forget to add session_start() at the top of this file.
return false;
}
Normalde açıklamada yazdığı gibi bir oturum değişkeni ile hallediyordum ama artık laravel kullandığım için oturum değişkenlerini bu dosya içinde kullanamıyorum. config/sessions.php içerisinde driver "native" olarak ayarlanmış durumda. Buna rağmen bağımsız bir dosyada
<?php
session_start();
print_r($_SESSION);
yaptığımda oturum dökümü yerine boş bir dizi alıyorum.
Array()
ckfinder'ın config.php dosyasına bir şekilde kullanıcının laravel Auth ile başarıyla giriş yaptığını göndermem gerekiyor.
...
if(Auth::attempt($data)) {
Session::put('ckfinder_enabled','enabled');
...
}
<?php
session_start();
/**
* This function must check the user session to be sure that he/she is
* authorized to upload and access files in the File Browser.
*
* @return boolean
*/
function CheckAuthentication()
{
// WARNING : DO NOT simply return "true". By doing so, you are allowing
// "anyone" to upload and list the files in your server. You must implement
// some kind of session validation here. Even something very simple as...
// return isset($_SESSION['IsAuthorized']) && $_SESSION['IsAuthorized'];
// ... where $_SESSION['IsAuthorized'] is set to "true" as soon as the
// user logs in your system. To be able to use session variables don't
// forget to add session_start() at the top of this file.
if($_SESSION['ckfinder_enabled'] == 'enabled') {
return true;
} else {
return false;
}
}
şeklinde denedim ama olmadı ne yazık ki. Böyle basit birşeyde tıkanacağım hiç aklıma gelmezdi
Her türlü fikire açığım