Hi guys,
After some time checking the code and doing some changes, i started looking into admin pages (which is basically the global ban part which i'm interested in).
It is located in Areas > Admin, as this image shows:, where you can find controllers, views, etc.
It is also registered in RouteConfig.cs inside Areas>Admin as:
public static void RegisterRoutes(IRouteBuilder routes)
{
RerouteDefaultArea(routes, "Admin", VoatSettings.Instance.AreaMaps, new { controller = "Spam", action = "Ban" });
}
so the url is yourdomain.com/Spam/Ban
When i tried to enter on that URL with a non global permission user, i got this error, so i created a new user called GlobalAdmin and i put global admin permissions in database.
So, when i try to enter to that URL with my GlobalAdmin (which have Global Admin roles in database) i'm not redirected to the error url and the spam controller is reached., but i got an exception
{System.InvalidOperationException: The view 'Ban' was not found. The following locations were searched:
/Views/Spam/Ban.cshtml
/Views/Shared/Ban.cshtml
So, to speed up things, i just copy and paste the Areas/Admin/Views/Spam/Ban.cshtml folder to Views/Spam/Ban.cshtml
Now i can ban users and domains (and delegate this to other people). Hope you found this useful, and of course if you have another way to do it please let me know!
view the rest of the comments →
[–] derram 0 points 1 point 1 point (+1|-0) ago
https://files.catbox.moe/otefg1.png :
https://files.catbox.moe/hm89i1.png :
https://files.catbox.moe/3itrdw.png :
https://files.catbox.moe/w3smn7.png :
This has been an automated message.