增加doi验证的功能

This commit is contained in:
wlx 2013-05-15 14:02:14 +00:00
parent aa3efdba5a
commit cdb91b830a
2 changed files with 10 additions and 4 deletions

View File

@ -3717,11 +3717,17 @@ class Admin_DataController extends Zend_Controller_Action
}
else if ($ac=="verified") //成功申请
{
$sql="update datadoi set ts_published=now() where uuid=? and ts_published is null";
$this->db->query($sql,array($uuid));
$this->_helper->layout->disableLayout();
$this->_helper->viewRenderer->setNoRender();
$this->jsonexit(array('success'=>'成功申请'));
$row=$this->db->fetchRow("select * from datadoi where uuid='$uuid'");
$content=@file_get_contents("http://dx.doi.org/".$row['doi']);
if (strpos($content,$row['doi'])!==false) //成功申请
{
$sql="update datadoi set ts_published=now() where uuid=? and ts_published is null";
$this->db->query($sql,array($uuid));
$this->jsonexit(array('success'=>'成功申请'));
} else
$this->jsonexit(array('success'=>'该DOI验证失败请检查'));
return true;
}
}//doi

View File

@ -58,7 +58,7 @@ table thead tr th {background:#EBF2F6;}
<td>
<a href="/admin/data/doi/ac/edit/uuid/<?= $item['uuid']?>">编辑</a>
<a href="/admin/data/doi/ac/convert/uuid/<?= $item['uuid']?>">导出</a>
<a href="javascript:void(0);" rel="/admin/data/doi/ac/verified/uuid/<?= $item['uuid']?>" class="verified_btn">成功</a>
<a href="javascript:void(0);" rel="/admin/data/doi/ac/verified/uuid/<?= $item['uuid']?>" class="verified_btn">验证</a>
<a href="javascript:void(0);" onclick="onedel(<?= $item['id']?>)" id="delbtn_<?= $item['id']?>">删除</a>
</td>
</tr>