Ejemplo n.º 1
0
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
include "../core.php";
// Admin Check
$user = UserManager::getLocalUser();
if (!$user->isAdmin()) {
    PageManager::displayErrorPage("access");
    return;
}
$userid = isset($_GET['userid']) ? $_GET['userid'] : null;
if ($userid != null) {
    if (UserManager::existsById($userid)) {
        $user = new User($userid);
        $page = new Page($smarty, "modals/CustomerRemove.tpl");
        if ($user->getData("gameServerCount") == 0) {
            $page->assign("u", $user);
        } else {
            $page->assign("t_Report", Reporting::Error("This customer cannot be deleted because still has gameservers. They have to be deleted manually."));
        }
        $page->display();
    } else {
        $p = new Page($smarty, "modals/DefaultError.tpl");
        $p->display();
    }
} else {
    $p = new Page($smarty, "modals/DefaultError.tpl");
    $p->display();
}
Ejemplo n.º 2
0
$smarty->assign("pageActive", "userservercontrol");
$lU = UserManager::GetLocalUser();
if ($lU->getSelectedGameserver() != null) {
    $gs = $lU->getSelectedGameserver();
    $page = new Page($smarty, "pages/userServerControl.tpl");
    if (isset($_GET['do']) || isset($_POST['do'])) {
        $do = isset($_GET['do']) ? $_GET['do'] : $_POST['do'];
    } else {
        $do = "nothing";
    }
    // Controllable
    $page->assign("controllable", $gs->isControlable());
    if (!$gs->isControlable()) {
        $page->assign("t_Report", Reporting::error("This Gameserver is not availabe for control at the moment."));
    } else {
        if ("Start" == $do) {
            $page->assign("t_Report", Reporting::success("The gameserver will be started soon."));
            $gs->scheduleStart();
        } else {
            if ("Stop" == $do) {
                $page->assign("t_Report", Reporting::success("The gameserver will be stopped soon."));
                $gs->scheduleStop();
            }
        }
    }
    $page->display();
} else {
    $page = new Page($smarty, "pages/bigmessage.tpl");
    $page->assign("t_Report", Reporting::Error("You havent selected any gameserver yet."));
    $page->display();
}