Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Making /albums default page #170

Open
madebysimone opened this issue Mar 25, 2016 · 3 comments
Open

Making /albums default page #170

madebysimone opened this issue Mar 25, 2016 · 3 comments

Comments

@madebysimone
Copy link

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!

  • Simon
@lGuillaume124
Copy link
Contributor

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
Copy link
Author

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

@pacija
Copy link

pacija commented Jul 27, 2017

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 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants