Файл: monst/core/pag/group/invite_user.php
Строк: 30
<?
if ( isset($_GET['invite_user']) AND !empty($_GET['user_id']) ) {
$user_id = (int)$_GET['user_id'];
if ( $GROUP['leader_id'] != $user['id'] ) {
g('/group');
}
$find = $_users -> findOne(
[
'id' => $user_id
]
);
if ( !$find ) {
g('/main');
}
if ( $find['part'] < 2 ) {
g('/id'.$user_id.'?need_part');
}
if ( $find['group_id'] > 0 ) {
g('/id'.$user_id.'?user_in_group');
}
$_group_invites -> remove(
[
'user_id' => $user_id
]
);
$id = new_id('_group_invites');
$_group_invites -> insert(
[
'id' => $id,
'user_id' => $user_id,
'group_id' => $GROUP['id'],
'time' => time(),
'leader_id' => $user['id']
]
);
//
$id = new_id('_not');
$text = Name($user['id']).' '.$lang['group.php']['invite_text'].'<br/><br/><div style="text-align: center;"><a href="/group?invite&not_id='.$id.'">'.$lang['group.php']['bt_invite'].'</a></div>';
$_not -> insert(
[
'id' => $id,
'user_id' => $user_id,
'time' => time(),
'text' => $text
]
);
g('/id' . $user_id . '?invite_ok');
}