merge r2054-2058.

This commit is contained in:
wlx 2012-03-16 06:15:54 +00:00
parent 7fa224418e
commit 81c8e569e2
2 changed files with 39 additions and 4 deletions

View File

@ -178,7 +178,7 @@ class AccountController extends Zend_Controller_Action
$sql="select usertype from users where username='$u'"; $sql="select usertype from users where username='$u'";
$rs=$db->query($sql); $rs=$db->query($sql);
$row=$rs->fetch(); $row=$rs->fetch();
if($row['usertype']!='administrator') //if($row['usertype']!='administrator')
{ {
require_once 'member.php'; require_once 'member.php';
$mb = new member(); $mb = new member();

View File

@ -12,8 +12,8 @@ class ServiceController extends Zend_Controller_Action
{ {
$this->db=Zend_Registry::get('db'); $this->db=Zend_Registry::get('db');
$this->config = Zend_Registry::get('config'); $this->config = Zend_Registry::get('config');
$this->messenger=$this->_helper->getHelper('FlashMessenger'); //$this->messenger=$this->_helper->getHelper('FlashMessenger');
$this->view->messages = $this->messenger->getMessages(); //$this->view->messages = $this->messenger->getMessages();
} }
/* /*
@ -1211,7 +1211,42 @@ class ServiceController extends Zend_Controller_Action
} }
echo '</ul>'; echo '</ul>';
echo $pagnation; echo $pagnation;
}//文档页面相关数据 }//文档页面相关数据
function geonetwork()
{
$this->_helper->viewRenderer->setNoRender();
$this->_helper->layout->disableLayout();
$auth = Zend_Auth::getInstance();
if (!$auth->hasIdentity())
exit();
$user = $auth->getIdentity();
//need to get pwd from database
$sql='select username,md5(password) as pwd from users where id='.$user->id;
$row=$this->db->fetchRow($sql);
$login=$this->config->geonetwork->url.'/srv/en/xml.user.login?username='.$row->username.'&password='.$row->pwd;
$url = $this->_request->getParam('url');
if empty($url)
$url='/geonetwork/srv/cn/';
$body='<html>
<script type="text/javascript" src="/js/jquery-1.7.min.js"></script>
<script type="text/javascript">
var b = null;
$(document).ready(function() {
$.get(
"'.$login.'",
{},
function(data){
var url = "'.$url.'";
$(location).attr("href",url);
}
);
});
</script>
<body></body>
</html>';
$this->getResponse()->setHeader('Content-Type', 'text/html')
->setBody($body);
}
/* /*
输出验证码 输出验证码