Skip to content

Commit 807575a

Browse files
authored
Merge pull request #103 from wcadena/desarrollo_1
Desarrollo 1
2 parents 114d1be + 3464e7f commit 807575a

4,379 files changed

Lines changed: 65015 additions & 303215 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/node_modules
22
/node_modules_otro
3-
/public/hot
4-
/public/storage
5-
/public/.well-known
3+
/html/hot
4+
/html/storage
5+
/html/.well-known
66
/storage/*.key
77
/storage/*files
88
/vendor

CONTRIBUTING.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
## Contribuir a gestor-inventarios-it
2-
Damos las gracias y bienvenidas sean todas las correcciones y mejoras en el desarrollo del código de gestor-inventarios-it, pruebas y documentación.
1+
## Contribuir a InventarioFinalApp
2+
Damos las gracias y bienvenidas sean todas las correcciones y mejoras en el desarrollo del código de InventarioFinalApp, pruebas y documentación.
33
Esta guía detalla como contribuir en el proyecto de una manera que sea eficiente para toda la comunidad.
44

55

@@ -15,7 +15,7 @@ Esta guía detalla como contribuir en el proyecto de una manera que sea eficient
1515

1616
### 1. Prerequisitos
1717

18-
1.1 [Leer el Manual de gestor-inventarios-it](/docs/gestor-inventarios-it.docx)
18+
1.1 [Leer el Manual de InventarioFinalApp](/docs/InventarioFinalApp.docx)
1919
En costrucción
2020

2121
1.2 Tener clara la normalización de código fuente
@@ -27,15 +27,15 @@ En costrucción
2727

2828
### 2. Preparación de ambiente local
2929

30-
2.1 Realizar Fork del repositorio https://github.com/wcadena/gestor-inventarios-it a tu cuenta GitHub
30+
2.1 Realizar Fork del repositorio https://github.com/wcadena/inventarioFinalApp a tu cuenta GitHub
3131

3232
2.2 Clonar el proyecto forkeado desde tu cuenta GitHub. Ejemplo:
3333
```console
34-
https://github.com/wcadena/gestor-inventarios-it.git
34+
https://github.com/wcadena/inventarioFinalApp.git
3535
```
3636
2.3 Agregar el repositorio padre como origen remoto. Ejemplo:
3737
```console
38-
git remote add upstream https://github.com/wcadena/gestor-inventarios-it.git
38+
git remote add upstream https://github.com/wcadena/inventarioFinalApp.git
3939
```
4040
2.4 Luego de clonado el proyecto, crear la rama beta para empezar a trabajar. Ejemplo:
4141
```console
@@ -130,7 +130,7 @@ contáctese con nosotros al correo wcadena@outlook.com
130130

131131
## Traducción
132132

133-
Las traducciones se hacen a partir del [repo original](https://github.com/wcadena/gestor-inventarios-it). Los aportes de traducción pueden ser de diferentes maneras:
133+
Las traducciones se hacen a partir del [repo original](https://github.com/wcadena/inventarioFinalApp). Los aportes de traducción pueden ser de diferentes maneras:
134134

135135
1. Traducir los términos pendientes o nuevos.
136136
2. Corregir traducciones existentes.
@@ -141,7 +141,7 @@ Sin embargo, al traducir queremos utilizar un español internacional.
141141
142142
## Flujo de Trabajo
143143

144-
1. Busca una traducción pendiente en la columna TODO: [ver traducciones pendientes](https://github.com/wcadena/gestor-inventarios-it/pendientes).
144+
1. Busca una traducción pendiente en la columna TODO: [ver traducciones pendientes](https://github.com/wcadena/inventarioFinalApp/pendientes).
145145
2. Asegúrate que nadie esté trabajando en él (te puedes dar cuenta viendo que no haya nadie asignado ni nadie ha comentado que está trabajando).
146146
3. Sigue las reglas descritas abajo y crea tu PR.
147147

app/Exceptions/Handler.php

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
use Illuminate\Database\QueryException;
1212
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
1313
use Illuminate\Session\TokenMismatchException;
14-
use Illuminate\Support\Facades\Session;
1514
use Illuminate\Validation\ValidationException;
1615
use Symfony\Component\HttpKernel\Exception\HttpException;
1716
use Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException;
@@ -67,12 +66,6 @@ public function render($request, Exception $exception)
6766
public function handleException($request, Exception $exception)
6867
{
6968
if (config('app.debug') && !$request->is('api/*')) {
70-
if ($exception instanceof TokenMismatchException) {
71-
Session::flash('TokenMismatchException_ev', true);
72-
73-
return redirect('/login?TokenMismatchException_ev=true');
74-
}
75-
7669
return parent::render($request, $exception);
7770
}
7871
if ($exception instanceof ValidationException) {

app/FileEntry.php

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,5 @@ class FileEntry extends Model
99
{
1010
use SoftDeletes;
1111
protected $dates = ['deleted_at'];
12-
protected $fillable = ['vinculo', 'vinculo_padre', 'filename', 'mime', 'path', 'size', 'user_id', 'tipo', 'imageable_type', 'imageable_id'];
13-
14-
/**
15-
* Get all of the owning imageable models or files.
16-
*/
17-
public function imageable()
18-
{
19-
return $this->morphTo();
20-
}
12+
protected $fillable = ['vinculo','vinculo_padre','filename', 'mime', 'path', 'size','user_id','tipo','imageable_type','imageable_id'];
2113
}

app/Http/Controllers/Auth/ForgotPasswordController.php

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44

55
use App\Http\Controllers\Controller;
66
use Illuminate\Foundation\Auth\SendsPasswordResetEmails;
7+
use Illuminate\Http\JsonResponse;
8+
use Illuminate\Http\Request;
9+
use Illuminate\Support\Facades\Password;
710

811
class ForgotPasswordController extends Controller
912
{
@@ -17,8 +20,84 @@ class ForgotPasswordController extends Controller
1720
| your application to your users. Feel free to explore this trait.
1821
|
1922
*/
23+
2024
use SendsPasswordResetEmails;
2125

26+
/**
27+
* Send a reset link to the given user.
28+
*
29+
* @param \Illuminate\Http\Request $request
30+
*
31+
* @return \Illuminate\Http\RedirectResponse
32+
*/
33+
public function sendResetLinkEmail(Request $request)
34+
{
35+
$this->validateEmail($request);
36+
37+
// We will send the password reset link to this user. Once we have attempted
38+
// to send the link, we will examine the response then see the message we
39+
// need to show to the user. Finally, we'll send out a proper response.
40+
$response = $this->broker()->sendResetLink(
41+
$request->only('email')
42+
);
43+
44+
return $response == Password::RESET_LINK_SENT
45+
? $this->sendResetLinkResponse($request, $response)
46+
: $this->sendResetLinkFailedResponse($request, $response);
47+
}
48+
49+
/**
50+
* Get the response for a successful password reset link.
51+
*
52+
* @param string $response
53+
*
54+
* @return mixed
55+
*/
56+
protected function sendResetLinkResponse(Request $request, $response)
57+
{
58+
if ($request->expectsJson()) {
59+
return response()->json([
60+
'status' => trans($response),
61+
]);
62+
}
63+
64+
return back()->with('status', trans($response));
65+
}
66+
67+
/**
68+
* Get the response for a failed password reset link.
69+
*
70+
* @param Request $request
71+
* @param $response
72+
*
73+
* @return mixed
74+
*/
75+
protected function sendResetLinkFailedResponse(Request $request, $response)
76+
{
77+
if ($request->expectsJson()) {
78+
return new JsonResponse([
79+
'message' => 'The given data was invalid.',
80+
'errors' => [
81+
'email' => trans($response),
82+
],
83+
], 422);
84+
}
85+
86+
return back()->withErrors(
87+
['email' => trans($response)]
88+
);
89+
}
90+
91+
/**
92+
* Display the form to request a password reset link.
93+
*
94+
* @return \Illuminate\Http\Response
95+
*/
96+
public function showLinkRequestForm()
97+
{
98+
return view('adminlte::auth.passwords.email');
99+
}
100+
22101
/**
23102
* Create a new controller instance.
24103
*

app/Http/Controllers/Auth/LoginController.php

Lines changed: 61 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
use App\Http\Controllers\Controller;
66
use Illuminate\Foundation\Auth\AuthenticatesUsers;
7+
use Illuminate\Http\Request;
78

89
class LoginController extends Controller
910
{
@@ -17,7 +18,21 @@ class LoginController extends Controller
1718
| to conveniently provide its functionality to your applications.
1819
|
1920
*/
20-
use AuthenticatesUsers;
21+
22+
use AuthenticatesUsers {
23+
attemptLogin as attemptLoginAtAuthenticatesUsers;
24+
}
25+
26+
/**
27+
* Show the application's login form.
28+
*
29+
* @return \Illuminate\Http\Response
30+
*/
31+
public function showLoginForm()
32+
{
33+
return view('adminlte::auth.login');
34+
}
35+
2136
/**
2237
* Where to redirect users after login.
2338
*
@@ -32,6 +47,50 @@ class LoginController extends Controller
3247
*/
3348
public function __construct()
3449
{
35-
$this->middleware('guest')->except('logout');
50+
$this->middleware('guest', ['except' => 'logout']);
51+
}
52+
53+
/**
54+
* Returns field name to use at login.
55+
*
56+
* @return string
57+
*/
58+
public function username()
59+
{
60+
return config('auth.providers.users.field', 'email');
61+
}
62+
63+
/**
64+
* Attempt to log the user into the application.
65+
*
66+
* @param \Illuminate\Http\Request $request
67+
*
68+
* @return bool
69+
*/
70+
protected function attemptLogin(Request $request)
71+
{
72+
if ($this->username() === 'email') {
73+
return $this->attemptLoginAtAuthenticatesUsers($request);
74+
}
75+
if (!$this->attemptLoginAtAuthenticatesUsers($request)) {
76+
return $this->attempLoginUsingUsernameAsAnEmail($request);
77+
}
78+
79+
return false;
80+
}
81+
82+
/**
83+
* Attempt to log the user into application using username as an email.
84+
*
85+
* @param \Illuminate\Http\Request $request
86+
*
87+
* @return bool
88+
*/
89+
protected function attempLoginUsingUsernameAsAnEmail(Request $request)
90+
{
91+
return $this->guard()->attempt(
92+
['email' => $request->input('username'), 'password' => $request->input('password')],
93+
$request->has('remember')
94+
);
3695
}
3796
}

app/Http/Controllers/Auth/RegisterController.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,16 @@ class RegisterController extends Controller
2525

2626
use RegistersUsers;
2727

28+
/**
29+
* Show the application registration form.
30+
*
31+
* @return \Illuminate\Http\Response
32+
*/
33+
public function showRegistrationForm()
34+
{
35+
return view('adminlte::auth.register');
36+
}
37+
2838
/**
2939
* Where to redirect users after login / registration.
3040
*

0 commit comments

Comments
 (0)