• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP print_failure函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中print_failure函数的典型用法代码示例。如果您正苦于以下问题:PHP print_failure函数的具体用法?PHP print_failure怎么用?PHP print_failure使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了print_failure函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: exec_ogp_module

function exec_ogp_module()
{
    global $db;
    global $view;
    $user_id = $_GET['user_id'];
    $y = isset($_GET['y']) ? $_GET['y'] : "";
    $user = $db->getUserById($user_id);
    if (empty($user)) {
        print_failure(get_lang_f('user_with_id_does_not_exist', $user_id));
        return;
    }
    $username = $user['users_login'];
    if ($y !== 'y') {
        if (!$db->isModuleInstalled("subusers")) {
            echo "<p>" . get_lang_f('are_you_sure_you_want_to_delete_user', $username) . "</p>";
        } else {
            if (!$db->isSubUser($user_id)) {
                echo "<p>" . get_lang_f('are_you_sure_you_want_to_delete_user', $username) . get_lang('andSubUsers') . "</p>";
            } else {
                echo "<p>" . get_lang_f('are_you_sure_you_want_to_delete_user', $username) . "</p>";
            }
        }
        echo "<p><a href=\"?m=user_admin&amp;p=del&amp;user_id={$user_id}&amp;y=y\">" . get_lang('yes') . "</a> <a href=\"?m=user_admin\">" . get_lang('no') . "</a></p>";
        return;
    }
    if (!$db->delUser($user_id)) {
        print_failure(get_lang_f('unable_to_delete_user', $username));
        $view->refresh("?m=user_admin");
        return;
    }
    print_success(get_lang_f('successfully_deleted_user', $username));
    $db->logger(get_lang_f('successfully_deleted_user', $username));
    $view->refresh("?m=user_admin");
}
开发者ID:jamiebatch452,项目名称:Open-Game-Panel,代码行数:34,代码来源:del_user.php


示例2: exec_ogp_module

function exec_ogp_module()
{
    global $db;
    global $view;
    $group_id = $_GET['group_id'];
    if (!$db->isAdmin($_SESSION['user_id'])) {
        $result = $db->getUserGroupList($_SESSION['user_id']);
        foreach ($result as $row) {
            if ($row['group_id'] == $group_id) {
                $own_group = TRUE;
            }
        }
    }
    if (!$db->isAdmin($_SESSION['user_id']) && !isset($own_group)) {
        echo "<p class='note'>" . get_lang('not_available') . "</p>";
        return;
    }
    // Delete user from group.
    if (isset($_GET['group_id']) && isset($_GET['user_id'])) {
        $group_id = trim($_GET['group_id']);
        $user_id = trim($_GET['user_id']);
        if (!$db->delUserFromGroup($user_id, $group_id)) {
            print_failure(get_lang_f('could_not_delete_user_from_group', $user_id, $group_id));
            $view->refresh("?m=user_admin");
            return;
        }
        echo "<p class='success'>" . get_lang_f('successfully_removed_from_group', $user_id, $group_id) . "</p>";
        $db->logger(get_lang_f('successfully_removed_from_group', $user_id, $group_id));
        $view->refresh("?m=user_admin&amp;p=show_groups");
    }
}
开发者ID:jamiebatch452,项目名称:Open-Game-Panel,代码行数:31,代码来源:del_from_group.php


示例3: exec_ogp_module

function exec_ogp_module()
{
    global $db;
    global $view;
    $group_id = $_REQUEST['group_id'];
    if (!$db->isAdmin($_SESSION['user_id'])) {
        $result = $db->getUserGroupList($_SESSION['user_id']);
        foreach ($result as $row) {
            if ($row['group_id'] == $group_id) {
                $own_group = TRUE;
            }
        }
    }
    if (!$db->isAdmin($_SESSION['user_id']) && !isset($own_group)) {
        echo "<p class='note'>" . get_lang('not_available') . "</p>";
        return;
    }
    if (isset($_POST['add_user_to_group'])) {
        $group_id = trim($_POST['group_id']);
        $user_id = trim($_POST['user_to_add']);
        $username = $db->getUserById($user_id);
        $group_name = $db->getGroupById($group_id);
        if (!$db->addUsertoGroup($user_id, $group_id)) {
            print_failure(get_lang_f('could_not_add_user_to_group', $username['users_login'], $group_name['group_name']));
            $view->refresh("?m=user_admin&amp;p=show_groups");
            return;
        }
        echo "<p class='success'>" . get_lang_f('successfully_added_to_group', $username['users_login'], $group_name['group_name']) . "</p>";
        $db->logger(get_lang_f('successfully_added_to_group', $username['users_login'], $group_name['group_name']));
        $view->refresh("?m=user_admin&amp;p=show_groups");
    }
}
开发者ID:jamiebatch452,项目名称:Open-Game-Panel,代码行数:32,代码来源:add_to_group.php


示例4: exec_ogp_module

function exec_ogp_module()
{
    global $view;
    global $db;
    #This will add a remote host to the list
    if (isset($_REQUEST['add_remote_host'])) {
        $rhost_ip = trim($_POST['remote_host']);
        $rhost_name = trim($_POST['remote_host_name']);
        $rhost_user_name = trim($_POST['remote_host_user_name']);
        $rhost_port = trim($_POST['remote_host_port']);
        $rhost_ftp_ip = trim($_POST['remote_host_ftp_ip']);
        $rhost_ftp_port = trim($_POST['remote_host_ftp_port']);
        $encryption_key = trim($_POST['remote_encryption_key']);
        $timeout = trim($_POST['timeout']);
        $use_nat = trim($_POST['use_nat']);
        if (empty($rhost_ip)) {
            print_failure(get_lang('enter_ip_host'));
            $view->refresh("?m=server");
            return;
        }
        if (empty($rhost_user_name)) {
            print_failure(get_lang('enter_unix_user_name'));
            $view->refresh("?m=server");
            return;
        }
        if (!isPortValid($rhost_port)) {
            print_failure(get_lang('enter_valid_ip'));
            $view->refresh("?m=server");
            return;
        }
        $rhost_id = $db->addRemoteServer($rhost_ip, $rhost_name, $rhost_user_name, $rhost_port, $rhost_ftp_ip, $rhost_ftp_port, $encryption_key, $timeout, $use_nat);
        if (!$rhost_id) {
            print_failure("" . get_lang('could_not_add_server') . " " . $rhost_ip . " " . get_lang('to_db') . "");
            $view->refresh("?m=server");
            return;
        }
        print_success("" . get_lang('added_server') . " {$rhost_ip} " . get_lang('with_port') . " {$rhost_port} " . get_lang('to_db_succesfully') . "");
        require_once 'includes/lib_remote.php';
        $remote = new OGPRemoteLibrary($rhost_ip, $rhost_port, $encryption_key);
        $iplist = $remote->discover_ips();
        if (empty($iplist)) {
            print_failure("" . get_lang('unable_discover') . " " . $rhost_ip . ". " . get_lang('set_ip_manually') . "");
        } else {
            print_success("" . get_lang('found_ips') . " (" . implode(",", $iplist) . ") " . get_lang('for_remote_server') . "");
            foreach ($iplist as $remote_ip) {
                $remote_ip = trim($remote_ip);
                if (empty($remote_ip)) {
                    continue;
                }
                if (!$db->addRemoteServerIp($rhost_id, $remote_ip)) {
                    print_failure("" . get_lang('failed_add_ip') . " (" . $remote_ip . ") " . get_lang('for_remote_server') . "");
                }
            }
        }
        $view->refresh("?m=server");
        return;
    }
}
开发者ID:jamiebatch452,项目名称:Open-Game-Panel,代码行数:58,代码来源:add_server.php


示例5: exec_ogp_module

function exec_ogp_module()
{
    global $db;
    global $view;
    print "<h2>" . get_lang_f('uninstalling_module', $_REQUEST['module']) . "</h2>";
    require_once 'modules/modulemanager/module_handling.php';
    if (isset($_REQUEST['id']) && isset($_REQUEST['module']) && uninstall_module($db, $_REQUEST['id'], $_REQUEST['module']) === TRUE) {
        print_success(get_lang_f("successfully_uninstalled_module", $_REQUEST['module']));
    } else {
        print_failure(get_lang_f("failed_to_uninstall_module", $_REQUEST['module']));
    }
    $view->refresh("?m=modulemanager");
}
开发者ID:jamiebatch452,项目名称:Open-Game-Panel,代码行数:13,代码来源:delete_module.php


示例6: heading

function heading()
{
    global $db, $view, $settings;
    if (!file_exists(CONFIG_FILE)) {
        print_failure(get_lang('failed_to_read_config'));
        $view->refresh("index.php");
        return;
    }
    // Start Output Buffering
    if (!isset($_SESSION['users_login'])) {
        print_failure(get_lang('invalid_login_information'));
        echo "<p class='note' style='color:red;'>" . get_lang('invalid_redirect') . "...</p>";
        echo "<meta http-equiv='refresh' content='2;url=index.php'";
        return;
    } else {
        $info = $db->getUser($_SESSION['users_login']);
        $chk_expire = $info['user_expires'];
        $exptime = read_expire($chk_expire);
        if ($exptime != "X") {
            list($days, $strd, $hours, $strh, $minutes, $strm) = explode(" ", $exptime);
            $minutes2expire = $minutes + intval($hours * 60) + intval($days * 24 * 60);
            if ($minutes2expire <= 0) {
                echo "<h1>" . get_lang('account_expired') . "</h1>";
                echo "<p class='note'>" . get_lang('contact_admin_to_enable_account') . "</p>";
                session_destroy();
                return;
            }
        }
        if (isset($settings['maintenance_mode']) && $settings['maintenance_mode'] == "1") {
            if ($_SESSION['users_group'] == "user") {
                echo "<h2>" . $settings['maintenance_title'] . "</h2>";
                echo "<p>" . $settings['maintenance_message'] . "</p>";
                $view->setTitle("OGP: Maintenance.");
                echo "<p class='failure'>" . get_lang('logging_out_10') . "...</p>";
                echo "<meta http-equiv='refresh' content='10;url=index.php'";
                session_destroy();
                return;
            }
        }
        if (isset($_REQUEST['logout'])) {
            session_destroy();
            print_success(get_lang('logout_message'));
            $view->refresh("index.php");
            return;
        }
        include "includes/navig.php";
    }
    if (isset($maintenance)) {
        echo $maintenance;
    }
}
开发者ID:jamiebatch452,项目名称:Open-Game-Panel,代码行数:51,代码来源:home.php


示例7: read_server_config

function read_server_config($filename)
{
    $dom = new DOMDocument();
    if ($dom->load($filename) === FALSE) {
        print_failure(get_lang_f('unable_to_load_xml', $filename));
        return FALSE;
    }
    if ($dom->schemaValidate(XML_SCHEMA) != TRUE) {
        print_failure(get_lang_f('xml_file_not_valid', $filename, XML_SCHEMA));
        return FALSE;
    }
    $xml = simplexml_load_file($filename);
    $xml->addChild('home_cfg_file', basename($filename));
    return $xml;
}
开发者ID:jamiebatch452,项目名称:Open-Game-Panel,代码行数:15,代码来源:server_config_parser.php


示例8: exec_ogp_module

function exec_ogp_module()
{
    require_once MODULES . "/litefm/litefm.php";
    $home_id = $_REQUEST['home_id'];
    if (empty($home_id)) {
        print_failure(get_lang('home_id_missing'));
        return;
    }
    if (litefm_check($home_id) === FALSE) {
        return;
    }
    global $db;
    $isAdmin = $db->isAdmin($_SESSION['user_id']);
    if ($isAdmin) {
        $home_cfg = $db->getGameHome($home_id);
    } else {
        $home_cfg = $db->getUserGameHome($_SESSION['user_id'], $home_id);
    }
    if ($home_cfg === FALSE) {
        print_failure(get_lang('no_access_to_home'));
        return;
    }
    echo "<table class='center' style='width:100%;'>" . show_back($home_id) . "</table>";
    //Logic to open the file we're editing
    $remote = new OGPRemoteLibrary($home_cfg['agent_ip'], $home_cfg['agent_port'], $home_cfg['encryption_key']);
    $data = "";
    $file_info = $remote->remote_readfile($home_cfg['home_path'] . "/" . $_SESSION['fm_cwd_' . $home_id], $data);
    if ($file_info === 0) {
        print_failure(get_lang("not_found"));
        return;
    } else {
        if ($file_info === -1) {
            print_failure(get_lang("agent_offline"));
            return;
        } else {
            if ($file_info === -2) {
                print_failure(get_lang("failed_read"));
                return;
            }
        }
    }
    echo "<form action='?m=litefm&amp;p=write_file' method='post'>";
    echo "<input type='hidden' name='home_id' value='{$home_id}' />";
    echo "<textarea name='file_content' style='width:98%;' rows='40'>{$data}</textarea>";
    echo "<p><input type='submit' name='save_file' value='" . get_lang('save') . "' /></p>";
    echo "</form>";
    show_back($home_id);
}
开发者ID:jamiebatch452,项目名称:Open-Game-Panel,代码行数:48,代码来源:fm_read.php


示例9: exec_ogp_module

function exec_ogp_module()
{
    global $db, $view, $settings;
    if (is_readable("includes/config.inc.php")) {
        require "includes/config.inc.php";
    }
    $isAdmin = $db->isAdmin($_SESSION['user_id']);
    if ($isAdmin) {
        $user_homes = $db->getIpPorts();
    } else {
        $user_homes = $db->getIpPortsForUser($_SESSION['user_id']);
    }
    echo "<h2>" . get_lang('ftp') . "</h2>";
    if ($user_homes === FALSE) {
        // If there are no games, then there can not be any mods either.
        print_failure('No game homes assigned');
        if ($isAdmin) {
            echo "<p><a href='?m=user_games&amp;p=assign&amp;user_id={$_SESSION['user_id']}'>Assign game homes</a></p>";
        }
        return;
    }
    if (empty($_GET['home_id'])) {
        unset($_GET['home_id']);
    }
    if (!isset($_GET['home_id'])) {
        create_home_selector($_GET['m'], FALSE, $user_homes);
        $show_all = TRUE;
    } else {
        create_home_selector($_GET['m'], FALSE, $user_homes);
        create_home_selector($_GET['m'], FALSE, "show_all");
        $show_all = FALSE;
    }
    if (isset($_GET['home_id'])) {
        $_SESSION['home_id'] = $_GET['home_id'];
    }
    $_SESSION['time_zone'] = $settings['time_zone'];
    ?>
	<IFRAME SRC="modules/ftp/index.php<?php 
    if (isset($_GET['home_id'])) {
        echo "?home_id=" . $_GET['home_id'];
    }
    ?>
" ALIGN=center WIDTH=100% HEIGHT=460 style="border:1px solid transparent;background-color:white" >
	</IFRAME>
	<?php 
    if ($show_all == FALSE) {
        echo "<form action='' method='get'>\n\t\t\t  <input type='hidden' name='m' value='gamemanager' />\n\t\t\t  <input type='hidden' name='p' value='game_monitor' />\n\t\t\t  <input type='hidden' name='home_id' value='" . $_GET['home_id'] . "' />\n\t\t\t  <input type='submit' value='" . get_lang('back') . "' />\n\t\t\t  </form>";
开发者ID:jamiebatch452,项目名称:Open-Game-Panel,代码行数:47,代码来源:ftp.php


示例10: exec_ogp_module

function exec_ogp_module()
{
    echo "<h2>" . get_lang('ban_list') . "</h2>";
    global $db;
    if (isset($_POST['unban'])) {
        unset($_POST['unban']);
        foreach ($_POST as $name => $ip) {
            $db->query("UPDATE `OGP_DB_PREFIXban_list` SET logging_attempts='0', banned_until='0' WHERE client_ip = '{$ip}';");
        }
    }
    $ban_list = $db->resultQuery("SELECT logging_attempts, banned_until, client_ip FROM `OGP_DB_PREFIXban_list`;");
    $ban_qty = 0;
    $ban_table = '';
    foreach ($ban_list as $ban) {
        if ($ban['logging_attempts'] >= 3) {
            $ban_table .= "<tr><td><input type=checkbox name='" . $ban_qty . "' value='" . $ban['client_ip'] . "' /></td><td>" . $ban['client_ip'] . "</td><td>" . date("r", $ban['banned_until']) . "</td></tr>\n";
            $ban_qty++;
        } else {
            continue;
        }
    }
    if ($ban_qty == 0) {
        print_failure(get_lang('no_banned_ips'));
    } else {
        echo "<form method=post >\n" . "<table><tr><th><span id=check >" . get_lang('unban') . "</span></th><th>" . get_lang('client_ip') . "</th><th>" . get_lang('banned_until') . "</th></tr>\n" . $ban_table . "</table>\n" . "<input type=submit name=unban value='" . get_lang('unban_selected_ips') . "' /></form>";
        ?>
		<script type="text/javascript" src="js/jquery-1.7.1.min.js"></script>
		<script type="text/javascript">
		$('span#check').css({'cursor':'pointer','color':'blue'});
		$('span#check').click(function(){
			$('input[type=checkbox]').each(function( ){
				if( this.checked )
				{
					$(this).attr('checked', false);
				}
				else
				{
					$(this).attr('checked', true);
				}
			});
		});
		</script>
		<?php 
    }
    echo create_back_button($_GET['m'], "main");
}
开发者ID:jamiebatch452,项目名称:Open-Game-Panel,代码行数:46,代码来源:banlist.php


示例11: litefm_check

function litefm_check($home_id)
{
    if (isset($_GET['path']) and !isset($_GET['upload']) and !isset($_POST['delete']) and !isset($_POST['create_folder']) and !isset($_POST['secureButton']) and !isset($_POST['delete_check']) and !isset($_POST['secure_check'])) {
        $path = $_GET['path'];
        // Make sure nobody tries to get outside thier game server by referencing the .. directory
        if (preg_match("/\\.\\.|\\||;/", $path)) {
            print_failure(get_lang("unallowed_char"));
            $_SESSION['fm_cwd_' . $home_id] = NULL;
            return FALSE;
        } else {
            $_SESSION['fm_cwd_' . $home_id] = @$_SESSION['fm_cwd_' . $home_id] . "/" . $path;
        }
    }
    // To go back a dir, we just use dirname to strip the last directory or file off the path
    if (isset($_GET['back']) and !isset($_GET['upload']) and !isset($_POST['delete']) and !isset($_POST['create_folder']) and !isset($_POST['secureButton']) and !isset($_POST['delete_check']) and !isset($_POST['secure_check'])) {
        $_SESSION['fm_cwd_' . $home_id] = str_replace("\\", "", dirname($_SESSION['fm_cwd_' . $home_id]));
    }
    return TRUE;
}
开发者ID:jamiebatch452,项目名称:Open-Game-Panel,代码行数:19,代码来源:litefm.php


示例12: exec_ogp_module

function exec_ogp_module()
{
    global $db;
    global $view;
    if (isset($_POST['add_group'])) {
        $group = trim($_POST['group_name']);
        if (empty($group)) {
            print_failure(get_lang('group_name_empty'));
            return;
        }
        if (!$db->addGroup($group, $_SESSION['user_id'])) {
            print_failure(get_lang_f("failed_to_add_group", $group));
            $view->refresh("?m=user_admin&amp;p=show_groups");
            return;
        }
        print_success(get_lang_f('successfully_added_group', $group));
        $db->logger(get_lang_f('successfully_added_group', $group));
        $view->refresh("?m=user_admin&amp;p=show_groups");
    }
}
开发者ID:jamiebatch452,项目名称:Open-Game-Panel,代码行数:20,代码来源:add_group.php


示例13: exec_ogp_module

function exec_ogp_module()
{
    global $view;
    global $db;
    echo "<h2>" . get_lang('view_log') . "</h2>";
    $rhost_id = @$_REQUEST['rhost_id'];
    $remote_server = $db->getRemoteServer($rhost_id);
    $remote = new OGPRemoteLibrary($remote_server['agent_ip'], $remote_server['agent_port'], $remote_server['encryption_key']);
    if (isset($_POST['save_file'])) {
        $file_info = $remote->remote_writefile('./ogp_agent.log', $_REQUEST['file_content']);
        if ($file_info === 1) {
            print_success(get_lang('wrote_changes'));
        } else {
            if ($file_info === 0) {
                print_failure(get_lang('failed_write'));
            } else {
                print_failure(get_lang("agent_offline"));
            }
        }
    }
    $data = "";
    $file_info = $remote->remote_readfile('./ogp_agent.log', $data);
    if ($file_info === 0) {
        print_failure(get_lang("not_found"));
        return;
    } else {
        if ($file_info === -1) {
            print_failure(get_lang("agent_offline"));
            return;
        } else {
            if ($file_info === -2) {
                print_failure(get_lang("failed_read"));
                return;
            }
        }
    }
    echo "<form action='?m=server&amp;p=log&amp;rhost_id=" . $rhost_id . "' method='post'>";
    echo "<textarea name='file_content' style='width:98%;' rows='40'>{$data}</textarea>";
    echo "<p><input type='submit' name='save_file' value='Save' /></p>";
    echo "</form>";
}
开发者ID:jamiebatch452,项目名称:Open-Game-Panel,代码行数:41,代码来源:view_log.php


示例14: exec_ogp_module

function exec_ogp_module()
{
    global $db;
    global $view;
    print "<h2>" . get_lang_f('installing_module', $_REQUEST['module']) . "</h2>";
    require_once 'modules/modulemanager/module_handling.php';
    $install_retval = -99;
    if (isset($_REQUEST['module'])) {
        $install_retval = install_module($db, $_REQUEST['module']);
    }
    if ($install_retval > 0) {
        print_success(get_lang_f("successfully_installed_module", $_REQUEST['module']));
    } else {
        if ($install_retval == 0) {
            print_success(get_lang_f("module_already_installed", $_REQUEST['module']));
        } else {
            print_failure(get_lang_f("failed_to_install_module", $_REQUEST['module']));
        }
    }
    $view->refresh("?m=modulemanager");
}
开发者ID:jamiebatch452,项目名称:Open-Game-Panel,代码行数:21,代码来源:add_module.php


示例15: exec_ogp_module

function exec_ogp_module()
{
    global $db;
    global $view;
    $group_id = $_GET['group_id'];
    if (!$db->isAdmin($_SESSION['user_id'])) {
        $result = $db->getUserGroupList($_SESSION['user_id']);
        foreach ($result as $row) {
            if ($row['group_id'] == $group_id) {
                $own_group = TRUE;
            }
        }
    }
    if (!$db->isAdmin($_SESSION['user_id']) && !isset($own_group)) {
        echo "<p class='note'>" . get_lang('not_available') . "</p>";
        return;
    }
    $y = isset($_GET['y']) ? $_GET['y'] : "";
    $group = $db->getGroupById($group_id);
    if (empty($group)) {
        print_failure(get_lang_f('group_with_id_does_not_exist', $group_id));
        return;
    }
    $groupname = $group['group_name'];
    if ($y !== 'y') {
        echo "<p>" . get_lang_f('are_you_sure_you_want_to_delete_group', $groupname) . "</p>";
        echo "<p><a href=\"?m=user_admin&amp;p=del_group&amp;group_id={$group_id}&amp;y=y\">" . get_lang('yes') . "</a> <a href=\"?m=user_admin&amp;p=show_groups\">" . get_lang('no') . "</a></p>";
        return;
    }
    if (!$db->delGroup($group_id)) {
        print_failure(get_lang_f('unable_to_delete_group', $groupname));
        $view->refresh("?m=user_admin&amp;p=show_groups");
        return;
    }
    print_success(get_lang_f('successfully_deleted_group', $groupname));
    $db->logger(get_lang_f('successfully_deleted_group', $groupname));
    $view->refresh("?m=user_admin&amp;p=show_groups");
}
开发者ID:jamiebatch452,项目名称:Open-Game-Panel,代码行数:38,代码来源:del_group.php


示例16: exec_ogp_module

function exec_ogp_module()
{
    global $db;
    global $view;
    $home_id = isset($_REQUEST['home_id']) ? $_REQUEST['home_id'] : "";
    $user_id = $_SESSION['user_id'];
    // Check if user has some games.
    $isAdmin = $db->isAdmin($user_id);
    if ($isAdmin) {
        $home_info = $db->getGameHome($home_id);
    } else {
        $home_info = $db->getUserGameHome($user_id, $home_id);
    }
    $home_cfg_id = $home_info['home_cfg_id'];
    if ($home_info) {
        echo "<h2>" . get_lang('user_addons') . ": " . $home_info['home_name'] . "</h2>\n\t\t\t\t <table class='center' >\n\t\t\t\t  <tr><td>";
        $plugins = $db->resultQuery("SELECT DISTINCT addon_id, name, game_name FROM OGP_DB_PREFIXaddons  NATURAL JOIN OGP_DB_PREFIXconfig_homes WHERE addon_type='plugin' AND home_cfg_id=" . $home_cfg_id);
        $plugins_qty = count($plugins);
        if ($plugins and $plugins_qty >= 1) {
            echo "<a href='?m=addonsmanager&amp;p=addons&amp;home_id=" . $home_id . "&amp;mod_id=" . $home_info['mod_id'] . "&amp;home_cfg_id=" . $home_cfg_id . "&amp;addon_type=plugin&amp;ip=" . $_GET['ip'] . "&amp;port=" . $_GET['port'] . "'>" . get_lang('install_plugin') . "(" . $plugins_qty . ")</a>";
        }
        $mappacks = $db->resultQuery("SELECT DISTINCT addon_id, name, game_name FROM OGP_DB_PREFIXaddons  NATURAL JOIN OGP_DB_PREFIXconfig_homes WHERE addon_type='mappack' AND home_cfg_id=" . $home_cfg_id);
        $mappacks_qty = count($mappacks);
        if ($mappacks and $mappacks_qty >= 1) {
            echo "</td><td>";
            echo "<a href='?m=addonsmanager&amp;p=addons&amp;home_id=" . $home_id . "&amp;mod_id=" . $home_info['mod_id'] . "&amp;home_cfg_id=" . $home_cfg_id . "&amp;addon_type=mappack&amp;ip=" . $_GET['ip'] . "&amp;port=" . $_GET['port'] . "'>" . get_lang('install_mappack') . "(" . $mappacks_qty . ")</a>";
        }
        $configs = $db->resultQuery("SELECT DISTINCT addon_id, name, game_name FROM OGP_DB_PREFIXaddons  NATURAL JOIN OGP_DB_PREFIXconfig_homes WHERE addon_type='config' AND home_cfg_id=" . $home_cfg_id);
        $configs_qty = count($configs);
        if ($configs and $configs_qty >= 1) {
            echo "</td><td>";
            echo "<a href='?m=addonsmanager&amp;p=addons&amp;home_id=" . $home_id . "&amp;mod_id=" . $home_info['mod_id'] . "&amp;home_cfg_id=" . $home_cfg_id . "&amp;addon_type=config&amp;ip=" . $_GET['ip'] . "&amp;port=" . $_GET['port'] . "'>" . get_lang('install_config') . "(" . $configs_qty . ")</a>";
        }
        echo "</td></tr>\n\t\t\t\t </table>\n\t\t\t\t <form action='?m=gamemanager&amp;p=game_monitor&amp;home_id=" . $home_id . "' method='POST'>\n\t\t\t\t  <input type='submit' value='" . get_lang('back') . "' />\n\t\t\t\t </form>\n\t\t\t\t <br>";
    } else {
        print_failure(get_lang('no_games_servers_available'));
    }
}
开发者ID:jamiebatch452,项目名称:Open-Game-Panel,代码行数:38,代码来源:user_addons.php


示例17: exec_ogp_module

function exec_ogp_module()
{
    $home_id = $_REQUEST['home_id'];
    if (empty($home_id)) {
        print_failure(get_lang('home_id_missing'));
        return;
    }
    global $db;
    $isAdmin = $db->isAdmin($_SESSION['user_id']);
    if ($isAdmin) {
        $home_cfg = $db->getGameHome($home_id);
    } else {
        $home_cfg = $db->getUserGameHome($_SESSION['user_id'], $home_id);
    }
    if ($home_cfg === FALSE) {
        print_failure(get_lang('no_access_to_home'));
        return;
    }
    if (isset($_REQUEST['save_file'])) {
        // If magic quotes are on then we need to remove those slashes here.
        if (get_magic_quotes_gpc()) {
            $_REQUEST['file_content'] = stripslashes($_REQUEST['file_content']);
        }
        $remote = new OGPRemoteLibrary($home_cfg['agent_ip'], $home_cfg['agent_port'], $home_cfg['encryption_key']);
        $file_info = $remote->remote_writefile($home_cfg['home_path'] . "/" . $_SESSION['fm_cwd_' . $home_id], $_REQUEST['file_content']);
        if ($file_info === 1) {
            print_success(get_lang('wrote_changes'));
            $db->logger(get_lang('wrote_changes') . " ( " . $home_cfg['home_name'] . " - " . $home_cfg['home_path'] . $_SESSION['fm_cwd_' . $home_id] . " )");
        } else {
            if ($file_info === 0) {
                print_failure(get_lang('failed_write'));
            } else {
                print_failure(get_lang("agent_offline"));
            }
        }
    }
    echo "<table class='center' style='width:100%;'>" . show_back($home_id) . "</table>";
}
开发者ID:jamiebatch452,项目名称:Open-Game-Panel,代码行数:38,代码来源:fm_write.php


示例18: exec_ogp_module

function exec_ogp_module()
{
    global $db;
    print "<h2>" . get_lang('modules') . "</h2>";
    print '<a href="?m=modulemanager&amp;p=update">' . get_lang('update_modules') . '</a>';
    $modules = $db->getInstalledModules();
    if ($modules === FALSE) {
        print_failure(get_lang('no_installed_modules'));
        return;
    }
    print "<p class='note'>" . get_lang("not_complete") . "</p>";
    print "<table class='center'><tr class='first_row'><td>" . get_lang('module_id') . "</td>\n        <td>" . get_lang('module_name') . "</td><td>" . get_lang('module_folder') . "</td>\n        <td>" . get_lang('module_version') . "</td><td>" . get_lang('db_version') . "</td>\n        <td></td></tr>";
    require_once 'modules/modulemanager/module_handling.php';
    $installed_modules = array();
    $i = 0;
    foreach ($modules as $row) {
        print "<tr class='tr" . $i++ % 2 . "'><td>" . $row['id'] . "</td>";
        print "<td>" . $row['title'] . "</td><td>" . $row['folder'] . "</td><td>" . $row['version'] . "</td><td>" . $row['db_version'] . "</td>";
        print "<td><a href='?m=modulemanager&amp;p=del&amp;id=" . $row['id'] . "&amp;module=" . $row['folder'] . "'>";
        print get_lang('delete') . "</a></td></tr>\n";
        array_push($installed_modules, $row['folder']);
    }
    print "</table>";
    $not_installed = array_diff(list_available_modules(), $installed_modules);
    if (empty($not_installed)) {
        return;
    }
    print "<h3>" . get_lang('modules_available_for_install') . "</h3>";
    echo "<table class='center'><tr class='first_row'><td>" . get_lang('module_folder') . "</td><td></td></tr>";
    foreach ($not_installed as $available_module) {
        echo "<tr><td>" . $available_module . "</td><td>";
        echo "<a href='?m=modulemanager&amp;p=add&amp;module=" . $available_module . "'>";
        echo get_lang('install') . "</a></td></tr>";
    }
    echo "</table>";
}
开发者ID:jamiebatch452,项目名称:Open-Game-Panel,代码行数:36,代码来源:modulemanager.php


示例19: exec_ogp_module

<script src="modules/addonsmanager/jquery-ui.js"></script>
<script>
$(function() {
$( 'input,textarea' ).tooltip();
});
</script>
<?php 
/*
 *
 * OGP - Open Game Panel
 * Copyright (C) Copyright (C) 2008 - 2013 The OGP Development Team
 *
 * http://www.opengamepanel.org/
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * 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, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 *
 */
function exec_ogp_module()
{
    global $db;
    if (isset($_POST['create_addon']) and isset($_POST['name']) and $_POST['url'] == "") {
        print_failure(get_lang("fill_the_url_address_to_a_compressed_file"));
    } elseif (isset($_POST['create_addon']) and isset($_POST['url']) and $_POST['name'] == "") {
        print_failure(get_lang("fill_the_addon_name"));
    } elseif (isset($_POST['create_addon']) and isset($_POST['name']) and isset($_POST['url']) and empty($_POST['addon_type'])) {
        print_failure(get_lang("select_an_addon_type"));
    } elseif (isset($_POST['create_addon']) and isset($_POST['name']) and isset($_POST['url']) and isset($_POST['addon_type']) and empty($_POST['home_cfg_id'])) {
        print_failure(get_lang("select_a_game_type"));
    } elseif (isset($_POST['create_addon']) and isset($_POST['name']) and isset($_POST['url']) and isset($_POST['addon_type']) and isset($_POST['home_cfg_id'])) {
        $fields['name'] = $_POST['name'];
        $fields['url'] = $_POST['url'];
        $fields['path'] = $_POST['path'];
        $fields['addon_type'] = $_POST['addon_type'];
        $fields['home_cfg_id'] = $_POST['home_cfg_id'];
        $fields['post_script'] = $_POST['post_script'];
        if (is_numeric($db->resultInsertId('addons', $fields))) {
            print_success(get_lang_f("addon_has_been_created", $_POST['name']));
            if (isset($_POST['addon_id']) && isset($_POST['edit'])) {
                $db->query("DELETE FROM OGP_DB_PREFIXaddons WHERE addon_id=" . $_POST['addon_id']);
            }
        }
    }
    echo "<h2>" . get_lang('addons_manager') . "</h2>";
    $name = isset($_POST['name']) ? $_POST['name'] : "";
    $url = isset($_POST['url']) ? $_POST['url'] : "";
    $path = isset($_POST['path']) ? $_POST['path'] : "";
    $post_script = isset($_POST['post_script']) ? $_POST['post_script'] : "";
    $home_cfg_id = isset($_POST['home_cfg_id']) ? $_POST['home_cfg_id'] : "";
    $addon_type = isset($_POST['addon_type']) ? $_POST['addon_type'] : "";
    if (isset($_POST['addon_id']) && isset($_POST['edit'])) {
        $addons_rows = $db->resultQuery("SELECT * FROM OGP_DB_PREFIXaddons WHERE addon_id=" . $_POST['addon_id']);
        $addon_info = $addons_rows[0];
        $name = isset($addon_info['name']) ? $addon_info['name'] : "";
        $url = isset($addon_info['url']) ? $addon_info['url'] : "";
        $path = isset($addon_info['path']) ? $addon_info['path'] : "";
        $post_script = isset($addon_info['post_script']) ? $addon_info['post_script'] : "";
        $home_cfg_id = isset($addon_info['home_cfg_id']) ? $addon_info['home_cfg_id'] : "";
        $addon_type = isset($addon_info['addon_type']) ? $addon_info['addon_type'] : "";
    }
    ?>
	<form action="" method="post">
		<table class="center">
			<tr>				
				<td align="right">
					<b><?php 
    print_lang('addon_name');
    ?>
</b>
				</td>
				<td align="left">
					<input type="text" value="<?php 
    echo $name;
    ?>
" name="name" size="90" title="<?php 
    print_lang('addon_name_info');
    ?>
" />
				</td>
			</tr>
			<tr>					
				<td align="right">
					<b><?php 
    print_lang('url');
    ?>
</b>
				</td>
				<td align="left">
					<input type="text" value="<?php 
//.........这里部分代码省略.........
开发者ID:jamiebatch452,项目名称:Open-Game-Panel,代码行数:101,代码来源:addons_manager.php


示例20: exec_ogp_module

function exec_ogp_module()
{
    if (!function_exists("curl_init")) {
        print_failure(get_lang('curl_needed'));
        return;
    }
    if ($_SESSION['users_group'] != "admin") {
        print_failure(get_lang('no_access'));
        return;
    }
    global $db;
    global $view;
    $version = $_GET['version'];
    $vtype = "SVN";
    echo "<h4>" . get_lang('dwl_update') . "</h4>\n";
    //This is usefull when you are downloading big files, as it
    //will prevent time out of the script
    set_time_limit(0);
    error_reporting(E_ALL);
    ini_set('display_errors', true);
    $baseDir = str_repla 

鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP print_feed_cat_select函数代码示例发布时间:2022-05-15
下一篇:
PHP print_errors函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap