Sonerezh / sonerezh

A self-hosted, web-based application to stream your music, everywhere.
https://www.sonerezh.bzh
GNU Affero General Public License v3.0
769 stars 122 forks source link

Making /albums default page #170

Open madebysimone opened 8 years ago

madebysimone commented 8 years ago

Hi I was wondering how I could setup my installation of Sonerezh so that the default web page loaded is not "songs" but "albums"? Thanks!

lGuillaume124 commented 8 years ago

Ho simonepolidori, you can edit app/Controller/AppController.php and add loginRedirect to the $components['Auth'] array, like this:

    public $components = array(
       [...]
        'Auth' => array(
            'authenticate' => array(
                'Form' => array(
                    'passwordHasher' => 'Blowfish',
                    'fields' => array('username' => 'email')
                )
            ),
            'authorize' => array('Controller'),
            'unauthorizedRedirect' => array('controller' => 'songs', 'action' => 'index'),
            'loginRedirect' => array('controller' => 'songs', 'action' => 'albums')
        ),
        [...]
    );

But you will need to do this each time you update Sonerezh...

madebysimone commented 8 years ago

I made the adjustment but it does not seem to work even after rebooting the whole server.

pacija commented 7 years ago

I made albums default page with the following:

--- UsersController.php.OLD 2017-07-27 11:41:16.969862000 +0200
+++ UsersController.php 2017-07-27 11:41:56.086034000 +0200
@@ -150,7 +150,7 @@
                     $this->Session->delete('auth');
                 }

-                return $this->redirect($this->Auth->redirectUrl());
+                return $this->redirect($this->Auth->redirectUrl('https://sonerezh.example.org/albums'));

             } else {
                 $this->Flash->error(__('Wrong credentials!'));

However, I have no idea if I broke anything else, hopefully someone reviews this :)