Apply automated PHP8 safety transforms
Agent-Logs-Url: https://github.com/GameServerPanel/GSP/sessions/89922108-1604-44ae-949d-358d32b9d70a Co-authored-by: iaretechnician <2749183+iaretechnician@users.noreply.github.com>
This commit is contained in:
parent
aca850b6cd
commit
e44519c030
465 changed files with 1716 additions and 1716 deletions
|
|
@ -71,7 +71,7 @@ function exec_ogp_module()
|
|||
$access_rights = "";
|
||||
|
||||
$ftp = FALSE;
|
||||
foreach ($selections as $selection => $flag)
|
||||
foreach ((array)$selections as $selection => $flag)
|
||||
{
|
||||
if (isset($_REQUEST[$selection]))
|
||||
{
|
||||
|
|
@ -89,7 +89,7 @@ function exec_ogp_module()
|
|||
}
|
||||
else
|
||||
{
|
||||
foreach ( $game_cfgs as $row )
|
||||
foreach ((array)$game_cfgs as $row)
|
||||
{
|
||||
if($row['home_cfg_id'] == $home_cfg_id){
|
||||
$server_name = $row['game_name'];
|
||||
|
|
@ -98,11 +98,11 @@ function exec_ogp_module()
|
|||
$readable_game_key = strtolower($readable_game_key);
|
||||
}
|
||||
}
|
||||
foreach ( $remote_servers as $server )
|
||||
foreach ((array)$remote_servers as $server)
|
||||
{
|
||||
if($server['remote_server_id'] == $rserver_id) $ogp_user = $server['ogp_user'];
|
||||
}
|
||||
foreach ( $users as $user )
|
||||
foreach ((array)$users as $user)
|
||||
{
|
||||
if($user['user_id'] == $web_user_id) $web_user = $user['users_login'];
|
||||
}
|
||||
|
|
@ -170,7 +170,7 @@ function exec_ogp_module()
|
|||
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 )
|
||||
foreach ((array)$remote_servers as $server)
|
||||
{
|
||||
echo "<option value='".$server['remote_server_id']."'>".
|
||||
$server['remote_server_name']." (".$server['agent_ip'].")</option>\n";
|
||||
|
|
@ -204,7 +204,7 @@ function exec_ogp_module()
|
|||
<td class='left'><select name='web_user_id'>";
|
||||
$users = $db->getUserList();
|
||||
|
||||
foreach ( $users as $user ){
|
||||
foreach ((array)$users as $user){
|
||||
// Only users and admins can be assigned homes... not subusers
|
||||
if(is_null($user['users_parent'])){
|
||||
echo "<option value='".$user['user_id']."'>".$user['users_login']."</option>\n";
|
||||
|
|
@ -214,7 +214,7 @@ function exec_ogp_module()
|
|||
// Select permisions
|
||||
echo "<tr><td class='right'>".get_lang('access_rights').":</td>
|
||||
<td class='left'>";
|
||||
foreach ( $selections as $selection => $flag)
|
||||
foreach ((array)$selections as $selection => $flag)
|
||||
{
|
||||
echo create_selection($selection,$flag);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ function exec_ogp_module()
|
|||
if ( isset( $_REQUEST['group_id'] ) && !$isAdmin )
|
||||
{
|
||||
$result = $db->getUserGroupList($_SESSION['user_id']);
|
||||
foreach ( $result as $row ) #loop through the groups
|
||||
foreach ((array)$result as $row) #loop through the groups
|
||||
{
|
||||
if ( $row['group_id'] == $_REQUEST['group_id'] )
|
||||
{
|
||||
|
|
@ -95,14 +95,14 @@ function exec_ogp_module()
|
|||
if($isAdmin)
|
||||
$access_right_flags = implode('',$_POST['flags']);
|
||||
|
||||
foreach($_POST['home_ids'] as $i => $home_id)
|
||||
foreach ((array)$_POST['home_ids'] as $i => $home_id)
|
||||
{
|
||||
if(!$isAdmin)
|
||||
{
|
||||
$home_info = $db->getUserGameHome($_SESSION['user_id'],$home_id);
|
||||
$access_rights = $home_info['access_rights'];
|
||||
$flags = $_POST['flags'];
|
||||
foreach($flags as $i => $flag)
|
||||
foreach ((array)$flags as $i => $flag)
|
||||
{
|
||||
if(!strstr($access_rights, $flag))
|
||||
unset($flags[$i]);
|
||||
|
|
@ -137,7 +137,7 @@ function exec_ogp_module()
|
|||
{
|
||||
$access_rights = "";
|
||||
|
||||
foreach ($selections as $selection => $flag)
|
||||
foreach ((array)$selections as $selection => $flag)
|
||||
{
|
||||
if (isset($_REQUEST[$selection]))
|
||||
$access_rights .= $flag;
|
||||
|
|
@ -154,7 +154,7 @@ function exec_ogp_module()
|
|||
}
|
||||
else
|
||||
{
|
||||
foreach ($selections as $selection => $flag)
|
||||
foreach ((array)$selections as $selection => $flag)
|
||||
{
|
||||
if (isset($_REQUEST[$selection]))
|
||||
{
|
||||
|
|
@ -218,7 +218,7 @@ function exec_ogp_module()
|
|||
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();">';
|
||||
echo "<option></option>\n";
|
||||
foreach ( $available_homes as $home )
|
||||
foreach ((array)$available_homes as $home)
|
||||
{
|
||||
if( isset($_POST['home_id']) && $_POST['home_id'] == $home['home_id'])
|
||||
$selected="selected='selected'";
|
||||
|
|
@ -243,7 +243,7 @@ function exec_ogp_module()
|
|||
$home_info = $db->getUserGameHome($_SESSION['user_id'],$_POST['home_id']);
|
||||
$access_rights = $home_info['access_rights'];
|
||||
}
|
||||
foreach ( $selections as $selection => $flag)
|
||||
foreach ((array)$selections as $selection => $flag)
|
||||
{
|
||||
echo create_selection($selection,$flag,$access_rights);
|
||||
}
|
||||
|
|
@ -283,11 +283,11 @@ function exec_ogp_module()
|
|||
<th>".get_lang("game_home_name")."</th><th>".get_lang("access_rights")."</th>
|
||||
<th>".get_lang("assign_expiration_date")."</th>
|
||||
<th>".get_lang("actions")."</th></tr>";
|
||||
foreach( $game_homes as $row )
|
||||
foreach ((array)$game_homes as $row)
|
||||
{
|
||||
$access_rights = empty($row['access_rights']) ? "-" : $row['access_rights'];
|
||||
$type = $id_type == "group" ? "user_group_expiration_date" : "user_expiration_date";
|
||||
$expiration = $row[$type] == "X" ? "X" : date('d/m/Y H:i:s', $row[$type]);
|
||||
$expiration = $row[$type] == "X" ? "X" : date('d/m/Y H:i:s', is_numeric($row[$type]) ? (int)$row[$type] : strtotime($row[$type]));
|
||||
echo "<tr><td><input type=checkbox class='change_access_rights' data-home_id='$row[home_id]' >$row[home_id]</td>
|
||||
<td>".$row['agent_ip']." (Agent)</td>
|
||||
<td>$row[game_name]</td>
|
||||
|
|
@ -305,7 +305,7 @@ function exec_ogp_module()
|
|||
echo "</table>";
|
||||
echo "<button id=\"change_access_rights_submit\" onclick=\"change_access_rights('".trim($id_type)."', '".trim($assign_id),"')\">".get_lang('change_access_rights_for_selected_servers')."</button>\n".
|
||||
"<div id='dialog' ";
|
||||
foreach ( $selections as $selection => $flag)
|
||||
foreach ((array)$selections as $selection => $flag)
|
||||
{
|
||||
echo "data-$flag=\"$selection\" ";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -116,7 +116,7 @@ function exec_ogp_module()
|
|||
{
|
||||
$dirlist['directorys'] = array_orderby($dirlist['directorys'], 'filename', SORT_ASC);
|
||||
$i = 0;
|
||||
foreach($dirlist['directorys'] as $directory)
|
||||
foreach ((array)$dirlist['directorys'] as $directory)
|
||||
{
|
||||
echo "<tr>\n".
|
||||
"<td class='folder' align=left data-item='$i' >".
|
||||
|
|
|
|||
|
|
@ -28,9 +28,9 @@ function exec_ogp_module()
|
|||
$expired_servers = $db->resultQuery("SELECT home_name, home_id, server_expiration_date FROM OGP_DB_PREFIXserver_homes WHERE server_expiration_date NOT LIKE 'X' AND server_expiration_date <= ".time().";");
|
||||
if($expired_servers)
|
||||
{
|
||||
foreach($expired_servers as $expired_server)
|
||||
foreach ((array)$expired_servers as $expired_server)
|
||||
{
|
||||
$db->logger(date('d/m/Y H:i:s', $expired_server['server_expiration_date'])." : SERVER EXPIRED: HOME ID:$expired_server[home_id] ($expired_server[home_name])");
|
||||
$db->logger(date('d/m/Y H:i:s', is_numeric($expired_server['server_expiration_date']) ? (int)$expired_server['server_expiration_date'] : strtotime($expired_server['server_expiration_date']))." : SERVER EXPIRED: HOME ID:$expired_server[home_id] ($expired_server[home_name])");
|
||||
$db->check_expire_date(0, $expired_server['home_id'], array('server'));
|
||||
}
|
||||
}
|
||||
|
|
@ -38,9 +38,9 @@ function exec_ogp_module()
|
|||
$expired_users = $db->resultQuery("SELECT user_id, home_id, user_expiration_date FROM OGP_DB_PREFIXuser_homes WHERE user_expiration_date NOT LIKE 'X' AND user_expiration_date <= ".time().";");
|
||||
if($expired_users)
|
||||
{
|
||||
foreach($expired_users as $expired_user)
|
||||
foreach ((array)$expired_users as $expired_user)
|
||||
{
|
||||
$db->logger(date('d/m/Y H:i:s', $expired_user['user_expiration_date'])." : USER ASSIGNATION EXPIRED : HOME ID:$expired_user[home_id] TO USER ID:$expired_user[user_id]");
|
||||
$db->logger(date('d/m/Y H:i:s', is_numeric($expired_user['user_expiration_date']) ? (int)$expired_user['user_expiration_date'] : strtotime($expired_user['user_expiration_date']))." : USER ASSIGNATION EXPIRED : HOME ID:$expired_user[home_id] TO USER ID:$expired_user[user_id]");
|
||||
$db->check_expire_date($expired_user['user_id'], $expired_user['home_id'], array('user'));
|
||||
}
|
||||
}
|
||||
|
|
@ -53,9 +53,9 @@ function exec_ogp_module()
|
|||
WHERE g.user_group_expiration_date NOT LIKE 'X' AND g.user_group_expiration_date <= ".time()." GROUP BY g.home_id;");
|
||||
if($expired_groups)
|
||||
{
|
||||
foreach($expired_groups as $expired_group)
|
||||
foreach ((array)$expired_groups as $expired_group)
|
||||
{
|
||||
$db->logger(date('d/m/Y H:i:s', $expired_group['user_group_expiration_date'])." : GROUP ASSIGNATION EXPIRED : HOME ID:$expired_group[home_id] TO GROUP ID:$expired_group[group_id]");
|
||||
$db->logger(date('d/m/Y H:i:s', is_numeric($expired_group['user_group_expiration_date']) ? (int)$expired_group['user_group_expiration_date'] : strtotime($expired_group['user_group_expiration_date']))." : GROUP ASSIGNATION EXPIRED : HOME ID:$expired_group[home_id] TO GROUP ID:$expired_group[group_id]");
|
||||
$db->check_expire_date($expired_group['user_id'], $expired_group['home_id'], array('user_group'));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -101,7 +101,7 @@ function exec_ogp_module()
|
|||
}
|
||||
else
|
||||
{
|
||||
foreach ( $enabled_mods as $enabled_rows )
|
||||
foreach ((array)$enabled_mods as $enabled_rows)
|
||||
{
|
||||
if ( $db->addModToGameHome($clone_home_id,
|
||||
$enabled_rows['mod_cfg_id']) === FALSE )
|
||||
|
|
@ -210,7 +210,7 @@ function exec_ogp_module()
|
|||
$assigned = $db->getHomeIpPorts($home_id);
|
||||
if( !empty($assigned) )
|
||||
{
|
||||
foreach ( $assigned as $assigned_rows )
|
||||
foreach ((array)$assigned as $assigned_rows)
|
||||
{
|
||||
echo "<p>".$assigned_rows['ip'].":".$assigned_rows['port']."</p>\n";
|
||||
}
|
||||
|
|
@ -232,7 +232,7 @@ function exec_ogp_module()
|
|||
get_lang('cpu_affinity')."</td><td>".
|
||||
get_lang('nice_level')."</td></tr>\n";
|
||||
|
||||
foreach ( $enabled_mods as $enabled_rows )
|
||||
foreach ((array)$enabled_mods as $enabled_rows)
|
||||
{
|
||||
echo "<tr>";
|
||||
echo "<td>".$enabled_rows['mod_name']."</td>";
|
||||
|
|
|
|||
|
|
@ -131,7 +131,7 @@ function exec_ogp_module()
|
|||
}
|
||||
|
||||
$found = 0;
|
||||
foreach ($save_field as $key => $value )
|
||||
foreach ((array)$save_field as $key => $value )
|
||||
{
|
||||
if($key == (string)$field['key']){
|
||||
$found++;
|
||||
|
|
@ -159,7 +159,7 @@ function exec_ogp_module()
|
|||
}
|
||||
}
|
||||
|
||||
if(is_array($updatedSettings) && count($updatedSettings) > 0){
|
||||
if(is_array($updatedSettings) && count((array)$updatedSettings) > 0){
|
||||
$db->changeCustomFields($home_info['home_id'],json_encode($updatedSettings));
|
||||
}else{
|
||||
$db->changeCustomFields($home_info['home_id'],"");
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ function logHandling($home_id, $action = 'delete', &$remote){
|
|||
$remote->exec('tar czf screenlogs/home_log_backup_'.$home_id.'.tar.gz '.implode(' ', array_keys($files)));
|
||||
}
|
||||
|
||||
foreach($files as $file => $type){
|
||||
foreach ((array)$files as $file => $type){
|
||||
if($remote->rfile_exists($file)){
|
||||
if($type == 'file'){
|
||||
$remote->exec('rm '.$file);
|
||||
|
|
@ -131,7 +131,7 @@ function exec_ogp_module() {
|
|||
$assigned = $db->getHomeIpPorts($home_id);
|
||||
if( !empty($assigned) )
|
||||
{
|
||||
foreach($assigned as $address)
|
||||
foreach ((array)$assigned as $address)
|
||||
{
|
||||
if($remote->rfile_exists( "startups/".$address['ip']."-".$address['port'] ) === 1)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ function exec_ogp_module()
|
|||
|
||||
$home_info = $db->getGameHomeWithoutMods($home_id);
|
||||
$servers_with_same_path = $db->getGameServersWithSamePath($home_info['remote_server_id'], $home_info['home_path']);
|
||||
$servers_with_same_path = (is_array($servers_with_same_path) ? count($servers_with_same_path) : 0);
|
||||
$servers_with_same_path = (is_array($servers_with_same_path) ? count((array)$servers_with_same_path) : 0);
|
||||
|
||||
$home_id = $home_info['home_id'];
|
||||
$enabled_mods = $db->getHomeMods($home_id);
|
||||
|
|
@ -51,7 +51,7 @@ function exec_ogp_module()
|
|||
{
|
||||
if( !empty($enabled_mods) )
|
||||
{
|
||||
foreach ( $enabled_mods as $enabled_rows )
|
||||
foreach ((array)$enabled_mods as $enabled_rows)
|
||||
{
|
||||
$db->delGameMod($enabled_rows['mod_id']);
|
||||
}
|
||||
|
|
@ -157,7 +157,7 @@ function exec_ogp_module()
|
|||
$ftp_accounts_list = $remote->ftp_mgr("list");
|
||||
$ftp_accounts = explode("\n",$ftp_accounts_list);
|
||||
|
||||
foreach($ftp_accounts as $ftp_account)
|
||||
foreach ((array)$ftp_accounts as $ftp_account)
|
||||
{
|
||||
if( $ftp_account != "" )
|
||||
{
|
||||
|
|
@ -252,7 +252,7 @@ function exec_ogp_module()
|
|||
$host_online = TRUE;
|
||||
$ftp_accounts_list = $remote->ftp_mgr("list");
|
||||
$ftp_accounts = explode("\n",$ftp_accounts_list);
|
||||
foreach($ftp_accounts as $ftp_account)
|
||||
foreach ((array)$ftp_accounts as $ftp_account)
|
||||
{
|
||||
if( $ftp_account != "" )
|
||||
{
|
||||
|
|
@ -364,7 +364,7 @@ function exec_ogp_module()
|
|||
$host_online = TRUE;
|
||||
$ftp_accounts_list = $remote->ftp_mgr("list");
|
||||
$ftp_accounts = explode("\n",$ftp_accounts_list);
|
||||
foreach($ftp_accounts as $ftp_account)
|
||||
foreach ((array)$ftp_accounts as $ftp_account)
|
||||
{
|
||||
if( $ftp_account != "" )
|
||||
{
|
||||
|
|
@ -422,7 +422,7 @@ function exec_ogp_module()
|
|||
$home_groups = $db->getGroupsForHome($home_info['home_id']);
|
||||
if( isset( $home_groups ) )
|
||||
{
|
||||
foreach($home_groups as $home_group)
|
||||
foreach ((array)$home_groups as $home_group)
|
||||
{
|
||||
$db->unassignHomeFrom("group",$home_group['group_id'],$home_id);
|
||||
}
|
||||
|
|
@ -455,7 +455,7 @@ function exec_ogp_module()
|
|||
{
|
||||
$home_info = $db->getGameHomeWithoutMods($home_id);
|
||||
$servers_with_same_path = $db->getGameServersWithSamePath($home_info['remote_server_id'], $home_info['home_path']);
|
||||
$servers_with_same_path = (is_array($servers_with_same_path) ? count($servers_with_same_path) : 0);
|
||||
$servers_with_same_path = (is_array($servers_with_same_path) ? count((array)$servers_with_same_path) : 0);
|
||||
|
||||
$success_json = array('result' => 'success', 'info' => get_lang("successfully_changed_game_server"));
|
||||
|
||||
|
|
@ -562,7 +562,7 @@ function exec_ogp_module()
|
|||
$cpuArray = explode(',', $_POST['cpus']);
|
||||
|
||||
// Check if a a valid core has been submitted. eg, the checkbox hasn't been manually edited.
|
||||
foreach($cpuArray as $cpu)
|
||||
foreach ((array)$cpuArray as $cpu)
|
||||
{
|
||||
if($cpu > $validCpus || !is_numeric($cpu))
|
||||
{
|
||||
|
|
@ -585,7 +585,7 @@ function exec_ogp_module()
|
|||
$result = 0;
|
||||
$cores = explode(',', $cpus);
|
||||
|
||||
foreach ($cores as $core) {
|
||||
foreach ((array)$cores as $core) {
|
||||
$coreNum = intval($core);
|
||||
$result |= (1 << $coreNum);
|
||||
}
|
||||
|
|
@ -666,7 +666,7 @@ function exec_ogp_module()
|
|||
$user = $db->getUserById($home_info['user_id_main']);
|
||||
echo "<option value='".$home_info['user_id_main']."'>".$user['users_login']."</option>\n";
|
||||
$users = $db->getUserList();
|
||||
foreach ( $users as $user ){
|
||||
foreach ((array)$users as $user){
|
||||
// Only users and admins can be assigned homes... not subusers
|
||||
if(is_null($user['users_parent'])){
|
||||
if($home_info['user_id_main'] != $user['user_id']){
|
||||
|
|
@ -771,7 +771,7 @@ function exec_ogp_module()
|
|||
else
|
||||
{
|
||||
$expiration_timestamp = is_numeric($server_expiration_ts) ? (int)$server_expiration_ts : strtotime($server_expiration_ts);
|
||||
$expiration_date = $expiration_timestamp !== FALSE ? date( "d/m/Y H:i:s", $expiration_timestamp ) : '';
|
||||
$expiration_date = $expiration_timestamp !== FALSE ? date("d/m/Y H:i:s", is_numeric($expiration_timestamp) ? (int)$expiration_timestamp : strtotime($expiration_timestamp)) : '';
|
||||
}
|
||||
|
||||
if( $master_server_home_id != FALSE AND $master_server_home_id == $home_id )
|
||||
|
|
@ -856,7 +856,7 @@ function exec_ogp_module()
|
|||
echo "<input type='hidden' name='home_id' value=\"$home_id\" />\n";
|
||||
echo get_lang("ip") .":<select name='ip' onchange='this.form.submit();'>";
|
||||
|
||||
foreach($avail_ips as $value)
|
||||
foreach ((array)$avail_ips as $value)
|
||||
{
|
||||
$selected = ( isset($_POST['ip']) and $_POST['ip'] == $value['ip_id'] ) ? "selected='selected'" : "";
|
||||
echo "<option value='".$value['ip_id']."' $selected >".$value['ip']."</option>\n";
|
||||
|
|
@ -877,11 +877,11 @@ function exec_ogp_module()
|
|||
}
|
||||
else
|
||||
{
|
||||
foreach ( $assigned as $assigned_rows )
|
||||
foreach ((array)$assigned as $assigned_rows)
|
||||
{
|
||||
$force_mod = "";
|
||||
$align = "center";
|
||||
if( !empty($enabled_mods) and count($enabled_mods) > 1 )
|
||||
if( !empty($enabled_mods) and count((array)$enabled_mods) > 1 )
|
||||
{
|
||||
$force_mod .= "<td align='left'>\n".
|
||||
"<form action='?m=user_games&p=edit&home_id=".$home_id."' method='post'>\n".
|
||||
|
|
@ -889,7 +889,7 @@ function exec_ogp_module()
|
|||
"<input type='hidden' name='port' value=".$assigned_rows['port']." />".
|
||||
"<select name='force_mod_id' onchange='this.form.submit();'>".
|
||||
"<option value='0' >". get_lang("force_mod_on_this_address") ."</option>";
|
||||
foreach($enabled_mods as $mod)
|
||||
foreach ((array)$enabled_mods as $mod)
|
||||
{
|
||||
$selected = $mod['mod_id'] == $assigned_rows['force_mod_id'] ? "selected='selected'" : "";
|
||||
$force_mod .= "<option value='".$mod['mod_id']."' $selected>".$mod['mod_name']."</option>";
|
||||
|
|
@ -920,7 +920,7 @@ function exec_ogp_module()
|
|||
else
|
||||
{
|
||||
$assigned = $db->getHomeIpPorts($home_id);
|
||||
if( !empty($assigned) and !empty($enabled_mods) and count($enabled_mods) > 1 )
|
||||
if( !empty($assigned) and !empty($enabled_mods) and count((array)$enabled_mods) > 1 )
|
||||
{
|
||||
echo "<table class='center'>\n".
|
||||
"<tr>\n".
|
||||
|
|
@ -929,7 +929,7 @@ function exec_ogp_module()
|
|||
"</td>\n".
|
||||
"</tr>\n";
|
||||
$force_mod = "";
|
||||
foreach ( $assigned as $assigned_rows )
|
||||
foreach ((array)$assigned as $assigned_rows)
|
||||
{
|
||||
$force_mod .= "<tr>\n<td align='right' style='width:50%' >".get_lang_f('switch_mod_for_address',$assigned_rows['ip'].":".$assigned_rows['port']).
|
||||
"</td>\n<td align='left' style='width:50%' >\n".
|
||||
|
|
@ -938,7 +938,7 @@ function exec_ogp_module()
|
|||
"<input type='hidden' name='port' value=".$assigned_rows['port']." />".
|
||||
"<select name='force_mod_id' onchange='this.form.submit();'>".
|
||||
"<option value='0' >". get_lang("force_mod_on_this_address") ."</option>";
|
||||
foreach($enabled_mods as $mod)
|
||||
foreach ((array)$enabled_mods as $mod)
|
||||
{
|
||||
$selected = $mod['mod_id'] == $assigned_rows['force_mod_id'] ? "selected='selected'" : "";
|
||||
$force_mod .= "<option value='".$mod['mod_id']."' $selected>".$mod['mod_name']."</option>";
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
function numbersFormatting($bytes){
|
||||
$si_prefix = array( 'B', 'KB', 'MB', 'GB', 'TB', 'EB', 'ZB', 'YB' );
|
||||
$base = 1024;
|
||||
$class = min((int)log($bytes , $base) , count($si_prefix) - 1);
|
||||
$class = min((int)log($bytes , $base) , count((array)$si_prefix) - 1);
|
||||
return sprintf('%1.2f' , $bytes / pow($base,$class)) . ' ' . $si_prefix[$class];
|
||||
}
|
||||
|
||||
|
|
@ -40,7 +40,7 @@ function exec_ogp_module()
|
|||
{
|
||||
$game_homes = $db->getGameHomes();
|
||||
$total_size = 0;
|
||||
foreach($game_homes as $game_home)
|
||||
foreach ((array)$game_homes as $game_home)
|
||||
{
|
||||
$remote = new OGPRemoteLibrary($game_home['agent_ip'], $game_home['agent_port'], $game_home['encryption_key'], $game_home['timeout']);
|
||||
$r = $remote->rfile_exists($game_home['home_path']);
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ function exec_ogp_module()
|
|||
}
|
||||
|
||||
$game_mods = $db->getAvailableModsForGameHome($home_id);
|
||||
foreach ( $game_mods as $game_mod )
|
||||
foreach ((array)$game_mods as $game_mod)
|
||||
{
|
||||
if( preg_match("/^none$/i", $game_mod['mod_name']) )
|
||||
{
|
||||
|
|
@ -81,7 +81,7 @@ function exec_ogp_module()
|
|||
echo "<form action='?m=user_games&p=edit&home_id=".$home_id."' method='post'>\n";
|
||||
echo "<input type='hidden' name='home_id' value=\"$home_id\" />\n";
|
||||
echo "<p>". get_lang("available_mods") .": <select name='mod_cfg_id'>\n";
|
||||
foreach ( $game_mods as $game_mod )
|
||||
foreach ((array)$game_mods as $game_mod)
|
||||
{
|
||||
echo "<option value='".$game_mod['mod_cfg_id']."'>".$game_mod['mod_name']."</option>\n";
|
||||
}
|
||||
|
|
@ -113,7 +113,7 @@ function exec_ogp_module()
|
|||
echo "<td><b>". get_lang("extra_cmd_line_args") ."</b></td>".
|
||||
"<td><b>". get_lang("nice_level") ."</b></td><td></td>".
|
||||
"</tr>\n";
|
||||
foreach ( $enabled_mods as $enabled_rows ) {
|
||||
foreach ((array)$enabled_mods as $enabled_rows) {
|
||||
echo "<tr id='mod_cfg_id_$enabled_rows[mod_cfg_id]'>".
|
||||
"<td><a href='?m=user_games&p=edit&mod_id=".$enabled_rows['mod_id'].
|
||||
"&home_id=$home_id&submit=delete_mod'>[ ". get_lang("remove_mod") ." ]</a><br>".
|
||||
|
|
@ -143,7 +143,7 @@ function exec_ogp_module()
|
|||
|
||||
$game_mods = $db->getAvailableModsForGameHome($home_id);
|
||||
$mods_available = 0;
|
||||
foreach ( $game_mods as $game_mod )
|
||||
foreach ((array)$game_mods as $game_mod)
|
||||
{
|
||||
if( !preg_match("/^none$/i", $game_mod['mod_name']) )
|
||||
{
|
||||
|
|
@ -156,7 +156,7 @@ function exec_ogp_module()
|
|||
echo "<form action='?m=user_games&p=edit&home_id=".$home_id."' method='post'>\n".
|
||||
"<input type='hidden' name='home_id' value=\"$home_id\" />\n".
|
||||
"<p>" . get_lang("available_mods") . ": <select name='mod_cfg_id'>\n";
|
||||
foreach ( $game_mods as $game_mod )
|
||||
foreach ((array)$game_mods as $game_mod)
|
||||
{
|
||||
echo "<option value='".$game_mod['mod_cfg_id']."'>".$game_mod['mod_name']."</option>\n";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ function exec_ogp_module()
|
|||
global $db;
|
||||
$home_info = $db->getGameHome($home_id);
|
||||
|
||||
if ( array_key_exists($mod_id, $home_info['mods']) )
|
||||
if ( array_key_exists($mod_id, (array)$home_info['mods']) )
|
||||
{
|
||||
echo "<h2>".get_lang('cmds_for')." \"".htmlentities($home_info['home_name'])."\" [Mod:".$home_info['mods'][$mod_id]['mod_name']."]</h2>";
|
||||
$server_xml = read_server_config(SERVER_CONFIG_LOCATION.$home_info['home_cfg_file']);
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ function exec_ogp_module()
|
|||
<th>".get_lang('actions')."</th></tr>";
|
||||
$i = 0;
|
||||
// sort($game_homes);
|
||||
foreach( $game_homes as $row )
|
||||
foreach ((array)$game_homes as $row)
|
||||
{
|
||||
$display_ip = checkDisplayPublicIP($row['display_public_ip'], (isset($row['ip']) and $row['ip'] != $row['agent_ip']) ? $row['ip'] : $row['agent_ip']);
|
||||
|
||||
|
|
@ -88,7 +88,7 @@ function exec_ogp_module()
|
|||
"<td class='tdh'>$row[game_name] $os_arch</td><td>$row[home_path]<br><div class='size' id='".$row["home_id"].
|
||||
"' style='cursor:pointer;' >[".get_lang('get_size')."]</div></td><td class='tdh'>";
|
||||
echo empty($row['home_name']) ? get_lang('not_available') : htmlentities($row['home_name']);
|
||||
$expiration_date = $row['server_expiration_date'] == "X" ? "X" : date('d/m/Y H:i:s', $row['server_expiration_date']);
|
||||
$expiration_date = $row['server_expiration_date'] == "X" ? "X" : date('d/m/Y H:i:s', is_numeric($row['server_expiration_date']) ? (int)$row['server_expiration_date'] : strtotime($row['server_expiration_date']));
|
||||
echo "</td><td>".$expiration_date."</td><td>
|
||||
<a href='?m=user_games&p=del&home_id=$row[home_id]'>[".get_lang('delete')."]</a>
|
||||
<a href='?m=user_games&p=edit&home_id=$row[home_id]'>[".get_lang('edit')."]</a>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue