phpVMS creators,
In my efforts to create a system that generates TeamSpeak Privilege keys, I decided that the best way to do it was to create a new core module. I've written all the necessary code, and uploaded it to the server, but when I select the page in the navigation bar, it comes back with an HTTP Error 500. I've looked through the code, and haven't found any reason why this would be happening.
Keys.php
<?php
/**
* phpVMS - Virtual Airline Administration Software
* Copyright (c) 2008 Nabeel Shahzad
* For more information, visit www.phpvms.net
* Forums: http://www.phpvms.net/forum
* Documentation: http://www.phpvms.net/docs
*
* phpVMS is licenced under the following license:
* Creative Commons Attribution Non-commercial Share Alike (by-nc-sa)
* View license.txt in the root, or visit http://creativecommons.org/licenses/by-nc-sa/3.0/
*
* @author Nabeel Shahzad
* @copyright Copyright (c) 2008, Nabeel Shahzad
* @link http://www.phpvms.net
* @license http://creativecommons.org/licenses/by-nc-sa/3.0/
*/
class Keys extends CodonModule{
public function index(){
if(PilotGroups::groups_has_perm(Auth::$usergroups, ACCESS_ADMIN))
{
$group = "Server Admin";
}else if(PilotGroups::groups_has_perm(Auth::$usergroups, EDIT_NEWS))
{
$group = "Instructor";
}else if(PilotGroups::groups_has_perm(Auth::$usergroups, EDIT_PILOTS)){
$group = "Hub Manager";
}else{
$group = "BVA Pilot";
}
// load framework files
require_once("britishvirginatlantic.co.uk/lib/ts3phpframework-master/libraries/TeamSpeak3/TeamSpeak3.php");
// connect to local server, authenticate and spawn an object for the virtual server on port 9987
$ts3_VirtualServer = TeamSpeak3::factory("serverquery://username:password@100.1.58.158:10011/?server_port=9987");
// spawn an object for the group using a specified name
$arr_ServerGroup = $ts3_VirtualServer->serverGroupGetByName($group);
// create the privilege key
$ts3_PrivilegeKey = $arr_ServerGroup->privilegeKeyCreate();
return $ts3_PriviledgeKey;
if($group!=""){
$this->set('key', genKey());
$this->render('key_generated.tpl');
return;
}else{
$this->set('message','Key unable to be generated. Try again later.');
$this->render('core_error.tpl');
return;
}
}
}
?>
key_generated.tpl
<p>Your Key:</p>
<p><?php echo $key ?></p>
Any ideas as to why this causes an HTTP error, and how I could fix it? Thanks.