2020-12-26 01:42:23 +08:00
|
|
|
<?php
|
2021-01-13 19:32:26 +08:00
|
|
|
require_once("../include/bittorrent.php");
|
2020-12-26 01:42:23 +08:00
|
|
|
dbconn();
|
|
|
|
|
require_once(get_langfile_path());
|
2024-04-29 01:20:28 +08:00
|
|
|
loggedinorreturn();
|
2021-01-06 02:19:03 +08:00
|
|
|
$id = isset($_POST['id']) ? intval($_POST['id']) : (isset($_GET['id']) ? intval($_GET['id']) : die());
|
2020-12-26 01:42:23 +08:00
|
|
|
int_check($id,true);
|
2024-04-29 01:41:55 +08:00
|
|
|
if (($CURUSER['id'] != $id && !user_can('viewinvite')) || !is_valid_id($id))
|
|
|
|
|
stderr($lang_functions['std_sorry'],$lang_functions['std_permission_denied'], true, false);
|
2020-12-26 01:42:23 +08:00
|
|
|
$email = unesc(htmlspecialchars(trim($_POST["email"])));
|
2022-12-08 20:43:33 +08:00
|
|
|
if(!empty($_POST['conusr'])) {
|
|
|
|
|
// sql_query("UPDATE users SET status = 'confirmed', editsecret = '' WHERE id IN (" . implode(", ", $_POST['conusr']) . ") AND status='pending'");
|
2025-09-14 00:47:09 +07:00
|
|
|
$userList = \App\Models\User::query()->whereIn('id', $_POST['conusr'])
|
2022-12-08 20:43:33 +08:00
|
|
|
->where('status', 'pending')
|
2025-09-14 00:47:09 +07:00
|
|
|
->get(\App\Models\User::$commonFields)
|
2022-12-08 20:43:33 +08:00
|
|
|
;
|
2025-09-14 00:47:09 +07:00
|
|
|
if ($userList->isNotEmpty()) {
|
|
|
|
|
$uidArr = [];
|
|
|
|
|
foreach ($userList as $user) {
|
|
|
|
|
$uidArr[] = $user->id;
|
|
|
|
|
fire_event(\App\Enums\ModelEventEnum::USER_UPDATED, $user);
|
|
|
|
|
}
|
|
|
|
|
\App\Models\User::query()->whereIn('id', $uidArr)->update(['status' => 'confirmed', 'editsecret' => '']);
|
|
|
|
|
}
|
2022-12-08 20:43:33 +08:00
|
|
|
} else {
|
|
|
|
|
stderr($lang_takeconfirm['std_sorry'],$lang_takeconfirm['std_no_buddy_to_confirm'].
|
|
|
|
|
"<a class=altlink href=invite.php?id={$CURUSER['id']}>".$lang_takeconfirm['std_here_to_go_back'],false);
|
|
|
|
|
}
|
2020-12-26 01:42:23 +08:00
|
|
|
$title = $SITENAME.$lang_takeconfirm['mail_title'];
|
2022-08-05 16:13:19 +08:00
|
|
|
$baseUrl = getSchemeAndHttpHost();
|
2025-04-19 02:06:51 +07:00
|
|
|
$siteName = \App\Models\Setting::getSiteName();
|
|
|
|
|
$mailContentTwo = sprintf($lang_takeconfirm['mail_content_two'], $siteName, $REPORTMAIL, $siteName);
|
2020-12-26 01:42:23 +08:00
|
|
|
$body = <<<EOD
|
|
|
|
|
{$lang_takeconfirm['mail_content_1']}
|
2022-08-05 16:13:19 +08:00
|
|
|
<b><a href="javascript:void(null)" onclick="window.open('{$baseUrl}/login.php')">{$lang_takeconfirm['mail_here']}</a></b><br />
|
|
|
|
|
{$baseUrl}/login.php
|
2025-04-19 02:06:51 +07:00
|
|
|
{$mailContentTwo}
|
2020-12-26 01:42:23 +08:00
|
|
|
EOD;
|
|
|
|
|
|
|
|
|
|
//this mail is sent when the site is using admin(open/closed)/inviter(closed) confirmation and the admin/inviter confirmed the pending user
|
2021-02-02 20:27:37 +08:00
|
|
|
sent_mail($email,$SITENAME,$SITEEMAIL,$title,$body,"invite confirm",false,false,'');
|
2020-12-26 01:42:23 +08:00
|
|
|
|
2025-02-19 19:46:51 +08:00
|
|
|
header("Location: invite.php?id=".htmlspecialchars($CURUSER['id']));
|
2020-12-26 01:42:23 +08:00
|
|
|
?>
|