- Upgrade to 7.x from 6.x #11
This commit is contained in:
parent
4e44d9d996
commit
bcbd05d7d8
29 changed files with 1289 additions and 647 deletions
|
@ -63,5 +63,6 @@ class DatasetState extends Command
|
|||
'server_date_modified' => DB::raw('now()')
|
||||
]);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -29,5 +29,6 @@ class Inspire extends Command
|
|||
public function handle()
|
||||
{
|
||||
$this->comment(PHP_EOL.Inspiring::quote().PHP_EOL);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -54,5 +54,6 @@ class SolrIndexBuilder extends Command
|
|||
// Log::debug(__METHOD__ . ': ' . 'Indexing document ' . $datasetId . ' failed: ' . $e->getMessage());
|
||||
// }
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -51,5 +51,6 @@ class UpdateSolrDataset extends Command
|
|||
} catch (Exception $e) {
|
||||
$this->error(__METHOD__ . ': ' . 'Indexing document ' . $dataset->id . ' failed: ' . $e->getMessage());
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
<?php namespace App\Exceptions;
|
||||
<?php
|
||||
|
||||
use Exception;
|
||||
namespace App\Exceptions;
|
||||
|
||||
// use Exception;
|
||||
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
|
||||
use Throwable;
|
||||
|
||||
class Handler extends ExceptionHandler
|
||||
{
|
||||
|
@ -12,7 +15,8 @@ class Handler extends ExceptionHandler
|
|||
* @var array
|
||||
*/
|
||||
protected $dontReport = [
|
||||
'Symfony\Component\HttpKernel\Exception\HttpException'
|
||||
'password',
|
||||
'password_confirmation',
|
||||
];
|
||||
|
||||
/**
|
||||
|
@ -20,22 +24,24 @@ class Handler extends ExceptionHandler
|
|||
*
|
||||
* This is a great spot to send exceptions to Sentry, Bugsnag, etc.
|
||||
*
|
||||
* @param \Exception $e
|
||||
* @param \Throable $exception
|
||||
* @return void
|
||||
*/
|
||||
public function report(Exception $e)
|
||||
public function report(Throwable $exception)
|
||||
{
|
||||
return parent::report($e);
|
||||
return parent::report($exception);
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* Render an exception into an HTTP response.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \Exception $e
|
||||
* @return \Illuminate\Http\Response
|
||||
* @param \Throwable $exception
|
||||
* @return \Symfony\Component\HttpFoundation\Response
|
||||
*
|
||||
* @throws \Throwable
|
||||
*/
|
||||
public function render($request, Exception $ex)
|
||||
public function render($request, Throwable $ex)
|
||||
{
|
||||
if ($ex instanceof \Illuminate\Auth\Access\AuthorizationException) {
|
||||
// return $this->errorResponse($exception->getMessage(), 403);
|
||||
|
|
40
app/Http/Controllers/Auth/ConfirmPasswordController.php
Normal file
40
app/Http/Controllers/Auth/ConfirmPasswordController.php
Normal file
|
@ -0,0 +1,40 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Auth;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Providers\RouteServiceProvider;
|
||||
use Illuminate\Foundation\Auth\ConfirmsPasswords;
|
||||
|
||||
class ConfirmPasswordController extends Controller
|
||||
{
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Confirm Password Controller
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This controller is responsible for handling password confirmations and
|
||||
| uses a simple trait to include the behavior. You're free to explore
|
||||
| this trait and override any functions that require customization.
|
||||
|
|
||||
*/
|
||||
|
||||
use ConfirmsPasswords;
|
||||
|
||||
/**
|
||||
* Where to redirect users when the intended url fails.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $redirectTo = RouteServiceProvider::HOME;
|
||||
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('auth');
|
||||
}
|
||||
}
|
|
@ -19,14 +19,4 @@ class ForgotPasswordController extends Controller
|
|||
*/
|
||||
|
||||
use SendsPasswordResetEmails;
|
||||
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('guest');
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
namespace App\Http\Controllers\Auth;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Providers\RouteServiceProvider;
|
||||
use Illuminate\Foundation\Auth\AuthenticatesUsers;
|
||||
|
||||
class LoginController extends Controller
|
||||
|
@ -25,7 +26,7 @@ class LoginController extends Controller
|
|||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $redirectTo = '/settings';
|
||||
protected $redirectTo = RouteServiceProvider::HOME;
|
||||
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
|
@ -34,17 +35,6 @@ class LoginController extends Controller
|
|||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('guest', ['except' => 'logout']);
|
||||
$this->middleware('guest')->except('logout');
|
||||
}
|
||||
|
||||
// public function logout(Request $request)
|
||||
// {
|
||||
// $this->guard()->logout();
|
||||
|
||||
// $request->session()->flush();
|
||||
|
||||
// $request->session()->regenerate();
|
||||
|
||||
// return redirect('/');
|
||||
// }
|
||||
}
|
||||
|
|
|
@ -2,10 +2,12 @@
|
|||
|
||||
namespace App\Http\Controllers\Auth;
|
||||
|
||||
use App\Models\User;
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Support\Facades\Validator;
|
||||
use App\Providers\RouteServiceProvider;
|
||||
use App\User;
|
||||
use Illuminate\Foundation\Auth\RegistersUsers;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
use Illuminate\Support\Facades\Validator;
|
||||
|
||||
class RegisterController extends Controller
|
||||
{
|
||||
|
@ -27,7 +29,7 @@ class RegisterController extends Controller
|
|||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $redirectTo = '/';
|
||||
protected $redirectTo = RouteServiceProvider::HOME;
|
||||
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
|
@ -48,9 +50,9 @@ class RegisterController extends Controller
|
|||
protected function validator(array $data)
|
||||
{
|
||||
return Validator::make($data, [
|
||||
'name' => 'required|max:255',
|
||||
'email' => 'required|email|max:255|unique:users',
|
||||
'password' => 'required|min:6|confirmed',
|
||||
'name' => ['required', 'string', 'max:255'],
|
||||
'email' => ['required', 'string', 'email', 'max:255', 'unique:users'],
|
||||
'password' => ['required', 'string', 'min:8', 'confirmed'],
|
||||
]);
|
||||
}
|
||||
|
||||
|
@ -65,7 +67,7 @@ class RegisterController extends Controller
|
|||
return User::create([
|
||||
'name' => $data['name'],
|
||||
'email' => $data['email'],
|
||||
'password' => bcrypt($data['password']),
|
||||
'password' => Hash::make($data['password']),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
namespace App\Http\Controllers\Auth;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Providers\RouteServiceProvider;
|
||||
use Illuminate\Foundation\Auth\ResetsPasswords;
|
||||
|
||||
class ResetPasswordController extends Controller
|
||||
|
@ -25,15 +26,5 @@ class ResetPasswordController extends Controller
|
|||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $redirectTo = '/';
|
||||
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('guest');
|
||||
}
|
||||
protected $redirectTo = RouteServiceProvider::HOME;
|
||||
}
|
||||
|
|
42
app/Http/Controllers/Auth/VerificationController.php
Normal file
42
app/Http/Controllers/Auth/VerificationController.php
Normal file
|
@ -0,0 +1,42 @@
|
|||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Auth;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Providers\RouteServiceProvider;
|
||||
use Illuminate\Foundation\Auth\VerifiesEmails;
|
||||
|
||||
class VerificationController extends Controller
|
||||
{
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Email Verification Controller
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This controller is responsible for handling email verification for any
|
||||
| user that recently registered with the application. Emails may also
|
||||
| be re-sent if the user didn't receive the original email message.
|
||||
|
|
||||
*/
|
||||
|
||||
use VerifiesEmails;
|
||||
|
||||
/**
|
||||
* Where to redirect users after verification.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $redirectTo = RouteServiceProvider::HOME;
|
||||
|
||||
/**
|
||||
* Create a new controller instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->middleware('auth');
|
||||
$this->middleware('signed')->only('verify');
|
||||
$this->middleware('throttle:6,1')->only('verify', 'resend');
|
||||
}
|
||||
}
|
|
@ -31,7 +31,10 @@ class SitelinkController extends Controller
|
|||
// }
|
||||
// }, $years);
|
||||
$this->ids = array();
|
||||
return view('frontend.sitelink.index')->with(['years' => $this->years, 'documents' => $this->ids]);
|
||||
return view(
|
||||
'frontend.sitelink.index',
|
||||
['years' => $this->years, 'documents' => $this->ids]
|
||||
);
|
||||
}
|
||||
|
||||
public function listDocs($year)
|
||||
|
@ -63,8 +66,10 @@ class SitelinkController extends Controller
|
|||
//$select->select('id');
|
||||
//$this->ids = $select->pluck('id');
|
||||
//return view('rdr.sitelink.index')->with(['years'=> $this->years,'ids'=> $this->ids]);
|
||||
return view('frontend.sitelink.index')
|
||||
->with(['years' => $this->years, 'documents' => $documents]);
|
||||
return view(
|
||||
'frontend.sitelink.index',
|
||||
['years' => $this->years, 'documents' => $documents]
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -61,7 +61,7 @@ class DoiController extends Controller
|
|||
public function index(): \Illuminate\Contracts\View\View
|
||||
{
|
||||
$datasets = Dataset::query()
|
||||
->has('identifier')
|
||||
->has('identifier')
|
||||
->orderBy('server_date_modified', 'desc')
|
||||
->get();
|
||||
return View::make('workflow.doi.index', [
|
||||
|
@ -164,9 +164,9 @@ class DoiController extends Controller
|
|||
},
|
||||
])->findOrFail($id);
|
||||
|
||||
return View::make('workflow.doi.edit', [
|
||||
return View::make('workflow.doi.edit', [
|
||||
'dataset' => $dataset,
|
||||
]);
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -192,8 +192,8 @@ class DoiController extends Controller
|
|||
$datacite_environment = config('tethys.datacite_environment');
|
||||
if ($datacite_environment == "debug") {
|
||||
$prefix = config('tethys.datacite_test_prefix');
|
||||
$base_domain = config('tethys.test_base_domain');
|
||||
} elseif ($datacite_environment == "production") {
|
||||
$base_domain = config('tethys.test_base_domain');
|
||||
} elseif ($datacite_environment == "production") {
|
||||
$prefix = config('tethys.datacite_prefix');
|
||||
$base_domain = config('tethys.base_domain');
|
||||
}
|
||||
|
@ -227,8 +227,8 @@ class DoiController extends Controller
|
|||
$response = $this->doiClient->updateMetadataForDoi($doiValue, $newXmlMeta);
|
||||
// if operation successful, store dataste identifier
|
||||
if ($response->getStatusCode() == 201) {
|
||||
$doi = $dataset->identifier();
|
||||
// $doi['value'] = $doiValue;
|
||||
$doi = $dataset->identifier;
|
||||
// $doi['value'] = $doiValue;
|
||||
// $doi['type'] = "doi";
|
||||
// $doi['status'] = "findable";
|
||||
// $doi->save();
|
||||
|
|
|
@ -671,8 +671,8 @@ class EditorController extends Controller
|
|||
$datacite_environment = config('tethys.datacite_environment');
|
||||
if ($datacite_environment == "debug") {
|
||||
$prefix = config('tethys.datacite_test_prefix');
|
||||
$base_domain = config('tethys.test_base_domain');
|
||||
} elseif ($datacite_environment == "production") {
|
||||
$base_domain = config('tethys.test_base_domain');
|
||||
} elseif ($datacite_environment == "production") {
|
||||
$prefix = config('tethys.datacite_prefix');
|
||||
$base_domain = config('tethys.base_domain');
|
||||
}
|
||||
|
|
|
@ -15,6 +15,7 @@ class RouteServiceProvider extends ServiceProvider
|
|||
* @var string
|
||||
*/
|
||||
protected $namespace = 'App\Http\Controllers';
|
||||
public const HOME = '/settings';
|
||||
|
||||
/**
|
||||
* Define your route model bindings, pattern filters, etc.
|
||||
|
|
|
@ -4,6 +4,8 @@ namespace App\Providers;
|
|||
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
use Solarium\Client;
|
||||
use Solarium\Core\Client\Adapter\Curl;
|
||||
use Symfony\Component\EventDispatcher\EventDispatcher;
|
||||
|
||||
class SolariumServiceProvider extends ServiceProvider
|
||||
{
|
||||
|
@ -18,6 +20,9 @@ class SolariumServiceProvider extends ServiceProvider
|
|||
public function register()
|
||||
{
|
||||
$this->app->bind(Client::class, function ($app) {
|
||||
|
||||
$adapter = new Curl();
|
||||
$dispatcher = new EventDispatcher();
|
||||
// $config = config('solarium');
|
||||
$config = array(
|
||||
'endpoint' => array(
|
||||
|
@ -30,7 +35,7 @@ class SolariumServiceProvider extends ServiceProvider
|
|||
)
|
||||
);
|
||||
//return new Client($config);
|
||||
return new Client($config);
|
||||
return new Client($adapter, $dispatcher, $config);
|
||||
//return new Client($app['config']['solarium']);
|
||||
});
|
||||
}
|
||||
|
|
|
@ -204,7 +204,7 @@ class DoiClient implements DoiInterface
|
|||
public function updateMetadataForDoi($doiValue, $newMeta)
|
||||
{
|
||||
$response = null;
|
||||
$url = $this->serviceUrl . '/metadata/' . $doiValue;
|
||||
$url = $this->serviceUrl . '/metadata/' . $doiValue;
|
||||
try {
|
||||
$client = new Client([
|
||||
'auth' => [$this->username, $this->password],
|
||||
|
|
Loading…
Add table
editor.link_modal.header
Reference in a new issue