mirror of
https://git.code.sf.net/p/seeddms/code
synced 2024-11-26 15:32:13 +00:00
do not include inc/inc.ClassNotificationService.php and inc.ClassEmailNotify.php
This commit is contained in:
parent
9bde72fe20
commit
7fcb8da860
137
utils/adddoc.php
137
utils/adddoc.php
|
@ -135,87 +135,86 @@ if($reqversion<1)
|
|||
$reqversion=1;
|
||||
|
||||
include($myincpath."/inc/inc.Settings.php");
|
||||
include($myincpath."/inc/inc.LogInit.php");
|
||||
include($myincpath."/inc/inc.Init.php");
|
||||
include($myincpath."/inc/inc.Extension.php");
|
||||
include($myincpath."/inc/inc.DBInit.php");
|
||||
include($myincpath."/inc/inc.ClassNotificationService.php");
|
||||
include($myincpath."/inc/inc.ClassEmailNotify.php");
|
||||
include($myincpath."/inc/inc.ClassController.php");
|
||||
|
||||
/* Parse categories {{{ */
|
||||
$categories = array();
|
||||
if(isset($options['K'])) {
|
||||
$categorynames = explode(',', $options['K']);
|
||||
foreach($categorynames as $categoryname) {
|
||||
$cat = $dms->getDocumentCategoryByName($categoryname);
|
||||
if($cat) {
|
||||
$categories[] = $cat;
|
||||
/* Parse categories {{{ */
|
||||
$categories = array();
|
||||
if(isset($options['K'])) {
|
||||
$categorynames = explode(',', $options['K']);
|
||||
foreach($categorynames as $categoryname) {
|
||||
$cat = $dms->getDocumentCategoryByName($categoryname);
|
||||
if($cat) {
|
||||
$categories[] = $cat;
|
||||
} else {
|
||||
echo "Category '".$categoryname."' not found".PHP_EOL;
|
||||
}
|
||||
}
|
||||
} /* }}} */
|
||||
|
||||
/* Parse document attributes. {{{ */
|
||||
$document_attributes = array();
|
||||
if (isset($options['a'])) {
|
||||
$docattr = array();
|
||||
if (is_array($options['a'])) {
|
||||
$docattr = $options['a'];
|
||||
} else {
|
||||
echo "Category '".$categoryname."' not found".PHP_EOL;
|
||||
$docattr = array($options['a']);
|
||||
}
|
||||
}
|
||||
} /* }}} */
|
||||
|
||||
/* Parse document attributes. {{{ */
|
||||
$document_attributes = array();
|
||||
if (isset($options['a'])) {
|
||||
$docattr = array();
|
||||
if (is_array($options['a'])) {
|
||||
$docattr = $options['a'];
|
||||
} else {
|
||||
$docattr = array($options['a']);
|
||||
}
|
||||
|
||||
foreach ($docattr as $thisAttribute) {
|
||||
$attrKey = strstr($thisAttribute, '=', true);
|
||||
$attrVal = substr(strstr($thisAttribute, '='), 1);
|
||||
if (empty($attrKey) || empty($attrVal)) {
|
||||
echo "Document attribute $thisAttribute not understood".PHP_EOL;
|
||||
exit(1);
|
||||
foreach ($docattr as $thisAttribute) {
|
||||
$attrKey = strstr($thisAttribute, '=', true);
|
||||
$attrVal = substr(strstr($thisAttribute, '='), 1);
|
||||
if (empty($attrKey) || empty($attrVal)) {
|
||||
echo "Document attribute $thisAttribute not understood".PHP_EOL;
|
||||
exit(1);
|
||||
}
|
||||
$attrdef = $dms->getAttributeDefinitionByName($attrKey);
|
||||
if (!$attrdef) {
|
||||
echo "Document attribute $attrKey unknown".PHP_EOL;
|
||||
exit(1);
|
||||
}
|
||||
$document_attributes[$attrdef->getID()] = $attrVal;
|
||||
}
|
||||
$attrdef = $dms->getAttributeDefinitionByName($attrKey);
|
||||
if (!$attrdef) {
|
||||
echo "Document attribute $attrKey unknown".PHP_EOL;
|
||||
exit(1);
|
||||
}
|
||||
$document_attributes[$attrdef->getID()] = $attrVal;
|
||||
}
|
||||
} /* }}} */
|
||||
} /* }}} */
|
||||
|
||||
/* Parse version attributes. {{{ */
|
||||
$version_attributes = array();
|
||||
if (isset($options['A'])) {
|
||||
$verattr = array();
|
||||
if (is_array($options['A'])) {
|
||||
$verattr = $options['A'];
|
||||
} else {
|
||||
$verattr = array($options['A']);
|
||||
}
|
||||
|
||||
foreach ($verattr as $thisAttribute) {
|
||||
$attrKey = strstr($thisAttribute, '=', true);
|
||||
$attrVal = substr(strstr($thisAttribute, '='), 1);
|
||||
if (empty($attrKey) || empty($attrVal)) {
|
||||
echo "Version attribute $thisAttribute not understood".PHP_EOL;
|
||||
exit(1);
|
||||
/* Parse version attributes. {{{ */
|
||||
$version_attributes = array();
|
||||
if (isset($options['A'])) {
|
||||
$verattr = array();
|
||||
if (is_array($options['A'])) {
|
||||
$verattr = $options['A'];
|
||||
} else {
|
||||
$verattr = array($options['A']);
|
||||
}
|
||||
$attrdef = $dms->getAttributeDefinitionByName($attrKey);
|
||||
if (!$attrdef) {
|
||||
echo "Version attribute $attrKey unknown".PHP_EOL;
|
||||
exit(1);
|
||||
}
|
||||
$version_attributes[$attrdef->getID()] = $attrVal;
|
||||
}
|
||||
} /* }}} */
|
||||
|
||||
/* Create a global user object {{{ */
|
||||
if($username) {
|
||||
if(!($user = $dms->getUserByLogin($username))) {
|
||||
echo "No such user '".$username."'.";
|
||||
exit;
|
||||
}
|
||||
} else
|
||||
$user = $dms->getUser(1);
|
||||
foreach ($verattr as $thisAttribute) {
|
||||
$attrKey = strstr($thisAttribute, '=', true);
|
||||
$attrVal = substr(strstr($thisAttribute, '='), 1);
|
||||
if (empty($attrKey) || empty($attrVal)) {
|
||||
echo "Version attribute $thisAttribute not understood".PHP_EOL;
|
||||
exit(1);
|
||||
}
|
||||
$attrdef = $dms->getAttributeDefinitionByName($attrKey);
|
||||
if (!$attrdef) {
|
||||
echo "Version attribute $attrKey unknown".PHP_EOL;
|
||||
exit(1);
|
||||
}
|
||||
$version_attributes[$attrdef->getID()] = $attrVal;
|
||||
}
|
||||
} /* }}} */
|
||||
|
||||
/* Create a global user object {{{ */
|
||||
if($username) {
|
||||
if(!($user = $dms->getUserByLogin($username))) {
|
||||
echo "No such user '".$username."'.";
|
||||
exit;
|
||||
}
|
||||
} else
|
||||
$user = $dms->getUser(1);
|
||||
|
||||
$dms->setUser($user);
|
||||
/* }}} */
|
||||
|
|
Loading…
Reference in New Issue
Block a user