How to protect cKFinder with Yii

Please help how to protect cKFinder to avoid direct access (http://example.com/assets/948c453c/ckfinder/ckfinder.html).

Thanks

the very easy way is use session.

when a form access, then you create session.

_form.php




$_SESSION['ckfinder'] = Yii::app()->user->id;



and in config ckfinder




function CheckAuthentication()

{

  if(isset($_SESSION['ckfinder']))

	return true;  // you can set more check validation here

  else

        die();  // or redirect somewhere


}



be sure to unset this session in other page cause it’s not needed.

if you know how yii session set, it’s better.

Thank you fastcrash

how to use ckfinder in CKEditor?


$js =<<<EOP

CKFinder.SetupCKEditor(null, '$assets/ckfinder/');

CKEDITOR.replace('{$name}',{$options});

EOP;