mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-28 06:12:37 -06:00
Core: ProcessHasAdminRights() function is added to utility functions. (#242)
* Core: ProcessHasAdminRights() function is added to utility functions. * reference/DetectPrivegedProcess: Cosmetics. * Core: ProcessHasAdminRights() renamed as IsAdmin() * Core: IsAdmin() renamed as IsUserAdmin().
This commit is contained in:
parent
707f3f7602
commit
1c48bd493c
5 changed files with 54 additions and 0 deletions
12
reference/DetectPrivilegedProcess/main.cpp
Normal file
12
reference/DetectPrivilegedProcess/main.cpp
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
#include <CtrlLib/CtrlLib.h>
|
||||
|
||||
using namespace Upp;
|
||||
|
||||
GUI_APP_MAIN
|
||||
{
|
||||
// Run the example as administrator (Windows) or as root (POSIX) to get the warning.
|
||||
if(IsUserAdmin())
|
||||
Exclamation(t_("Warning: Application has administrator/root rights.&This might pose a security risk!"));
|
||||
else
|
||||
PromptOK(t_("Application has user rights."));
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue