Commit 0dc6a95a authored by Clare Lenihan's avatar Clare Lenihan Committed by Clare Lenihan
Browse files

added check for if user is deleted

parent c5dc5d0a
......@@ -35,11 +35,11 @@ safe_require('search', 'internal');
$id = param_integer('id');
$returnto = param_alpha('returnto', 'myfriends');
if (!record_exists('usr_friend_request', 'owner', $USER->get('id'), 'requester', $id)) {
if (!record_exists('usr_friend_request', 'owner', $USER->get('id'), 'requester', $id)
|| !($user = get_record('usr', 'id', $id, 'deleted', 0))) {
throw new AccessDeniedException(get_string('cantdenyrequest', 'group'));
}
$user = get_record('usr', 'id', $id);
$user->introduction = get_field('artefact', 'title', 'artefacttype', 'introduction', 'owner', $id);
$form = pieform(array(
......
......@@ -35,11 +35,11 @@ $returnto = param_alpha('returnto', 'myfriends');
if (is_friend($id, $USER->get('id'))
|| get_friend_request($id, $USER->get('id'))
|| get_account_preference($id, 'friendscontrol') != 'auth'
|| $id == $USER->get('id')) {
|| $id == $USER->get('id')
|| !($user = get_record('usr', 'id', $id, 'deleted', 0))) {
throw new AccessDeniedException(get_string('cantrequestfriendship', 'group'));
}
$user = get_record('usr', 'id', $id);
$user->introduction = get_field('artefact', 'title', 'artefacttype', 'introduction', 'owner', $id);
define('TITLE', get_string('sendfriendshiprequest', 'group', display_name($id)));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment