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

Error when logged in as submission account user and then trying to then login as regular user #1

Open
benkeen opened this issue Jun 5, 2014 · 0 comments

Comments

@benkeen
Copy link
Member

benkeen commented Jun 5, 2014

On the site I'm developing, I have the option to edit your submissions using the Submission Accounts module. I also have a regular user account that is used to view all submissions (view, not edit). This regular user is open to the public so I can easily control what the public sees (I can't use the API to display the submissions on this particular site).

Problem is that if someone logs in to edit their submission and try to view the public listings they get an error that says (* = server path leading to the formtools folder):
Notice: Undefined index: login_page in _
/formtools/index.php on line 11
Notice: Undefined index: in */formtools/index.php on line 12
Warning: Cannot modify header information - headers already sent by (output started at *
/formtools/index.php:11) in _/formtools/index.php on line 12

Thanks for all of your hard work on this.

Steps to reproduce:

  1. Login as a Submission Account
  2. Go to the regular formtools index page

KZeni: I got it working by doing a quick hack of adding the following to /formtools/index.php (lines after 'require_once("global/session_start.php");')

// Start check if submission account
$form_id_str = "";
if (isset($_SESSION["ft"]["account"]["form_id"])){
$form_id_str = "?form_tools_form_id=" . $_SESSION["ft"]["account"]["form_id"];

$module_settings = ft_get_module_settings("", "submission_accounts");
$logout_url = $module_settings["logout_url"];

$_SESSION["ft"] = array();

header("location: $logout_url{$form_id_str}");
}
// End check if submission account

Let me know if there's a better way of doing this, thanks.

Interesting... thanks for posting your fix.

I really hate to update the core code for fixes for custom modules, though.

Frankly this is really an overall design problem. The two account types (Submission Accounts & the Core) SHOULD be entirely independent. It was bad design on my part to combine the two like I did.

I'll put this down as "confirmed", but I'm going to give it some more thought before implementing your fix - or one like it.

Thanks, KZeni!

  • Ben
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

1 participant