forked from iopietro/Travianz-Legacy
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
284 additions
and
3,858 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?php | ||
|
||
namespace App\FrontModule\Presenters; | ||
|
||
use Nette; | ||
|
||
class LoginPresenter extends Nette\Application\UI\Presenter | ||
{ | ||
public function actionDefault() | ||
{ | ||
|
||
} | ||
|
||
|
||
public function renderDefault() | ||
{ | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
<?php | ||
|
||
namespace App\FrontModule\Presenters; | ||
|
||
use App; | ||
use Nette; | ||
|
||
class RegisterPresenter extends Nette\Application\UI\Presenter | ||
{ | ||
/** @var App\FrontModule\Model\User\UserModel @inject */ | ||
public $userModel; | ||
|
||
/** @var App\FrontModule\Model\User\RegisterService @inject */ | ||
public $registerService; | ||
|
||
public function actionDefault() | ||
{ | ||
|
||
} | ||
|
||
|
||
public function renderDefault() | ||
{ | ||
|
||
} | ||
|
||
protected function createComponentRegisterForm() | ||
{ | ||
$form = new Nette\Application\UI\Form(); | ||
|
||
$form->addText('nickname', 'Nickname') | ||
->setRequired(); | ||
|
||
$form->addText('email', 'Email') | ||
->setRequired(); | ||
|
||
$form->addPassword('password', 'Password') | ||
->setRequired(); | ||
|
||
$form->addRadioList('tribe', 'Choose tribe', [ | ||
1 => 'Romans', | ||
2 => 'Teutons', | ||
3 => 'Gauls', | ||
]) | ||
->setRequired(); | ||
|
||
$form->addRadioList('position', 'Starting position', [ | ||
0 => 'Random', | ||
1 => 'North west (+|-)', | ||
2 => 'South west (-|-)', | ||
3 => 'North east (+|+)', | ||
4 => 'South east (+|-)', | ||
]) | ||
->setDefaultValue(0) | ||
->setRequired(); | ||
|
||
$form->addCheckbox('accept', 'I accept the game rules and general terms and conditions.') | ||
->setRequired(); | ||
|
||
$form->addSubmit('signup', 'Signup'); | ||
|
||
$form->onSuccess[] = [$this, 'processRegistration']; | ||
|
||
return $form; | ||
} | ||
|
||
|
||
public function processRegistration(Nette\Application\UI\Form $form) | ||
{ | ||
$values = $form->getValues(); | ||
|
||
$existingUser = $this->userModel->getByEmail($values->email); | ||
if ($existingUser) { | ||
$this->flashMessage('Email allready exists'); | ||
$this->redirect(':Front:Register:default'); | ||
} | ||
|
||
$this->registerService->createUser($values); | ||
|
||
$this->redirect(':Front:Login:default'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | ||
<html xmlns="http://www.w3.org/1999/xhtml"> | ||
<head> | ||
<title>Spamian</title> | ||
<link rel="shortcut icon" href="{$baseUrl}/favicon.ico" /> | ||
<meta name="content-language" content="en" /> | ||
<meta http-equiv="cache-control" content="max-age=0" /> | ||
<meta http-equiv="imagetoolbar" content="no" /> | ||
<meta http-equiv="content-type" content="text/html; charset=UTF-8" /> | ||
<script src="{$baseUrl}/mt-core.js" type="text/javascript"></script> | ||
<script src="{$baseUrl}/unx.js" type="text/javascript"></script> | ||
<script src="{$baseUrl}/new.js" type="text/javascript"></script> | ||
<link href="{$baseUrl}/gpack/travian_default/lang/en/compact.css" rel="stylesheet" type="text/css" /> | ||
<link href="{$baseUrl}/gpack/travian_default/lang/en/lang.css" rel="stylesheet" type="text/css" /> | ||
<link href="{$baseUrl}/gpack/travian_default/travian.css" rel="stylesheet" type="text/css" /> | ||
</head> | ||
<body n:class="isset($bodyClass) ? $bodyClass : ''"> | ||
{include content} | ||
|
||
{include ../../Templates/footer.latte} | ||
<div id="ce"></div> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{var bodyClass = 'v35 ie ie7'} | ||
{layout '../@layoutGame.latte'} | ||
{block content} | ||
|
||
{/block} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
{var bodyClass = 'v35 ie ie7'} | ||
{layout '../@layoutGame.latte'} | ||
{block content} | ||
<div class="wrapper"> | ||
<div id="dynamic_header"> | ||
</div> | ||
<div id="header"></div> | ||
<div id="mid"> | ||
<div id="side_navi"> | ||
<a id="logo" n:href=":Front:Homepage:default" name="logo"><img src="{$baseUrl}/img/x.gif" alt="Travian"></a> | ||
|
||
<p> | ||
<a n:href=":Front:Homepage:default">Homepage</a> | ||
<a n:href=":Front:Login:default">Login</a> | ||
<a n:href=":Front:Register:default">Registration</a> | ||
</p> | ||
</div> | ||
</div> | ||
|
||
<div id="content" class="signup"> | ||
|
||
<h1><img src="{$baseUrl}/img/x.gif" class="anmelden" alt="register for the game"></h1> | ||
<h5><img src="{$baseUrl}/img/x.gif" class="img_u05" alt="registration"/></h5> | ||
|
||
<p> | ||
Before you register an account you should read the <a href='{$baseUrl}/anleitung.php' target='_blank'>instructions</a> of Travian ro1 to see the specific advantages and disadvantages of the three tribes. | ||
</p> | ||
{foreach $flashes as $flash} | ||
<div class="flash {$flash->type}">{$flash->message}</div> | ||
{/foreach} | ||
|
||
{control registerForm} | ||
|
||
<p class="info">Each player may only own ONE account per server.</p> | ||
</div> | ||
<div id="ce"></div> | ||
<div id="side_info" class="outgame"> | ||
|
||
<div class="clear"></div> | ||
</div> | ||
|
||
<div class="footer-stopper outgame"></div> | ||
<div class="clear"></div> | ||
</div> | ||
{/block} |
Oops, something went wrong.