Still on Drupal 7? Security support for Drupal 7 ended on 5 January 2025. Please visit our Drupal 7 End of Life resources page to review all of your options.
I need an extra password widget in a module, and have run into a snag.
I've implemented hook_settings. The behavior I want is to check if the password and the confirm password fields don't match, I want the usual sort of "Passwords Must Match" error message to appear.
The problem is that system.module saves my password settings very early in the request processing. I can't use hook_validate because it won't get called for the _settings page. I can't do the validation in hook_settings because the system steps in long before that.
What's the recommended way to deal with this. I have a solution that works, but it's so fragile that it's pretty much guaranteed to get broken the next time system.module changes:
if(isset($_POST['edit']['my_password'])){
//looks like we are setting the site password.
//make sure the copies match so we do not get locked out.
$pw = $_POST['edit']['my_password'];
$pw_confirm = $_POST['edit']['my_password_confirm'];
if($pw != $pw_confirm){
form_set_error('my_password', t('Passwords must match!'));
//and we must unset some globals to fool the systems settings
//gremlin. TO DO: This is hinkey, and may break.
unset($_POST['edit']['my_password']);
unset($_POST['edit']['my_password_confirm']);
if($_POST['op'] == t('Save configuration')){
$_POST['op'] .= "--mod"; //to fool system.module
i've been looking for quite some time for a whiteboard module (for any cms), but have had no luck. does anyone know of one? or where to begin to develop one?
I have installed Chatbox by installing the tabels into my Mysql database and installed the module.. But where do the chatbox appear to users and how do i get it appear to users?
I'm writing a module and when it's in the module directory nothing will display on the drupal site. None of the code is being executed. So it would help to know what hooks have to be called in Drupal 4.6.1. If a module template exists that all modules could start from that would be helpful too.
I did a couple of searches, but I didn't find anything related to using the filemanager module with image.module.
I llike a lot of the features the image.module provides, and I would like to use image.module to store my images instead of creating my own implementation of image.module just to get around having the module store everything in the same directory.