We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 26182
    • 164 Posts
    Hi,

    I was just wondering how you can re-direct a user to a page once you’ve implemented the manager login snippet. That is, when the user logs in they are taken to the appropriate page.

    Any help you could offer would be greatly appreciated.

    Thankyou smiley

    Sarah
      • 26182
      • 164 Posts
      Does the information go somewhere here?

      if($_SESSION['mgrValidated']) {
         // check if we should redirect user to a web page
         $tbl = $modx->getFullTableName('user_settings');
         $id = $modx->db->getValue("SELECT setting_value FROM {$tbl} WHERE user = '{$usr_internalKey}' AND setting_name = 'manager_login_startup';");
         if(isset($id) && $id>0) {
          $url = $modx->makeUrl($id);
          header("Location: {$url}");
         }
        }

      [Moderator’s note: glow tags replaced with code tags for readability (and fewer headaches) smiley]
        • 22303 MODX Staff
        • 10,725 Posts
        You can edit the users settings in the Manager and select a front-end page id for the user to be directed to.
          • 26182
          • 164 Posts
          Hey thanks for that smiley I tried to replicate the code from the back end and install it in a snippet to implement deleting users. Do you think this has any chance of working? Or is there a way to do it?

          Thankyou.

          Sarah