Wruczek / ts-website

A website for your TeamSpeak 3 server
https://ts.wruczek.tech
GNU General Public License v3.0
333 stars 80 forks source link

Channel which should be private is subscribed #192

Closed TrickShotMLG02 closed 3 years ago

TrickShotMLG02 commented 3 years ago

I have one channel called private, which can't be subscribed by any servergroup. But the query does. How can I fix this?

Wruczek commented 3 years ago

To hide a channel from TS-website viewer you can either:

TrickShotMLG02 commented 3 years ago

I can't find viewer_hidden_channel_ids in the configtable of the mysqldb

Wruczek commented 3 years ago

My bad, the change in not in any release. I would need to publish a release, or you can update your viewer.php file to the one in the repo and then add a new config row to the config table:

INSERT INTO `tsw_config` (`identifier`, `type`, `value`, `user_editable`) VALUES ('viewer_hidden_channel_ids', 'JSON', '[]', 1);

Then you can set viewer_hidden_channel_ids to the IDs you want.

TrickShotMLG02 commented 3 years ago

I will try it this afternoon. Thank you for your fast reply

TrickShotMLG02 commented 3 years ago

I have added the channelid to the db and it is still displaying the channel on the webpage with all the clients which are inside (After 15 Minutes)

Wruczek commented 3 years ago

Are you sure you have updated the viewer.php file?

TrickShotMLG02 commented 3 years ago

I think so. I will try it again

TrickShotMLG02 commented 3 years ago

It was exact the same content as mentioned previously, so everything should be correct

TrickShotMLG02 commented 3 years ago

I think I know what the problem is

This is the constructor of the ViewerRenderer:

`public function __construct($imgPath) { $this->imgPath = $imgPath;

    $cm = CacheManager::i();
    $this->serverInfo = $cm->getServerInfo();
    $this->channelList = $cm->getChannelList();
    $this->clientList = $cm->getClientList();
    $this->serverGroupList = $cm->getServerGroupList();
    $this->channelGroupList = $cm->getChannelGroupList();
}

`

And this constructor is getting called $viewerRenderer = new ViewerRenderer("img/ts-icons", Config::get("viewer_hidden_channel_ids"));

I believe, that I also need to update the constructor so there is support for both parameters. Am I right?

TrickShotMLG02 commented 3 years ago

I have fixed it, by copying the ViewerRenderer.php from your repo and replacing my old one.

Wruczek commented 3 years ago

You are right, more files need to bed edited. I really should publish a new release.

TrickShotMLG02 commented 3 years ago

Maybe. But you have done a great job with this project. Keep it up.

Wruczek commented 3 years ago

We can keep this issue closed, publishing a new release should be a separate issue.