-
-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #105 from et-nik/develop
Redesigned UI
- Loading branch information
Showing
412 changed files
with
30,929 additions
and
26,310 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,5 +17,4 @@ public function getHeaders() | |
{ | ||
return []; | ||
} | ||
|
||
} |
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
19 changes: 19 additions & 0 deletions
19
app/Exceptions/Repositories/InvalidCertificateException.php
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 Gameap\Exceptions\Repositories; | ||
|
||
use Gameap\Exceptions\Http\HttpException; | ||
use Illuminate\Http\Response; | ||
|
||
class InvalidCertificateException extends HttpException | ||
{ | ||
public function getStatusCode() | ||
{ | ||
return Response::HTTP_UNPROCESSABLE_ENTITY; | ||
} | ||
|
||
public function getHeaders() | ||
{ | ||
return []; | ||
} | ||
} |
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,57 @@ | ||
<?php | ||
|
||
namespace Gameap\Http\Controllers\API; | ||
|
||
use Gameap\Http\Controllers\Controller; | ||
use Illuminate\Foundation\Auth\AuthenticatesUsers; | ||
use Illuminate\Http\Request; | ||
|
||
class AuthController extends Controller | ||
{ | ||
use AuthenticatesUsers; | ||
|
||
/** | ||
* @var Request | ||
*/ | ||
protected $request; | ||
|
||
/** | ||
* The maximum number of attempts to allow. | ||
* @var int | ||
*/ | ||
protected $maxAttempts = 5; | ||
|
||
/** | ||
* Number of minutes to throttle for. | ||
* | ||
* @var int | ||
*/ | ||
protected $decayMinutes = 3; | ||
|
||
/** | ||
* Create a new controller instance. | ||
* | ||
* @param \Illuminate\Http\Request $request | ||
* @return void | ||
*/ | ||
public function __construct(Request $request) | ||
{ | ||
$this->request = $request; | ||
} | ||
|
||
/** | ||
* Get the login username to be used by the controller. | ||
* | ||
* @return string | ||
*/ | ||
public function username() | ||
{ | ||
$field = filter_var($this->request->get('login'), FILTER_VALIDATE_EMAIL) | ||
? 'email' | ||
: 'login'; | ||
|
||
$this->request->merge([$field => $this->request->get('login')]); | ||
|
||
return $field; | ||
} | ||
} |
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,65 @@ | ||
<?php | ||
|
||
namespace Gameap\Http\Controllers\API; | ||
|
||
use Gameap\Http\Controllers\AuthController; | ||
use Gameap\Http\Requests\ClientCertificatesRequest; | ||
use Gameap\Models\ClientCertificate; | ||
use Gameap\Repositories\ClientCertificateRepository; | ||
|
||
class ClientCertificatesController extends AuthController | ||
{ | ||
/** | ||
* The ClientCertificateRepository instance. | ||
* | ||
* @var \Gameap\Repositories\ClientCertificateRepository | ||
*/ | ||
protected $repository; | ||
|
||
/** | ||
* Create a new ClientCertificatesController instance. | ||
* | ||
* @param \Gameap\Repositories\ClientCertificateRepository $repository | ||
*/ | ||
public function __construct(ClientCertificateRepository $repository) | ||
{ | ||
parent::__construct(); | ||
|
||
$this->repository = $repository; | ||
} | ||
|
||
/** | ||
* Display a listing of the resource. | ||
* | ||
* @return \Illuminate\View\View | ||
*/ | ||
public function list() | ||
{ | ||
$clientCertificates = $this->repository->getAll(99999); | ||
|
||
return $clientCertificates->map(function ($item) { | ||
return $item->only([ | ||
'id', | ||
'fingerprint', | ||
'expires', | ||
'info', | ||
]); | ||
}); | ||
} | ||
|
||
public function store(ClientCertificatesRequest $request) | ||
{ | ||
$this->repository->store($request); | ||
|
||
return ['message' => 'success']; | ||
} | ||
|
||
public function destroy($id) | ||
{ | ||
$clientCertificate = $this->repository->findById($id); | ||
|
||
$this->repository->destroy($clientCertificate); | ||
|
||
return ['message' => 'success']; | ||
} | ||
} |
Oops, something went wrong.