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

PHP get_lang_f函数代码示例

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

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



在下文中一共展示了get_lang_f函数的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: get_db_error_text

function get_db_error_text($db_retval, &$error_text)
{
    if (is_a($db_retval, "OGPDatabase")) {
        return FALSE;
    }
    switch ($db_retval) {
        case -1:
            $error_text = get_lang("db_error_invalid_host");
            break;
        case -11:
            $error_text = get_lang("db_error_invalid_user_and_pass");
            break;
        case -12:
            $error_text = get_lang("db_error_invalid_database");
            break;
        case -98:
            $error_text = get_lang("db_error_invalid_db_type");
            break;
        case -99:
            $error_text = get_lang("db_error_module_missing");
            break;
        default:
            $error_text = get_lang_f("db_unknown_error", $db_retval);
            break;
    }
    return TRUE;
}
开发者ID:jamiebatch452,项目名称:Open-Game-Panel,代码行数:27,代码来源:helpers.php


示例4: 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


示例5: exec_ogp_module

function exec_ogp_module()
{
    global $db, $view, $settings;
    if (!isset($_SESSION)) {
        session_start();
    }
    if (isset($_SESSION['ERRMSG_ARR']) && is_array($_SESSION['ERRMSG_ARR']) && count($_SESSION['ERRMSG_ARR']) > 0) {
        $errmsg = '<table>';
        foreach ($_SESSION['ERRMSG_ARR'] as $msg) {
            $errmsg .= "<tr><td><img width='8px' src='images/offline.png'/></td><td style='text-align:left;color:red;'>" . $msg . '</td></tr>';
        }
        $errmsg .= '</table><br>';
        unset($_SESSION['ERRMSG_ARR']);
    }
    echo "<h2>" . get_lang('user_registration') . "</h2>";
    if (isset($errmsg)) {
        echo $errmsg;
        $input = $_SESSION['INPUT'];
    }
    $lang_switch = (isset($_GET['lang']) and $_GET['lang'] != "-") ? "&lang=" . $_GET['lang'] : "";
    ?>
	<style>
	.left {
		margin-left:auto;
		margin-right:auto;
		text-align:left;
	}

	.right
	{
		margin-left:auto;
		margin-right:auto;
		text-align:right;
	}
	</style>
	<?php 
    require_once 'includes/form_table_class.php';
    $ft = new FormTable();
    $ft->start_form("?m=register&p=exec{$lang_switch}", "post", "name=\"loginForm\"");
    $ft->start_table();
    $ft->add_field('string', 'login_name', @$input['users_login']);
    $ft->add_field('password', 'users_passwd', '');
    $ft->add_field('password', 'users_cpasswd', '');
    $ft->add_field('string', 'users_fname', @$input['users_fname']);
    $ft->add_field('string', 'users_lname', @$input['users_lname']);
    $ft->add_field('string', 'users_email', @$input['users_email']);
    $ft->add_field_hidden('users_comment', get_lang_f('registered_on', date("d/m/Y")));
    echo "<tr><td>&nbsp;</td><td>";
    require_once 'recaptchalib.php';
    require_once 'captchakeys.php';
    $use_ssl = isset($_SERVER['HTTPS']) ? true : false;
    echo recaptcha_get_html($publickey, null, $use_ssl);
    echo "</td></tr>";
    $ft->end_table();
    $ft->add_button("submit", "Submit", get_lang('register_a_new_user'));
    $ft->end_form();
}
开发者ID:jamiebatch452,项目名称:Open-Game-Panel,代码行数:57,代码来源:register.php


示例6: exec_ogp_module

function exec_ogp_module()
{
    require_once "includes/functions.php";
    global $db;
    global $view;
    if (!isset($_SESSION)) {
        session_start();
    }
    // Unset refer session used to redirect back to subusers page after editing account information
    if (isset($_SESSION['REFER'])) {
        unset($_SESSION['REFER']);
    }
    if (isset($_SESSION['ERRMSG_ARR']) && is_array($_SESSION['ERRMSG_ARR']) && count($_SESSION['ERRMSG_ARR']) > 0) {
        $errmsg = '<table>';
        foreach ($_SESSION['ERRMSG_ARR'] as $msg) {
            $errmsg .= "<tr><td><img width='8px' src='images/offline.png'/></td><td style='text-align:left;color:red;'>" . $msg . '</td></tr>';
        }
        $errmsg .= '</table><br>';
        unset($_SESSION['ERRMSG_ARR']);
    }
    echo "<h2>" . get_lang('delete_sub_user') . "</h2>";
    if (isset($errmsg)) {
        echo $errmsg;
    }
    // Subuser Delete Check
    if (isset($_POST['editUser'])) {
        $_SESSION['REFER'] = "?m=subusers&p=del";
        $userID = $_POST['user_id'];
        unset($_POST['editUser']);
        $view->refresh("?m=user_admin&p=edit_user&user_id=" . $userID, 0);
    } else {
        if (isset($_POST['delUser'])) {
            if (!isset($_POST['del_check'])) {
                $user_info = $db->getUserById($_POST['user_id']);
                echo "<table class='center' style='width:100%;' ><tr>\n" . "<td>" . get_lang_f('del_subuser_conf') . " " . $user_info['users_login'] . "?</td>" . "</tr><tr><td>" . '<form method="post" >' . "\n" . '<input type="hidden" name="user_id" value="' . $_POST['user_id'] . '">' . "\n" . '<input type="hidden" name="delUser" value="' . $_POST['delUser'] . '">' . "\n" . '<button name="del_check" value="yes" >' . get_lang('yes') . "</button>\n" . '<button name="del_check" value="no" >' . get_lang('no') . "</button>\n" . "</form>\n" . "</td>\n" . "</tr>\n" . "</table><br>\n";
            } elseif ($_POST['del_check'] == "yes") {
                $userID = $_POST['user_id'];
                $user_info = $db->getUserById($userID);
                $errflag = false;
                if (!$db->delUser($userID)) {
                    $errmsg_arr[] = get_lang('err_parent_user');
                    $errflag = true;
                }
                //If there are input validations, redirect back to the registration form
                if ($errflag) {
                    $_SESSION['ERRMSG_ARR'] = $errmsg_arr;
                } else {
                    echo "<p>" . get_lang_f('subuser_deleted', $user_info['users_login']) . "</p>";
                }
            }
        }
        $results = listAllSubUsers();
        echo $results;
    }
}
开发者ID:jamiebatch452,项目名称:Open-Game-Panel,代码行数:55,代码来源:del_subuser.php


示例7: 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


示例8: exec_ogp_module

function exec_ogp_module()
{
    global $db;
    global $view;
    print "<h2>" . get_lang_f('updating_modules') . "</h2>";
    require_once 'modules/modulemanager/module_handling.php';
    $modules = $db->getInstalledModules();
    //print_r($modules)
    foreach ($modules as $row) {
        update_module($db, $row['id'], $row['folder']);
    }
    print "<p>" . get_lang_f('updating_finished') . "</p>";
    $view->refresh("?m=modulemanager");
}
开发者ID:jamiebatch452,项目名称:Open-Game-Panel,代码行数:14,代码来源:update_modules.php


示例9: 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


示例10: 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


示例11: 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


示例12: 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


示例13: exec_ogp_module

function exec_ogp_module()
{
    global $db;
    $isAdmin = $db->isAdmin($_SESSION['user_id']);
    if (isset($_REQUEST['user_id']) && !$isAdmin) {
        echo "<p class='note'>" . get_lang('not_available') . "</p>";
        return;
    }
    if (isset($_REQUEST['group_id']) && !$isAdmin) {
        $result = $db->getUserGroupList($_SESSION['user_id']);
        foreach ($result as $row) {
            if ($row['group_id'] == $_REQUEST['group_id']) {
                $own_group = TRUE;
            }
        }
    }
    if (!$isAdmin && !isset($own_group)) {
        echo "<p class='note'>" . get_lang('not_available') . "</p>";
        return;
    }
    if (!isset($_REQUEST['user_id']) && !isset($_REQUEST['group_id'])) {
        print_failure(get_lang("invalid_url"));
        return;
    }
    /// \todo We might want to save this information to XML file?
    $selections = array("allow_updates" => "u", "allow_file_management" => "f", "allow_parameter_usage" => "p", "allow_extra_params" => "e", "allow_ftp" => "t", "allow_custom_fields" => "c");
    if (isset($_REQUEST['user_id'])) {
        $assign_id = $_REQUEST['user_id'];
        $id_type = "user";
        $user = $db->getUserById($assign_id);
        $assign_name = $user['users_login'];
    } else {
        if (isset($_REQUEST['group_id'])) {
            $assign_id = $_REQUEST['group_id'];
            $id_type = "group";
            $group = $db->getGroupById($assign_id);
            $assign_name = $group['group_name'];
        }
    }
    $submit = isset($_POST['submit']) ? $_POST['submit'] : "";
    if (isset($_REQUEST['assign'])) {
        $access_rights = "";
        foreach ($selections as $selection => $flag) {
            if (isset($_REQUEST[$selection])) {
                $access_rights .= $flag;
            }
        }
        $hacker = FALSE;
        if (!$isAdmin) {
            $home_info = $db->getUserGameHome($_SESSION['user_id'], $_REQUEST['home_id']);
            if (!$home_info) {
                print_failure(get_lang_f("failed_to_assign_game_for", $id_type, "(Hacking attempt)"));
                $hacker = TRUE;
            } else {
                foreach ($selections as $selection => $flag) {
                    if (isset($_REQUEST[$selection])) {
                        if (!preg_match("/{$flag}/", $home_info['access_rights'])) {
                            print_failure(get_lang_f("failed_to_assign_game_for", $id_type, "(Hacking attempt)"));
                            $hacker = TRUE;
                        }
                    }
                }
            }
        }
        if (!$hacker) {
            if ($db->assignHomeTo($id_type, $assign_id, $_REQUEST['home_id'], $access_rights) === TRUE) {
                print_success(get_lang_f("assigned_home_to_" . $id_type, $_REQUEST['home_id'], $assign_name));
                $db->logger(get_lang_f("assigned_home_to_" . $id_type, $_REQUEST['home_id'], $assign_name));
            } else {
                print_failure(get_lang_f("failed_to_assign_game_for_", $id_type, $db->getError()));
            }
        }
        unset($_POST['home_id']);
    } else {
        if (isset($_REQUEST['unassign'])) {
            if ($db->unassignHomeFrom($id_type, $assign_id, $_REQUEST['home_id']) === TRUE) {
                print_success(get_lang_f("unassigned_home_from_" . $id_type, $_REQUEST['home_id'], $assign_name));
                $db->logger(get_lang_f("unassigned_home_from_" . $id_type, $_REQUEST['home_id'], $assign_name));
            } else {
                print_failure(get_lang_f("failed_to_assign_game_from_", $id_type));
            }
        }
    }
    $remote_servers = $db->getRemoteServers();
    if (empty($remote_servers)) {
        print_failure(get_lang("no_remote_servers_available_please_add_at_least_one"));
        echo "<p><a href='?m=server'>" . get_lang('add_remote_server') . "</a></p>";
        return;
    }
    if ($isAdmin) {
        $available_homes = $db->getAvailableHomesFor($id_type, $assign_id);
    } else {
        $available_homes = $db->getAvailableUserHomesFor($id_type, $assign_id, $_SESSION['user_id']);
    }
    if (!empty($available_homes)) {
        echo "<h2>" . get_lang_f('assign_new_home_to_' . $id_type, $assign_name) . "</h2>";
        echo "<form action='?m=user_games&amp;p=assign' method='post'>";
        echo "<input name='" . $id_type . "_id' value='" . $assign_id . "' type='hidden' />\n";
        echo "<table class='center'><tr><td align='right'><label for='home_id'>" . get_lang('select_home') . ":</label></td>";
        echo '<td align="left"><select id="home_id" name="home_id" onchange="this.form.submit();">';
//.........这里部分代码省略.........
开发者ID:jamiebatch452,项目名称:Open-Game-Panel,代码行数:101,代码来源:assign_home.php


示例14: exec_ogp_module

function exec_ogp_module()
{
    global $db;
    global $view;
    echo "<h2>" . get_lang('add_new_game_home') . "</h2>";
    echo "<p><a href='?m=user_games'>&lt;&lt; " . get_lang('back_to_game_servers') . "</a></p>";
    $remote_servers = $db->getRemoteServers();
    if ($remote_servers === FALSE) {
        echo "<p class='note'>" . get_lang('no_remote_servers_configured') . "</p>\n\t\t\t  <p><a href='?m=server'>" . get_lang('add_remote_server') . "</a></p>";
        return;
    }
    $game_cfgs = $db->getGameCfgs();
    $users = $db->getUserList();
    if ($game_cfgs === FALSE) {
        echo "<p class='note'>" . get_lang('no_game_configurations_found') . " <a href='?m=config_games'>" . get_lang('game_configurations') . "</a></p>";
        return;
    }
    echo "<p> <span class='note'>" . get_lang('note') . ":</span> " . get_lang('add_mods_note') . "</p>";
    $selections = array("allow_updates" => "u", "allow_file_management" => "f", "allow_parameter_usage" => "p", "allow_extra_params" => "e", "allow_ftp" => "t", "allow_custom_fields" => "c");
    if (isset($_REQUEST['add_game_home'])) {
        $rserver_id = $_POST['rserver_id'];
        $home_cfg_id = $_POST['home_cfg_id'];
        $web_user_id = trim($_POST['web_user_id']);
        $control_password = genRandomString(8);
        $access_rights = "";
        $ftp = FALSE;
        foreach ($selections as $selection => $flag) {
            if (isset($_REQUEST[$selection])) {
                $access_rights .= $flag;
                if ($flag == "t") {
                    $ftp = TRUE;
                }
            }
        }
        if (empty($web_user_id)) {
            print_failure(get_lang('game_path_empty'));
        } else {
            foreach ($game_cfgs as $row) {
                if ($row['home_cfg_id'] == $home_cfg_id) {
                    $server_name = $row['game_name'];
                }
            }
            foreach ($remote_servers as $server) {
                if ($server['remote_server_id'] == $rserver_id) {
                    $ogp_user = $server['ogp_user'];
                }
            }
            foreach ($users as $user) {
                if ($user['user_id'] == $web_user_id) {
                    $web_user = $user['users_login'];
                }
            }
            $ftppassword = genRandomString(8);
            $game_path = "/home/" . $ogp_user . "/OGP_User_Files/";
            if (($new_home_id = $db->addGameHome($rserver_id, $web_user_id, $home_cfg_id, clean_path($game_path), $server_name, $control_password, $ftppassword)) !== FALSE) {
                $db->assignHomeTo("user", $web_user_id, $new_home_id, $access_rights);
                if ($ftp) {
                    $home_info = $db->getGameHomeWithoutMods($new_home_id);
                    require_once 'includes/lib_remote.php';
                    $remote = new OGPRemoteLibrary($home_info['agent_ip'], $home_info['agent_port'], $home_info['encryption_key']);
                    $host_stat = $remote->status_chk();
                    if ($host_stat === 1) {
                        $remote->ftp_mgr("useradd", $home_info['home_id'], $home_info['ftp_password'], $home_info['home_path']);
                    }
                    $db->changeFtpStatus('enabled', $new_home_id);
                }
                print_success(get_lang('game_home_added'));
                $db->logger(get_lang('game_home_added') . " ({$server_name})");
                $view->refresh("?m=user_games&amp;p=edit&amp;home_id={$new_home_id}");
            } else {
                print_failure(get_lang_f("failed_to_add_home_to_db", $db->getError()));
            }
        }
    }
    // View form to add more servers.
    if (!isset($_POST['rserver_id'])) {
        echo "<form action='?m=user_games&amp;p=add' method='post'>";
        echo "<table class='center'>";
        echo "<tr><td  class='right'>" . get_lang('game_server') . "</td><td class='left'><select onchange=" . '"this.form.submit()"' . " name='rserver_id'>\n";
        echo "<option>" . get_lang('select_remote_server') . "</option>\n";
        foreach ($remote_servers as $server) {
            echo "<option value='" . $server['remote_server_id'] . "'>" . $server['remote_server_name'] . " (" . $server['agent_ip'] . ")</option>\n";
        }
        echo "</select>\n";
        echo "</form>";
        echo "</td></tr></table>";
    } else {
        if (isset($_POST['rserver_id'])) {
            $rhost_id = $_POST['rserver_id'];
        }
        $remote_server = $db->getRemoteServer($rhost_id);
        require_once 'includes/lib_remote.php';
        $remote = new OGPRemoteLibrary($remote_server['agent_ip'], $remote_server['agent_port'], $remote_server['encryption_key']);
        $host_stat = $remote->status_chk();
        if ($host_stat === 1) {
            $os = $remote->what_os();
        } else {
            print_failure(get_lang_f("caution_agent_offline_can_not_get_os_and_arch_showing_servers_for_all_platforms"));
            $os = "Unknown OS";
        }
//.........这里部分代码省略.........
开发者ID:jamiebatch452,项目名称:Open-Game-Panel,代码行数:101,代码来源:add_home.php


示例15: exec_ogp_module

function exec_ogp_module()
{
    global $db;
    global $view;
    $home_id = isset($_REQUEST['home_id']) ? $_REQUEST['home_id'] : "";
    $mod_id = isset($_REQUEST['mod_id']) ? $_REQUEST['mod_id'] : "";
    $isAdmin = $db->isAdmin($_SESSION['user_id']);
    if ($isAdmin) {
        $home_info = $db->getGameHome($home_id);
    } else {
        $home_info = $db->getUserGameHome($_SESSION['user_id'], $home_id);
    }
    if ($home_info === FALSE || preg_match("/u/", $home_info['access_rights']) != 1) {
        print_failure(get_lang('no_rights'));
        echo "<table class='center'><tr><td><a href='?m=gamemanager&amp;p=game_monitor&amp;home_id=" . $home_info['home_id'] . "'><< " . get_lang('back') . "</a></td></tr></table>";
        return;
    }
    $game_type = $home_info['game_key'];
    echo "<h2>Updating game server <em>" . $home_info['home_name'] . "</em></h2>";
    $server_xml = read_server_config(SERVER_CONFIG_LOCATION . "/" . $home_info['home_cfg_file']);
    if ($server_xml->installer != "steamcmd") {
        print_failure(get_lang('xml_steam_error'));
        return;
    }
    $remote = new OGPRemoteLibrary($home_info['agent_ip'], $home_info['agent_port'], $home_info['encryption_key']);
    $host_stat = $remote->status_chk();
    if ($remote->is_screen_running(OGP_SCREEN_TYPE_HOME, $home_id) == 1) {
        print_failure(get_lang('server_running_cant_update'));
        return;
    }
    $log_txt = '';
    $update_active = $remote->get_log(OGP_SCREEN_TYPE_UPDATE, $home_id, clean_path($home_info['home_path']), $log_txt);
    $modkey = $home_info['mods'][$mod_id]['mod_key'];
    $mod_xml = xml_get_mod($server_xml, $modkey);
    if (!$mod_xml) {
        print_failure(get_lang_f('mod_key_not_found_from_xml', $modkey));
        return;
    }
    if ($update_active === 0) {
        print_failure(get_lang('agent_offline'));
        echo "<meta http-equiv='refresh' content='5'>";
        return;
    } else {
        if ($_REQUEST['update'] == 'update' && $update_active != 1) {
            $installer_name = $modkey;
            if (isset($mod_xml->installer_name)) {
                $installer_name = $mod_xml->installer_name;
            }
            $mod_cfg_id = $home_info['mod_cfg_id'];
            $game_mod_precmd = $db->resultQuery("SELECT DISTINCT precmd FROM OGP_DB_PREFIXgame_mods WHERE mod_id='{$mod_id}'");
            if ($game_mod_precmd[0]['precmd'] === NULL or empty($game_mod_precmd[0]['precmd'])) {
                $config_mod_precmd = $db->resultQuery("SELECT DISTINCT def_precmd FROM OGP_DB_PREFIXconfig_mods WHERE mod_cfg_id='{$mod_cfg_id}'");
                if ($config_mod_precmd[0]['def_precmd'] === NULL or empty($config_mod_precmd[0]['def_precmd'])) {
                    $precmd = "";
                } else {
                    $precmd = $config_mod_precmd[0]['def_precmd'];
                }
            } else {
                $precmd = $game_mod_precmd[0]['precmd'];
            }
            $game_mod_postcmd = $db->resultQuery("SELECT DISTINCT postcmd FROM OGP_DB_PREFIXgame_mods WHERE mod_id='{$mod_id}'");
            if ($game_mod_postcmd[0]['postcmd'] === NULL or empty($game_mod_postcmd[0]['postcmd'])) {
                $config_mod_postcmd = $db->resultQuery("SELECT DISTINCT def_postcmd FROM OGP_DB_PREFIXconfig_mods WHERE mod_cfg_id='{$mod_cfg_id}'");
                if ($config_mod_postcmd[0]['def_postcmd'] === NULL or empty($config_mod_postcmd[0]['def_postcmd'])) {
                    $postcmd = "";
                } else {
                    $postcmd = $config_mod_postcmd[0]['def_postcmd'];
                }
            } else {
                $postcmd = $game_mod_postcmd[0]['postcmd'];
            }
            $exec_folder_path = clean_path($home_info['home_path'] . "/" . $server_xml->exe_location);
            $exec_path = clean_path($exec_folder_path . "/" . $server_xml->server_exec_name);
            if (isset($_REQUEST['master_server_home_id'])) {
                $ms_home_id = $_REQUEST['master_server_home_id'];
                $ms_info = $db->getGameHome($ms_home_id);
                $steam_out = $remote->masterServerUpdate($home_id, $home_info['home_path'], $ms_home_id, $ms_info['home_path'], $exec_folder_path, $exec_path, $precmd, $postcmd);
            } else {
                if (preg_match("/win32/", $server_xml->game_key) or preg_match("/win64/", $server_xml->game_key)) {
                    $cfg_os = "windows";
                } elseif (preg_match("/linux/", $server_xml->game_key)) {
                    $cfg_os = "linux";
                }
                $settings = $db->getSettings();
                // Some games like L4D2 require anonymous login
                if ($mod_xml->installer_login) {
                    $login = $mod_xml->installer_login;
                    $pass = '';
                } else {
                    $login = $settings['steam_user'];
                    $pass = $settings['steam_pass'];
                }
                $modname = ($installer_name == '90' and !preg_match("/(cstrike|valve)/", $modkey)) ? $modkey : '';
                $betaname = isset($mod_xml->betaname) ? $mod_xml->betaname : '';
                $betapwd = isset($mod_xml->betapwd) ? $mod_xml->betapwd : '';
                $steam_out = $remote->steam_cmd($home_id, $home_info['home_path'], $installer_name, $modname, $betaname, $betapwd, $login, $pass, $settings['steam_guard'], $exec_folder_path, $exec_path, $precmd, $postcmd, $cfg_os);
            }
            if ($steam_out === 0) {
                print_failure(get_lang('failed_to_start_steam_update'));
                return;
//.........这里部分代码省略.........
开发者ID:jamiebatch452,项目名称:Open-Game-Panel,代码行数:101,代码来源:update_server.php


示例16: exec_ogp_module

function exec_ogp_module()
{
    if ($_SESSION['users_group'] != "admin") {
        print_failure(get_lang('no_access'));
        return;
    }
    global $db;
    global $view;
    echo "<h2>" . get_lang('update') . "</h2>";
    $panel_settings = $db->getSettings();
    $pversion = "" . $panel_settings['ogp_version'] . "";
    echo '<a href="?m=update&p=blacklist" >' . get_lang('blacklist_files') . "</a>&nbsp;" . get_lang('blacklist_files_info') . "</br></br>";
    echo get_lang('panel_version') . ": " . $pversion . "</br></br>";
    //Get SVN rev.
    $serverlist_url = "http://svn.code.sf.net/p/hldstart/code/trunk/upload/";
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $serverlist_url);
    curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)');
    curl_setopt($ch, CURLOPT_HTTPHEADER, array("Accept-Language: es-es,en"));
    curl_setopt($ch, CURLOPT_TIMEOUT, 60);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    //Save Page
    $result = curl_exec($ch);
    curl_close($ch);
    //Parse the result to get the last version.
    preg_match_all("(<title>p/hldstart/code - Revision (.*): /trunk/upload</title>)siU", $result, $matches);
    $last_svn_version = $matches[1][0];
    if (isset($last_svn_version) and $last_svn_version != "") {
        echo get_lang('latest_version') . ": {$last_svn_version}</br></br>";
        //Check snapshot file exists.
        $ch = curl_init("http://master.dl.sourceforge.net/project/ogpextras/Alternative-Snapshot/hldstart-code-{$last_svn_version}.zip");
        curl_setopt($ch, CURLOPT_NOBODY, true);
        curl_exec($ch);
        $retcode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
        curl_close($ch);
        // Run the snapshot creation if it does not exists yet.
        if ($retcode == '404') {
            print_failure("The snapshot of the current version has not been created yet.");
            print_failure("Try again in 5 minutes.");
        } else {
            if ($last_svn_version != $pversion) {
                if (isset($_GET['view_changes'])) {
                    echo "<div style=\"\ttext-align:left;\n\t\t\t\t\t\t\t\t\t\twidth:80%;\n\t\t\t\t\t\t\t\t\t\tmargin:0 auto;\n\t\t\t\t\t\t\t\t\t\tpadding: 10px 5px;\n\t\t\t\t\t\t\t\t\t\tborder: 1px solid rgb(170, 170, 170);\n\t\t\t\t\t\t\t\t\t\tborder-radius: 4px;\n\t\t\t\t\t\t\t\t\t\tbackground-color: rgb(189, 229, 248);\" >";
                    for ($revision = $pversion + 1; $revision <= $last_svn_version; $revision++) {
                        $serverlist_url = "http://sourceforge.net/p/hldstart/code/{$revision}/";
                        $ch = curl_init();
                        curl_setopt($ch, CURLOPT_URL, $serverlist_url);
                        curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)');
                        curl_setopt($ch, CURLOPT_HTTPHEADER, array("Accept-Language: es-es,en"));
                        curl_setopt($ch, CURLOPT_TIMEOUT, 10);
                        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
                        //Save Page
                        $result = curl_exec($ch);
                        curl_close($ch);
                        //Parse the result to get the last version.
                        preg_match_all("(<div class=\"commit-message\">(.*)</div>\n    <div class=\"commit-details\">)siU", $result, $matches);
                        $commit_message = str_replace("<div class=\"markdown_content\">", "\\sl\\", $matches[1][0]);
                        $commit_message = strip_tags($commit_message);
                        $commit_message = str_replace("\\sl\\", "<br>", $commit_message);
                        echo "<b>Revision {$revision} changes</b>: {$commit_message}<br><br>";
                    }
                    echo "</div>";
                } else {
                    echo "<form action='' method='get'>";
                    echo "<input type='hidden' name='m' value='update' />";
                    echo "<input type='hidden' name='view_changes' value='true' />";
                    echo "<input type='submit' value='" . get_lang('view_changes') . "' /></form>";
                    $messages_qty = $last_svn_version - $pversion;
                    if ($messages_qty >= 3) {
                        print_failure(get_lang_f('get_x_revison_messages_may_take_some_time', $messages_qty));
                    }
                }
                echo "<br>";
                $sf_mirrors = file("modules/update/mirrors.list");
                echo "<form action='?m=update&amp;p=updating&amp;version=" . $last_svn_version . "' method='post'>";
                echo get_lang('select_mirror') . ": " . create_drop_box_from_array_rsync($sf_mirrors, "mirror");
                echo "<br><br><input type='submit' value='" . get_lang('update_now') . "' /></form><br><br>";
            } else {
                print_failure(get_lang('the_panel_is_up_to_date'));
            }
        }
    } else {
        print_failure('sourceforge.net is down or not responding.');
    }
    echo "</div>";
}
开发者ID:jamiebatch452,项目名称:Open-Game-Panel,代码行数:86,代码来源:update.php


示例17: exec_ogp_module

function exec_ogp_module()
{
    global $db;
    global $view;
    $home_cfg_id = isset($_REQUEST['home_cfg_id']) ? $_REQUEST['home_cfg_id'] : "";
    $home_id = isset($_REQUEST['home_id']) ? $_REQUEST['home_id'] : "";
    $addon_id = isset($_REQUEST['addon_id']) ? $_REQUEST['addon_id'] : "";
    $isAdmin = $db->isAdmin($_SESSION['user_id']);
    if ($isAdmin) {
        $home_info = $db->getGameHome($home_id);
    } else {
        $home_info = $db->getUserGameHome($_SESSION['user_id'], $home_id);
    }
    if ($home_info === FALSE) {
        print_failure(get_lang('no_rights'));
        echo create_back_button("addonsmanager", "user_addons");
        return;
    }
    $server_xml = read_server_config(SERVER_CONFIG_LOCATION . "/" . $home_info['home_cfg_file']);
    $state = isset($_REQUEST['state']) ? $_REQUEST['state'] : "";
    $pid = isset($_REQUEST['pid']) ? $_REQUEST['pid'] : -1;
    if (!empty($state)) {
        $remote = new OGPRemoteLibrary($home_info['agent_ip'], $home_info['agent_port'], $home_info['encryption_key']);
        $addons_rows = $db->resultQuery("SELECT url, path, post_script FROM OGP_DB_PREFIXaddons WHERE addon_id=" . $addon_id);
        $addon_info = $addons_rows[0];
        $url = $addon_info['url'];
        $filename = basename($url);
        #### This makes replacements to the bash script:
        if (isset($addon_info['post_script']) and !empty($addon_info['post_script']) and $addon_info['post_script'] != & 

鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP get_langfile_path函数代码示例发布时间:2022-05-15
下一篇:
PHP get_lang函数代码示例发布时间: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