I am having a hard time getting it to work correctly with my websites (built using osCommerce). I have searched the forums and google for the past 3 days and I can't find a solution. I've been able to get it to work. My problem is that I am not able to block anyone from uploading directly to: mysite/admin/ckfinder/ckfinder.html
My config.php looks like this:
Can anyone help me with this?
My config.php looks like this:
<?php session_start(); function CheckAuthentication() { if(!isset($_SESSION['osCAdminID'])) return true; else return false; } // LicenseKey : Paste your license key here. If left blank, CKFinder will be fully functional, in demo mode. $config['LicenseName'] = ''; $config['LicenseKey'] = ''; $baseUrl = '/ckfinder/userfiles/'; $baseDir = resolveUrl($baseUrl); $config['Thumbnails'] = Array( 'url' => $baseUrl . '_thumbs', 'directory' => $baseDir . '_thumbs', 'enabled' => true, 'directAccess' => false, 'maxWidth' => 100, 'maxHeight' => 100, 'bmpSupported' => false, 'quality' => 80); $config['Images'] = Array( 'maxWidth' => 1600, 'maxHeight' => 1200, 'quality' => 80); $config['RoleSessionVar'] = 'CKFinder_UserRole'; $config['AccessControl'][] = Array( 'role' => '*', 'resourceType' => '*', 'folder' => '/', 'folderView' => true, 'folderCreate' => true, 'folderRename' => true, 'folderDelete' => true, 'fileView' => true, 'fileUpload' => true, 'fileRename' => true, 'fileDelete' => true); $config['DefaultResourceTypes'] = ''; $config['ResourceType'][] = Array( 'name' => 'Files', // Single quotes not allowed 'url' => $baseUrl . 'files', 'directory' => $baseDir . 'files', 'maxSize' => 0, 'allowedExtensions' => '7z,aiff,asf,avi,bmp,csv,doc,fla,flv,gif,gz,gzip,jpeg,jpg,mid,mov,mp3,mp4,mpc,mpeg,mpg,ods,odt,pdf,png,ppt,pxd,qt,ram,rar,rm,rmi,rmvb,rtf,sdc,sitd,swf,sxc,sxw,tar,tgz,tif,tiff,txt,vsd,wav,wma,wmv,xls,zip', 'deniedExtensions' => ''); $config['ResourceType'][] = Array( 'name' => 'Images', 'url' => $baseUrl . 'images', 'directory' => $baseDir . 'images', 'maxSize' => 0, 'allowedExtensions' => 'bmp,gif,jpeg,jpg,png', 'deniedExtensions' => ''); $config['ResourceType'][] = Array( 'name' => 'Flash', 'url' => $baseUrl . 'flash', 'directory' => $baseDir . 'flash', 'maxSize' => 0, 'allowedExtensions' => 'swf,flv', 'deniedExtensions' => ''); $config['CheckDoubleExtension'] = true; $config['FilesystemEncoding'] = 'UTF-8'; $config['SecureImageUploads'] = true; $config['CheckSizeAfterScaling'] = true; $config['HtmlExtensions'] = array('html', 'htm', 'xml', 'js'); $config['HideFolders'] = Array(".svn", "CVS"); $config['HideFiles'] = Array(".*"); $config['ChmodFiles'] = 0755 ; $config['ChmodFolders'] = 0755 ; $config['ForceAscii'] = false;
Can anyone help me with this?
Re: Can't Prevent Uploads
(removed the !)
Re: Can't Prevent Uploads
The file browser is disabled for security reasons. Please contact your system administrator and check the CKFinder configuration file.
Of course, that leads me to believe that what I have isn't going to work. I'm now starting to wonder how/where this even looks for the osCAdminID in the first place. I'm really quite lost here. I know that Joomla and Drupal both have much more complicated CheckAuthentication functions that call upon their configuration files and, I'm guessing, their databases. I'm thinking I may end up having to do the same thing, but I really have no idea how to do that.
Re: Can't Prevent Uploads
Just create a simple .php page that outputs the $_SESSION['osCAdminID']) and when you manage to get that (or the correct variable name) then you are almost done.
Re: Can't Prevent Uploads
Do you think that is secure enough?
Re: Can't Prevent Uploads
Thanks.
Re: Can't Prevent Uploads
Re: Can't Prevent Uploads
Perhaps I can get your help on something else? I should have posted this in this area, I believe I posted it in the wrong board by mistake. I'll just paste my other question here:
I have 2 questions. I have integrated ckfinder with ckeditor.
First, when right-click on an image in my CKFinder, I see the options: View, Download, Rename, & Delete. How do I get the Select to show up so that I can get the image into my ckeditor?
My second question is about the folders I have in CKFinder. On my website, I have my website images in the images folder and my website's design images in my design folder. Is there a way to get both of these folders to show in CKFinder without getting all of the other folders/files in my root to show?
Re: Can't Prevent Uploads
Re: Can't Prevent Uploads
Apologies for late reply.
Unfortunately I have no idea what session variables is osCommerce using, but as Alfonso wrote, it might be a definitely good idea to print all session variables in a separate script to see:
- what session variables are available when user is logged in
- whether you're able to easily access osCommerce session varialbles (some PHP applications need a bit more complicated code than just session_start to be able to access their session variables)
To do this, simply create a simple file with this code:
Wiktor Walc
CTO, CKSource - http://cksource.com
--
Follow CKEditor on: Twitter | Facebook | Google+
Re: Can't Prevent Uploads
I figured out why the select wasn't showing up. It was because I turned the ckfinder.html file into a php page. Now, why turning an html page into a php page prevents me from seeing the select and select thumbnail, I can't imagine.
The reason why I changed it was so that I could place the php code to force a user to login to use ckfinder.
So, I've turned it back into html again and everything is working as it should. The problem now, of course, is that anyone can access that page since I still haven't figured out how to get the CheckAuthentication to work properly for my site.
For the session variables, if I enter
Into a blank file, I get a blank response. If I enter it into one of my pages that force a user to login, I get this:
Of course, knowing that really doesn't help me since I still can't figure out how to use that information. I don't see how/where ckfinder uses the variable or sees if a user is logged in.
Could you please help me?
Re: Can't Prevent Uploads
Hey, did you guys ever figure this out? This might help but I can get this to work; http://www.parorrey.com/blog/oscommerce ... rce-store/
Re: Can't Prevent Uploads
Had anyone figure this out? Cannot get the admin session to do authentication on the ckfinder page, hacker can upload files through there