R
ragtek
Guest
I'm showing the node edit page in the frontend.
The controller redirects to
to stop this behaviour i coded this:
It's working fine on 2 testboards, but is it a clean way?
The only scenario where this could cause problems is that the user renamed his admin.php to something else, but could users using this add-on get other problems?
The controller redirects to
PHP:
return $this->responseRedirect(
XenForo_ControllerResponse_Redirect::SUCCESS,
XenForo_Link::buildAdminLink('nodes') . $this->getLastHash($nodeId)
);
to stop this behaviour i coded this:
PHP:
$comeFrom = $this->_request->get('_xfRequestUri');
if(preg_match("/admin.php/",$comeFrom)){
return $this->responseRedirect(
XenForo_ControllerResponse_Redirect::SUCCESS,
XenForo_Link::buildAdminLink('nodes') . $this->getLastHash($nodeId)
);
}
else if ($this->_noRedirect()){
return $this->responseRedirect(
XenForo_ControllerResponse_Redirect::SUCCESS,
XenForo_Link::buildPublicLink('pages', $pageData)
);
}
It's working fine on 2 testboards, but is it a clean way?
The only scenario where this could cause problems is that the user renamed his admin.php to something else, but could users using this add-on get other problems?