This forum is for module development and code related questions, not general module support. For general support, use the Post installation forum.

Need help on a form validation

Hi all,

I hope to post in the correct section...
Excuse me in advance for my bad english, I'm french and very tired...

I've recently discovered Drupal and really enjoy this tool, but I don't understand how to modify posted values in the validate function...
I saw "form_set_value()" can modify values which will be transmitted in the submit process,
but in the case of an error appears in validate, these modifications are lost !

How could I do to set new values accessible in the form redisplayed ?

See ya.
Sébastien

Custom module to set online/offline a drupal website

Hi! I'm trying to develop a small module for let an user withouth the site administration permissions to set the site "online/offline". I've write this file ( online.module ) :

<?php

function online_help($section='') {
  $output = '';

  switch ($section) {
    case "admin/modules#description":
      $output = t("Abilita/Disabilita l'accesso al sito");
      break;
  }

  return $output;
}


function online_perm() {
  return array('enable website');
} 


function online_settings() {  

if (user_access('enable website')) {
    
  $form['site_status']['site_offline'] = array(
    '#type' => 'radios',
    '#title' => t('Site status'),
    '#default_value' => variable_get('site_offline', 0),
    '#options' => array(t('Online'), t('Off-line')),
    '#description' => t('When set to "Online", all visitors will be able to browse your site normally. When set to "Off-line", only users with the "administer site configuration" permission will be able to access your site to perform maintenance; all other visitors will see the site off-line message configured below. Authorized users can log in during "Off-line" mode directly via the <a href="%user-login">user login</a> page.', array('%user-login' => url('user'))),
  );

 return $form;
}

}

The problem is simple: the hook_settings doesn't use my online_perm() but only the site administrations permissions. So actually only the site administrators can view this page, other users cannot!!!

Is there any session management object in Drupal?

Hi,

Is there any session management object in Drupal, or any other way to store user depended variables?

Any ideas?

Thanks.

New Module - Shoud data be stored as a new Node type or...?

I'm not sure i'm asking this the right way.

I've been pouring through the API manual and i'm finally getting the hang of writing my own complex module (although i've never written a simple one yet ;-))..

My module will require two new tables that store event and venue data. The module will then relate (JOIN) the data and display it as needed.

I'm confused about a few things:

1) Does my data need to be designed as a NODE? What i mean is must my module ONLY extend type node by creating a new node type "events" and "venues" and then using node hooks and tables with nids behind the scenes?

OR

2) can i just ditch the whole node paradigm and create my own tables without nids but basic primary keys?

I believe views and panels are NOT nodes. So i DO NOT THINK CONTENT THAT IS DISPLAYED IN DRUPAL HAS TO BE OF TYPE (EXTENDED) NODE (but i'm not sure)?

I think one can create whatever table one wants and access it however one wants (whether nodes or custom tables) as long as hook_menu and hook_block are (MUST be) provided in order to output and make the content available on the page - right??

Another way of asking this might be:

1) What do i GAIN by extending my new data types as a node (that i can't foresee right now)?
2) What do i LOSE by NOT extending my new data types as a node (that i can't foresee right now)?

thanks in advance for any and all input regarding this

Switching from Drupal authentication to Active Directory authentication

I'm using Drupal 4.6 to run the intranet for the company I work for. Up to now, we've been using Drupal authentication for access. But as the usability and necessity of this intranet grows, more people are complaining about having to remember a different password from their Active Directory password.

So I've begun experimenting with the LDAP integration module. We've got it to work. When an Active Directory user logs into the test site for the first time using their AD credentials, a new Drupal account is added for them; I can then add any special roles for them and they're good to go--perfect! However, most of our users already have Drupal accounts that used Drupal authentication. When one of those users logs in using their AD credentials, the following message appears at the top:

Another user already exists in this system with the same login name. You should contact the system's administrator in order to solve this conflict.

But the user doesn't appear to be logged in as a different user. They have the same roles and access as before, and I see no new user that's been created. So it seems the warning doesn't have any real purpose. I could comment the message out from the module, but before I do, I'd like to get some input from this forum as to any negative effects from this approach I might be missing. (Disclosure: I'm not a programmer or very knowledgable about Active Directory/LDAP. My knowledge of PHP is self-taught by working with Drupal for the past year.)

FCK 2.3.2, Drupal 5b2: File Browser - Upload OK, Browsing doesnt work

Hi,

i have installed the newest release of the fck module with fck 2.3.2. I use 5.0 beta 2.

It works fine and i configure the file browser too:
- i set up the path within the phpconnector

It works. I am able to upload images, they are stored in the right directory on the server.

BUT!!!!!!
I CAN'T SEE ANY IMAGE IN THE BROWSER OF FCK!!

I used FireBug to debug and got the following error message (x-times, i don't know if this is important):
uncaught exception: Die Erlaubnis für den Aufruf der Methode XMLHttpRequest.open wurde verweigert

Pages

Subscribe with RSS Subscribe to RSS - Module development and code questions