--- /Users/sbourget/Downloads/mrbs/web/config.inc.php 2008-08-05 08:22:40.000000000 -0400 +++ /Users/sbourget/Sites/moodle19/blocks/mrbs/web/config.inc.php 2008-08-17 16:40:45.000000000 -0400 @@ -294,8 +294,9 @@ # Set the language used for emails (choose an available lang.* file). # Default is 'en'. -define ("MAIL_ADMIN_LANG", substr($USER->lang,0,2)); //I think this should be same as the locale based on the Moodle user's langage - +if (isset($USER->lang)) { + define ("MAIL_ADMIN_LANG", substr($USER->lang,0,2)); //I think this should be same as the locale based on the Moodle user's langage +} # Set the email address of the From field. Default is $mrbs_admin_email define ("MAIL_FROM", $cfg_mrbs->mail_from); @@ -332,7 +333,9 @@ //Set locale - previously in language.php which is has now been removed, may be redundant and unnecessary but just in case if (empty($locale)) { //quick and ugly hack to avoid PHP notice - $locale=substr($USER->lang,0,2); + if (isset($USER->lang)) { + $locale=substr($USER->lang,0,2); + } } $windows_locale = "eng"; @@ -345,7 +348,9 @@ # language tokens. This must equate to a lang.* file in MRBS. # e.g. use "fr" to use the translations in "lang.fr" as the default # translations -$default_language_tokens = substr($USER->lang,0,2); //this could be either set to use the user default (or the site default) +if (isset($USER->lang)) { + $default_language_tokens = substr($USER->lang,0,2); //this could be either set to use the user default (or the site default) +} // echo $default_language_tokens; # Set this to 1 to disable the automatic language changing MRBS performs