unset($module);
- include_once("$fullmod/version.php"); # defines $module with version etc
- include_once("$fullmod/db/$CFG->dbtype.php"); # defines upgrading function
+ if ( is_readable("$fullmod/version.php")) {
+ include_once("$fullmod/version.php"); # defines $module with version etc
+ } else {
+ notify("Module $mod: $fullmod/version.php was not readable");
+ continue;
+ }
+
+ if ( is_readable("$fullmod/db/$CFG->dbtype.php")) {
+ include_once("$fullmod/db/$CFG->dbtype.php"); # defines upgrading function
+ } else {
+ notify("Module $mod: $fullmod/db/$CFG->dbtype.php was not readable");
+ continue;
+ }
+
if (!isset($module)) {
continue;
$cookiename = "MOODLEID{$CFG->prefix}";
- return rc4decrypt($_COOKIE[$cookiename]);
+ if (empty($_COOKIE[$cookiename])) {
+ return "";
+ } else {
+ return rc4decrypt($_COOKIE[$cookiename]);
+ }
}
foreach ($mods as $mod) {
$fullmod = "$CFG->dirroot/mod/$mod";
unset($module);
+ if (!is_readable("$fullmod/version.php")) {
+ notify("Module '$mod' is not readable - check permissions");
+ continue;
+ }
include_once("$fullmod/version.php"); # defines $module with version etc
if ($currmodule = get_record("modules", "name", $mod)) {
if ($module->version > $currmodule->version) {