I've installed cas module version 5.x-2.0 and When I try to visit my drupal home page I get a blank page.
On the apache log I found the following stack trace:
==> /var/log/httpd/error_log <==
[Mon Apr 23 11:44:35 2007] [error] [client 127.0.0.1] PHP Fatal error: Call to undefined function arg() in /var/www/wwwherald/modules/cas/cas.module on line 325
[Mon Apr 23 11:44:35 2007] [error] [client 127.
Mauro: Rusista says:
0.0.1] PHP Stack trace:
[Mon Apr 23 11:44:35 2007] [error] [client 127.0.0.1] PHP 1. {main}() /var/www/wwwherald/index.php:0
[Mon Apr 23 11:44:35 2007] [error] [client 127.0.0.1] PHP 2. drupal_bootstrap() /var/www/wwwherald/index.php:13
[Mon Apr 23 11:44:35 2007] [error] [client 127.0.0.1] PHP 3. _drupal_bootstrap() /var/www/wwwherald/includes/bootstrap.inc:771
[Mon Apr 23 11:44:35 2007] [er
Mauro: Rusista says:
ror] [client 127.0.0.1] PHP 4. _drupal_cache_init() /var/www/wwwherald/includes/bootstrap.inc:818
[Mon Apr 23 11:44:35 2007] [error] [client 127.0.0.1] PHP 5. bootstrap_invoke_all() /var/www/wwwherald/includes/bootstrap.inc:859
[Mon Apr 23 11:44:35 2007] [error] [client 127.0.0.1] PHP 6. module_invoke() /var/www/wwwherald/includes/bootstrap.inc:443
[Mon Apr 23 11:44:35 2007] [error] [client
Mauro: Rusista says:
127.0.0.1] PHP 7. call_user_func_array() /var/www/wwwherald/includes/module.inc:386
[Mon Apr 23 11:44:35 2007] [error] [client 127.0.0.1] PHP 8. cas_init() /var/www/wwwherald/includes/module.inc:0
[Mon Apr 23 11:44:35 2007] [error] [client 127.0.0.1] PHP 9. _cas_force_login() /var/www/wwwherald/modules/cas/cas.module:23
[Mon Apr 23 11:44:35 2007] [error] [client 127.0.0.1] PHP Notice: Undef
Mauro: Rusista says:
ined property: stdClass: cache in /var/www/wwwherald/includes/session.inc on line 77
[Mon Apr 23 11:44:35 2007] [error] [client 127.0.0.1] PHP Stack trace:
[Mon Apr 23 11:44:35 2007] [error] [client 127.0.0.1] PHP 1. {main}() /var/www/wwwherald/index.php:0
[Mon Apr 23 11:44:35 2007] [error] [client 127.0.0.1] PHP 2. drupal_bootstrap() /var/www/wwwherald/index.php:13
[Mon Apr 23 11:44:35 2007
Mauro: Rusista says:
] [error] [client 127.0.0.1] PHP 3. _drupal_bootstrap() /var/www/wwwherald/includes/bootstrap.inc:771
[Mon Apr 23 11:44:35 2007] [error] [client 127.0.0.1] PHP 4. _drupal_cache_init() /var/www/wwwherald/includes/bootstrap.inc:818
[Mon Apr 23 11:44:35 2007] [error] [client 127.0.0.1] PHP 5. bootstrap_invoke_all() /var/www/wwwherald/includes/bootstrap.inc:859
[Mon Apr 23 11:44:35 2007] [error]
Mauro: Rusista says:
[client 127.0.0.1] PHP 6. module_invoke() /var/www/wwwherald/includes/bootstrap.inc:443
[Mon Apr 23 11:44:35 2007] [error] [client 127.0.0.1] PHP 7. call_user_func_array() /var/www/wwwherald/includes/module.inc:386
[Mon Apr 23 11:44:35 2007] [error] [client 127.0.0.1] PHP 8. cas_init() /var/www/wwwherald/includes/module.inc:0
[Mon Apr 23 11:44:35 2007] [error] [client 127.0.0.1] PHP 9. _c
Mauro: Rusista says:
as_force_login() /var/www/wwwherald/modules/cas/cas.module:23
[Mon Apr 23 11:44:35 2007] [error] [client 127.0.0.1] PHP 10. sess_write() /var/www/wwwherald/includes/session.inc:0
Thanks in Advance
Comments
Comment #1
metzlerd commentedTry turning off page caching. See if this fixes your problem. I'll need to think about a solution if that's the case.
Comment #2
mvinas commentedThanks it works perfectly, but I have another issue, after I authenticated myself against CAS server I got the following error.
CAS Authentication failed!
You were not authenticated.
You may submit your request again by clicking here.
If the problem persists, you may contact the administrator of this site.
phpCAS 0.5.1-1 using server https://localhost:8443/cas-pub/ (CAS 2.0)
is it mandatory to have the user previously created in drupal to login?
Thanks in Advance
Comment #3
metzlerd commentedNo it's not technically. Whether user accounts are created automaitically is controlled in the user account sections setting of the cas settings page where you configured cas initially. You can set cas to create accounts automatically or to require an admin to do so in advance.
Dave
Comment #4
metzlerd commentedCode needs to be reworked to not use arg. I think a Q split would fix this.
Comment #5
greensky commentedIn the cas.module I changed a line in the "_cas_force_login()" function from:
if ( (arg(0)=="cas") )
to
if ( function_exists("arg") && (arg(0)=="cas") )
The reason the error is showing up is because the arg function doesn't exist if the page is cached. This is because Drupal doesn't pull all of the include files in if a page is cached. Since you'll always redirect away from Drupal if (arg(0)=="cas") you will never cache that page. This means you can add the function_exists test before calling this and not affect the outcome of the if statement.
I ran into another issue relating to cache which is described in this thread: http://drupal.org/node/111697 I applied this patch http://drupal.org/files/issues/user_cache.patch and now everything works. I can enable caching and have CAS authentication enabled.
Comment #6
metzlerd commentedI fixed this in HEAD, and will be rolling a new release shortly. Of course the drupal caching bug still applies.
Comment #7
metzlerd commentedComment #8
(not verified) commented