PDA

View Full Version : Libacts2 Setting Permissions Error


crazyandy
10-07-2008, 16:32
Hello,

I am trying to set permission for server admin and I am getting error.

What I am doing is setting the variables for each permission to 0 or 1 and then passing them into the array as shown below:

$http->writeGroupPermissions(Absurd_TeamSpeak2_HTTPClient ::SERVER_ADMIN, array(
'ugSA_upAccessWebAdminServer' => $ugSA_upAccessWebAdminServer,
'ugSA_upAccessTcpServer' => $ugSA_upAccessTcpServer,
'ugSA_upAccessVoice' => $ugSA_upAccessVoice,
'ugSA_upAdminRegisterPlayer' => $ugSA_upAdminRegisterPlayer,
'ugSA_upAdminListDBUsers' => $ugSA_upAdminListDBUsers,
'ugSA_upAdminChangeOwnPassword' => $ugSA_upAdminChangeOwnPassword,
'ugSA_upAdminChangeUserPassword' => $ugSA_upAdminChangeUserPassword,
'ugSA_upAdminSetServerPermissions' => $ugSA_upAdminSetServerPermissions,
'ugSA_upAdminEditServerWebpostUrl' => $ugSA_upAdminEditServerWebpostUrl,
'ugSA_upAdminEditServerName' => $ugSA_upAdminEditServerName,
'ugSA_upAdminEditServerWelcomeMessage' => $ugSA_upAdminEditServerWelcomeMessage,
'ugSA_upAdminEditServerPassword' => $ugSA_upAdminEditServerPassword,
'ugSA_upAdminEditServerType' => $ugSA_upAdminEditServerType,
'ugSA_upAdminEditServerAllodCodecs' => $ugSA_upAdminEditServerAllodCodecs,
'ugSA_upAdminBanIp' => $ugSA_upAdminBanIp,
'ugSA_upAdminMovePlayer' => $ugSA_upAdminMovePlayer,
'ugSA_upAdminStopServer' => $ugSA_upAdminStopServer,
'ugSA_upAdminStartServer' => $ugSA_upAdminStartServer,
'ugSA_upChannelJoinRegisterred' => $ugSA_upChannelJoinRegisterred,
'ugSA_upChannelCreateRegisterred' => $ugSA_upChannelCreateRegisterred,
'ugSA_upChannelCreateUnregisterred' => $ugSA_upChannelCreateUnregisterred,
'ugSA_upChannelCreateDefault' => $ugSA_upChannelCreateDefault,
'ugSA_upChannelCreateSubchannels' => $ugSA_upChannelCreateSubchannels,
'ugSA_upChannelCreateModerated' => $ugSA_upChannelCreateModerated,
'ugSA_upChannelDelete' => $ugSA_upChannelDelete,
'ugSA_upChannelEditName' => $ugSA_upChannelEditName,
'ugSA_upChannelEditPassword' => $ugSA_upChannelEditPassword,
'ugSA_upChannelEditTopic' => $ugSA_upChannelEditTopic,
'ugSA_upChannelEditDescription' => $ugSA_upChannelEditDescription,
'ugSA_upChannelEditOrder' => $ugSA_upChannelEditOrder,
'ugSA_upChannelEditMaxUsers' => $ugSA_upChannelEditMaxUsers,
'ugSA_upChannelEditCodec' => $ugSA_upChannelEditCodec,
'ugSA_upChannelJoinChannelWithoutPassword' => $ugSA_upChannelJoinChannelWithoutPassword,
'ugSA_upPrivilegeGrantSA' => $ugSA_upPrivilegeGrantSA,
'ugSA_upPrivilegeGrantCA' => $ugSA_upPrivilegeGrantCA,
'ugSA_upPrivilegeGrantAutoOp' => $ugSA_upPrivilegeGrantAutoOp,
'ugSA_upPrivilegeGrantOp' => $ugSA_upPrivilegeGrantOp,
'ugSA_upPrivilegeGrantAutoV' => $ugSA_upPrivilegeGrantAutoV,
'ugSA_upPrivilegeGrantV' => $ugSA_upPrivilegeGrantV,
'ugSA_upPrivilegeGrantAllowRegistration' => $ugSA_upPrivilegeGrantAllowRegistration,
'ugSA_upPrivilegeRevokeSA' => $ugSA_upPrivilegeRevokeSA,
'ugSA_upPrivilegeRevokeCA' => $ugSA_upPrivilegeRevokeCA,
'ugSA_upPrivilegeRevokeAutoOp' => $ugSA_upPrivilegeRevokeAutoOp,
'ugSA_upPrivilegeRevokeOp' => $ugSA_upPrivilegeRevokeOp,
'ugSA_upPrivilegeRevokeAutoV' => $ugSA_upPrivilegeRevokeAutoV,
'ugSA_upPrivilegeRevokeV' => $ugSA_upPrivilegeRevokeV,
'ugSA_upPrivilegeRevokeAllowRegistration' => $ugSA_upPrivilegeRevokeAllowRegistration,
'ugSA_upPrivilegeAdminPlayerRegister' => $ugSA_upPrivilegeAdminPlayerRegister,
'ugSA_upPrivilegePlayerDelete' => $ugSA_upPrivilegePlayerDelete,
'ugSA_upPrivilegeRegisterSelfByDefault' => $ugSA_upPrivilegeRegisterSelfByDefault,
'ugSA_upSendTextToAll' => $ugSA_upSendTextToAll,
'ugSA_upSendTextToOwnChannel' => $ugSA_upSendTextToOwnChannel,
'ugSA_upSendTextToAllChannel' => $ugSA_upSendTextToAllChannel,
'ugSA_upSendTextToPlayer' => $ugSA_upSendTextToPlayer,
'ugSA_upKickPlayerFromServer' => $ugSA_upKickPlayerFromServer,
'ugSA_upKickPlayerFromChannel' => $ugSA_upKickPlayerFromChannel,
'ugSA_upAllowChannelCommanderStatus' => $ugSA_upAllowChannelCommanderStatus
));


For some reason it is comming up with this error:

Fatal error: Uncaught exception 'Absurd_IO_Exception' with message 'unable to read data from TCP string' in
/home/ts/public_html/tspanel/Absurd/Network/TextClient.php:131 Stack trace: #0
/home/ts/public_html/tspanel/Absurd/TeamSpeak2/HTTPClient.php(238): Absurd_Network_TextClient->readLine() #1
/home/ts/public_html/tspanel/Absurd/TeamSpeak2/HTTPClient.php(220): Absurd_TeamSpeak2_HTTPClient->read() #2
/home/ts/public_html/tspanel/Absurd/TeamSpeak2/HTTPClient.php(320): Absurd_TeamSpeak2_HTTPClient->post('/permissions_se...', Array) #3
/home/ts/public_html/tspanel/serveradmin_permissions.php(619): Absurd_TeamSpeak2_HTTPClient->writeGroupPermissions('sa', Array) #4
/home/ts/public_html/tspanel/main.php(158): include('/home/ts/public...') #5
{main} thrown in /home/ts/public_html/tspanel/Absurd/Network/TextClient.php on line 131


The same code style works for channel admin, operator and voice.
Registered and Unregistered just come up with:

unable to read data from TCP string

Theres no stack trace.

Has anyone got any ideas?


Thanks Andy

Claw
11-07-2008, 13:42
The TeamSpeak 2 Webserver sucks, and so these do not work every time, you have to life with this "bug".

crazyandy
11-07-2008, 13:59
Well I did notice that the permissions are getting set ok, but it just dosnt look professional having errors come up in your script.

So there is no work around or a better way of setting the permissions?


Andy

Claw
11-07-2008, 18:15
Nope. There isn't a better way

ScP
11-07-2008, 19:42
The only other way to set the permissions is to query the database directly using sql commands. Remote controlling the built-in web administration interface is still the most effective way.

crazyandy
12-07-2008, 18:24
So the way i have it is the best way?

If it is only an error that pops up from time to time, then I think I can live with it, as it is still setting the permissions.
And after I restarted the server it seems to be working properly now.

I dont realy want to use sql commands because restarting the virtual server every time would be anoying.

Well thanks for the help with this and it seems to have sorted its self, for now anyway.


Thanks all,
Andy