I noticed the img_assist.module has code: return drupal_access_denied();
Is there another code, hook, or possible future feature request, so as to not use the drupal standard access denied page, rather direct to a custom access denied page or popup, fore example. Sorry but image assist privileges are only for registered users, please kindly regis...etc... Rather than the default, unsympathetic and uninformative, 403 Access Denied.
I tried Custom Error module which is a very useful module, but it doesn't solve this issue. The Custom Error module is for changing global custom errors 403 and 404, and not specific errors initiated by an event, i.e. image_assist.
I tried http://groups.drupal.org/node/80154, but making a rule, seems to be an overkill.
I hope many of you also agree, a custom 403 feature would improve UX and therefore create registered users.
Comments
Comment #1
cj-a-min commentedHere is what I did, to create a custom page popup.
Basically, if an unsuspecting anonymous user clicks on the photo icon on the tinymce bar, it redirects them to a custom popup, and not a ugly 403. And if they are a registered user, than the image_assist module proceeds like normal.
Definitely NOT the drupal way of doing things; it's ugly; plus I am not a PHP coder; and it's just a hack job. Don't Ban me. So if anyone else can come up with a better solution, it would be great!
In img_assist.module, replace the function img_assist_wysiwyg_plugin with:
Create a copy of your editor_plugin.js and rename it anony_editor_plugin.js and change the following:
to:
Create a 403 dir, in your root, and create a image-access-please-register.html. You can put whatever you want, i.e. In order to insert images, you'll need to register, bla bla bla.
Maybe if anyone knows how to turn this into a module or create a hook for the template file??
Anyone, want to take a crack at it?