blob: d7abf1b8f07d646aebb11423d17a354dd6ea3107 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -24,6 +24,7 @@
#include <kmessagebox.h>
#include <kmainwindow.h>
#include <kapp.h>
+#include <kuser.h>
#include <klocale.h>
#include <dcopclient.h>
@@ -129,7 +130,12 @@
// KMessageBox::error( 0, I18N_NOOP( "Kvpnc must be started as root!" ) );
// exit(0);
// }
-
+ if (!KUser().isSuperUser())
+ {
+ KMessageBox::error( 0L, i18n( "Kvpnc must be started as root!" ) );
+ exit(0);
+ }
+
KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
a.setMainWidget( kvpnc );
|