mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-03 14:10:57 +08:00
user add exists method
This commit is contained in:
@@ -137,6 +137,11 @@ class User extends Authenticatable implements FilamentUser, HasName
|
||||
return $result;
|
||||
}
|
||||
|
||||
public static function exists($id): bool
|
||||
{
|
||||
return self::query()->where("id", $id)->exists();
|
||||
}
|
||||
|
||||
public function canAccessFilament(): bool
|
||||
{
|
||||
return $this->canAccessAdmin();
|
||||
|
||||
@@ -70,7 +70,7 @@ if ($row['anonymous'] == 'yes' && $CURUSER["id"] == $row["owner"]) {
|
||||
KPS("-",$uploadtorrent_bonus,$row["owner"]);
|
||||
|
||||
//Send pm to torrent uploader
|
||||
if ($CURUSER["id"] != $row["owner"]){
|
||||
if ($CURUSER["id"] != $row["owner"] && \App\Models\User::exists($row["owner"])){
|
||||
$dt = sqlesc(date("Y-m-d H:i:s"));
|
||||
$subject = sqlesc($lang_delete_target[get_user_lang($row["owner"])]['msg_torrent_deleted']);
|
||||
$msg = sqlesc($lang_delete_target[get_user_lang($row["owner"])]['msg_the_torrent_you_uploaded'].$row['name'].$lang_delete_target[get_user_lang($row["owner"])]['msg_was_deleted_by']."[url=userdetails.php?id=".$CURUSER['id']."]".$CURUSER['username']."[/url]".$lang_delete_target[get_user_lang($row["owner"])]['msg_reason_is'].$reasonstr);
|
||||
|
||||
Reference in New Issue
Block a user