* adjust the check referer logic.

This commit is contained in:
wangchunsheng
2011-04-28 13:20:18 +00:00
parent 8ca156c3c0
commit 673301f0fc
+10 -4
View File
@@ -349,22 +349,28 @@ class user extends control
)
{
if($this->app->getViewType() == 'json') die(json_encode(array('status' => 'success')));
/* Get the module and method of the referer. */
if($this->config->requestType == 'PATH_INFO')
{
$path = substr($this->post->referer, strrpos($this->post->referer, '/')+1);
$path = rtrim($path, 'html');
$path = rtrim($path, '.');
list($module, $method) = explode($this->config->requestFix, $path);
$path = substr($this->post->referer, strrpos($this->post->referer, '/') + 1);
$path = rtrim($path, '.html');
list($module, $method) = explode($this->config->requestFix, $path);
}
else
{
$module = $this->get->m;
$method = $this->get->f;
}
if(common::hasPriv($module, $method))
{
die(js::locate($this->post->referer, 'parent'));
}
else
{
die(js::locate($this->config->default->module, 'parent'));
}
}
else
{