File tree Expand file tree Collapse file tree 6 files changed +170
-0
lines changed
Expand file tree Collapse file tree 6 files changed +170
-0
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+ // Init
3+ //error_reporting(NULL);
4+ ob_start ();
5+ session_start ();
6+ $ TAB = 'USER ' ;
7+ include ($ _SERVER ['DOCUMENT_ROOT ' ]."/inc/main.php " );
8+
9+ // Header
10+ include ($ _SERVER ['DOCUMENT_ROOT ' ].'/templates/header.html ' );
11+
12+ // Panel
13+ top_panel ($ user ,$ TAB );
14+
15+ // Are you admin?
16+ if ($ _SESSION ['user ' ] == 'admin ' ) {
17+
18+ // Cancel
19+ if (!empty ($ _POST ['back ' ])) {
20+ header ("Location: /list/user/ " );
21+ }
22+
23+ // Ok
24+ if (!empty ($ _GET ['user ' ])) {
25+ $ v_username = escapeshellarg ($ _GET ['user ' ]);
26+ exec (VESTA_CMD ."v_suspend_user " .$ v_username , $ output , $ return_var );
27+ if ($ return_var != 0 ) {
28+ $ error = implode ('<br> ' , $ output );
29+ if (empty ($ error )) $ error = 'Error: vesta did not return any output. ' ;
30+ $ _SESSION ['error_msg ' ] = $ error ;
31+ } else {
32+ $ _SESSION ['ok_msg ' ] = "OK: user <b> " .$ _GET [user]."</b> has been suspended. " ;
33+ unset($ v_lname );
34+ }
35+ unset($ output );
36+
37+ include ($ _SERVER ['DOCUMENT_ROOT ' ].'/templates/admin/menu_suspend_user.html ' );
38+ include ($ _SERVER ['DOCUMENT_ROOT ' ].'/templates/admin/suspend_user.html ' );
39+ unset($ _SESSION ['error_msg ' ]);
40+ unset($ _SESSION ['ok_msg ' ]);
41+
42+ } else {
43+ header ("Location: /list/user/ " );
44+ }
45+
46+ }
47+
48+ // Footer
49+ include ($ _SERVER ['DOCUMENT_ROOT ' ].'/templates/footer.html ' );
Original file line number Diff line number Diff line change 1+ < table class ="sub-menu ">
2+ < tr >
3+ < td style ="padding: 10px 2px 28px 0; " > < a class ="add-name "> < i > Suspending User </ i > </ a >
4+ < ?php
5+ if (!empty($_SESSION['error_msg'])) {
6+ echo "< a class =\ "add-error\"> < i > → ".$_SESSION['error_msg']."</ i > </ a > ";
7+ } else {
8+ if (!empty($_SESSION['ok_msg'])) {
9+ echo "< a class =\ "add-ok\"> < i > → ".$_SESSION['ok_msg']."</ i > </ a > ";
10+ }
11+ }
12+ ?>
13+ </ td >
14+ </ tr >
15+ </ table >
Original file line number Diff line number Diff line change 1+ < table class ="sub-menu ">
2+ < tr >
3+ < td style ="padding: 10px 2px 28px 0; " > < a class ="add-name "> < i > Unsuspending User </ i > </ a >
4+ < ?php
5+ if (!empty($_SESSION['error_msg'])) {
6+ echo "< a class =\ "add-error\"> < i > → ".$_SESSION['error_msg']."</ i > </ a > ";
7+ } else {
8+ if (!empty($_SESSION['ok_msg'])) {
9+ echo "< a class =\ "add-ok\"> < i > → ".$_SESSION['ok_msg']."</ i > </ a > ";
10+ }
11+ }
12+ ?>
13+ </ td >
14+ </ tr >
15+ </ table >
Original file line number Diff line number Diff line change 1+ < table class ='data '>
2+ < tr class ="data-add ">
3+ < td class ="data-dotted " style ="padding: 0px 10px 0px 0px " width ="150 ">
4+ < table class ="data-col1 ">
5+ < tr > < td style ="padding: 18 0 4 18; "> </ td > </ tr >
6+ </ table >
7+ </ td >
8+ < td class ="data-dotted " width ="830px " style ="vertical-align:top; ">
9+ < table width ="830px "> < tr >
10+ < td > </ td >
11+ </ tr > </ table >
12+ < form method ="post " name ="v_suspend_user ">
13+ < table class ="data-col2 " width ="830px ">
14+ < tr > < td style ="padding: 24px 0 0 0; ">
15+ < input type ="submit " class ="add-button " name ="back " value ="Back to users ">
16+ </ td > </ tr >
17+ </ form >
18+ </ table >
19+ </ td>
20+ </ tr>
21+ </ table>
Original file line number Diff line number Diff line change 1+ < table class ='data '>
2+ < tr class ="data-add ">
3+ < td class ="data-dotted " style ="padding: 0px 10px 0px 0px " width ="150 ">
4+ < table class ="data-col1 ">
5+ < tr > < td style ="padding: 18 0 4 18; "> </ td > </ tr >
6+ </ table >
7+ </ td >
8+ < td class ="data-dotted " width ="830px " style ="vertical-align:top; ">
9+ < table width ="830px "> < tr >
10+ < td > </ td >
11+ </ tr > </ table >
12+ < form method ="post " name ="v_suspend_user ">
13+ < table class ="data-col2 " width ="830px ">
14+ < tr > < td style ="padding: 24px 0 0 0; ">
15+ < input type ="submit " class ="add-button " name ="back " value ="Back to users ">
16+ </ td > </ tr >
17+ </ form >
18+ </ table >
19+ </ td>
20+ </ tr>
21+ </ table>
Original file line number Diff line number Diff line change 1+ <?php
2+ // Init
3+ //error_reporting(NULL);
4+ ob_start ();
5+ session_start ();
6+ $ TAB = 'USER ' ;
7+ include ($ _SERVER ['DOCUMENT_ROOT ' ]."/inc/main.php " );
8+
9+ // Header
10+ include ($ _SERVER ['DOCUMENT_ROOT ' ].'/templates/header.html ' );
11+
12+ // Panel
13+ top_panel ($ user ,$ TAB );
14+
15+ // Are you admin?
16+ if ($ _SESSION ['user ' ] == 'admin ' ) {
17+
18+ // Cancel
19+ if (!empty ($ _POST ['back ' ])) {
20+ header ("Location: /list/user/ " );
21+ }
22+
23+ // Ok
24+ if (!empty ($ _GET ['user ' ])) {
25+ $ v_username = escapeshellarg ($ _GET ['user ' ]);
26+ exec (VESTA_CMD ."v_unsuspend_user " .$ v_username , $ output , $ return_var );
27+ if ($ return_var != 0 ) {
28+ $ error = implode ('<br> ' , $ output );
29+ if (empty ($ error )) $ error = 'Error: vesta did not return any output. ' ;
30+ $ _SESSION ['error_msg ' ] = $ error ;
31+ } else {
32+ $ _SESSION ['ok_msg ' ] = "OK: user <b> " .$ _GET [user]."</b> has been unsuspended. " ;
33+ unset($ v_lname );
34+ }
35+ unset($ output );
36+
37+ include ($ _SERVER ['DOCUMENT_ROOT ' ].'/templates/admin/menu_suspend_user.html ' );
38+ include ($ _SERVER ['DOCUMENT_ROOT ' ].'/templates/admin/suspend_user.html ' );
39+ unset($ _SESSION ['error_msg ' ]);
40+ unset($ _SESSION ['ok_msg ' ]);
41+
42+ } else {
43+ header ("Location: /list/user/ " );
44+ }
45+
46+ }
47+
48+ // Footer
49+ include ($ _SERVER ['DOCUMENT_ROOT ' ].'/templates/footer.html ' );
You can’t perform that action at this time.
0 commit comments