Skip to content

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

@benkeen

Description

@benkeen

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions