From ce8c75eeb88cc81f283fd565766d735ddd6bfb46 Mon Sep 17 00:00:00 2001 From: skodak Date: Sat, 31 May 2008 11:13:21 +0000 Subject: [PATCH] MDL-14679 towards /user conversion --- lib/dml/oci8po_adodb_moodle_recordset.php | 2 + user/addnote.php | 6 +- user/extendenrol.php | 17 +-- user/groupaddnote.php | 6 +- user/groupextendenrol.php | 17 +-- user/index.php | 148 +++++++++++----------- user/messageselect.php | 6 +- user/tabs.php | 6 +- user/view.php | 32 ++--- 9 files changed, 118 insertions(+), 122 deletions(-) diff --git a/lib/dml/oci8po_adodb_moodle_recordset.php b/lib/dml/oci8po_adodb_moodle_recordset.php index 7e9769584a..5e56dfca32 100644 --- a/lib/dml/oci8po_adodb_moodle_recordset.php +++ b/lib/dml/oci8po_adodb_moodle_recordset.php @@ -30,6 +30,8 @@ class oci8po_adodb_moodle_recordset extends adodb_moodle_recordset { } public function rewind() { + //TODO - this does not work in Oracle :-( + error('Implement rewind in oracle by doing query again'); $this->rs->MoveFirst(); } diff --git a/user/addnote.php b/user/addnote.php index 56fafed848..fce7e91e49 100644 --- a/user/addnote.php +++ b/user/addnote.php @@ -6,7 +6,7 @@ $id = required_param('id', PARAM_INT); // course id $users = optional_param('userid', array(), PARAM_INT); // array of user id $contents = optional_param('contents', array(), PARAM_RAW); // array of user notes $states = optional_param('states', array(), PARAM_ALPHA); // array of notes states -if (! $course = get_record('course', 'id', $id)) { +if (! $course = $DB->get_record('course', array('id'=>$id))) { print_error("Course ID is incorrect"); } @@ -25,7 +25,7 @@ if (!empty($users) && confirm_sesskey()) { $note->courseid = $id; $note->format = FORMAT_PLAIN; foreach ($users as $k => $v) { - if(!$user = get_record('user', 'id', $v) || empty($contents[$k])) { + if(!$user = $DB->get_record('user', array('id'=>$v)) || empty($contents[$k])) { continue; } $note->id = 0; @@ -74,7 +74,7 @@ if (empty($users)) { } foreach ($users as $k => $v) { - if(!$user = get_record('user', 'id', $v)) { + if(!$user = $DB->get_record('user', array('id'=>$v))) { continue; } $checkbox = choose_from_menu($state_names, 'states[' . $k . ']', empty($states[$k]) ? NOTES_STATE_PUBLIC : $states[$k], '', '', '0', true); diff --git a/user/extendenrol.php b/user/extendenrol.php index 1054766ac3..a84f13a9a7 100644 --- a/user/extendenrol.php +++ b/user/extendenrol.php @@ -4,7 +4,7 @@ require_once("../config.php"); $id = required_param('id', PARAM_INT); // course id $users = optional_param('userid', array(), PARAM_INT); // array of user id -if (! $course = get_record('course', 'id', $id)) { +if (! $course = $DB->get_record('course', array('id'=>$id))) { print_error("Course ID is incorrect"); } @@ -22,10 +22,10 @@ if ((count($users) > 0) and ($form = data_submitted()) and confirm_sesskey()) { foreach ($form->userid as $k => $v) { // find all roles this student have in this course - if ($students = get_records_sql("SELECT ra.id, ra.roleid, ra.timestart, ra.timeend - FROM {$CFG->prefix}role_assignments ra - WHERE userid = $v - AND contextid = $context->id")) { + if ($students = $DB->get_records_sql("SELECT ra.id, ra.roleid, ra.timestart, ra.timeend + FROM {role_assignments} ra + WHERE userid = ? + AND contextid = ?", array($v, $context->id))) { // enrol these users again, with time extension // not that this is not necessarily a student role foreach ($students as $student) { @@ -124,9 +124,10 @@ $notavailable = get_string('notavailable'); foreach ($_POST as $k => $v) { if (preg_match('/^user(\d+)$/',$k,$m)) { - if (!($user = get_record_sql("SELECT * FROM {$CFG->prefix}user u - INNER JOIN {$CFG->prefix}role_assignments ra ON u.id=ra.userid - WHERE u.id={$m[1]} AND ra.contextid = $context->id"))) { + if (!($user = $DB->get_record_sql("SELECT * + FROM {user} u + JOIN {role_assignments} ra ON u.id=ra.userid + WHERE u.id=? AND ra.contextid = ?", array($m[1], $context->id)))) { continue; } $userbasemenu = $basemenu; diff --git a/user/groupaddnote.php b/user/groupaddnote.php index faaa4d90b7..0deff44691 100644 --- a/user/groupaddnote.php +++ b/user/groupaddnote.php @@ -7,7 +7,7 @@ $users = optional_param('userid', array(), PARAM_INT); // array of user id $content = optional_param('content', '', PARAM_RAW); // note content $state = optional_param('state', '', PARAM_ALPHA); // note publish state -if (! $course = get_record('course', 'id', $id)) { +if (! $course = $DB->get_record('course', array('id'=>$id))) { print_error("Course ID is incorrect"); } @@ -24,7 +24,7 @@ if (!empty($users) && !empty($content) && confirm_sesskey()) { $note->content = $content; $note->publishstate = $state; foreach ($users as $k => $v) { - if(!$user = get_record('user', 'id', $v)) { + if(!$user = $DB->get_record('user', array('id'=>$v))) { continue; } $note->id = 0; @@ -69,7 +69,7 @@ $strpublishstate = get_string('publishstate', 'notes'); $userlist = array(); foreach ($users as $k => $v) { - if(!$user = get_record('user', 'id', $v)) { + if (!$user = $DB->get_record('user', array('id'=>$v))) { continue; } echo ''; diff --git a/user/groupextendenrol.php b/user/groupextendenrol.php index 76a2813399..de0897c5a7 100755 --- a/user/groupextendenrol.php +++ b/user/groupextendenrol.php @@ -4,7 +4,7 @@ require_once("../config.php"); $id = required_param('id', PARAM_INT); // course id $users = optional_param('userid', array(), PARAM_INT); // array of user id -if (! $course = get_record('course', 'id', $id)) { +if (! $course = $DB->get_record('course', array('id'=>$id))) { print_error("Course ID is incorrect"); } @@ -20,10 +20,10 @@ if ((count($users) > 0) and ($form = data_submitted()) and confirm_sesskey()) { foreach ($form->userid as $k => $v) { // find all roles this student have in this course - if ($students = get_records_sql("SELECT ra.id, ra.roleid, ra.timestart, ra.timeend - FROM {$CFG->prefix}role_assignments ra - WHERE userid = $v - AND contextid = $context->id")) { + if ($students = $DB->get_records_sql("SELECT ra.id, ra.roleid, ra.timestart, ra.timeend + FROM {role_assignments} ra + WHERE userid = ? + AND contextid = ?", array($v, $context->id))) { // enrol these users again, with time extension // not that this is not necessarily a student role foreach ($students as $student) { @@ -122,9 +122,10 @@ $notavailable = get_string('notavailable'); foreach ($_POST as $k => $v) { if (preg_match('/^user(\d+)$/',$k,$m)) { - if (!($user = get_record_sql("SELECT * FROM {$CFG->prefix}user u - INNER JOIN {$CFG->prefix}role_assignments ra ON u.id=ra.userid - WHERE u.id={$m[1]} AND ra.contextid = $context->id"))) { + if (!($user = $DB->get_record_sql("SELECT * + FROM {user} u + JOIN {role_assignments} ra ON u.id=ra.userid + WHERE u.id=? AND ra.contextid = ?", array($m[1], $context->id)))) { continue; } if ($user->timestart) { diff --git a/user/index.php b/user/index.php index 0c31b1d5ce..229f31c846 100644 --- a/user/index.php +++ b/user/index.php @@ -27,11 +27,11 @@ if (! $context = get_context_instance_by_id($contextid)) { error("Context ID is incorrect"); } - if (! $course = get_record('course', 'id', $context->instanceid)) { + if (! $course = $DB->get_record('course', array('id'=>$context->instanceid))) { error("Course ID is incorrect"); } } else { - if (! $course = get_record('course', 'id', $courseid)) { + if (! $course = $DB->get_record('course', array('id'=>$courseid))) { error("Course ID is incorrect"); } if (! $context = get_context_instance(CONTEXT_COURSE, $course->id)) { @@ -220,16 +220,16 @@ // get minimum lastaccess for this course and display a dropbox to filter by lastaccess going back this far. // we need to make it diferently for normal courses and site course if ($context->id != $frontpagectx->id) { - $minlastaccess = get_field_sql('SELECT min(timeaccess) - FROM '.$CFG->prefix.'user_lastaccess - WHERE courseid = '.$course->id.' - AND timeaccess != 0'); - $lastaccess0exists = record_exists('user_lastaccess', 'courseid', $course->id, 'timeaccess', 0); + $minlastaccess = $DB->get_field_sql('SELECT min(timeaccess) + FROM {user_lastaccess} + WHERE courseid = ? + AND timeaccess != 0', array($course->id)); + $lastaccess0exists = $DB->record_exists('user_lastaccess', array('courseid'=>$course->id, 'timeaccess'=>0)); } else { - $minlastaccess = get_field_sql('SELECT min(lastaccess) - FROM '.$CFG->prefix.'user - WHERE lastaccess != 0'); - $lastaccess0exists = record_exists('user','lastaccess',0); + $minlastaccess = $DB->get_field_sql('SELECT min(lastaccess) + FROM {user} + WHERE lastaccess != 0'); + $lastaccess0exists = $DB->record_exists('user', array('lastaccess'=>0)); } $now = usergetmidnight(time()); @@ -383,7 +383,7 @@ )); $table->setup(); - + $params = array(); // we are looking for all users with this role assigned in this context or higher if ($usercontexts = get_parent_contexts($context)) { $listofcontexts = '('.implode(',', $usercontexts).')'; @@ -391,7 +391,8 @@ $listofcontexts = '('.$sitecontext->id.')'; // must be site } if ($roleid > 0) { - $selectrole = " AND r.roleid = $roleid "; + $selectrole = " AND r.roleid = :roleid "; + $params['roleid'] = $roleid; } else { $selectrole = " "; } @@ -424,18 +425,19 @@ } if ($context->id != $frontpagectx->id or $roleid >= 0) { - $from = "FROM {$CFG->prefix}user u - LEFT OUTER JOIN {$CFG->prefix}context ctx - ON (u.id=ctx.instanceid AND ctx.contextlevel = ".CONTEXT_USER.") - JOIN {$CFG->prefix}role_assignments r - ON u.id=r.userid - LEFT OUTER JOIN {$CFG->prefix}user_lastaccess ul - ON (r.userid=ul.userid and ul.courseid = $course->id) "; + $from = "FROM {user} u + LEFT OUTER JOIN {context} ctx + ON (u.id=ctx.instanceid AND ctx.contextlevel = ".CONTEXT_USER.") + JOIN {role_assignments} r + ON u.id=r.userid + LEFT OUTER JOIN {user_lastaccess} ul + ON (r.userid=ul.userid and ul.courseid = :courseid) "; + $params['courseid'] = $course->id; } else { // on frontpage and we want all registered users - $from = "FROM {$CFG->prefix}user u - LEFT OUTER JOIN {$CFG->prefix}context ctx - ON (u.id=ctx.instanceid AND ctx.contextlevel = ".CONTEXT_USER.") "; + $from = "FROM {user} u + LEFT OUTER JOIN {context} ctx + ON (u.id=ctx.instanceid AND ctx.contextlevel = ".CONTEXT_USER.") "; } $hiddensql = has_capability('moodle/role:viewhiddenassigns', $context)? '':' AND r.hidden = 0 '; @@ -455,18 +457,18 @@ if ($context->id != $frontpagectx->id) { $where = "WHERE (r.contextid = $context->id OR r.contextid in $listofcontexts) - AND u.deleted = 0 $selectrole - AND (ul.courseid = $course->id OR ul.courseid IS NULL) - AND u.username != 'guest' - $adminroles - $hiddensql "; + AND u.deleted = 0 $selectrole + AND (ul.courseid = $course->id OR ul.courseid IS NULL) + AND u.username != 'guest' + $adminroles + $hiddensql "; $where .= get_course_lastaccess_sql($accesssince); } else { if ($roleid >= 0) { $where = "WHERE (r.contextid = $context->id OR r.contextid in $listofcontexts) - AND u.deleted = 0 $selectrole - AND u.username != 'guest'"; - $where .= get_user_lastaccess_sql($accesssince); + AND u.deleted = 0 $selectrole + AND u.username != 'guest'"; + $where .= get_user_lastaccess_sql($accesssince); } else { $where = "WHERE u.deleted = 0 AND u.username != 'guest'"; @@ -476,19 +478,22 @@ $wheresearch = ''; if (!empty($search)) { - $LIKE = sql_ilike(); - $fullname = sql_fullname('u.firstname','u.lastname'); - $wheresearch .= ' AND ('. $fullname .' '. $LIKE .'\'%'. $search .'%\' OR email '. $LIKE .'\'%'. $search .'%\' OR idnumber '.$LIKE.' \'%'.$search.'%\') '; - + $LIKE = $DB->sql_ilike(); + $fullname = $DB->sql_fullname('u.firstname','u.lastname'); + $wheresearch .= " AND ($fullname $LIKE :search1 OR email $LIKE :search2 OR idnumber $LIKE :search3) "; + $params['search1'] = "%$search%"; + $params['search2'] = "%$search%"; + $params['search3'] = "%$search%"; } if ($currentgroup) { // Displaying a group by choice // FIX: TODO: This will not work if $currentgroup == 0, i.e. "those not in a group" - $from .= 'LEFT JOIN '.$CFG->prefix.'groups_members gm ON u.id = gm.userid '; - $where .= ' AND gm.groupid = '.$currentgroup; + $from .= 'LEFT JOIN {groups_members} gm ON u.id = gm.userid '; + $where .= ' AND gm.groupid = :currentgroup'; + $params['curentgroup'] = $currentgroup; } - $totalcount = count_records_sql('SELECT COUNT(distinct u.id) '.$from.$where); // Each user could have > 1 role + $totalcount = $DB->count_records_sql("SELECT COUNT(distinct u.id) $from $where", $params); // Each user could have > 1 role if ($table->get_sql_where()) { $where .= ' AND '.$table->get_sql_where(); @@ -510,12 +515,12 @@ } } - $matchcount = count_records_sql('SELECT COUNT(distinct u.id) '.$from.$where.$wheresearch); + $matchcount = $DB->count_records_sql("SELECT COUNT(distinct u.id) $from $where $wheresearch", $params); $table->initialbars(true); $table->pagesize($perpage, $matchcount); - $userlist = get_recordset_sql($select.$from.$where.$wheresearch.$sort, + $userlist = $DB->get_recordset_sql("$select $from $where $wheresearch $sort", $params, $table->get_page_start(), $table->get_page_size()); // @@ -527,25 +532,20 @@ if ($mode===MODE_ENROLDETAILS) { $userids = array(); - while ($user = rs_fetch_next_record($userlist)) { + foreach ($userlist as $user) { $userids[] = $user->id; } $userlist_extra = get_participants_extra($userids, $avoidroles, $course, $context); // Only Oracle cannot seek backwards // and must re-query... - if ($userlist->canSeek === true) { - $userlist->MoveFirst(); - } else { - $userlist = get_recordset_sql($select.$from.$where.$wheresearch.$sort, - $table->get_page_start(), $table->get_page_size()); - } + $userlist->rewind(); } if ($context->id == $frontpagectx->id) { $strallsiteusers = get_string('allsiteusers', 'role'); if ($CFG->defaultfrontpageroleid) { - if ($fprole = get_record('role', 'id', $CFG->defaultfrontpageroleid)) { + if ($fprole = $DB->get_record('role', array('id'=>$CFG->defaultfrontpageroleid))) { $fprole = role_get_name($fprole, $frontpagectx); $strallsiteusers = "$strallsiteusers ($fprole)"; } @@ -579,7 +579,7 @@ } if ($roleid > 0) { - if (!$currentrole = get_record('role','id',$roleid)) { + if (!$currentrole = $DB->get_record('role', array('id'=>$roleid))) { error('That role does not exist'); } $a->number = $totalcount; @@ -715,7 +715,7 @@ if ($matchcount > 0) { $usersprinted = array(); - while ($user = rs_fetch_next_record($userlist)) { + foreach ($userlist as $user) { if (in_array($user->id, $usersprinted)) { /// Prevent duplicates by r.hidden - MDL-13935 continue; } @@ -746,7 +746,7 @@ } $usersprinted = array(); - while ($user = rs_fetch_next_record($userlist)) { + foreach ($userlist as $user) { if (in_array($user->id, $usersprinted)) { /// Prevent duplicates by r.hidden - MDL-13935 continue; } @@ -898,7 +898,7 @@ print_footer($course); if ($userlist) { - rs_close($userlist); + $userlist->close(); } @@ -925,13 +925,14 @@ function get_user_lastaccess_sql($accesssince='') { } function get_participants_extra ($userids, $avoidroles, $course, $context) { - - global $CFG; + global $CFG, $DB; if (count($userids) === 0 || count($avoidroles) === 0) { return array(); } + $params = array(); + $userids = implode(',', $userids); // turn the path into a list of context ids @@ -946,10 +947,10 @@ function get_participants_extra ($userids, $avoidroles, $course, $context) { } if (!empty($CFG->enablegroupings)) { - $gpjoin = "LEFT OUTER JOIN {$CFG->prefix}groupings_groups gpg - ON gpg.groupid=g.id - LEFT OUTER JOIN {$CFG->prefix}groupings gp - ON (gp.courseid={$course->id} AND gp.id=gpg.groupingid)"; + $gpjoin = "LEFT OUTER JOIN {groupings_groups} gpg + ON gpg.groupid=g.id + LEFT OUTER JOIN {groupings} gp + ON (gp.courseid={$course->id} AND gp.id=gpg.groupingid)"; $gpselect = ',gp.id AS gpid, gp.name AS gpname '; } else { $gpjoin = ''; @@ -967,27 +968,27 @@ function get_participants_extra ($userids, $avoidroles, $course, $context) { ra.enrol AS enrolplugin, g.id AS gid, g.name AS gname $gpselect - FROM {$CFG->prefix}role_assignments ra - JOIN {$CFG->prefix}context ctx - ON (ra.contextid=ctx.id) - LEFT OUTER JOIN {$CFG->prefix}course_categories cc - ON (ctx.contextlevel=40 AND ctx.instanceid=cc.id) + FROM {role_assignments} ra + JOIN {context} ctx + ON (ra.contextid=ctx.id) + LEFT JOIN {course_categories} cc + ON (ctx.contextlevel=40 AND ctx.instanceid=cc.id) /* only if groups active */ - LEFT OUTER JOIN {$CFG->prefix}groups_members gm - ON (ra.userid=gm.userid) - LEFT OUTER JOIN {$CFG->prefix}groups g - ON (gm.groupid=g.id AND g.courseid={$course->id}) + LEFT JOIN {groups_members} gm + ON (ra.userid=gm.userid) + LEFT JOIN {groups} g + ON (gm.groupid=g.id AND g.courseid={$course->id}) /* and if groupings is enabled... */ $gpjoin - WHERE ra.userid IN ( $userids ) - AND ra.contextid in ( $contextids ) - $avoidrolescond + WHERE ra.userid IN ( $userids ) + AND ra.contextid in ( $contextids ) + $avoidrolescond - ORDER BY ra.userid, ctx.depth DESC"; + ORDER BY ra.userid, ctx.depth DESC"; - $rs = get_recordset_sql($sql); + $rs = $DB->get_recordset_sql($sql, $params); $extra = array(); // Data structure - @@ -1005,7 +1006,7 @@ function get_participants_extra ($userids, $avoidroles, $course, $context) { // and modifierid (with an outer join to mdl_user! // - while ($rec = rs_fetch_next_record($rs)) { + foreach ($rs as $rec) { $userid = $rec->userid; // Prime an initial user rec... @@ -1032,6 +1033,7 @@ function get_participants_extra ($userids, $avoidroles, $course, $context) { } } + $rs->close(); return $extra; } diff --git a/user/messageselect.php b/user/messageselect.php index e023a4304e..492e3bd409 100644 --- a/user/messageselect.php +++ b/user/messageselect.php @@ -12,7 +12,7 @@ $format = optional_param('format',FORMAT_MOODLE,PARAM_INT); $deluser = optional_param('deluser',0,PARAM_INT); - if (!$course = get_record('course','id',$id)) { + if (!$course = $DB->get_record('course', array('id'=>$id))) { print_error("Invalid course id"); } @@ -46,7 +46,7 @@ foreach ($_POST as $k => $v) { if (preg_match('/^(user|teacher)(\d+)$/',$k,$m)) { if (!array_key_exists($m[2],$SESSION->emailto[$id])) { - if ($user = get_record_select('user','id = '.$m[2],'id,firstname,lastname,idnumber,email,emailstop,mailformat,lastaccess')) { + if ($user = $DB->get_record_select('user', "id = ?", array($m[2]), 'id,firstname,lastname,idnumber,email,emailstop,mailformat,lastaccess')) { $SESSION->emailto[$id][$m[2]] = $user; $SESSION->emailto[$id][$m[2]]->teacher = ($m[1] == 'teacher'); $count++; @@ -79,7 +79,7 @@ if ($count) { if ($count == 1) { - $heading = get_string('addedrecip','moodle',$count); + $heading = get_string('addedrecip','moodle',$count); } else { $heading = get_string('addedrecips','moodle',$count); } diff --git a/user/tabs.php b/user/tabs.php index fd729e6bce..1b6062bbd8 100644 --- a/user/tabs.php +++ b/user/tabs.php @@ -18,7 +18,7 @@ } if (($filtertype == 'site' && $filterselect) || ($filtertype=='user' && $filterselect)) { - $user = get_record('user','id',$filterselect); + $user = $DB->get_record('user', array('id'=>$filterselect)); } $inactive = NULL; @@ -48,7 +48,7 @@ **************************************/ } else if ($filtertype == 'course' && $filterselect) { - $course = get_record('course','id',$filterselect); + $course = $DB->get_record('course', array('id'=>$filterselect)); $coursecontext = get_context_instance(CONTEXT_COURSE, $course->id); print_heading(format_string($course->fullname)); @@ -85,7 +85,7 @@ **************************************/ } else { if (isset($userid)) { - $user = get_record('user','id', $userid); + $user = $DB->get_record('user', array('id'=>$userid)); } print_heading(fullname($user, has_capability('moodle/site:viewfullnames', get_context_instance(CONTEXT_COURSE, $course->id)))); diff --git a/user/view.php b/user/view.php index c42633307f..875efa786d 100644 --- a/user/view.php +++ b/user/view.php @@ -16,11 +16,11 @@ $id = $USER->id; } - if (! $user = get_record("user", "id", $id) ) { + if (! $user = $DB->get_record("user", array("id"=>$id))) { print_error("No such user in this course"); } - if (! $course = get_record("course", "id", $course) ) { + if (! $course = $DB->get_record("course", array("id"=>$course))) { print_error("No such course id"); } @@ -42,7 +42,7 @@ if (!empty($CFG->forcelogin) || $course->id != SITEID) { // do not force parents to enrol - if (!get_record('role_assignments', 'userid', $USER->id, 'contextid', $usercontext->id)) { + if (!$DB->get_record('role_assignments', array('userid'=>$USER->id, 'contextid'=>$usercontext->id))) { require_login($course->id); } } @@ -150,7 +150,7 @@ if ($course->id != SITEID) { $user->lastaccess = false; - if ($lastaccess = get_record('user_lastaccess', 'userid', $user->id, 'courseid', $course->id)) { + if ($lastaccess = $DB->get_record('user_lastaccess', array('userid'=>$user->id, 'courseid'=>$course->id))) { $user->lastaccess = $lastaccess->timeaccess; } } @@ -175,23 +175,13 @@ if (is_mnet_remote_user($user)) { $sql = " - SELECT DISTINCT - h.id, - h.name, - h.wwwroot, - a.name as application, - a.display_name - FROM - {$CFG->prefix}mnet_host h, - {$CFG->prefix}mnet_application a - WHERE - h.id = '{$user->mnethostid}' AND - h.applicationid = a.id - ORDER BY - a.display_name, - h.name"; - - $remotehost = get_record_sql($sql); + SELECT DISTINCT h.id, h.name, h.wwwroot, + a.name as application, a.display_name + FROM {mnet_host} h, {mnet_application} a + WHERE h.id = ? AND h.applicationid = a.id + ORDER BY a.display_name, h.name"; + + $remotehost = $DB->get_record_sql($sql, array($user->mnethostid)); echo '

'.get_string('remote'.$remotehost->application.'user')."
\n"; if ($USER->id == $user->id) { -- 2.39.5