|
|
+ |
查看详细
邀请专家
更改管理员
diff --git a/application/admin/views/scripts/review/reviewed.phtml b/application/admin/views/scripts/review/reviewed.phtml
index d3c74486..46a1bcad 100644
--- a/application/admin/views/scripts/review/reviewed.phtml
+++ b/application/admin/views/scripts/review/reviewed.phtml
@@ -32,7 +32,8 @@
- 标题 |
+ 标题 |
+ 管理员 |
结束时间 |
操作 |
@@ -41,6 +42,7 @@
paginator as $item): ?>
|
+ |
|
查看评审意见 重新评审 |
diff --git a/application/default/controllers/AccountController.php b/application/default/controllers/AccountController.php
index ecd01e20..c9f790af 100755
--- a/application/default/controllers/AccountController.php
+++ b/application/default/controllers/AccountController.php
@@ -114,6 +114,7 @@ class AccountController extends Zend_Controller_Action
{
$this->view->pageID = "account-secure";
+ include_once("helper/view.php");
include_once("Users.php");
$usr = new Users($this->db);
@@ -124,60 +125,99 @@ class AccountController extends Zend_Controller_Action
$uid = $user->id;
}
+ $opt = $this->_getParam('opt');
$submit = $this->_getParam('submit');
- if(!empty($submit))
+ if(empty($opt))
{
- $data = $this->AccountSecureParamFilter();
-
- $this->view->AlertType = "alert-error";
- if(strlen($data['password'])>18 || strlen($data['new_password'])>18)
+ $this->view->section = "password";
+ if(!empty($submit))
{
- $this->view->error = "密码过长";
- return true;
- }
- if(strlen($data['new_password'])<=6 || strlen($data['new_password_confrim'])<=6)
- {
- $this->view->error = "密码过短,请输入大于6位的密码";
- return true;
- }
- if(md5($data['new_password']) != md5($data['new_password_confrim']))
- {
- $this->view->error = "两次输入的密码不相同";
- return true;
- }
-
- $sql = "SELECT password FROM users WHERE id=$uid";
- $rs = $this->db->query($sql);
- $row = $rs->fetch();
-
- if(md5($data['password']) != $row['password'])
- {
- $this->view->error = "原密码不正确";
- return true;
- }
-
- $data['password'] = md5($data['new_password']);
-
- unset($data['new_password']);
- unset($data['new_password_confrim']);
-
- if($this->db->update("users",$data,"id=$uid"))
- {
- $this->view->AlertType = "alert-success";
- $this->view->msg = "修改成功!";
- $this->view->jump_url = "/account/secure";
- return true;
- }else{
+ $data = $this->AccountSecureParamFilter();
+
$this->view->AlertType = "alert-error";
- $this->view->error = "修改失败,请重试";
- $this->view->info = $data;
- return true;
+ if(strlen($data['password'])>18 || strlen($data['new_password'])>18)
+ {
+ $this->view->error = view::Error("密码过长");
+ return true;
+ }
+ if(strlen($data['new_password'])<=6 || strlen($data['new_password_confrim'])<=6)
+ {
+ $this->view->error = view::Error("密码过短,请输入大于6位的密码");
+ return true;
+ }
+ if(md5($data['new_password']) != md5($data['new_password_confrim']))
+ {
+ $this->view->error = view::Error("两次输入的密码不相同");
+ return true;
+ }
+
+ $sql = "SELECT password FROM users WHERE id=$uid";
+ $rs = $this->db->query($sql);
+ $row = $rs->fetch();
+
+ if(md5($data['password']) != $row['password'])
+ {
+ $this->view->error = view::Error("原密码不正确");
+ return true;
+ }
+
+ $data['password'] = md5($data['new_password']);
+
+ unset($data['new_password']);
+ unset($data['new_password_confrim']);
+
+ if($this->db->update("users",$data,"id=$uid"))
+ {
+ view::Post($this,array("content"=>'修改成功!','url'=>'/account/secure'));
+ return true;
+ }else{
+ $this->view->error = view::Error("修改失败");
+ return true;
+ }
+ }else{
+ $this->view->info = $usr->getUserInfo($uid);
}
- }else{
- $this->view->info = $usr->getUserInfo($uid);
- }
+ }//password
+ if($opt == "email")
+ {
+ $this->view->section = "email";
+ if(!empty($submit))
+ {
+ $email = $this->_getParam('email');
+ $password = $this->_getParam('password');
+
+ if(!preg_match("/\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/i",$email))
+ {
+ $this->view->error = view::Error("错误的邮箱格式");
+ return true;
+ }
+
+ $sql = "SELECT password FROM users WHERE id=$uid";
+ $rs = $this->db->query($sql);
+ $row = $rs->fetch();
+
+ if(md5($password) != $row['password'])
+ {
+ $this->view->error = view::Error("原密码错误");
+ return true;
+ }
+
+ $data['email'] = $email;
+
+ if($this->db->update("users",$data,"id=$uid"))
+ {
+ view::Post($this,array("content"=>'修改成功!','url'=>'/account/secure'));
+ return true;
+ }else{
+ $this->view->error = view::Error("修改失败");
+ return true;
+ }
+ }else{
+ $this->view->info = $usr->getUserInfo($uid);
+ }
+ }//email
}
function AccountSecureParamFilter(){
diff --git a/application/default/controllers/AuthorController.php b/application/default/controllers/AuthorController.php
index 6ce39d74..b4c7c80c 100644
--- a/application/default/controllers/AuthorController.php
+++ b/application/default/controllers/AuthorController.php
@@ -4060,11 +4060,11 @@ class AuthorController extends Zend_Controller_Action
$this->view->data = $data;
$info = $doi->checkinfo($data['info']);
if(!is_array($info)){
- $this->view->error = view::Error('alert-error',$info,-1);
+ $this->view->error = view::Error($info);
return true;
}else{
$data['info'] = $info;
- $data['info'] = $doi->sksort($data['info'],"order",SORT_DESC);
+ $data['info'] = $doi->sksort($data['info'],"order",SORT_ASC);
}
$uid = view::User('id');
$state = $doi->update($data,$uuid,$uid);
@@ -4073,7 +4073,7 @@ class AuthorController extends Zend_Controller_Action
$this->view->msg = view::Msg('alert-success',"修改成功!",'/author/doi/uuid/'.$uuid);
return false;
}else{
- $this->view->error = view::Error('alert-error',"修改失败",-1);
+ $this->view->error = view::Error("修改失败");
return false;
}
}
diff --git a/application/default/controllers/ServiceController.php b/application/default/controllers/ServiceController.php
index 7fd559b9..5abb15ae 100644
--- a/application/default/controllers/ServiceController.php
+++ b/application/default/controllers/ServiceController.php
@@ -269,7 +269,7 @@ class ServiceController extends Zend_Controller_Action
$review=$this->_request->getParam('review');
if (!empty($uuid))
{
- $sql="select x.data,m.title,m.description,g.id,m.projection from xml x left join metadata m on m.id=x.id left join geonetworkmetadata g on g.uuid=m.uuid where m.uuid=".$this->db->quote($uuid);
+ $sql="select g.data,m.title,m.description,g.id,m.projection from metadata m left join xml x on m.id=x.id left join geonetworkmetadata g on g.uuid=m.uuid where m.uuid=".$this->db->quote($uuid);
$row=$this->db->fetchRow($sql);
$sql="select r.* from reference r left join mdref m on m.refid=r.id where m.uuid=?";
$sql=$this->db->quoteInto($sql,$uuid);
@@ -340,9 +340,9 @@ class ServiceController extends Zend_Controller_Action
if (preg_match("/MSIE/", $ua)) {
$dispostion = 'attachment; filename="'.urlencode($row['title']).'.doc"';
} else if (preg_match("/Firefox/", $ua)) {
- $dispostion;
+ //$dispostion;
} else {
- $dispostion = 'attachment; filename*="'.urlencode($row['title']).'.doc"';
+ $dispostion = 'attachment; filename="'.$row['title'].'.doc"';
}
$content.=$xslt->transformToXML($dom);
@@ -375,7 +375,7 @@ class ServiceController extends Zend_Controller_Action
{
$sql="select x.data,m.title,m.citation,m.suppinfo,m.doi,m.filesize,m.fileformat,m.south,m.east,m.west,m.north,m.timebegin,m.timeend,m.title_en,m.uuid,m.description,g.id,m.projection,t.filetype,
cc.name as category, cc.name_zh as category_zh
- from xml x left join metadata m on m.id=x.id left join thumbnail t on x.id=t.id
+ from metadata m left join xml x on m.id=x.id left join thumbnail t on x.id=t.id
left join category c on c.id=m.id left join categorycode cc on c.code=cc.code
left join geonetworkmetadata g on g.uuid=m.uuid where m.uuid=".$this->db->quote($uuid);
$row=$this->db->fetchRow($sql);
@@ -443,7 +443,7 @@ class ServiceController extends Zend_Controller_Action
$pdf->metadata=$row;
$pdf->Draw();
$pdf->setTitle($row['title'],true);
- $pdf->setAuthor('中国西部环境与生态科学数据中心',true);
+ $pdf->setAuthor('寒区旱区科学数据中心',true);
$this->getResponse()->setHeader('Content-Type', 'application/pdf');
//->setHeader('Content-Disposition','inline; filename="'.$row['title'].'.pdf"');
$pdf->Output($row['title'].'.pdf','I');
diff --git a/application/default/views/scripts/account/secure.phtml b/application/default/views/scripts/account/secure.phtml
index 93d707d4..9ce66cb2 100644
--- a/application/default/views/scripts/account/secure.phtml
+++ b/application/default/views/scripts/account/secure.phtml
@@ -13,56 +13,70 @@
修改安全性设置
- msg)) { ?>
- jump_url)) {?>
-
- jump_url)) { ?>
- 如果页面没有自动跳转请点击这里
-
-
-
-
+
+
+ - section == "email" || empty($this->section)) echo 'class="active"'?>>电子邮箱
+ - section == "password") echo 'class="active"'?>>修改密码
+
error)) { ?>
-
- ×
- error)) { ?> = $this->error ?>
-
- error as $v) { ?>
- - = $v ?>
-
-
-
-
+ = $this->error ?>
-
+
diff --git a/application/models/MetadataPDF.php b/application/models/MetadataPDF.php
index b7ab0fd3..32670194 100644
--- a/application/models/MetadataPDF.php
+++ b/application/models/MetadataPDF.php
@@ -28,10 +28,10 @@ class MetadataPDF extends PDF_Unicode
$this->Image('http://westdc.westgis.ac.cn/images/westdc_logo_white.gif',80,30,0,0,'','http://westdc.westgis.ac.cn/');
$this->SetFont('uGB','B',20);
$this->setXY(0,70);
- $this->Cell(0,0,'中国西部环境与生态科学数据中心',0,2,'C',false,'http://westdc.westgis.ac.cn/');
+ $this->Cell(0,0,'寒区旱区科学数据中心',0,2,'C',false,'http://westdc.westgis.ac.cn/');
$imgurl='http://'.$_SERVER['SERVER_NAME'].'/service/bigthumb/uuid/'.$this->metadata['uuid'];
$imgsize=getimagesize($imgurl);
- if ($imgsize)
+ if ($this->metadata['filetype'] && $imgsize)
{
if ($imgsize[0]/$imgsize[1]>200/180)
$this->Image($imgurl,5,110,200,0,$this->metadata['filetype']);
@@ -104,7 +104,7 @@ class MetadataPDF extends PDF_Unicode
$this->ln(5);
$x=$this->getX();$y=$this->getY();
$w=50*abs(($this->metadata['north']-$this->metadata['south'])/($this->metadata['west']-$this->metadata['east']));
- $this->Image('http://'.$_SERVER['SERVER_NAME'].'/service/thumb/uuid/'.$this->metadata['uuid'],$x+80+$w,$y,0,50,$this->metadata['filetype']);
+ if ($this->metadata['filetype']) $this->Image('http://'.$_SERVER['SERVER_NAME'].'/service/thumb/uuid/'.$this->metadata['uuid'],$x+80+$w,$y,0,50,$this->metadata['filetype']);
$this->rect($x+50,$y,$w,50);
$this->setXY($x+55,$y-4);
$this->write(5,'N:'.$this->metadata['north']);
diff --git a/application/models/data/Doi.php b/application/models/data/Doi.php
index 8fd74392..2b47d4c0 100644
--- a/application/models/data/Doi.php
+++ b/application/models/data/Doi.php
@@ -39,11 +39,14 @@ class Doi extends Zend_Controller_Plugin_Abstract
}
function update($data,$uuid,$uid=0){
- include_once("data/Author.php");
- $author = new Author($this->db);
- if($author->checkAuthor($uuid,$uid)==false)
+ if(!empty($uid))
{
- return "您没有权限";
+ include_once("data/Author.php");
+ $author = new Author($this->db);
+ if($author->checkAuthor($uuid,$uid)==false)
+ {
+ return "您没有权限";
+ }
}
$doi_info = $this->view($uuid);
if($doi_info == false)
@@ -79,10 +82,10 @@ class Doi extends Zend_Controller_Plugin_Abstract
$orgs_en = array();
foreach($data['info'] as $k=>$v)
{
- $authors[$v['order']] = $v['author'];
- $orgs[$v['order']] = $v['organization'];
- $authors_en[$v['order']] = $v['author_en'];
- $orgs_en[$v['order']] = $v['organization_en'];
+ $authors[$v['order']] = str_replace(",",",",$v['author']);
+ $orgs[$v['order']] = str_replace(",",",",$v['organization']);
+ $authors_en[$v['order']] = str_replace(",",",",$v['author_en']);
+ $orgs_en[$v['order']] = str_replace(",",",",$v['organization_en']);
}
$authors = "{".join(",",$authors)."}";
$orgs = "{".join(",",$orgs)."}";
@@ -104,11 +107,11 @@ class Doi extends Zend_Controller_Plugin_Abstract
foreach($authors as $k=>$v)
{
$info[$k] = array(
- 'author'=>$authors[$k],
- 'organization'=>$orgs[$k],
- 'author_en'=>$authors_en[$k],
- 'organization_en'=>$orgs_en[$k],
- 'order'=> 5*count($authors)-($k*5)
+ 'author'=>str_replace("\"","",$authors[$k]),
+ 'organization'=>str_replace("\"","",$orgs[$k]),
+ 'author_en'=>str_replace("\"","",$authors_en[$k]),
+ 'organization_en'=>str_replace("\"","",$orgs_en[$k]),
+ 'order'=> count($authors)+($k-1)
);
}
//include_once("helper/view.php");
diff --git a/application/models/helper/view.php b/application/models/helper/view.php
index 8718edb5..b54364d6 100644
--- a/application/models/helper/view.php
+++ b/application/models/helper/view.php
@@ -37,7 +37,7 @@ class view extends Zend_Controller_Plugin_Abstract
return $html;
}
- static function Error($type,$content,$url=''){
+ static function Error($content,$type='',$url=''){
if(empty($type))
{
$AlertType = "alert-error";
|