Commit 6d0bf96a authored by Andreas Heimann's avatar Andreas Heimann

simple user system & uploading

parent 7ab7b987
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
###> symfony/framework-bundle ### ###> symfony/framework-bundle ###
APP_ENV=dev APP_ENV=dev
APP_SECRET=06a9c48e270b2fe48e4ad56dbd245008 APP_SECRET=0c8123f3e5a70f21cf5d2a8bc8a86bff
#TRUSTED_PROXIES=127.0.0.0/8,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16 #TRUSTED_PROXIES=127.0.0.0/8,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16
#TRUSTED_HOSTS='^(localhost|example\.com)$' #TRUSTED_HOSTS='^(localhost|example\.com)$'
###< symfony/framework-bundle ### ###< symfony/framework-bundle ###
...@@ -29,5 +29,5 @@ APP_SECRET=06a9c48e270b2fe48e4ad56dbd245008 ...@@ -29,5 +29,5 @@ APP_SECRET=06a9c48e270b2fe48e4ad56dbd245008
# For an SQLite database, use: "sqlite:///%kernel.project_dir%/var/data.db" # For an SQLite database, use: "sqlite:///%kernel.project_dir%/var/data.db"
# For a PostgreSQL database, use: "postgresql://db_user:db_password@127.0.0.1:5432/db_name?serverVersion=11&charset=utf8" # For a PostgreSQL database, use: "postgresql://db_user:db_password@127.0.0.1:5432/db_name?serverVersion=11&charset=utf8"
# IMPORTANT: You MUST configure your server version, either here or in config/packages/doctrine.yaml # IMPORTANT: You MUST configure your server version, either here or in config/packages/doctrine.yaml
DATABASE_URL=mysql://db_user:db_password@127.0.0.1:3306/db_name?serverVersion=5.7 DATABASE_URL=mysql://root:rootpw@127.0.0.1:3306/customspeens?serverVersion=5.7
###< doctrine/doctrine-bundle ### ###< doctrine/doctrine-bundle ###
# Cache and logs (Symfony2)
/app/cache/*
/app/logs/*
!app/cache/.gitkeep
!app/logs/.gitkeep
# Email spool folder ###> symfony/framework-bundle ###
/app/spool/* /.env.local
/.env.local.php
# Cache, session files and logs (Symfony3) /.env.*.local
/var/cache/* /config/secrets/prod/prod.decrypt.private.php
/var/logs/* /public/bundles/
/var/sessions/* /var/
!var/cache/.gitkeep
!var/logs/.gitkeep
!var/sessions/.gitkeep
# Logs (Symfony4)
/var/log/*
!var/log/.gitkeep
# Parameters
/app/config/parameters.yml
/app/config/parameters.ini
# Managed by Composer
/app/bootstrap.php.cache
/var/bootstrap.php.cache
/bin/*
!bin/console
!bin/symfony_requirements
/vendor/ /vendor/
###< symfony/framework-bundle ###
# Assets and user uploads ###> symfony/phpunit-bridge ###
/web/bundles/ .phpunit
/web/uploads/ .phpunit.result.cache
# PHPUnit
/app/phpunit.xml
/phpunit.xml /phpunit.xml
###< symfony/phpunit-bridge ###
# Build data
/build/
# Composer PHAR
/composer.phar
# Backup entities generated with doctrine:generate:entities command
**/Entity/*~
# Embedded web-server pid file
/.web-server-pid
#!/usr/bin/env php
<?php
if (!file_exists(dirname(__DIR__).'/vendor/symfony/phpunit-bridge/bin/simple-phpunit.php')) {
echo "Unable to find the `simple-phpunit.php` script in `vendor/symfony/phpunit-bridge/bin/`.\n";
exit(1);
}
if (false === getenv('SYMFONY_PHPUNIT_DIR')) {
putenv('SYMFONY_PHPUNIT_DIR='.__DIR__.'/.phpunit');
}
require dirname(__DIR__).'/vendor/symfony/phpunit-bridge/bin/simple-phpunit.php';
...@@ -2,36 +2,35 @@ ...@@ -2,36 +2,35 @@
"type": "project", "type": "project",
"license": "proprietary", "license": "proprietary",
"require": { "require": {
"php": "^7.2.5", "php": "^7.1.3",
"ext-ctype": "*", "ext-ctype": "*",
"ext-iconv": "*", "ext-iconv": "*",
"sensio/framework-extra-bundle": "^5.1", "friendsofsymfony/user-bundle": "~2.0",
"symfony/asset": "5.0.*", "sensio/framework-extra-bundle": "^5.5",
"symfony/console": "5.0.*", "symfony/asset": "4.4.*",
"symfony/dotenv": "5.0.*", "symfony/console": "4.4.*",
"symfony/expression-language": "5.0.*", "symfony/dotenv": "4.4.*",
"symfony/expression-language": "4.4.*",
"symfony/flex": "^1.3.1", "symfony/flex": "^1.3.1",
"symfony/form": "5.0.*", "symfony/form": "4.4.*",
"symfony/framework-bundle": "5.0.*", "symfony/framework-bundle": "4.4.*",
"symfony/http-client": "5.0.*", "symfony/http-client": "4.4.*",
"symfony/intl": "5.0.*", "symfony/intl": "4.4.*",
"symfony/mailer": "5.0.*", "symfony/mailer": "4.4.*",
"symfony/monolog-bundle": "^3.1", "symfony/monolog-bundle": "^3.1",
"symfony/notifier": "5.0.*",
"symfony/orm-pack": "*", "symfony/orm-pack": "*",
"symfony/process": "5.0.*", "symfony/process": "4.4.*",
"symfony/security-bundle": "5.0.*", "symfony/security-bundle": "4.4.*",
"symfony/serializer-pack": "*", "symfony/serializer-pack": "*",
"symfony/string": "5.0.*", "symfony/translation": "4.4.*",
"symfony/translation": "5.0.*",
"symfony/twig-pack": "*", "symfony/twig-pack": "*",
"symfony/validator": "5.0.*", "symfony/validator": "4.4.*",
"symfony/web-link": "5.0.*", "symfony/web-link": "4.4.*",
"symfony/yaml": "5.0.*" "symfony/yaml": "4.4.*"
}, },
"require-dev": { "require-dev": {
"symfony/debug-pack": "*", "symfony/debug-pack": "*",
"symfony/maker-bundle": "^1.0", "symfony/maker-bundle": "^1.14",
"symfony/profiler-pack": "*", "symfony/profiler-pack": "*",
"symfony/test-pack": "*" "symfony/test-pack": "*"
}, },
...@@ -55,7 +54,6 @@ ...@@ -55,7 +54,6 @@
"paragonie/random_compat": "2.*", "paragonie/random_compat": "2.*",
"symfony/polyfill-ctype": "*", "symfony/polyfill-ctype": "*",
"symfony/polyfill-iconv": "*", "symfony/polyfill-iconv": "*",
"symfony/polyfill-php72": "*",
"symfony/polyfill-php71": "*", "symfony/polyfill-php71": "*",
"symfony/polyfill-php70": "*", "symfony/polyfill-php70": "*",
"symfony/polyfill-php56": "*" "symfony/polyfill-php56": "*"
...@@ -78,7 +76,7 @@ ...@@ -78,7 +76,7 @@
"extra": { "extra": {
"symfony": { "symfony": {
"allow-contrib": false, "allow-contrib": false,
"require": "5.0.*" "require": "4.4.*"
} }
} }
} }
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -4,12 +4,13 @@ return [ ...@@ -4,12 +4,13 @@ return [
Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => ['all' => true], Symfony\Bundle\FrameworkBundle\FrameworkBundle::class => ['all' => true],
Symfony\Bundle\TwigBundle\TwigBundle::class => ['all' => true], Symfony\Bundle\TwigBundle\TwigBundle::class => ['all' => true],
Twig\Extra\TwigExtraBundle\TwigExtraBundle::class => ['all' => true], Twig\Extra\TwigExtraBundle\TwigExtraBundle::class => ['all' => true],
Symfony\Bundle\WebProfilerBundle\WebProfilerBundle::class => ['dev' => true, 'test' => true],
Symfony\Bundle\MonologBundle\MonologBundle::class => ['all' => true],
Symfony\Bundle\DebugBundle\DebugBundle::class => ['dev' => true, 'test' => true],
Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle::class => ['all' => true], Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle::class => ['all' => true],
Doctrine\Bundle\DoctrineBundle\DoctrineBundle::class => ['all' => true], Doctrine\Bundle\DoctrineBundle\DoctrineBundle::class => ['all' => true],
Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle::class => ['all' => true], Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle::class => ['all' => true],
Symfony\Bundle\SecurityBundle\SecurityBundle::class => ['all' => true], Symfony\Bundle\SecurityBundle\SecurityBundle::class => ['all' => true],
Symfony\Bundle\WebProfilerBundle\WebProfilerBundle::class => ['dev' => true, 'test' => true],
Symfony\Bundle\MonologBundle\MonologBundle::class => ['all' => true],
Symfony\Bundle\DebugBundle\DebugBundle::class => ['dev' => true, 'test' => true],
Symfony\Bundle\MakerBundle\MakerBundle::class => ['dev' => true], Symfony\Bundle\MakerBundle\MakerBundle::class => ['dev' => true],
FOS\UserBundle\FOSUserBundle::class => ['all' => true],
]; ];
fos_user:
db_driver: orm # other valid values are 'mongodb', 'couchdb' and 'propel'
firewall_name: main
user_class: App\Entity\User
from_email:
address: "system@customspeens.net"
sender_name: "CustomSpeens"
\ No newline at end of file
...@@ -14,3 +14,6 @@ framework: ...@@ -14,3 +14,6 @@ framework:
#fragments: true #fragments: true
php_errors: php_errors:
log: true log: true
templating:
engines: ['twig', 'php']
framework:
notifier:
#chatter_transports:
# slack: '%env(SLACK_DSN)%'
# telegram: '%env(TELEGRAM_DSN)%'
#texter_transports:
# twilio: '%env(TWILIO_DSN)%'
# nexmo: '%env(NEXMO_DSN)%'
channel_policy:
# use chat/slack, chat/telegram, sms/twilio or sms/nexmo
urgent: ['email']
high: ['email']
medium: ['email']
low: ['email']
admin_recipients:
- { email: admin@example.com }
framework: framework:
router: router:
utf8: true utf8: true
\ No newline at end of file
security: security:
# https://symfony.com/doc/current/security.html#where-do-users-come-from-user-providers encoders:
FOS\UserBundle\Model\UserInterface: bcrypt
role_hierarchy:
ROLE_MODERATOR: ROLE_USER
ROLE_ADMIN: ROLE_MODERATOR
providers: providers:
users_in_memory: { memory: null } fos_userbundle:
id: fos_user.user_provider.username
firewalls: firewalls:
dev:
pattern: ^/(_(profiler|wdt)|css|images|js)/
security: false
main: main:
anonymous: lazy pattern: ^/
provider: users_in_memory user_checker: security.user_checker
form_login:
# activate different ways to authenticate provider: fos_userbundle
# https://symfony.com/doc/current/security.html#firewalls-authentication csrf_token_generator: security.csrf.token_manager
# https://symfony.com/doc/current/security/impersonating_user.html logout: true
# switch_user: true anonymous: true
# Easy way to control access for large sections of your site
# Note: Only the *first* access control that matches will be used
access_control: access_control:
# - { path: ^/admin, roles: ROLE_ADMIN } - { path: ^/login$, role: IS_AUTHENTICATED_ANONYMOUSLY }
# - { path: ^/profile, roles: ROLE_USER } - { path: ^/register, role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/resetting, role: IS_AUTHENTICATED_ANONYMOUSLY }
- { path: ^/upload/, role: ROLE_USER }
- { path: ^/modpanel/, role: ROLE_MODERATOR }
- { path: ^/adminpanel/, role: ROLE_ADMIN }
\ No newline at end of file
twig: twig:
default_path: '%kernel.project_dir%/templates' default_path: '%kernel.project_dir%/templates'
debug: '%kernel.debug%'
strict_variables: '%kernel.debug%'
exception_controller: null
#index:
# path: /
# controller: App\Controller\DefaultController::index
...@@ -5,3 +5,6 @@ controllers: ...@@ -5,3 +5,6 @@ controllers:
kernel: kernel:
resource: ../../src/Kernel.php resource: ../../src/Kernel.php
type: annotation type: annotation
fos_user:
resource: "@FOSUserBundle/Resources/config/routing/all.xml"
\ No newline at end of file
...@@ -4,6 +4,9 @@ ...@@ -4,6 +4,9 @@
# Put parameters here that don't need to change on each machine where the app is deployed # Put parameters here that don't need to change on each machine where the app is deployed
# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration # https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration
parameters: parameters:
backup_path: "%kernel.project_dir%/public/uploads/backup"
cover_path: "%kernel.project_dir%/public/uploads/cover"
temp_path: "%kernel.project_dir%/public/uploads/temp"
services: services:
# default configuration for services in *this* file # default configuration for services in *this* file
......
<?php
namespace App\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\Routing\Annotation\Route;
class IndexController extends AbstractController
{
/**
* @Route("/", name="index.index")
*/
public function index()
{
return $this->render('index/index.html.twig', [
'controller_name' => 'IndexController',
]);
}
/**
* @Route("/hot", name="index.hot")
*/
public function hotUploads()
{
return $this->render('index/index.html.twig', [
'controller_name' => 'IndexController',
]);
}
/**
* @Route("/new", name="index.new")
*/
public function newUploads()
{
return $this->render('index/index.html.twig', [
'controller_name' => 'IndexController',
]);
}
}
<?php
namespace App\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\Routing\Annotation\Route;
class ModerationController extends AbstractController
{
/**
* @Route("/moderation", name="moderation.index")
*/
public function index()
{
return $this->render('moderation/index.html.twig', [
'controller_name' => 'ModerationController',
]);
}
}
<?php
namespace App\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\Routing\Annotation\Route;
class ProfileController extends AbstractController
{
/**
* @Route("/profile", name="profile.index")
*/
public function index()
{
return $this->render('profile/index.html.twig', [
'controller_name' => 'ProfileController',
]);
}
}
<?php
namespace App\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\HttpFoundation\File\Exception\FileException;
use Symfony\Component\HttpFoundation\File\UploadedFile;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Form\Extension\Core\Type\TextType;;
use Symfony\Component\Form\Extension\Core\Type\FileType;
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
use App\Entity\Song;
use App\Utils\HelperFunctions;
class UploadController extends AbstractController
{
/**
* @Route("/upload", name="upload.index")
*/
public function index(Request $request)
{
$em = $this->getDoctrine()->getManager();
$tempVars = [];
$song = new Song();
$form = $this->createFormBuilder()
->add('backupPath', FileType::class, ['label' => 'Backup .zip file'])
->add('save', SubmitType::class, ['label' => 'Upload'])
->getForm();
$form->handleRequest($request);
$tempVars['uploadForm'] = $form->createView();
if($form->isSubmitted() && $form->isValid()) {
$data = $form->getData();
$backupFile = $data['backupPath'];
if($backupFile) {
$song->setFileReference(uniqid());
$zip = new \ZipArchive;
if($zip->open($backupFile)) {
try {
// extract backup
$extractionPath = $this->getParameter('temp_path').DIRECTORY_SEPARATOR.$song->getFileReference();
$zip->extractTo($extractionPath);
$zip->close();
try {
// get backup data
$allSRTBFiles = glob($extractionPath.DIRECTORY_SEPARATOR."*.srtb");
$srtbContent = json_decode(file_get_contents($allSRTBFiles[0]));
$trackInfo = json_decode($srtbContent->largeStringValuesContainer->values[0]->val);
// set meta data
$song->setTitle($trackInfo->title);
$song->setSubtitle($trackInfo->subtitle);
$song->setArtist($trackInfo->artistName);
$song->setAuthor($trackInfo->charter);
try {
// find cover
$coverFiles = glob($extractionPath.DIRECTORY_SEPARATOR."AlbumArt".DIRECTORY_SEPARATOR.$trackInfo->albumArtReference->assetName.".*");
if($coverFiles[0]) {
rename($coverFiles[0], $this->getParameter('cover_path').DIRECTORY_SEPARATOR.$song->getFileReference().".png");
}
} catch(Exception $e) {
var_dump($e);
}
try {
// move backup file
$backupFile->move($this->getParameter('backup_path'), $song->getFileReference().'.'.$backupFile->guessExtension());
} catch(Exception $e) {
var_dump($e);
}
// clean up temp files
$hf = new HelperFunctions();
$hf->delTree($extractionPath);
// save in database
$em->persist($song);
$em->flush();
$tempVars['songInfo'] = $song;
return $this->render('upload/success.html.twig', $tempVars);
} catch(Exception $e) {
var_dump($e);
}
} catch(Exception $e) {
var_dump($e);
}
} else {
throw new \Exception("Error when extracting ZIP file");
}
}
}
return $this->render('upload/index.html.twig', $tempVars);
}
}
<?php
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass="App\Repository\SongRepository")
*/
class Song
{
/**
* @ORM\Id()
* @ORM\GeneratedValue()
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255)
*/
private $title;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $subtitle;
/**
* @ORM\Column(type="string", length=255)
*/
private $artist;
/**
* @ORM\Column(type="string", length=255)
*/
private $author;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $fileReference;
public function getId(): ?int
{
return $this->id;
}
public function getTitle(): ?string
{
return $this->title;
}
public function setTitle(string $title): self
{
$this->title = $title;
return $this;
}
public function getSubtitle(): ?string
{
return $this->subtitle;
}
public function setSubtitle(?string $subtitle): self
{
$this->subtitle = $subtitle;
return $this;
}
public function getArtist(): ?string
{
return $this->artist;
}
public function setArtist(string $artist): self
{
$this->artist = $artist;
return $this;
}
public function getAuthor(): ?string
{
return $this->author;
}
public function setAuthor(string $author): self
{
$this->author = $author;
return $this;
}
public function getFileReference(): ?string
{
return $this->fileReference;
}
public function setFileReference(?string $fileReference): self
{
$this->fileReference = $fileReference;
return $this;
}
}
<?php
// src/AppBundle/Entity/User.php
namespace App\Entity;
use FOS\UserBundle\Model\User as BaseUser;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity
* @ORM\Table(name="fos_user")
*/
class User extends BaseUser
{
/**
* @ORM\Id
* @ORM\Column(type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id;
public function __construct()
{
parent::__construct();
// your own logic
}
}
\ No newline at end of file
<?php
namespace App\Repository;
use App\Entity\Song;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\Common\Persistence\ManagerRegistry;
/**
* @method Song|null find($id, $lockMode = null, $lockVersion = null)
* @method Song|null findOneBy(array $criteria, array $orderBy = null)
* @method Song[] findAll()
* @method Song[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
*/
class SongRepository extends ServiceEntityRepository
{
public function __construct(ManagerRegistry $registry)
{
parent::__construct($registry, Song::class);
}
// /**
// * @return Song[] Returns an array of Song objects
// */
/*
public function findByExampleField($value)
{
return $this->createQueryBuilder('s')
->andWhere('s.exampleField = :val')
->setParameter('val', $value)
->orderBy('s.id', 'ASC')
->setMaxResults(10)
->getQuery()
->getResult()
;
}
*/
/*
public function findOneBySomeField($value): ?Song
{
return $this->createQueryBuilder('s')
->andWhere('s.exampleField = :val')
->setParameter('val', $value)
->getQuery()
->getOneOrNullResult()
;
}
*/
}
<?php
namespace App\Utils;
use App\Utils\HelperFunctions;
class HelperFunctions {
public static function delTree($dir) {
$hf = new HelperFunctions();
$files = array_diff(scandir($dir), array('.','..'));
foreach ($files as $file) {
(is_dir("$dir/$file")) ? $hf->delTree("$dir/$file") : unlink("$dir/$file");
}
return rmdir($dir);
}
}
\ No newline at end of file
...@@ -90,6 +90,9 @@ ...@@ -90,6 +90,9 @@
"egulias/email-validator": { "egulias/email-validator": {
"version": "2.1.17" "version": "2.1.17"
}, },
"friendsofsymfony/user-bundle": {
"version": "v2.1.2"
},
"jdorn/sql-formatter": { "jdorn/sql-formatter": {
"version": "v1.2.17" "version": "v1.2.17"
}, },
...@@ -103,7 +106,7 @@ ...@@ -103,7 +106,7 @@
"version": "1.0.2" "version": "1.0.2"
}, },
"monolog/monolog": { "monolog/monolog": {
"version": "2.0.2" "version": "1.25.3"
}, },
"nikic/php-parser": { "nikic/php-parser": {
"version": "v4.3.0" "version": "v4.3.0"
...@@ -132,9 +135,6 @@ ...@@ -132,9 +135,6 @@
"psr/container": { "psr/container": {
"version": "1.0.0" "version": "1.0.0"
}, },
"psr/event-dispatcher": {
"version": "1.0.0"
},
"psr/link": { "psr/link": {
"version": "1.0.0" "version": "1.0.0"
}, },
...@@ -154,19 +154,19 @@ ...@@ -154,19 +154,19 @@
] ]
}, },
"symfony/asset": { "symfony/asset": {
"version": "v5.0.6" "version": "v4.4.6"
}, },
"symfony/browser-kit": { "symfony/browser-kit": {
"version": "v5.0.6" "version": "v4.4.6"
}, },
"symfony/cache": { "symfony/cache": {
"version": "v5.0.6" "version": "v4.4.6"
}, },
"symfony/cache-contracts": { "symfony/cache-contracts": {
"version": "v2.0.1" "version": "v2.0.1"
}, },
"symfony/config": { "symfony/config": {
"version": "v5.0.6" "version": "v4.4.6"
}, },
"symfony/console": { "symfony/console": {
"version": "4.4", "version": "4.4",
...@@ -182,7 +182,10 @@ ...@@ -182,7 +182,10 @@
] ]
}, },
"symfony/css-selector": { "symfony/css-selector": {
"version": "v5.0.6" "version": "v4.4.6"
},
"symfony/debug": {
"version": "v4.4.6"
}, },
"symfony/debug-bundle": { "symfony/debug-bundle": {
"version": "4.1", "version": "4.1",
...@@ -200,34 +203,34 @@ ...@@ -200,34 +203,34 @@
"version": "v1.0.7" "version": "v1.0.7"
}, },
"symfony/dependency-injection": { "symfony/dependency-injection": {
"version": "v5.0.6" "version": "v4.4.6"
}, },
"symfony/doctrine-bridge": { "symfony/doctrine-bridge": {
"version": "v5.0.6" "version": "v4.4.6"
}, },
"symfony/dom-crawler": { "symfony/dom-crawler": {
"version": "v5.0.6" "version": "v4.4.6"
}, },
"symfony/dotenv": { "symfony/dotenv": {
"version": "v5.0.6" "version": "v4.4.6"
}, },
"symfony/error-handler": { "symfony/error-handler": {
"version": "v5.0.6" "version": "v4.4.6"
}, },
"symfony/event-dispatcher": { "symfony/event-dispatcher": {
"version": "v5.0.6" "version": "v4.4.6"
}, },
"symfony/event-dispatcher-contracts": { "symfony/event-dispatcher-contracts": {
"version": "v2.0.1" "version": "v1.1.7"
}, },
"symfony/expression-language": { "symfony/expression-language": {
"version": "v5.0.6" "version": "v4.4.6"
}, },
"symfony/filesystem": { "symfony/filesystem": {
"version": "v5.0.6" "version": "v4.4.6"
}, },
"symfony/finder": { "symfony/finder": {
"version": "v5.0.6" "version": "v4.4.6"
}, },
"symfony/flex": { "symfony/flex": {
"version": "1.0", "version": "1.0",
...@@ -242,7 +245,7 @@ ...@@ -242,7 +245,7 @@
] ]
}, },
"symfony/form": { "symfony/form": {
"version": "v5.0.6" "version": "v4.4.6"
}, },
"symfony/framework-bundle": { "symfony/framework-bundle": {
"version": "4.4", "version": "4.4",
...@@ -265,22 +268,22 @@ ...@@ -265,22 +268,22 @@
] ]
}, },
"symfony/http-client": { "symfony/http-client": {
"version": "v5.0.6" "version": "v4.4.6"
}, },
"symfony/http-client-contracts": { "symfony/http-client-contracts": {
"version": "v2.0.1" "version": "v2.0.1"
}, },
"symfony/http-foundation": { "symfony/http-foundation": {
"version": "v5.0.6" "version": "v4.4.6"
}, },
"symfony/http-kernel": { "symfony/http-kernel": {
"version": "v5.0.6" "version": "v4.4.6"
}, },
"symfony/inflector": { "symfony/inflector": {
"version": "v5.0.6" "version": "v4.4.6"
}, },
"symfony/intl": { "symfony/intl": {
"version": "v5.0.6" "version": "v4.4.6"
}, },
"symfony/mailer": { "symfony/mailer": {
"version": "4.3", "version": "4.3",
...@@ -304,10 +307,10 @@ ...@@ -304,10 +307,10 @@
} }
}, },
"symfony/mime": { "symfony/mime": {
"version": "v5.0.6" "version": "v4.4.6"
}, },
"symfony/monolog-bridge": { "symfony/monolog-bridge": {
"version": "v5.0.6" "version": "v4.4.6"
}, },
"symfony/monolog-bundle": { "symfony/monolog-bundle": {
"version": "3.3", "version": "3.3",
...@@ -323,20 +326,8 @@ ...@@ -323,20 +326,8 @@
"./config/packages/test/monolog.yaml" "./config/packages/test/monolog.yaml"
] ]
}, },
"symfony/notifier": {
"version": "5.0",
"recipe": {
"repo": "github.com/symfony/recipes",
"branch": "master",
"version": "5.0",
"ref": "c31585e252b32fe0e1f30b1f256af553f4a06eb9"
},
"files": [
"./config/packages/notifier.yaml"
]
},
"symfony/options-resolver": { "symfony/options-resolver": {
"version": "v5.0.6" "version": "v4.4.6"
}, },
"symfony/orm-pack": { "symfony/orm-pack": {
"version": "v1.0.8" "version": "v1.0.8"
...@@ -356,35 +347,32 @@ ...@@ -356,35 +347,32 @@
"./tests/bootstrap.php" "./tests/bootstrap.php"
] ]
}, },
"symfony/polyfill-intl-grapheme": {
"version": "v1.15.0"
},
"symfony/polyfill-intl-icu": { "symfony/polyfill-intl-icu": {
"version": "v1.15.0" "version": "v1.15.0"
}, },
"symfony/polyfill-intl-idn": { "symfony/polyfill-intl-idn": {
"version": "v1.15.0" "version": "v1.15.0"
}, },
"symfony/polyfill-intl-normalizer": { "symfony/polyfill-mbstring": {
"version": "v1.15.0" "version": "v1.15.0"
}, },
"symfony/polyfill-mbstring": { "symfony/polyfill-php72": {
"version": "v1.15.0" "version": "v1.15.0"
}, },
"symfony/polyfill-php73": { "symfony/polyfill-php73": {
"version": "v1.15.0" "version": "v1.15.0"
}, },
"symfony/process": { "symfony/process": {
"version": "v5.0.6" "version": "v4.4.6"
}, },
"symfony/profiler-pack": { "symfony/profiler-pack": {
"version": "v1.0.4" "version": "v1.0.4"
}, },
"symfony/property-access": { "symfony/property-access": {
"version": "v5.0.6" "version": "v4.4.6"
}, },
"symfony/property-info": { "symfony/property-info": {
"version": "v5.0.6" "version": "v4.4.6"
}, },
"symfony/routing": { "symfony/routing": {
"version": "4.2", "version": "4.2",
...@@ -413,19 +401,19 @@ ...@@ -413,19 +401,19 @@
] ]
}, },
"symfony/security-core": { "symfony/security-core": {
"version": "v5.0.6" "version": "v4.4.6"
}, },
"symfony/security-csrf": { "symfony/security-csrf": {
"version": "v5.0.6" "version": "v4.4.6"
}, },
"symfony/security-guard": { "symfony/security-guard": {
"version": "v5.0.6" "version": "v4.4.6"
}, },
"symfony/security-http": { "symfony/security-http": {
"version": "v5.0.6" "version": "v4.4.6"
}, },
"symfony/serializer": { "symfony/serializer": {
"version": "v5.0.6" "version": "v4.4.6"
}, },
"symfony/serializer-pack": { "symfony/serializer-pack": {
"version": "v1.0.3" "version": "v1.0.3"
...@@ -434,10 +422,10 @@ ...@@ -434,10 +422,10 @@
"version": "v2.0.1" "version": "v2.0.1"
}, },
"symfony/stopwatch": { "symfony/stopwatch": {
"version": "v5.0.6" "version": "v4.4.6"
}, },
"symfony/string": { "symfony/templating": {
"version": "v5.0.6" "version": "v4.4.6"
}, },
"symfony/test-pack": { "symfony/test-pack": {
"version": "v1.0.6" "version": "v1.0.6"
...@@ -459,15 +447,15 @@ ...@@ -459,15 +447,15 @@
"version": "v2.0.1" "version": "v2.0.1"
}, },
"symfony/twig-bridge": { "symfony/twig-bridge": {
"version": "v5.0.6" "version": "v4.4.6"
}, },
"symfony/twig-bundle": { "symfony/twig-bundle": {
"version": "5.0", "version": "4.4",
"recipe": { "recipe": {
"repo": "github.com/symfony/recipes", "repo": "github.com/symfony/recipes",
"branch": "master", "branch": "master",
"version": "5.0", "version": "4.4",
"ref": "fab9149bbaa4d5eca054ed93f9e1b66cc500895d" "ref": "15a41bbd66a1323d09824a189b485c126bbefa51"
}, },
"files": [ "files": [
"./config/packages/test/twig.yaml", "./config/packages/test/twig.yaml",
...@@ -492,13 +480,13 @@ ...@@ -492,13 +480,13 @@
] ]
}, },
"symfony/var-dumper": { "symfony/var-dumper": {
"version": "v5.0.6" "version": "v4.4.6"
}, },
"symfony/var-exporter": { "symfony/var-exporter": {
"version": "v5.0.6" "version": "v4.4.6"
}, },
"symfony/web-link": { "symfony/web-link": {
"version": "v5.0.6" "version": "v4.4.6"
}, },
"symfony/web-profiler-bundle": { "symfony/web-profiler-bundle": {
"version": "3.3", "version": "3.3",
...@@ -515,7 +503,7 @@ ...@@ -515,7 +503,7 @@
] ]
}, },
"symfony/yaml": { "symfony/yaml": {
"version": "v5.0.6" "version": "v4.4.6"
}, },
"twig/extra-bundle": { "twig/extra-bundle": {
"version": "v3.0.3" "version": "v3.0.3"
......
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8" />
<title>{% block title %}Welcome!{% endblock %}</title> <title>CustomSpeens</title>
<!-- Stylesheets -->
{% block stylesheets %}{% endblock %} {% block stylesheets %}{% endblock %}
</head> </head>
<body> <body>
<strong>CustomSpeens</strong><br /><br />
<nav>
<a href="{{ path('index.index') }}">Index</a><br />
<a href="{{ path('index.hot') }}">Hot</a><br />
<a href="{{ path('index.new') }}">New</a><br /><br />
{% if is_granted("ROLE_USER") %}
<div>{{ app.user.username }}</div>
<a href="{{ path('upload.index') }}">Upload</a><br />
<a href="{{ path('fos_user_security_logout') }}">Logout</a>
{% else %}
<a href="{{ path('fos_user_security_login') }}">Login</a><br />
<a href="{{ path('fos_user_registration_register') }}">Register</a>
{% endif %}
</nav>
<hr />
{% block body %}{% endblock %} {% block body %}{% endblock %}
{% block javascripts %}{% endblock %} {% block javascripts %}{% endblock %}
</body> </body>
</html> </html>
\ No newline at end of file
{% extends 'base.html.twig' %}
{% block title %}Hello IndexController!{% endblock %}
{% block body %}
INDEX
{% endblock %}
{% extends 'base.html.twig' %}
{% block title %}Hello ModerationController!{% endblock %}
{% block body %}
MODERATION
{% endblock %}
{% extends 'base.html.twig' %}
{% block title %}Hello ProfileController!{% endblock %}
{% block body %}
PROFILE
{% endblock %}
{% extends 'base.html.twig' %}
{% block title %}Hello UploadController!{% endblock %}
{% block body %}
<h1>Upload</h1>
{{ form_start(uploadForm) }}
{{ form_widget(uploadForm) }}
{{ form_end(uploadForm) }}
{% endblock %}
{% extends 'base.html.twig' %}
{% block title %}Hello UploadController!{% endblock %}
{% block body %}
<h1>Upload</h1>
<h2>Successfully uploaded!</h2>
<p>
<img src="{{ asset("uploads/cover/" ~ songInfo.fileReference ~ ".png") }}" alt="Cover" /><br /><br />
Title: {{ songInfo.title }}<br />
Subtitle: {{ songInfo.subtitle }}<br />
Artist: {{ songInfo.artist }}<br />
Charter: {{ songInfo.author }}
{% endblock %}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment