Sat, 2010-03-20 11:26 - John Pfeiffer
Access denied You are not authorized to access this page. Drupal image insert errors...
In Drupal, when trying to insert an image using a what you see is what you get editor, I ran into two minor (but irritating) problems:
- When logged in as SITE ADMIN the picture didn't show up even after being uploaded and placed...
RESOLUTION: The Input Format was selected as Filtered HTML (or plaintext even!) so none of the tags were placed in the content node. Changing the radio button on Input Format to FULL HTML made the picture insertion actually appear when Previewing / Saving.
- When logged in as a Role given all privileges (basically one step down from SITE ADMIN) and trying to use the what you see is what you get editor to insert an image, when clicking on the Browse button it opens up the following:
Access denied You are not authorized to access this page.
RESOLUTION (many steps)
- The Input Format "Full HTML" did not have any roles assigned to it.
Administer -> Site configuration -> Input Formats -> Name "Full HTML" ... Configure Choose the role that you wish to use for uploading images and click the checkbox. NOTE: a more secure solution would be to define a limited Input Format that can add "image" tags and other necessary What You See is What You Get functionality. e.g. <img> 2. Administrator -> Site configuration -> FCKEditor Ensure the Role has permission to use FCKEditor (and image uploading) Roles allowed to use this profile Then scroll down to "File Browser settings" Choose IMCE as the browser type from the dropdown Choose to "allow quick uploads" Yes from the radio button 3. Now update your site's permission configurations: Administer -> Content Management -> Post Settings -> Rebuild Permissions button
- Now for the dirty part...difficult Drupal FCKEditor security requires: /Drupal-Root/modules/fckeditor-6.x-2.0/fckeditor/fckeditor/editor/filemanager/connectors/php OR (best practice not followed in above example... oops) /Drupal-Root/sites/all/modules/fckeditor-6.x-2.0/fckeditor/fckeditor/editor/filemanager/connectors/php/config.php download, make a backup and then modify config.php change: $Config['Enabled'] = false ; to: $Config['Enabled'] = true ; change: $Config['UserFilesPath'] = '/userfiles/' ; to: $Config['UserFilesPath'] = '/images/' ; Add the extra line below... $Config['UserFilesAbsolutePath'] = '' ; require_once "../../../../../filemanager.config.php"; You may also have to: FTP into Drupal-Root/sites/default download the settings.php and save a backup copy modify the file by changing the following line $cookie_domain = 'your domain'; then upload the updated version BUT BE AWARE, DRUPAL makes this file read only by default (so in Filezilla FTP you should right click and choose File Permissions... make it Writeable, then upload your changed version, then change the file permissions back to read only).
Apparently this is an old and very common problem: http://drupal.org/node/242153