- check if post vars are set

- check if fulltext index could be opened
This commit is contained in:
steinm 2012-12-17 07:40:13 +00:00
parent 27fb745dd9
commit 2e2fd114a8

View File

@ -54,8 +54,14 @@ $version_comment = $_POST["version_comment"];
$keywords = $_POST["keywords"]; $keywords = $_POST["keywords"];
$categories = preg_replace('/[^0-9,]+/', '', $_POST["categoryidform1"]); $categories = preg_replace('/[^0-9,]+/', '', $_POST["categoryidform1"]);
if(isset($_POST["attributes"]))
$attributes = $_POST["attributes"]; $attributes = $_POST["attributes"];
else
$attributes = array();
if(isset($_POST["attributes_version"]))
$attributes_version = $_POST["attributes_version"]; $attributes_version = $_POST["attributes_version"];
else
$attributes_version = array();
$reqversion = (int)$_POST["reqversion"]; $reqversion = (int)$_POST["reqversion"];
if ($reqversion<1) $reqversion=1; if ($reqversion<1) $reqversion=1;
@ -210,9 +216,11 @@ for ($file_num=0;$file_num<count($_FILES["userfile"]["tmp_name"]);$file_num++){
require_once('LetoDMS/Lucene.php'); require_once('LetoDMS/Lucene.php');
$index = LetoDMS_Lucene_Indexer::open($settings->_luceneDir); $index = LetoDMS_Lucene_Indexer::open($settings->_luceneDir);
if($index) {
LetoDMS_Lucene_Indexer::init($settings->_stopWordsFile); LetoDMS_Lucene_Indexer::init($settings->_stopWordsFile);
$index->addDocument(new LetoDMS_Lucene_IndexedDocument($dms, $document, isset($settings->_convcmd) ? $settings->_convcmd : null, true)); $index->addDocument(new LetoDMS_Lucene_IndexedDocument($dms, $document, isset($settings->_convcmd) ? $settings->_convcmd : null, true));
} }
}
/* Add a default notification for the owner of the document */ /* Add a default notification for the owner of the document */
if($settings->_enableOwnerNotification) { if($settings->_enableOwnerNotification) {