Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

General Questions

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Redirect to 'admin/myModule'


Reply

3 Posts   992 Views

Avatar
Edward Cutty

27 May 2010 at 9:38pm Community Member, 4 Posts

Hi all, got a problem with redirect in admin section.

When an user is logged, i want to redirect him to the page of the module i've created (example: /admin/myModule).

I've tried to do this in LeftAndMain using Director::redirect($Url_base. 'myModule'), but it doesn't work.

Any suggestions?

Thanks in advance

ed

Avatar
swaiba

28 May 2010 at 3:59am (Last edited: 28 May 2010 4:00am), Forum Moderator, 1796 Posts

I've used this in _config.php...

Security::set_default_login_dest('admin/myModule');

Barry

Avatar
Edward Cutty

28 May 2010 at 7:28pm (Last edited: 28 May 2010 7:34pm), Community Member, 4 Posts

Thanks so much Barry, but it doesn't work for me. I've also tried to set the $default_login_dest in Security.php, but it always redirects me to admin/.

I solved changing (in LeftAndMain) this line

return Director::redirect($candidate->Link);

to

return Director::redirect('admin/myModule');

Bye