“Error” in the querystring causes redirect to configuration page
-
The code below handles oauth integration. If error exists in the querystring, the plugin always redirects to admin.php?page=mb_email_configuration. This causes a problem for us as other integrations may return “error” to the site that have nothing to do with oauth or the mail bank plugin. This causes great confusion for our users.
Is it possible to implement a check for someone to be logged in as an admin in order to get redirected to admin.php? This would solve our issue. Or, if you have a different suggestion that would only redirect when appropriate, that would be great. Thanks.
/*
Function Name: oauth_handling_mail_bank
Parameters: No
Description: This function is used to Manage Redirect.
Created On: 11-08-2016 11:53
Created By: Tech Banker Team
*/if(!function_exists(“oauth_handling_mail_bank”))
{
function oauth_handling_mail_bank()
{if(isset($_REQUEST[“code”]))
{
if(file_exists(MAIL_BANK_DIR_PATH.”lib/callback.php”))
{
include_once MAIL_BANK_DIR_PATH.”lib/callback.php”;
}
}
elseif(isset($_REQUEST[“error”]))
{
$url = admin_url(“admin.php?page=mb_email_configuration”);
header(“location: $url”);
}
}}
- The topic ‘“Error” in the querystring causes redirect to configuration page’ is closed to new replies.