forked from miguel456/rbrecruiter
Compare commits
2 Commits
develop
...
analysis-a
Author | SHA1 | Date | |
---|---|---|---|
773ec570d9 | |||
53c23f3698 |
0
.editorconfig
Executable file → Normal file
0
.editorconfig
Executable file → Normal file
4
.env.example
Executable file → Normal file
4
.env.example
Executable file → Normal file
@@ -7,10 +7,6 @@ APP_LOGO="https://www.raspberrypi.org/app/uploads/2020/05/Raspberry-Pi-OS-downlo
|
||||
APP_SITEHOMEPAGE=""
|
||||
# This can be your main homepage, other than this site itself
|
||||
|
||||
# Forces ssl connections even if the environment is set to "local".
|
||||
# Void if env is production.
|
||||
NONPROD_FORCE_SECURE=false
|
||||
|
||||
LOG_CHANNEL=stack
|
||||
|
||||
DB_CONNECTION=mysql
|
||||
|
0
.gitattributes
vendored
Executable file → Normal file
0
.gitattributes
vendored
Executable file → Normal file
0
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Executable file → Normal file
0
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Executable file → Normal file
0
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Executable file → Normal file
0
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Executable file → Normal file
0
.gitignore
vendored
Executable file → Normal file
0
.gitignore
vendored
Executable file → Normal file
14
.idea/hrm-mcserver.iml
generated
Executable file → Normal file
14
.idea/hrm-mcserver.iml
generated
Executable file → Normal file
@@ -2,16 +2,12 @@
|
||||
<module type="WEB_MODULE" version="4">
|
||||
<component name="NewModuleRootManager">
|
||||
<content url="file://$MODULE_DIR$">
|
||||
<sourceFolder url="file://$MODULE_DIR$/database/factories" isTestSource="false" packagePrefix="Database\Factories\" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/tests" isTestSource="true" packagePrefix="Tests\" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/database/seeders" isTestSource="false" packagePrefix="Database\Seeders\" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/spec" isTestSource="true" />
|
||||
<sourceFolder url="file://$MODULE_DIR$/app" isTestSource="false" packagePrefix="App\" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/almasaeed2010/adminlte" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/asm89/stack-cors" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/awssat/discord-notification-channel" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/barryvdh/laravel-debugbar" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/berkayk/onesignal-laravel" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/brick/math" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/clue/stream-filter" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/composer" />
|
||||
@@ -31,7 +27,6 @@
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/filp/whoops" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/fruitcake/laravel-cors" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/fzaninotto/faker" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/graham-campbell/result-type" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/guzzlehttp/guzzle" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/guzzlehttp/promises" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/guzzlehttp/psr7" />
|
||||
@@ -49,7 +44,6 @@
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/mcamara/laravel-localization" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/mockery/mockery" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/monolog/monolog" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/mpociot/teamwork" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/myclabs/deep-copy" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/nesbot/carbon" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/nikic/php-parser" />
|
||||
@@ -72,7 +66,6 @@
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/phpspec/prophecy" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/phpunit/php-code-coverage" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/phpunit/php-file-iterator" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/phpunit/php-invoker" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/phpunit/php-text-template" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/phpunit/php-timer" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/phpunit/php-token-stream" />
|
||||
@@ -89,16 +82,12 @@
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/ramsey/collection" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/ramsey/uuid" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/scrivo/highlight.php" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/cli-parser" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/code-unit" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/code-unit-reverse-lookup" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/comparator" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/complexity" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/diff" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/environment" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/exporter" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/global-state" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/lines-of-code" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/object-enumerator" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/object-reflector" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/sebastian/recursion-context" />
|
||||
@@ -117,8 +106,6 @@
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/event-dispatcher" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/event-dispatcher-contracts" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/finder" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/http-client" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/http-client-contracts" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/http-foundation" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/http-kernel" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/mime" />
|
||||
@@ -134,7 +121,6 @@
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-php80" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/polyfill-uuid" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/process" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/psr-http-message-bridge" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/routing" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/service-contracts" />
|
||||
<excludeFolder url="file://$MODULE_DIR$/vendor/symfony/string" />
|
||||
|
0
.idea/laravel-plugin.xml
generated
Executable file → Normal file
0
.idea/laravel-plugin.xml
generated
Executable file → Normal file
0
.idea/misc.xml
generated
Executable file → Normal file
0
.idea/misc.xml
generated
Executable file → Normal file
0
.idea/modules.xml
generated
Executable file → Normal file
0
.idea/modules.xml
generated
Executable file → Normal file
14
.idea/php.xml
generated
Executable file → Normal file
14
.idea/php.xml
generated
Executable file → Normal file
@@ -141,21 +141,9 @@
|
||||
<path value="$PROJECT_DIR$/vendor/graham-campbell/markdown" />
|
||||
<path value="$PROJECT_DIR$/vendor/league/mime-type-detection" />
|
||||
<path value="$PROJECT_DIR$/vendor/mcamara/laravel-localization" />
|
||||
<path value="$PROJECT_DIR$/vendor/mpociot/teamwork" />
|
||||
<path value="$PROJECT_DIR$/vendor/sebastian/code-unit" />
|
||||
<path value="$PROJECT_DIR$/vendor/sebastian/cli-parser" />
|
||||
<path value="$PROJECT_DIR$/vendor/sebastian/complexity" />
|
||||
<path value="$PROJECT_DIR$/vendor/sebastian/lines-of-code" />
|
||||
<path value="$PROJECT_DIR$/vendor/graham-campbell/result-type" />
|
||||
<path value="$PROJECT_DIR$/vendor/symfony/http-client" />
|
||||
<path value="$PROJECT_DIR$/vendor/symfony/http-client-contracts" />
|
||||
<path value="$PROJECT_DIR$/vendor/phpunit/php-invoker" />
|
||||
<path value="$PROJECT_DIR$/vendor/awssat/discord-notification-channel" />
|
||||
<path value="$PROJECT_DIR$/vendor/berkayk/onesignal-laravel" />
|
||||
<path value="$PROJECT_DIR$/vendor/symfony/psr-http-message-bridge" />
|
||||
</include_path>
|
||||
</component>
|
||||
<component name="PhpProjectSharedConfiguration" php_language_level="7.3" />
|
||||
<component name="PhpProjectSharedConfiguration" php_language_level="7.2" />
|
||||
<component name="PhpUnit">
|
||||
<phpunit_settings>
|
||||
<PhpUnitSettings configuration_file_path="$PROJECT_DIR$/phpunit.xml" custom_loader_path="$PROJECT_DIR$/vendor/autoload.php" use_configuration_file="true" />
|
||||
|
0
.idea/phpunit.xml
generated
Executable file → Normal file
0
.idea/phpunit.xml
generated
Executable file → Normal file
0
.idea/vcs.xml
generated
Executable file → Normal file
0
.idea/vcs.xml
generated
Executable file → Normal file
0
.phive/phars.xml
Executable file → Normal file
0
.phive/phars.xml
Executable file → Normal file
26
.styleci.yml
Executable file → Normal file
26
.styleci.yml
Executable file → Normal file
@@ -1,13 +1,13 @@
|
||||
risky: false
|
||||
version: 7
|
||||
preset: recommended
|
||||
finder:
|
||||
exclude:
|
||||
- "modules"
|
||||
- "node_modules"
|
||||
- "storage"
|
||||
- "vendor"
|
||||
name: "*.php"
|
||||
not-name:
|
||||
- "*.blade.php"
|
||||
- "_ide_helper.php"
|
||||
php:
|
||||
preset: laravel
|
||||
disabled:
|
||||
- unused_use
|
||||
finder:
|
||||
not-name:
|
||||
- index.php
|
||||
- server.php
|
||||
js:
|
||||
finder:
|
||||
not-name:
|
||||
- webpack.mix.js
|
||||
css: true
|
||||
|
6
.vscode/launch.json
vendored
Executable file → Normal file
6
.vscode/launch.json
vendored
Executable file → Normal file
@@ -4,15 +4,11 @@
|
||||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
|
||||
{
|
||||
"name": "Listen for XDebug",
|
||||
"type": "php",
|
||||
"request": "launch",
|
||||
"port": 9000,
|
||||
"ignore": [
|
||||
"**/vendor/**/*.php"
|
||||
]
|
||||
"port": 9000
|
||||
},
|
||||
{
|
||||
"name": "Launch currently open script",
|
||||
|
0
CODE_OF_CONDUCT.md
Executable file → Normal file
0
CODE_OF_CONDUCT.md
Executable file → Normal file
0
CONTRIBUTING.md
Executable file → Normal file
0
CONTRIBUTING.md
Executable file → Normal file
12
README.md
Executable file → Normal file
12
README.md
Executable file → Normal file
@@ -1,6 +1,6 @@
|
||||
|
||||
# Raspberry Teams - The Simple Staff Application Manager v 0.6.2 [](https://crowdin.com/project/raspberry-staff-manager) [](https://bitbucket.styleci.io/repos/2513833655827911319?branch=develop)
|
||||
## The quick and pain-free staff application manager
|
||||
# RB Recruiter v 0.6.2 [](https://crowdin.com/project/raspberry-staff-manager)
|
||||
## The quick and pain-free form management solution for communities
|
||||
|
||||
Have you ever gotten tired of managing your Minecraft server/network's applications through Discord (or anything else) and having to scroll through hundreds of new messages just to find that one applicant's username?
|
||||
|
||||
@@ -43,10 +43,10 @@ Many other features are currently planned for this app, such as:
|
||||
|
||||
Tech stack:
|
||||
- [Laravel 7](https://laravel.com/)
|
||||
- [Eloquent ORM](https://laravel.com/docs/5.0/eloquent)
|
||||
- [AdminLTE](https://adminlte.io/) / [Bootstrap 4](https://getbootstrap.com/docs/4.0/getting-started/introduction/)
|
||||
- [jQuery](https://jquery.com/) / [Plain Javascript](https://www.javascript.com/)
|
||||
- [vueJS](https://vuejs.org/) (in the future)
|
||||
- Eloquent ORM
|
||||
- AdminLTE / Bootstrap 4
|
||||
- jQuery / Plain Javascript
|
||||
- vueJS (in the future)
|
||||
|
||||
# Stability
|
||||
|
||||
|
0
SECURITY.md
Executable file → Normal file
0
SECURITY.md
Executable file → Normal file
0
app/Application.php
Executable file → Normal file
0
app/Application.php
Executable file → Normal file
0
app/Appointment.php
Executable file → Normal file
0
app/Appointment.php
Executable file → Normal file
0
app/Ban.php
Executable file → Normal file
0
app/Ban.php
Executable file → Normal file
0
app/Comment.php
Executable file → Normal file
0
app/Comment.php
Executable file → Normal file
0
app/Console/Commands/CountVotes.php
Executable file → Normal file
0
app/Console/Commands/CountVotes.php
Executable file → Normal file
@@ -1,140 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* Copyright © 2020 Miguel Nogueira
|
||||
*
|
||||
* This file is part of Raspberry Staff Manager.
|
||||
*
|
||||
* Raspberry Staff Manager is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Raspberry Staff Manager is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Raspberry Staff Manager. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use App\Facades\UUID;
|
||||
use App\Profile;
|
||||
use App\User;
|
||||
use Illuminate\Console\Command;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
|
||||
class CreateUser extends Command
|
||||
{
|
||||
/**
|
||||
* The name and signature of the console command.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'users:create';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Creates an application user. Seeding the database is for testing environments, so use this command in production for your first admin user.';
|
||||
|
||||
/**
|
||||
* Create a new command instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
do {
|
||||
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
|
||||
system('cls');
|
||||
} else {
|
||||
system('clear');
|
||||
}
|
||||
|
||||
$this->info('Welcome to the user account creation wizard. If you just installed the application, we recommend you create your first admin user here. If you don\'t, you won\'t gain admin privileges after creating an account in the web interface.');
|
||||
$this->info('We\'ll ask some questions to get you started.');
|
||||
|
||||
$username = $this->ask('Username');
|
||||
do {
|
||||
$password = $this->secret('Password');
|
||||
$password_confirm = $this->secret('Confirm Password');
|
||||
|
||||
if ($password === $password_confirm) {
|
||||
$password = Hash::make($password);
|
||||
$matches = true;
|
||||
} else {
|
||||
$this->error('Password doesn\'t match. Please try again.');
|
||||
$matches = false;
|
||||
}
|
||||
} while (! $matches);
|
||||
|
||||
$email = $this->ask('E-mail address');
|
||||
$name = $this->ask('First/Last Name');
|
||||
|
||||
do {
|
||||
try {
|
||||
$uuid = UUID::toUUID($this->ask('Minecraft username (Must be a valid Premium account)'));
|
||||
} catch (\InvalidArgumentException $e) {
|
||||
$this->error($e->getMessage());
|
||||
$hasError = true;
|
||||
}
|
||||
|
||||
if (isset($hasError)) {
|
||||
$continue = true;
|
||||
} else {
|
||||
$continue = false;
|
||||
}
|
||||
unset($hasError);
|
||||
} while ($continue);
|
||||
|
||||
$this->info('Please check if these details are correct: ');
|
||||
$this->info('Username: '.$username);
|
||||
$this->info('Email: '.$email);
|
||||
$this->info('Name: '.$name);
|
||||
} while (! $this->confirm('Create user now? You can go back to correct any details.'));
|
||||
|
||||
$user = User::create([
|
||||
'uuid' => $uuid,
|
||||
'name' => $name,
|
||||
'email' => $email,
|
||||
'username' => $username,
|
||||
'originalIP' => '127.0.0.1',
|
||||
'password' => $password,
|
||||
]);
|
||||
|
||||
if ($user) {
|
||||
$user->assignRole('admin', 'reviewer', 'user', 'hiringManager');
|
||||
Profile::create([
|
||||
'profileShortBio' => 'Random data '.rand(0, 1000),
|
||||
'profileAboutMe' => 'Random data '.rand(0, 1000),
|
||||
'socialLinks' => '[]',
|
||||
'avatarPreference' => 'gravatar',
|
||||
'userID' => $user->id,
|
||||
]);
|
||||
|
||||
$this->info('Account created! You may now login at '.route('login').'. Enjoy the app!');
|
||||
|
||||
return 0;
|
||||
} else {
|
||||
$this->error('There was an unknown problem creating the user. There might have been errors above. Please try again.');
|
||||
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
4
app/Console/Commands/Install.php
Executable file → Normal file
4
app/Console/Commands/Install.php
Executable file → Normal file
@@ -61,7 +61,9 @@ class Install extends Command
|
||||
if (Storage::disk('local')->missing('INSTALLED')) {
|
||||
$this->info('[!! Welcome to Rasberry Teams !!]');
|
||||
$this->info('>> Installing...');
|
||||
$this->call('down');
|
||||
$this->call('down', [
|
||||
'--message' => 'Down for maintenance. We\'ll be right back!',
|
||||
]);
|
||||
|
||||
copy($basePath.'/.env.example', $basePath.'/.env');
|
||||
$this->call('key:generate');
|
||||
|
@@ -1,82 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* Copyright © 2020 Miguel Nogueira
|
||||
*
|
||||
* This file is part of Raspberry Staff Manager.
|
||||
*
|
||||
* Raspberry Staff Manager is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Raspberry Staff Manager is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Raspberry Staff Manager. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use Faker\Factory;
|
||||
use Faker\Generator;
|
||||
use Illuminate\Console\Command;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
|
||||
class MakeFile extends Command
|
||||
{
|
||||
/**
|
||||
* The name and signature of the console command.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'files:make {count : How many test files to generate}';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Generates test files for the TeamFile model. Use in conjunction with it\'s factory.';
|
||||
|
||||
/**
|
||||
* The faker instance used to obtain dummy text.
|
||||
*
|
||||
* @var Generator
|
||||
*/
|
||||
private $faker;
|
||||
|
||||
/**
|
||||
* Create a new command instance.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
$this->faker = Factory::create();
|
||||
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
$count = $this->argument('count');
|
||||
$this->info('Creating '.$this->argument('count').' files!');
|
||||
|
||||
for ($max = 1; $max < $count; $max++) {
|
||||
Storage::disk('local')->put('factory_files/testfile_'.rand(0, 5000).'.txt', $this->faker->paragraphs(40, true));
|
||||
}
|
||||
|
||||
$this->info('Finished creating files! They will be randomly picked by the factory.');
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
0
app/Console/Commands/SetEnv.php
Executable file → Normal file
0
app/Console/Commands/SetEnv.php
Executable file → Normal file
0
app/Console/Kernel.php
Executable file → Normal file
0
app/Console/Kernel.php
Executable file → Normal file
0
app/CustomFacades/IP.php
Executable file → Normal file
0
app/CustomFacades/IP.php
Executable file → Normal file
0
app/Events/ApplicationApprovedEvent.php
Executable file → Normal file
0
app/Events/ApplicationApprovedEvent.php
Executable file → Normal file
0
app/Events/ApplicationDeniedEvent.php
Executable file → Normal file
0
app/Events/ApplicationDeniedEvent.php
Executable file → Normal file
0
app/Events/NewApplicationEvent.php
Executable file → Normal file
0
app/Events/NewApplicationEvent.php
Executable file → Normal file
0
app/Events/UserBannedEvent.php
Executable file → Normal file
0
app/Events/UserBannedEvent.php
Executable file → Normal file
0
app/Exceptions/Handler.php
Executable file → Normal file
0
app/Exceptions/Handler.php
Executable file → Normal file
0
app/Facades/ContextAwareValidation.php
Executable file → Normal file
0
app/Facades/ContextAwareValidation.php
Executable file → Normal file
@@ -1,17 +0,0 @@
|
||||
<?php
|
||||
|
||||
|
||||
namespace App\Facades;
|
||||
|
||||
|
||||
use Illuminate\Support\Facades\Facade;
|
||||
|
||||
class DigitalStorageHelper extends Facade
|
||||
{
|
||||
|
||||
protected static function getFacadeAccessor()
|
||||
{
|
||||
return 'digitalStorageHelperFacadeRoot';
|
||||
}
|
||||
|
||||
}
|
0
app/Facades/IP.php
Executable file → Normal file
0
app/Facades/IP.php
Executable file → Normal file
0
app/Facades/Options.php
Executable file → Normal file
0
app/Facades/Options.php
Executable file → Normal file
0
app/Facades/UUID.php
Executable file → Normal file
0
app/Facades/UUID.php
Executable file → Normal file
0
app/Form.php
Executable file → Normal file
0
app/Form.php
Executable file → Normal file
0
app/Helpers/ContextAwareValidator.php
Executable file → Normal file
0
app/Helpers/ContextAwareValidator.php
Executable file → Normal file
@@ -1,107 +0,0 @@
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
|
||||
namespace App\Helpers;
|
||||
|
||||
/**
|
||||
* Class DigitalStorageHelper
|
||||
*
|
||||
* The digital storage helper class helps you convert bytes into several other units.
|
||||
* It should be used whenever you need to display a file's size in a human readable way.
|
||||
*
|
||||
* It's framework agnostic, meaning you can take it out of context and it'll still work; However, you'll have to instantiate it first.
|
||||
* @package App\Helpers
|
||||
*/
|
||||
class DigitalStorageHelper
|
||||
{
|
||||
|
||||
/**
|
||||
* The digital storage value to be manipulated.
|
||||
* @var $value
|
||||
*/
|
||||
protected $value;
|
||||
|
||||
|
||||
/**
|
||||
* Sets the digital storage value for manipulation.
|
||||
*
|
||||
* @param int $value The digital storage value in bytes
|
||||
* @return $this The current instance
|
||||
*/
|
||||
public function setValue(int $value): DigitalStorageHelper
|
||||
{
|
||||
$this->value = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Converts the digital storage value to kilobytes.
|
||||
*
|
||||
* @return float|int
|
||||
*/
|
||||
public function toKilobytes(): float
|
||||
{
|
||||
return $this->value / 1000;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Converts the digital storage value to megabytes.
|
||||
*
|
||||
* @return float|int
|
||||
*/
|
||||
public function toMegabytes(): float
|
||||
{
|
||||
return $this->value / (1 * pow(10, 6)); // 1 times 10 to the power of 6
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Convert the digital storage value to gigabytes. Might be an approximation
|
||||
*
|
||||
* @return float
|
||||
*/
|
||||
public function toGigabytes(): float
|
||||
{
|
||||
return $this->value / (1 * pow(10, 9));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Convert the digital storage value to terabytes.
|
||||
*
|
||||
* @return float
|
||||
*/
|
||||
public function toTerabytes(): float
|
||||
{
|
||||
return $this->value / (1 * pow(10, 12));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Format the digital storage value to one of the units: b, kb, mb, gb and tb.
|
||||
* The method has been adapted to use both MiB and MB values.
|
||||
*
|
||||
* @param int $precision The rounding precision
|
||||
* @param bool $si Use international system units. Defaults to false
|
||||
* @return string The human readable digital storage value, in either, for instance, MB or MiB
|
||||
* @see https://stackoverflow.com/a/2510459/11540218 StackOverflow question regarding unit conversion
|
||||
* @since 7.3.23
|
||||
*/
|
||||
public function formatBytes($precision = 2, $si = false): string
|
||||
{
|
||||
$units = ['B', 'KiB', 'MiB', 'GiB', 'TiB'];
|
||||
if ($si)
|
||||
$units = ['B', 'KB', 'MB', 'GB', 'TB'];
|
||||
|
||||
$bytes = max($this->value, 0);
|
||||
$pow = floor(($bytes ? log($bytes) : 0) / log(($si) ? 1000 : 1024));
|
||||
$pow = min($pow, count($units) - 1);
|
||||
|
||||
$bytes /= pow(($si) ? 1000 : 1024, $pow);
|
||||
|
||||
return round($bytes, $precision) . ' ' . $units[$pow];
|
||||
}
|
||||
|
||||
}
|
4
app/Helpers/Options.php
Executable file → Normal file
4
app/Helpers/Options.php
Executable file → Normal file
@@ -39,11 +39,9 @@ class Options
|
||||
}
|
||||
Cache::put($option, $value);
|
||||
Cache::put($option.'_desc', 'Undefined description');
|
||||
|
||||
return $value->option_value;
|
||||
}
|
||||
|
||||
return $value;
|
||||
return $value->option_value;
|
||||
}
|
||||
|
||||
public function setOption(string $option, string $value, string $description)
|
||||
|
52
app/Http/Controllers/ApplicationController.php
Executable file → Normal file
52
app/Http/Controllers/ApplicationController.php
Executable file → Normal file
@@ -35,7 +35,7 @@ use Illuminate\Support\Facades\Log;
|
||||
|
||||
class ApplicationController extends Controller
|
||||
{
|
||||
private function canVote($votes): bool
|
||||
private function canVote($votes)
|
||||
{
|
||||
$allvotes = collect([]);
|
||||
|
||||
@@ -85,6 +85,56 @@ class ApplicationController extends Controller
|
||||
->with('applications', Application::paginate(6));
|
||||
}
|
||||
|
||||
public function showAllPendingApps()
|
||||
{
|
||||
$this->authorize('viewAny', Application::class);
|
||||
|
||||
return view('dashboard.appmanagement.outstandingapps')
|
||||
->with('applications', Application::where('applicationStatus', 'STAGE_SUBMITTED')->get());
|
||||
}
|
||||
|
||||
public function showPendingInterview()
|
||||
{
|
||||
$this->authorize('viewAny', Application::class);
|
||||
$applications = Application::with('appointment', 'user')->get();
|
||||
$count = 0;
|
||||
|
||||
$pendingInterviews = collect([]);
|
||||
$upcomingInterviews = collect([]);
|
||||
|
||||
foreach ($applications as $application) {
|
||||
if (! is_null($application->appointment) && $application->appointment->appointmentStatus == 'CONCLUDED') {
|
||||
$count = +1;
|
||||
}
|
||||
|
||||
switch ($application->applicationStatus) {
|
||||
case 'STAGE_INTERVIEW':
|
||||
$upcomingInterviews->push($application);
|
||||
|
||||
break;
|
||||
|
||||
case 'STAGE_INTERVIEW_SCHEDULED':
|
||||
$pendingInterviews->push($application);
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return view('dashboard.appmanagement.interview')
|
||||
->with([
|
||||
'finishedCount' => $count,
|
||||
'applications' => $pendingInterviews,
|
||||
'upcomingApplications' => $upcomingInterviews,
|
||||
]);
|
||||
}
|
||||
|
||||
public function showPeerReview()
|
||||
{
|
||||
$this->authorize('viewAny', Application::class);
|
||||
|
||||
return view('dashboard.appmanagement.peerreview')
|
||||
->with('applications', Application::where('applicationStatus', 'STAGE_PEERAPPROVAL')->get());
|
||||
}
|
||||
|
||||
public function renderApplicationForm(Request $request, $vacancySlug)
|
||||
{
|
||||
|
0
app/Http/Controllers/AppointmentController.php
Executable file → Normal file
0
app/Http/Controllers/AppointmentController.php
Executable file → Normal file
0
app/Http/Controllers/Auth/ConfirmPasswordController.php
Executable file → Normal file
0
app/Http/Controllers/Auth/ConfirmPasswordController.php
Executable file → Normal file
0
app/Http/Controllers/Auth/ForgotPasswordController.php
Executable file → Normal file
0
app/Http/Controllers/Auth/ForgotPasswordController.php
Executable file → Normal file
0
app/Http/Controllers/Auth/LoginController.php
Executable file → Normal file
0
app/Http/Controllers/Auth/LoginController.php
Executable file → Normal file
0
app/Http/Controllers/Auth/RegisterController.php
Executable file → Normal file
0
app/Http/Controllers/Auth/RegisterController.php
Executable file → Normal file
0
app/Http/Controllers/Auth/ResetPasswordController.php
Executable file → Normal file
0
app/Http/Controllers/Auth/ResetPasswordController.php
Executable file → Normal file
0
app/Http/Controllers/Auth/TwofaController.php
Executable file → Normal file
0
app/Http/Controllers/Auth/TwofaController.php
Executable file → Normal file
0
app/Http/Controllers/Auth/VerificationController.php
Executable file → Normal file
0
app/Http/Controllers/Auth/VerificationController.php
Executable file → Normal file
0
app/Http/Controllers/BanController.php
Executable file → Normal file
0
app/Http/Controllers/BanController.php
Executable file → Normal file
0
app/Http/Controllers/CommentController.php
Executable file → Normal file
0
app/Http/Controllers/CommentController.php
Executable file → Normal file
0
app/Http/Controllers/ContactController.php
Executable file → Normal file
0
app/Http/Controllers/ContactController.php
Executable file → Normal file
0
app/Http/Controllers/Controller.php
Executable file → Normal file
0
app/Http/Controllers/Controller.php
Executable file → Normal file
0
app/Http/Controllers/DashboardController.php
Executable file → Normal file
0
app/Http/Controllers/DashboardController.php
Executable file → Normal file
0
app/Http/Controllers/DevToolsController.php
Executable file → Normal file
0
app/Http/Controllers/DevToolsController.php
Executable file → Normal file
8
app/Http/Controllers/FormController.php
Executable file → Normal file
8
app/Http/Controllers/FormController.php
Executable file → Normal file
@@ -48,14 +48,6 @@ class FormController extends Controller
|
||||
$this->authorize('create', Form::class);
|
||||
$fields = $request->all();
|
||||
|
||||
if (count($fields) == 2) {
|
||||
// form is probably empty, since forms with fields will alawys have more than 2 items
|
||||
|
||||
$request->session()->flash('error', 'Sorry, but you may not create empty forms.');
|
||||
|
||||
return redirect()->to(route('showForms'));
|
||||
}
|
||||
|
||||
$contextValidation = ContextAwareValidator::getValidator($fields, true, true);
|
||||
|
||||
if (! $contextValidation->get('validator')->fails()) {
|
||||
|
0
app/Http/Controllers/HomeController.php
Executable file → Normal file
0
app/Http/Controllers/HomeController.php
Executable file → Normal file
0
app/Http/Controllers/OptionsController.php
Executable file → Normal file
0
app/Http/Controllers/OptionsController.php
Executable file → Normal file
0
app/Http/Controllers/ProfileController.php
Executable file → Normal file
0
app/Http/Controllers/ProfileController.php
Executable file → Normal file
0
app/Http/Controllers/ResponseController.php
Executable file → Normal file
0
app/Http/Controllers/ResponseController.php
Executable file → Normal file
0
app/Http/Controllers/StaffProfileController.php
Executable file → Normal file
0
app/Http/Controllers/StaffProfileController.php
Executable file → Normal file
@@ -1,243 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* Copyright © 2020 Miguel Nogueira
|
||||
*
|
||||
* This file is part of Raspberry Staff Manager.
|
||||
*
|
||||
* Raspberry Staff Manager is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Raspberry Staff Manager is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Raspberry Staff Manager. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Http\Requests\EditTeamRequest;
|
||||
use App\Http\Requests\NewTeamRequest;
|
||||
use App\Http\Requests\SendInviteRequest;
|
||||
use App\Mail\InviteToTeam;
|
||||
use App\Team;
|
||||
use App\User;
|
||||
use App\Vacancy;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\Mail;
|
||||
use Mpociot\Teamwork\Exceptions\UserNotInTeamException;
|
||||
use Mpociot\Teamwork\Facades\Teamwork;
|
||||
use Mpociot\Teamwork\TeamInvite;
|
||||
|
||||
class TeamController extends Controller
|
||||
{
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$this->authorize('index');
|
||||
|
||||
$teams = Team::with('users.roles')->get();
|
||||
|
||||
return view('dashboard.teams.teams')
|
||||
->with('teams', $teams);
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function store(NewTeamRequest $request)
|
||||
{
|
||||
$this->authorize('create');
|
||||
|
||||
$team = Team::create([
|
||||
'name' => $request->teamName,
|
||||
'owner_id' => Auth::user()->id,
|
||||
]);
|
||||
|
||||
Auth::user()->teams()->attach($team->id);
|
||||
|
||||
$request->session()->flash('success', 'Team successfully created.');
|
||||
|
||||
return redirect()->back();
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*
|
||||
* @param int $id
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function edit(Team $team)
|
||||
{
|
||||
$this->authorize('update', $team);
|
||||
|
||||
return view('dashboard.teams.edit-team')
|
||||
->with('team', $team)
|
||||
->with('users', User::all())
|
||||
->with('vacancies', Vacancy::with('teams')->get()->all());
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param int $id
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function update(EditTeamRequest $request, Team $team)
|
||||
{
|
||||
$this->authorize('update', $team);
|
||||
|
||||
|
||||
$team->description = $request->teamDescription;
|
||||
$team->openJoin = $request->joinType;
|
||||
|
||||
$team->save();
|
||||
|
||||
$request->session()->flash('success', 'Team edited successfully.');
|
||||
|
||||
return redirect()->to(route('teams.index'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
* @param int $id
|
||||
* @return \Illuminate\Http\Response
|
||||
*/
|
||||
public function destroy($id)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
public function invite(SendInviteRequest $request, Team $team)
|
||||
{
|
||||
$this->authorize('invite', $team);
|
||||
|
||||
$user = User::findOrFail($request->user);
|
||||
|
||||
if (! $team->openJoin) {
|
||||
if (! Teamwork::hasPendingInvite($user->email, $team)) {
|
||||
Teamwork::inviteToTeam($user, $team, function (TeamInvite $invite) use ($user) {
|
||||
Mail::to($user)->send(new InviteToTeam($invite));
|
||||
});
|
||||
|
||||
$request->session()->flash('success', 'Invite sent! They can now accept or deny it.');
|
||||
} else {
|
||||
$request->session()->flash('error', 'This user has already been invited.');
|
||||
}
|
||||
} else {
|
||||
$request->session()->flash('error', 'You can\'t invite users to public teams.');
|
||||
}
|
||||
|
||||
return redirect()->back();
|
||||
}
|
||||
|
||||
public function processInviteAction(Request $request, $action, $token)
|
||||
{
|
||||
switch ($action) {
|
||||
case 'accept':
|
||||
|
||||
$invite = Teamwork::getInviteFromAcceptToken($token);
|
||||
|
||||
if ($invite && $invite->user->is(Auth::user())) {
|
||||
Teamwork::acceptInvite($invite);
|
||||
$request->session()->flash('success', 'Invite accepted! You have now joined '.$invite->team->name.'.');
|
||||
} else {
|
||||
$request->session()->flash('error', 'Invalid or expired invite URL.');
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case 'deny':
|
||||
|
||||
$invite = Teamwork::getInviteFromDenyToken($token);
|
||||
|
||||
if ($invite && $invite->user->is(Auth::user())) {
|
||||
Teamwork::denyInvite($invite);
|
||||
$request->session()->flash('success', 'Invite denied! Ask for another invite if this isn\'t what you meant.');
|
||||
} else {
|
||||
$request->session()->flash('error', 'Invalid or expired invite URL.');
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
$request->session()->flash('error', 'Sorry, but the invite URL you followed was malformed. Try asking for another invite, or submit a bug report.');
|
||||
|
||||
}
|
||||
|
||||
// This page will show the user's current teams
|
||||
return redirect()->to(route('teams.index'));
|
||||
}
|
||||
|
||||
public function switchTeam(Request $request, Team $team)
|
||||
{
|
||||
$this->authorize('switchTeam', $team);
|
||||
|
||||
try {
|
||||
Auth::user()->switchTeam($team);
|
||||
|
||||
$request->session()->flash('success', 'Switched teams! Your team dashboard will now use this context.');
|
||||
} catch (UserNotInTeamException $ex) {
|
||||
$request->session()->flash('error', 'You can\'t switch to a team you don\'t belong to.');
|
||||
}
|
||||
|
||||
return redirect()->back();
|
||||
}
|
||||
|
||||
// Since it's a separate form, we shouldn't use the same update method
|
||||
public function assignVacancies(Request $request, Team $team)
|
||||
{
|
||||
$this->authorize('update', $team);
|
||||
|
||||
// P.S. To future developers
|
||||
// This method gave me a lot of trouble lol. It's hard to write code when you're half asleep.
|
||||
// There may be an n+1 query in the view and I don't think there's a way to avoid that without writing a lot of extra code.
|
||||
|
||||
$requestVacancies = $request->assocVacancies;
|
||||
$currentVacancies = $team->vacancies->pluck('id')->all();
|
||||
|
||||
if (is_null($requestVacancies)) {
|
||||
foreach ($team->vacancies as $vacancy) {
|
||||
$team->vacancies()->detach($vacancy->id);
|
||||
}
|
||||
|
||||
$request->session()->flash('success', 'Removed all vacancy associations.');
|
||||
|
||||
return redirect()->back();
|
||||
}
|
||||
|
||||
$vacancyDiff = array_diff($requestVacancies, $currentVacancies);
|
||||
$deselectedDiff = array_diff($currentVacancies, $requestVacancies);
|
||||
|
||||
if (! empty($vacancyDiff) || ! empty($deselectedDiff)) {
|
||||
foreach ($vacancyDiff as $selectedVacancy) {
|
||||
$team->vacancies()->attach($selectedVacancy);
|
||||
}
|
||||
|
||||
foreach ($deselectedDiff as $deselectedVacancy) {
|
||||
$team->vacancies()->detach($deselectedVacancy);
|
||||
}
|
||||
} else {
|
||||
$team->vacancies()->attach($requestVacancies);
|
||||
}
|
||||
|
||||
$request->session()->flash('success', 'Assignments changed successfully.');
|
||||
|
||||
return redirect()->back();
|
||||
}
|
||||
}
|
@@ -1,152 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
// Most of these namespaces have no effect on the code, however, they're used by IDEs so they can resolve return types and for PHPDocumentor as well
|
||||
|
||||
|
||||
use App\TeamFile;
|
||||
use App\Http\Requests\UploadFileRequest;
|
||||
|
||||
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use League\Flysystem\FileNotFoundException;
|
||||
// Documentation-purpose namespaces
|
||||
use Illuminate\Contracts\Foundation\Application;
|
||||
use Illuminate\Contts\View\Factory;
|
||||
use Illuminate\Contracts\View\View;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Response;
|
||||
|
||||
|
||||
|
||||
class TeamFileController extends Controller
|
||||
{
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*
|
||||
* @param Request $request
|
||||
* @return Application|Factory|View|Response
|
||||
*/
|
||||
public function index(Request $request)
|
||||
{
|
||||
$this->authorize('index');
|
||||
|
||||
if (is_null(Auth::user()->currentTeam))
|
||||
{
|
||||
$request->session()->flash('error', 'Please choose a team before viewing it\'s files.');
|
||||
return redirect()->to(route('teams.index'));
|
||||
}
|
||||
|
||||
return view('dashboard.teams.team-files')
|
||||
->with('files', TeamFile::with('team', 'uploader')->paginate(6));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*
|
||||
* @param UploadFileRequest $request
|
||||
* @return RedirectResponse
|
||||
*/
|
||||
public function store(UploadFileRequest $request)
|
||||
{
|
||||
$this->authorize('store');
|
||||
|
||||
$upload = $request->file('file');
|
||||
|
||||
$file = $upload->store('uploads');
|
||||
$originalFileName = $upload->getClientOriginalName();
|
||||
$originalFileExtension = $upload->extension();
|
||||
$originalFileSize = $upload->getSize();
|
||||
|
||||
$fileEntry = TeamFile::create([
|
||||
'uploaded_by' => Auth::user()->id,
|
||||
'team_id' => Auth::user()->currentTeam->id,
|
||||
'name' => $originalFileName,
|
||||
'caption' => $request->caption,
|
||||
'description' => $request->description,
|
||||
'fs_location' => $file,
|
||||
'extension' => $originalFileExtension,
|
||||
'size' => $originalFileSize
|
||||
]);
|
||||
|
||||
if ($fileEntry && !is_bool($file))
|
||||
{
|
||||
$request->session()->flash('success', 'File uploaded successfully!');
|
||||
return redirect()->back();
|
||||
}
|
||||
|
||||
$request->session()->flash('error', 'There was an unknown error whilst trying to upload your file.');
|
||||
return redirect()->back();
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function download(Request $request, TeamFile $teamFile)
|
||||
{
|
||||
$this->authorize('download');
|
||||
|
||||
try
|
||||
{
|
||||
return Storage::download($teamFile->fs_location, $teamFile->name);
|
||||
}
|
||||
catch (FileNotFoundException $ex)
|
||||
{
|
||||
$request->session()->flash('error', 'Sorry, but the requested file could not be found in storage. Sometimes, files may be physically deleted by admins, but not from the app\'s database.');
|
||||
return redirect()->back();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*
|
||||
* @param \App\TeamFile $teamFile
|
||||
* @return Response
|
||||
*/
|
||||
public function edit(TeamFile $teamFile)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \App\TeamFile $teamFile
|
||||
* @return Response
|
||||
*/
|
||||
public function update(Request $request, TeamFile $teamFile)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*
|
||||
* @param Request $request
|
||||
* @param \App\TeamFile $teamFile
|
||||
* @return RedirectResponse
|
||||
*/
|
||||
public function destroy(Request $request, TeamFile $teamFile)
|
||||
{
|
||||
$this->authorize('delete');
|
||||
|
||||
try
|
||||
{
|
||||
Storage::delete($teamFile->fs_location);
|
||||
$teamFile->delete();
|
||||
|
||||
$request->session()->flash('success', 'File deleted successfully.');
|
||||
}
|
||||
catch (\Exception $ex)
|
||||
{
|
||||
$request->session()->flash('error', 'There was an error deleting the file: ' . $ex->getMessage());
|
||||
}
|
||||
|
||||
return redirect()->back();
|
||||
}
|
||||
}
|
5
app/Http/Controllers/UserController.php
Executable file → Normal file
5
app/Http/Controllers/UserController.php
Executable file → Normal file
@@ -32,7 +32,6 @@ use App\Http\Requests\SearchPlayerRequest;
|
||||
use App\Http\Requests\UpdateUserRequest;
|
||||
use App\Notifications\ChangedPassword;
|
||||
use App\Notifications\EmailChanged;
|
||||
use App\Traits\ReceivesAccountTokens;
|
||||
use App\User;
|
||||
use Google2FA;
|
||||
use Illuminate\Http\Request;
|
||||
@@ -43,8 +42,6 @@ use Spatie\Permission\Models\Role;
|
||||
|
||||
class UserController extends Controller
|
||||
{
|
||||
use ReceivesAccountTokens;
|
||||
|
||||
public function showStaffMembers()
|
||||
{
|
||||
$this->authorize('viewStaff', User::class);
|
||||
@@ -215,7 +212,7 @@ class UserController extends Controller
|
||||
$this->authorize('delete', $user);
|
||||
|
||||
if ($request->confirmPrompt == 'DELETE ACCOUNT') {
|
||||
$user->forceDelete();
|
||||
$user->delete();
|
||||
$request->session()->flash('success', 'User deleted successfully. PII has been erased.');
|
||||
} else {
|
||||
$request->session()->flash('error', 'Wrong confirmation text! Try again.');
|
||||
|
0
app/Http/Controllers/VacancyController.php
Executable file → Normal file
0
app/Http/Controllers/VacancyController.php
Executable file → Normal file
0
app/Http/Controllers/VoteController.php
Executable file → Normal file
0
app/Http/Controllers/VoteController.php
Executable file → Normal file
0
app/Http/Kernel.php
Executable file → Normal file
0
app/Http/Kernel.php
Executable file → Normal file
0
app/Http/Middleware/ApplicationEligibility.php
Executable file → Normal file
0
app/Http/Middleware/ApplicationEligibility.php
Executable file → Normal file
0
app/Http/Middleware/Authenticate.php
Executable file → Normal file
0
app/Http/Middleware/Authenticate.php
Executable file → Normal file
0
app/Http/Middleware/Bancheck.php
Executable file → Normal file
0
app/Http/Middleware/Bancheck.php
Executable file → Normal file
0
app/Http/Middleware/CheckForMaintenanceMode.php
Executable file → Normal file
0
app/Http/Middleware/CheckForMaintenanceMode.php
Executable file → Normal file
0
app/Http/Middleware/EncryptCookies.php
Executable file → Normal file
0
app/Http/Middleware/EncryptCookies.php
Executable file → Normal file
0
app/Http/Middleware/ForceLogoutMiddleware.php
Executable file → Normal file
0
app/Http/Middleware/ForceLogoutMiddleware.php
Executable file → Normal file
0
app/Http/Middleware/RedirectIfAuthenticated.php
Executable file → Normal file
0
app/Http/Middleware/RedirectIfAuthenticated.php
Executable file → Normal file
0
app/Http/Middleware/TrimStrings.php
Executable file → Normal file
0
app/Http/Middleware/TrimStrings.php
Executable file → Normal file
0
app/Http/Middleware/TrustProxies.php
Executable file → Normal file
0
app/Http/Middleware/TrustProxies.php
Executable file → Normal file
0
app/Http/Middleware/UsernameUUID.php
Executable file → Normal file
0
app/Http/Middleware/UsernameUUID.php
Executable file → Normal file
0
app/Http/Middleware/VerifyCsrfToken.php
Executable file → Normal file
0
app/Http/Middleware/VerifyCsrfToken.php
Executable file → Normal file
0
app/Http/Requests/Add2FASecretRequest.php
Executable file → Normal file
0
app/Http/Requests/Add2FASecretRequest.php
Executable file → Normal file
0
app/Http/Requests/BanUserRequest.php
Executable file → Normal file
0
app/Http/Requests/BanUserRequest.php
Executable file → Normal file
0
app/Http/Requests/ChangeEmailRequest.php
Executable file → Normal file
0
app/Http/Requests/ChangeEmailRequest.php
Executable file → Normal file
0
app/Http/Requests/ChangePasswordRequest.php
Executable file → Normal file
0
app/Http/Requests/ChangePasswordRequest.php
Executable file → Normal file
0
app/Http/Requests/DeleteUserRequest.php
Executable file → Normal file
0
app/Http/Requests/DeleteUserRequest.php
Executable file → Normal file
@@ -1,50 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* Copyright © 2020 Miguel Nogueira
|
||||
*
|
||||
* This file is part of Raspberry Staff Manager.
|
||||
*
|
||||
* Raspberry Staff Manager is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Raspberry Staff Manager is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Raspberry Staff Manager. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
namespace App\Http\Requests;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class EditTeamRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
'teamDescription' => 'required|string|max:200',
|
||||
'joinType' => 'required|boolean',
|
||||
];
|
||||
}
|
||||
}
|
0
app/Http/Requests/FlushSessionsRequest.php
Executable file → Normal file
0
app/Http/Requests/FlushSessionsRequest.php
Executable file → Normal file
0
app/Http/Requests/NewCommentRequest.php
Executable file → Normal file
0
app/Http/Requests/NewCommentRequest.php
Executable file → Normal file
@@ -1,49 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* Copyright © 2020 Miguel Nogueira
|
||||
*
|
||||
* This file is part of Raspberry Staff Manager.
|
||||
*
|
||||
* Raspberry Staff Manager is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Raspberry Staff Manager is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Raspberry Staff Manager. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
namespace App\Http\Requests;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class NewTeamRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
'teamName' => 'required|max:200|string',
|
||||
];
|
||||
}
|
||||
}
|
0
app/Http/Requests/ProfileSave.php
Executable file → Normal file
0
app/Http/Requests/ProfileSave.php
Executable file → Normal file
0
app/Http/Requests/Remove2FASecretRequest.php
Executable file → Normal file
0
app/Http/Requests/Remove2FASecretRequest.php
Executable file → Normal file
0
app/Http/Requests/SaveNotesRequest.php
Executable file → Normal file
0
app/Http/Requests/SaveNotesRequest.php
Executable file → Normal file
0
app/Http/Requests/SearchPlayerRequest.php
Executable file → Normal file
0
app/Http/Requests/SearchPlayerRequest.php
Executable file → Normal file
@@ -1,49 +0,0 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* Copyright © 2020 Miguel Nogueira
|
||||
*
|
||||
* This file is part of Raspberry Staff Manager.
|
||||
*
|
||||
* Raspberry Staff Manager is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* Raspberry Staff Manager is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with Raspberry Staff Manager. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
namespace App\Http\Requests;
|
||||
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class SendInviteRequest extends FormRequest
|
||||
{
|
||||
/**
|
||||
* Determine if the user is authorized to make this request.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function authorize()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the validation rules that apply to the request.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function rules()
|
||||
{
|
||||
return [
|
||||
'user' => 'required|integer',
|
||||
];
|
||||
}
|
||||
}
|
0
app/Http/Requests/UpdateUserRequest.php
Executable file → Normal file
0
app/Http/Requests/UpdateUserRequest.php
Executable file → Normal file
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user