Search

Hi,

I'm using the Members extension with the Members Form which allows me to setup a redirect after the member logs in. I would like to be more specific and redirect the member depending on their role.

I'm trying to do this by writing some custom php code using the class.role.php but it's return a 500 error page. I'm a symphony and php newbie, wondering if someone can give me some pointers.

<?php

require_once('../../extensions/members/lib/class.role.php');

$RM = new RoleManager();

echo $RM::fetchRoleIDByHandle('user1', false);

?>

Thank you!

If you want to keep it all in your XSLT layer you could grab the user data from datasources/page params and do the logic in your templates, and use the Page Headers extension to perform the actual redirect. This way you wouldn't have to write any PHP at all.

Just remember that any header output has to happen before you start outputting any other content. Easy enough to add in your master.xsl or similar before any other output.

Thanks Henry! I'll definitely look into the Page Headers extension.

But just for future reference, can you tell what was wrong with the way I was referencing the Role Manager library?

The Page Headers extension worked perfectly for my redirects. I was wondering if I can also use this extension to load a pdf. For example:

header('Content-type: application/pdf'); header('Content-Disposition: inline; filename="test.pdf"'); header('Content-Length: ' . filesize('test.pdf')); @readfile('test.pdf');

Check out Force Download.

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details