Installation problem resulting in CHttpException

Ive installed the ubermigration module on xampp with apache on my local machine but it does not work when i try to navigate to the admin section of the module.
 
All installation steps prior to this completed without error.
 
I get an error a CHttpException error on the page.
 
Please advise
Thanks
 

  1. Profile photo of john parkjohn park 260.00 $tone October 8, 2019
    Its failing here


    public function getUrlReferrer() {
    return isset($_SERVER['HTTP_REFERER'])?$_SERVER['HTTP_REFERER']:null;
    }


    I dont seem to have a HTTP_REFERERThanks

4 answers

Profile photo of john park 260.00 $tone October 8, 2019
Public

pffft sorted 
/**
* Init function
*/
public function init()
{
/**
* Check access for security
* We only allow access this tool with valid token string
* and request from M2 back-end internal URL context
**/
$refererURL = Yii::app()->request->getUrlReferrer();
$token = Yii::app()->request->getParam(‘token’, null);

if (empty($refererURL) || $token != UBMigrate::getToken()) {
throw new CHttpException(400, Yii::t(‘frontend’,’Your request is invalid.’));
} else {
$envData = UBMigrate::getEnvData();
$validURLPart1 = “/({$envData[‘backend’][‘frontName’]}\/ubdatamigration\/index\/index)/i”;
$validURLPart2 = “/(pub\/ub-tool)/i”;
//if ( preg_match($validURLPart1, $refererURL) || preg_match($validURLPart2, $refererURL) ) {
//initial language
if (!isset(Yii::app()->session[‘_lang’])) {
Yii::app()->session[‘_lang’] = Yii::app()->params[‘defaultLanguage’];
}
Yii::app()->language = Yii::app()->session[‘_lang’];
return parent::init();
//} else {
//throw new CHttpException(400, Yii::t(‘frontend’,’Your request is invalid.’));
//}
}
}
 
i just took out the check but would still like a proper solution lol
 
 

#1
Profile photo of ubdev Staff 98350.00 $tone October 9, 2019
Public

Hi John, 

I dont seem to have a HTTP_REFERER

You’re right, the issue related to your PHP setting $_SERVER[‘HTTP_REFERER’]. 
Meanwhile, we wonder if you have another paid profile at Ubertheme? We could not keep track of the purchase associated with your profile. 
Our technical support requires active subscription though. 
Regards,
Ubertheme team
 

#2
Profile photo of ubdev Staff 98350.00 $tone October 9, 2019
Public

Hi John, 
 
Glad that you sorted it out at your end. 
 
In case you have any additional related to the migration, please help to advice your client to submit under his paid profile. We will work closely with you then. 
 
PS. The Magento 2.3.3 has just been out on Oct 8, our team is still testing compatibility with this new release. We will update our migration tool accordingly soon.
Regards,
Ubertheme team 

#4

Please login or Register to Submit Answer

Written By

Comments