Ugh. I'm still getting the error message: warning: Cannot modify header information - headers already sent Honestly... This is so frustrating. I think it would take less time to write my own CMS. How come there is not support? -----Original Message----- From: development-bounces@drupal.org [mailto:development-bounces@drupal.org] On Behalf Of Sheryl (Permutations Software) Sent: Sunday, December 18, 2005 4:28 PM To: development@drupal.org Subject: RE: [development] authentication hooks - PLEASE HELP Putting output buffer statements into my theme seems to have solved the tracing problem, at least. At the top and bottom of the hook_page() function in my PHP theme, I added these statements: $output = eval('ob_start();'); ... $output .= eval('ob_end_flush();'); I still have many other problems, however. Drupal calls databases and functions at unpredictable times. I can't tell what's going on and there is no documentation. -----Original Message----- From: development-bounces@drupal.org [mailto:development-bounces@drupal.org] On Behalf Of Sheryl (Permutations Software) Sent: Sunday, December 18, 2005 4:10 PM To: development@drupal.org Subject: RE: [development] authentication hooks - PLEASE HELP The only way I know to turn on output buffering it to create the buffer at the top of the page and write it at the bottom with these calls: ob_start(); ... ob_end_flush(); But with Drupal - who knows where the top of the page is, or the bottom. Hmmm... Actually, I wrote a custom template in PHP (no engine). Maybe I can put it in my template file.
An alternative hack is to write debugging output to the watchdog table (works only for debugging sections of code where common.inc is available)
Thanks for the watchdog tip... I don't know where common.inc is used or when it would "be available". I'm a strong PHP programmer, but not very familiar with Drupal's architecture. I did write to the author of the Webserver Auth mod and he wrote back - hopefully he can help. -----Original Message----- From: development-bounces@drupal.org [mailto:development-bounces@drupal.org] On Behalf Of puregin Sent: Sunday, December 18, 2005 3:45 PM To: development@drupal.org Subject: Re: [development] authentication hooks - PLEASE HELP Hi Sheryl, I believe that output buffering is a PHP option - you can enable it in your php.ini file, or .htaccess, or in your settings.php file. An alternative hack is to write debugging output to the watchdog table (works only for debugging sections of code where common.inc is available): watchdog('debug', "var = $var"); It's ugly but hey, what people will do in times of desperation... I've not looked at Webserver authentication. Have you tried contacting the maintainer? You might also try hanging out in #drupal at irc.freenode.net. Have a look at drupaldocs.org for the developer documentation, including overviews of the hook system. The Drupal handbooks may also be of help, especially the Developer handbook (http://drupal.org/handbooks) Cheers, Djun On 18-Dec-2005, at 12:26 PM, Sheryl (Permutations Software) wrote:
I downloaded the Webserver Authentication module because it's very similar to the module that I need to write for my own site. It's a simple module, but I can't get it to work and I've hit a brick wall. Nothing works - Drupal doesn't recognize when I'm logged into my other authentication system, let alone create Drupal registrations on the fly. It doesn't even appear that the hook_auth module is being called, but I can't trace through the execution because Drupal doesn't use output buffers so inserting echo statements causes errors.
I have tested my login and authentication functions in a separate test program, so I know that they work. I don't know why my module doesn't work. It's probably something simple, but there is virtually no documentation on authentication modules, and I can't figure it out for myself because I can't trace through execution with echo statements. I need information on these basic questions:
- Which hook functions are called when (and not just from within the Drupal code, but from what user action)? I thought that hook_auth() might be called when the user logged in (that was a wild guess), but I can't get Drupal to call this function no matter what I do.
- Exactly how the returns of each function are used - in what other parts of Drupal. Without knowing this, I don't know what's required. In particular for hook_auth, but also for hook_info. When/ how are the hook_info functions used? By what part of Drupal? What might call these, and why?
- What values are set in the database to control authentication, and what does each value mean? In particular, what is the meaning of the different values for "status" in the user table?
- How can I echo values while the script is executing to I can debug my modules???????????????
Please, someone help. I've posted message after message, and no one helps. Thanks in advance.