Skip to content

Commit

Permalink
Update to 1.3.12
Browse files Browse the repository at this point in the history
  • Loading branch information
lgund committed Oct 13, 2017
1 parent c40350f commit a2ed7b4
Show file tree
Hide file tree
Showing 11 changed files with 56 additions and 55 deletions.
5 changes: 3 additions & 2 deletions php/admin/web_admin_settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,12 +126,13 @@
<h4 class="card-title"><i class="fa fa-info"></i> <?php echo $language['version_info']; ?></h4>
</div>
<div class="card-block">
<?php $versionPossible = isUpdatePossible(); ?>
<div class="row" style="padding:.75rem;">
<div class="col-lg-1"></div>
<div class="col-lg-5 col-md-6">
<?php echo $language['installed_version']; ?>:
</div>
<div class="col-lg-5 col-md-6 <?php echo (INTERFACE_VERSION == checkNewVersion()) ? "text-success" : "text-danger"; ?>" style="text-align:center;">
<div class="col-lg-5 col-md-6 <?php echo (!$versionPossible) ? "text-success" : "text-danger"; ?>" style="text-align:center;">
<?php echo INTERFACE_VERSION; ?>
</div>
<div class="col-lg-1"></div>
Expand All @@ -146,7 +147,7 @@
</div>
<div class="col-lg-1"></div>
</div>
<?php if(INTERFACE_VERSION != checkNewVersion(false)) { ?>
<?php if($versionPossible) { ?>
<div class="row" style="padding:.75rem;">
<div class="alert alert-danger">
<b><i class="fa fa-warning"></i> <?php echo $language['attention']; ?>!</b>
Expand Down
4 changes: 2 additions & 2 deletions php/admin/web_admin_user_serverpermission.php
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,6 @@ function closeModalServerEdit()
},
success: function(data)
{
console.log(data);
if(data == 'null')
{
$('.serverEditChangeClass').each(function() {
Expand All @@ -528,7 +527,8 @@ function closeModalServerEdit()
var informations = JSON.parse(data);

$('.serverEditChangeClass').each(function() {
if(typeof(informations[$(this).attr("right")]) != 'undefined')
console.log(informations[$(this).attr("right")]);
if(typeof(informations[$(this).attr("right")]) != 'undefined' && informations[$(this).attr("right")] != 'false')
{
$(this).bootstrapToggle('on');
}
Expand Down
22 changes: 21 additions & 1 deletion php/functions/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
/*
Installed Webinterface version
*/
define("INTERFACE_VERSION", "1.3.11-OPEN-BETA");
define("INTERFACE_VERSION", "1.3.12-OPEN-BETA");

/*
Anti XSS
Expand Down Expand Up @@ -204,6 +204,26 @@ function checkNewVersion($withInfo = true)
};
};

/*
Update possible
*/
function isUpdatePossible()
{
try
{
$client = new SoapClient(null, array(
'location' => 'http://wiki.first-coder.de/soap/soap_server.php',
'uri' => 'https://wiki.first-coder.de/soap/soap_server.php'
));

return $client->isUpdatePossible(INTERFACE_VERSION, DONATOR_MAIL, (SEND_VERSION == "true") ? true : false);
}
catch(Exception $e)
{
return false;
};
};

/*
Set instance config
*/
Expand Down
33 changes: 2 additions & 31 deletions php/functions/functionsSql.php
Original file line number Diff line number Diff line change
Expand Up @@ -652,12 +652,12 @@ function getCheckedClientServerEditRights($pk, $instanz, $port)
{
if(!in_array($key, $clientKeys) && strpos($clientKeys[$key][$instanz], $port) !== false)
{
unset($returnKeys[$keyname]);
$returnKeys[$keyname] = "false";
};
}
else
{
unset($returnKeys[$keyname]);
$returnKeys[$keyname] = "false";
};
};

Expand Down Expand Up @@ -1711,13 +1711,6 @@ function getUserRights($type, $key, $withTime = true, $just = "all")
$returnData[$row['rights_name']][$row['access_instanz']] = $row['access_ports'];
};
};
foreach($mysql_keys AS $name=>$key)
{
if(!isSet($returnData[$name]))
{
$returnData[$name]['key'] = "NONE";
};
};
break;
case "global":
foreach($result AS $row)
Expand All @@ -1734,13 +1727,6 @@ function getUserRights($type, $key, $withTime = true, $just = "all")
};
};
};
foreach($mysql_keys AS $name=>$key)
{
if(!isSet($returnData[$name]))
{
$returnData[$name] = "NONE";
};
};
break;
case "time":
foreach($result AS $row)
Expand All @@ -1751,14 +1737,6 @@ function getUserRights($type, $key, $withTime = true, $just = "all")
$returnData[$row['rights_name']]['time'] = $row['timestamp'];
};
};
foreach($mysql_keys AS $name=>$key)
{
if(!isSet($returnData[$name]))
{
$returnData[$name]['key'] = "NONE";
$returnData[$name]['time'] = "0";
};
};
break;
default:
foreach($result AS $row)
Expand All @@ -1774,13 +1752,6 @@ function getUserRights($type, $key, $withTime = true, $just = "all")
$returnData[$row['rights_name']][$row['access_instanz']] = $row['access_ports'];
};
};
foreach($mysql_keys AS $name=>$key)
{
if(!isSet($returnData[$name]))
{
$returnData[$name]['key'] = "NONE";
};
};
break;
};

Expand Down
4 changes: 2 additions & 2 deletions php/functions/functionsTeamspeak.php
Original file line number Diff line number Diff line change
Expand Up @@ -1874,7 +1874,7 @@ function getTeamspeakslotsArray($serverList, $instanz, $forceInfo = false)
{
if(isSet($server['virtualserver_clientsonline']) && isSet($server['virtualserver_queryclientsonline']) && isSet($server['virtualserver_maxclients']))
{
if(strpos($user_right['right_web_server_view'][$instanz], $server['virtualserver_port']) !== false || $user_right['right_web_global_server']['key'] == $mysql_keys['right_web_global_server'])
if(isPortPermission($user_right, $instanz, $server['virtualserver_port'], 'right_web_server_view') || $user_right['right_web_global_server']['key'] == $mysql_keys['right_web_global_server'])
{
$returnArray[0]['virtualserver_clientsonline'] = $returnArray[0]['virtualserver_clientsonline'] + ($server['virtualserver_clientsonline'] - $server['virtualserver_queryclientsonline']);
$returnArray[0]['virtualserver_maxclients'] = $returnArray[0]['virtualserver_maxclients'] + $server['virtualserver_maxclients'];
Expand All @@ -1889,7 +1889,7 @@ function getTeamspeakslotsArray($serverList, $instanz, $forceInfo = false)
$newServerList = array();
foreach($serverList AS $server)
{
if(strpos($user_right['right_web_server_view'][$instanz], $server['virtualserver_port']) !== false || $user_right['right_web_global_server']['key'] == $mysql_keys['right_web_global_server'])
if(isPortPermission($user_right, $instanz, $server['virtualserver_port'], 'right_web_server_view') || $user_right['right_web_global_server']['key'] == $mysql_keys['right_web_global_server'])
{
$server['virtualserver_clientsonline'] = $server['virtualserver_clientsonline'] - $server['virtualserver_queryclientsonline'];
$newServerList[] = $server;
Expand Down
2 changes: 1 addition & 1 deletion php/main/web_main.php
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@
logged = '<?php echo ($LoggedIn) ? "true" : "false"; ?>',
wantServer = new Array(),
checkClientInterval = <?php echo CHECK_CLIENT_PERMS; ?>,
updateAvalible = "<?php echo (checkNewVersion(false) != INTERFACE_VERSION) ? "true" : "false"; ?>",
updateAvalible = "<?php echo (isUpdatePossible()) ? "true" : "false"; ?>",
hasPermission = "<?php echo $hasPermission; ?>",
timer = 10,
emailRegex = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
Expand Down
11 changes: 5 additions & 6 deletions php/profile/web_profil_dashboard.php
Original file line number Diff line number Diff line change
Expand Up @@ -192,24 +192,24 @@
</thead>
<tbody class="table-dashboard">
<?php foreach($getTeamspeakInfo AS $server) {
if(strpos($user_right['right_web_server_view'][$instanz], $server['virtualserver_port']) !== false || $user_right['right_web_global_server']['key'] == $mysql_keys['right_web_global_server']) { ?>
if(isPortPermission($user_right, $instanz, $server['virtualserver_port'], 'right_web_server_view') || $user_right['right_web_global_server']['key'] == $mysql_keys['right_web_global_server']) { ?>
<tr class="rightClickContextMenu" onClick="showTeamspeakserver('<?php echo $server['virtualserver_id']; ?>', '<?php echo $instanz; ?>');">
<td port="<?php echo $server['virtualserver_port']; ?>" instanz="<?php echo $instanz; ?>" sid="<?php echo $server['virtualserver_id']; ?>"
permission="<?php echo (strpos($user_right['right_web_server_start_stop'][$instanz], $server['virtualserver_port']) !== false || $user_right['right_web_global_server']['key'] == $mysql_keys['right_web_global_server']) ? "true" : "false"; ?>">
permission="<?php echo (isPortPermission($user_right, $instanz, $server['virtualserver_port'], 'right_web_server_start_stop') || $user_right['right_web_global_server']['key'] == $mysql_keys['right_web_global_server']) ? "true" : "false"; ?>">
<?php xssEcho($server['virtualserver_name']); ?>
</td>
<td style="text-align: center;" port="<?php echo $server['virtualserver_port']; ?>" instanz="<?php echo $instanz; ?>" sid="<?php echo $server['virtualserver_id']; ?>"
permission="<?php echo (strpos($user_right['right_web_server_start_stop'][$instanz], $server['virtualserver_port']) !== false || $user_right['right_web_global_server']['key'] == $mysql_keys['right_web_global_server']) ? "true" : "false"; ?>">
permission="<?php echo (isPortPermission($user_right, $instanz, $server['virtualserver_port'], 'right_web_server_start_stop') || $user_right['right_web_global_server']['key'] == $mysql_keys['right_web_global_server']) ? "true" : "false"; ?>">
<?php echo $server['virtualserver_port']; ?>
</td>
<td port="<?php echo $server['virtualserver_port']; ?>" instanz="<?php echo $instanz; ?>" sid="<?php echo $server['virtualserver_id']; ?>" style="text-align: center;cursor: pointer !important;"
id="status-<?php echo $instanz; ?>-<?php echo $server['virtualserver_id']; ?>" class="<?php echo ($server['virtualserver_status'] == "online") ? "text-success" : "text-danger"; ?>"
permission="<?php echo (strpos($user_right['right_web_server_start_stop'][$instanz], $server['virtualserver_port']) !== false || $user_right['right_web_global_server']['key'] == $mysql_keys['right_web_global_server']) ? "true" : "false"; ?>">
permission="<?php echo (isPortPermission($user_right, $instanz, $server['virtualserver_port'], 'right_web_server_start_stop') || $user_right['right_web_global_server']['key'] == $mysql_keys['right_web_global_server']) ? "true" : "false"; ?>">
<?php xssEcho($server['virtualserver_status']); ?>
</td>
<td style="text-align: center;" port="<?php echo $server['virtualserver_port']; ?>" instanz="<?php echo $instanz; ?>" sid="<?php echo $server['virtualserver_id']; ?>"
id="clients-<?php echo $instanz; ?>-<?php echo $server['virtualserver_id']; ?>"
permission="<?php echo (strpos($user_right['right_web_server_start_stop'][$instanz], $server['virtualserver_port']) !== false || $user_right['right_web_global_server']['key'] == $mysql_keys['right_web_global_server']) ? "true" : "false"; ?>">
permission="<?php echo (isPortPermission($user_right, $instanz, $server['virtualserver_port'], 'right_web_server_start_stop') || $user_right['right_web_global_server']['key'] == $mysql_keys['right_web_global_server']) ? "true" : "false"; ?>">
<?php if($server['virtualserver_status'] == "online")
{
echo $server['virtualserver_clientsonline']." / ".$server['virtualserver_maxclients'];
Expand All @@ -226,7 +226,6 @@
</table>
</div>
</div>
<p style="text-align: center;margin-top: 10px;"><?php echo $language['dashbord_right_click_info']; ?></p>
<?php }; ?>

<ul id="contextMenu" class="dropdown-menu" role="menu" >
Expand Down
6 changes: 3 additions & 3 deletions php/teamspeak/web_teamspeak_serverview_modal_channelview.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
/*
Has the Client the Permission
*/
if((strpos($user_right['right_web_server_view'][$_REQUEST['instanz']], $_REQUEST['port']) === false && $user_right['right_web_global_server']['key'] != $mysql_keys['right_web_global_server']) || $user_right['right_web']['key'] != $mysql_keys['right_web'])
if((!isPortPermission($user_right, $_REQUEST['instanz'], $_REQUEST['port'], 'right_web_server_view') && $user_right['right_web_global_server']['key'] != $mysql_keys['right_web_global_server']) || $user_right['right_web']['key'] != $mysql_keys['right_web'])
{
reloadSite(RELOAD_TO_SERVERVIEW);
};
Expand Down Expand Up @@ -91,7 +91,7 @@
<a class="nav-link active" href="#channelInformations" data-toggle="tab"><?php echo $language['informations']; ?></a>
</li>
<li class="nav-item channelViewPills">
<?php if(strpos($user_right['right_web_channel_actions'][$_REQUEST['instanz']], $_REQUEST['port']) !== false || $user_right['right_web_global_server']['key'] == $mysql_keys['right_web_global_server']) { ?>
<?php if(isPortPermission($user_right, $_REQUEST['instanz'], $_REQUEST['port'], 'right_web_channel_actions') || $user_right['right_web_global_server']['key'] == $mysql_keys['right_web_global_server']) { ?>
<a class="nav-link" href="#channelActions" data-toggle="tab"><?php echo $language['actions']; ?></a>
<?php } else { ?>
<a class="nav-link disabled" href="#"><?php echo $language['actions']; ?></a>
Expand Down Expand Up @@ -248,7 +248,7 @@
<div class="col-lg-3 col-md-3"></div>
</div>
</div>
<?php if(strpos($user_right['right_web_channel_actions'][$_REQUEST['instanz']], $_REQUEST['port']) !== false || $user_right['right_web_global_server']['key'] == $mysql_keys['right_web_global_server']) { ?>
<?php if(isPortPermission($user_right, $_REQUEST['instanz'], $_REQUEST['port'], 'right_web_channel_actions') || $user_right['right_web_global_server']['key'] == $mysql_keys['right_web_global_server']) { ?>
<div class="tab-pane" id="channelActions">
<table class="table table-condensed">
<thead>
Expand Down
10 changes: 5 additions & 5 deletions php/teamspeak/web_teamspeak_serverview_modal_clientview.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
/*
Has the Client the Permission
*/
if((strpos($user_right['right_web_server_view'][$_REQUEST['instanz']], $_REQUEST['port']) === false && $user_right['right_web_global_server']['key'] != $mysql_keys['right_web_global_server']) || $user_right['right_web']['key'] != $mysql_keys['right_web'])
if((!isPortPermission($user_right, $_REQUEST['instanz'], $_REQUEST['port'], 'right_web_server_view') && $user_right['right_web_global_server']['key'] != $mysql_keys['right_web_global_server']) || $user_right['right_web']['key'] != $mysql_keys['right_web'])
{
reloadSite(RELOAD_TO_SERVERVIEW);
};
Expand Down Expand Up @@ -118,14 +118,14 @@ function getTime($timestamp)
<a class="nav-link active" href="#clientInformations" data-toggle="tab"><?php echo $language['informations']; ?></a>
</li>
<li class="nav-item clientViewPills">
<?php if(strpos($user_right['right_web_client_actions'][$_REQUEST['instanz']], $_REQUEST['port']) !== false || $user_right['right_web_global_server']['key'] == $mysql_keys['right_web_global_server']) { ?>
<?php if(isPortPermission($user_right, $_REQUEST['instanz'], $_REQUEST['port'], 'right_web_client_actions') || $user_right['right_web_global_server']['key'] == $mysql_keys['right_web_global_server']) { ?>
<a class="nav-link" href="#clientActions" data-toggle="tab"><?php echo $language['actions']; ?></a>
<?php } else { ?>
<a class="nav-link disabled" href="#"><?php echo $language['actions']; ?></a>
<?php } ?>
</li>
<li class="nav-item clientViewPills">
<?php if(strpos($user_right['right_web_client_rights'][$_REQUEST['instanz']], $_REQUEST['port']) !== false || $user_right['right_web_global_server']['key'] == $mysql_keys['right_web_global_server']) { ?>
<?php if(isPortPermission($user_right, $_REQUEST['instanz'], $_REQUEST['port'], 'right_web_client_rights') || $user_right['right_web_global_server']['key'] == $mysql_keys['right_web_global_server']) { ?>
<a class="nav-link" href="#clientRights" data-toggle="tab"><?php echo $language['permission']; ?></a>
<?php } else { ?>
<a class="nav-link disabled" href="#"><?php echo $language['permission']; ?></a>
Expand Down Expand Up @@ -358,7 +358,7 @@ function getTime($timestamp)
</tbody>
</table>
</div>
<?php if(strpos($user_right['right_web_client_actions'][$_REQUEST['instanz']], $_REQUEST['port']) !== false || $user_right['right_web_global_server']['key'] == $mysql_keys['right_web_global_server']) { ?>
<?php if(isPortPermission($user_right, $_REQUEST['instanz'], $_REQUEST['port'], 'right_web_client_actions') || $user_right['right_web_global_server']['key'] == $mysql_keys['right_web_global_server']) { ?>
<div class="tab-pane" id="clientActions">
<table class="table table-condensed table-hover">
<thead>
Expand Down Expand Up @@ -445,7 +445,7 @@ function getTime($timestamp)
</div>
</div>
<?php } ?>
<?php if(strpos($user_right['right_web_client_rights'][$_REQUEST['instanz']], $_REQUEST['port']) !== false || $user_right['right_web_global_server']['key'] == $mysql_keys['right_web_global_server']) { ?>
<?php if(isPortPermission($user_right, $_REQUEST['instanz'], $_REQUEST['port'], 'right_web_client_rights') || $user_right['right_web_global_server']['key'] == $mysql_keys['right_web_global_server']) { ?>
<div class="tab-pane" id="clientRights">
<table class="table table-condensed table-hover">
<thead>
Expand Down
10 changes: 10 additions & 0 deletions updater/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,16 @@
};
};

// Check local config
if(!is_writable(__dir__."/../config/config.php"))
{
if(!chmod(__dir__."/../config/config.php", 0666))
{
echo '<li>config/config.php........... FAILED (CAN NOT SET PERMISSION TO 0666)</li>';
$permissionCheck = false;
};
};

$zipHandle = zip_open($filename);
if($permissionCheck)
{
Expand Down
4 changes: 2 additions & 2 deletions updater/updater.php
Original file line number Diff line number Diff line change
Expand Up @@ -165,12 +165,12 @@
$tmpVersion = false;
foreach($versionList AS $version)
{
if($version == INTERFACE_VERSION)
if($version == INTERFACE_VERSION && $updatePossible != 0)
{
$tmpVersion = true;
echo "<tr class=\"text-warning\"><td>".$version."</td><td>".$language['current_version']."</td><td><button onClick=\"ShowChangelog('".$tmpVersionNumber."', false)\" class=\"btn btn-sm btn-secondary\">".$language['changelog']."</button></td></tr>";
}
else if(!$tmpVersion)
else if(!$tmpVersion && $updatePossible != 0)
{
if($updatePossible == $tmpVersionNumber)
{
Expand Down

0 comments on commit a2ed7b4

Please sign in to comment.