<?php

if (!isset($gCms)) exit;


if (! $this->CheckPermission('Use Play'))
	return $this->DisplayErrorPage($id, $params, $returnid,$this->Lang('accessdenied'));


include_once dirname(__FILE__).'/class.player.php';

$oldplayerid = isset($params['playerid']) ? $params['playerid'] : -1;


$player = new pPlayer();
if (!$player->loaddb($oldplayerid))
	return $this->DisplayErrorPage($id, $params, $returnid,$this->Lang('error_unknownplayer'));


$player->name .= ' ('.$this->lang('copy').')';
$player->locked = false;
$params['playerid'] = 'new';
$player->id = 'new';

require_once(dirname(__FILE__).'/action.editplayer.php');


?>