Skip to content

Commit

Permalink
Revert "Desarrollo 1"
Browse files Browse the repository at this point in the history
  • Loading branch information
wcadena committed Mar 10, 2019
1 parent 807575a commit eb63aad
Show file tree
Hide file tree
Showing 4,379 changed files with 303,218 additions and 65,018 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
6 changes: 3 additions & 3 deletions .gitignore
@@ -1,8 +1,8 @@
/node_modules
/node_modules_otro
/html/hot
/html/storage
/html/.well-known
/public/hot
/public/storage
/public/.well-known
/storage/*.key
/storage/*files
/vendor
Expand Down
16 changes: 8 additions & 8 deletions CONTRIBUTING.md
@@ -1,5 +1,5 @@
## Contribuir a InventarioFinalApp
Damos las gracias y bienvenidas sean todas las correcciones y mejoras en el desarrollo del código de InventarioFinalApp, pruebas y documentación.
## Contribuir a gestor-inventarios-it
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.
Esta guía detalla como contribuir en el proyecto de una manera que sea eficiente para toda la comunidad.


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

### 1. Prerequisitos

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

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

### 2. Preparación de ambiente local

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

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

## Traducción

Las traducciones se hacen a partir del [repo original](https://github.com/wcadena/inventarioFinalApp). Los aportes de traducción pueden ser de diferentes maneras:
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:

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

1. Busca una traducción pendiente en la columna TODO: [ver traducciones pendientes](https://github.com/wcadena/inventarioFinalApp/pendientes).
1. Busca una traducción pendiente en la columna TODO: [ver traducciones pendientes](https://github.com/wcadena/gestor-inventarios-it/pendientes).
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).
3. Sigue las reglas descritas abajo y crea tu PR.

Expand Down
7 changes: 7 additions & 0 deletions app/Exceptions/Handler.php
Expand Up @@ -11,6 +11,7 @@
use Illuminate\Database\QueryException;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
use Illuminate\Session\TokenMismatchException;
use Illuminate\Support\Facades\Session;
use Illuminate\Validation\ValidationException;
use Symfony\Component\HttpKernel\Exception\HttpException;
use Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException;
Expand Down Expand Up @@ -66,6 +67,12 @@ public function render($request, Exception $exception)
public function handleException($request, Exception $exception)
{
if (config('app.debug') && !$request->is('api/*')) {
if ($exception instanceof TokenMismatchException) {
Session::flash('TokenMismatchException_ev', true);

return redirect('/login?TokenMismatchException_ev=true');
}

return parent::render($request, $exception);
}
if ($exception instanceof ValidationException) {
Expand Down
10 changes: 9 additions & 1 deletion app/FileEntry.php
Expand Up @@ -9,5 +9,13 @@ class FileEntry extends Model
{
use SoftDeletes;
protected $dates = ['deleted_at'];
protected $fillable = ['vinculo','vinculo_padre','filename', 'mime', 'path', 'size','user_id','tipo','imageable_type','imageable_id'];
protected $fillable = ['vinculo', 'vinculo_padre', 'filename', 'mime', 'path', 'size', 'user_id', 'tipo', 'imageable_type', 'imageable_id'];

/**
* Get all of the owning imageable models or files.
*/
public function imageable()
{
return $this->morphTo();
}
}
79 changes: 0 additions & 79 deletions app/Http/Controllers/Auth/ForgotPasswordController.php
Expand Up @@ -4,9 +4,6 @@

use App\Http\Controllers\Controller;
use Illuminate\Foundation\Auth\SendsPasswordResetEmails;
use Illuminate\Http\JsonResponse;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Password;

class ForgotPasswordController extends Controller
{
Expand All @@ -20,84 +17,8 @@ class ForgotPasswordController extends Controller
| your application to your users. Feel free to explore this trait.
|
*/

use SendsPasswordResetEmails;

/**
* Send a reset link to the given user.
*
* @param \Illuminate\Http\Request $request
*
* @return \Illuminate\Http\RedirectResponse
*/
public function sendResetLinkEmail(Request $request)
{
$this->validateEmail($request);

// We will send the password reset link to this user. Once we have attempted
// to send the link, we will examine the response then see the message we
// need to show to the user. Finally, we'll send out a proper response.
$response = $this->broker()->sendResetLink(
$request->only('email')
);

return $response == Password::RESET_LINK_SENT
? $this->sendResetLinkResponse($request, $response)
: $this->sendResetLinkFailedResponse($request, $response);
}

/**
* Get the response for a successful password reset link.
*
* @param string $response
*
* @return mixed
*/
protected function sendResetLinkResponse(Request $request, $response)
{
if ($request->expectsJson()) {
return response()->json([
'status' => trans($response),
]);
}

return back()->with('status', trans($response));
}

/**
* Get the response for a failed password reset link.
*
* @param Request $request
* @param $response
*
* @return mixed
*/
protected function sendResetLinkFailedResponse(Request $request, $response)
{
if ($request->expectsJson()) {
return new JsonResponse([
'message' => 'The given data was invalid.',
'errors' => [
'email' => trans($response),
],
], 422);
}

return back()->withErrors(
['email' => trans($response)]
);
}

/**
* Display the form to request a password reset link.
*
* @return \Illuminate\Http\Response
*/
public function showLinkRequestForm()
{
return view('adminlte::auth.passwords.email');
}

/**
* Create a new controller instance.
*
Expand Down
63 changes: 2 additions & 61 deletions app/Http/Controllers/Auth/LoginController.php
Expand Up @@ -4,7 +4,6 @@

use App\Http\Controllers\Controller;
use Illuminate\Foundation\Auth\AuthenticatesUsers;
use Illuminate\Http\Request;

class LoginController extends Controller
{
Expand All @@ -18,21 +17,7 @@ class LoginController extends Controller
| to conveniently provide its functionality to your applications.
|
*/

use AuthenticatesUsers {
attemptLogin as attemptLoginAtAuthenticatesUsers;
}

/**
* Show the application's login form.
*
* @return \Illuminate\Http\Response
*/
public function showLoginForm()
{
return view('adminlte::auth.login');
}

use AuthenticatesUsers;
/**
* Where to redirect users after login.
*
Expand All @@ -47,50 +32,6 @@ public function showLoginForm()
*/
public function __construct()
{
$this->middleware('guest', ['except' => 'logout']);
}

/**
* Returns field name to use at login.
*
* @return string
*/
public function username()
{
return config('auth.providers.users.field', 'email');
}

/**
* Attempt to log the user into the application.
*
* @param \Illuminate\Http\Request $request
*
* @return bool
*/
protected function attemptLogin(Request $request)
{
if ($this->username() === 'email') {
return $this->attemptLoginAtAuthenticatesUsers($request);
}
if (!$this->attemptLoginAtAuthenticatesUsers($request)) {
return $this->attempLoginUsingUsernameAsAnEmail($request);
}

return false;
}

/**
* Attempt to log the user into application using username as an email.
*
* @param \Illuminate\Http\Request $request
*
* @return bool
*/
protected function attempLoginUsingUsernameAsAnEmail(Request $request)
{
return $this->guard()->attempt(
['email' => $request->input('username'), 'password' => $request->input('password')],
$request->has('remember')
);
$this->middleware('guest')->except('logout');
}
}
10 changes: 0 additions & 10 deletions app/Http/Controllers/Auth/RegisterController.php
Expand Up @@ -25,16 +25,6 @@ class RegisterController extends Controller

use RegistersUsers;

/**
* Show the application registration form.
*
* @return \Illuminate\Http\Response
*/
public function showRegistrationForm()
{
return view('adminlte::auth.register');
}

/**
* Where to redirect users after login / registration.
*
Expand Down

0 comments on commit eb63aad

Please sign in to comment.