function update_user_login_times() {
global $USER;
+ $user = new object();
$USER->lastlogin = $user->lastlogin = $USER->currentlogin;
$USER->currentlogin = $user->lastaccess = $user->currentlogin = time();
}
if (!$record = get_record("course_meta","parent_course",$metacourseid,"child_course",$courseid)) {
+ $rec = new object();
$rec->parent_course = $metacourseid;
$rec->child_course = $courseid;
if (!insert_record('course_meta',$rec)) {
return false;
}
+ $a = new object();
$a->firstname = $user->firstname;
$a->sitename = $site->fullname;
$a->username = $user->username;
error("Could not set user password!");
}
+ $a = new object();
$a->firstname = $user->firstname;
$a->sitename = $site->fullname;
$a->username = $user->username;
$site = get_site();
$from = get_admin();
+ $data = new object();
$data->firstname = fullname($user);
$data->sitename = $site->fullname;
$data->admin = fullname($from) .' ('. $from->email .')';
$site = get_site();
$from = get_admin();
+ $data = new object();
$data->firstname = $user->firstname;
$data->sitename = $site->fullname;
$data->link = $CFG->httpswwwroot .'/login/forgot_password.php?p='. $user->secret .'&s='. $user->username;
// do it this way if we can, it's much faster
if (!empty($CFG->pathtodu) && is_executable(trim($CFG->pathtodu))) {
$command = trim($CFG->pathtodu).' -sk --apparent-size '.escapeshellarg($rootdir);
+ $output = null;
+ $return = null;
exec($command,$output,$return);
if (is_array($output)) {
return get_real_size(intval($output[0]).'k'); // we told it to return k.
if (!file_exists("$CFG->themedir/$theme/config.php")) { // bad folder
continue;
}
- unset($THEME); // Note this is not the global one!! :-)
+ $THEME = new object(); // Note this is not the global one!! :-)
include("$CFG->themedir/$theme/config.php");
if (!isset($THEME->sheets)) { // Not a valid 1.5 theme
continue;
$lang = current_language();
}
+ $string = array();
+
$path = $CFG->dirroot .'/lang/en_utf8/pix.php'; // always exists
if (file_exists($CFG->dataroot .'/lang/'. $lang .'_local/pix.php')) {
$langs = array(current_language(), get_string('parentlanguage'), 'en');
foreach ($langs as $lang) {
+ $info = new object();
$info->filepath = $CFG->dirroot .'/lang/'. $lang .'/docs/'. $file;
$info->urlpath = $CFG->wwwroot .'/lang/'. $lang .'/docs/'. $file;
function moodle_needs_upgrading() {
global $CFG;
+ $version = null;
include_once($CFG->dirroot .'/version.php'); # defines $version and upgrades
if ($CFG->version) {
if ($version > $CFG->version) {
if ($mods = get_list_of_plugins('mod')) {
foreach ($mods as $mod) {
$fullmod = $CFG->dirroot .'/mod/'. $mod;
- unset($module);
+ $module = new object();
if (!is_readable($fullmod .'/version.php')) {
notify('Module "'. $mod .'" is not readable - check permissions');
continue;
mtrace('Emailing '. $admin->username .' about '. count($logs) .' failed login attempts');
email_to_user($admin,get_admin(),$subject,$message);
}
+ $conf = new object();
$conf->name = 'lastnotifyfailure';
$conf->value = time();
if ($current = get_record('config', 'name', 'lastnotifyfailure')) {
// -$zipfilename is the name of the zip file (without path)
// -$destpath is the destination path where the zip file will uncompressed (dir)
+ $list = null;
+
if (empty($CFG->unzip)) { // Use built-in php-based unzip function
include_once("$CFG->libdir/pclzip/pclzip.lib.php");