Merge branch 'seeddms-5.0.x' into develop

This commit is contained in:
Uwe Steinmann 2016-03-23 12:36:47 +01:00
commit 8b1effc2f3
10 changed files with 35 additions and 28 deletions

View File

@ -1571,7 +1571,8 @@ class SeedDMS_Core_Document extends SeedDMS_Core_Object { /* {{{ */
if($attributes) {
foreach($attributes as $attrdefid=>$attribute) {
if(trim($attribute))
/* $attribute can be a string or an array */
if($attribute)
if(!$content->setAttributeValue($this->_dms->getAttributeDefinition($attrdefid), $attribute)) {
$this->removeContent($content);
$db->rollbackTransaction();

View File

@ -987,8 +987,6 @@ SeedDMS_Core_DMS::getNotificationsByUser() are deprecated
</notes>
</release>
<release>
<<<<<<< HEAD
=======
<date>2016-01-21</date>
<time>07:12:53</time>
<version>

View File

@ -33,10 +33,10 @@ $session->setSplashMsg(array('type'=>'success', 'msg'=>getMLText('splash_cleared
add_log_line();
if($_GET['refferer'])
if(isset($_GET['refferer']) && $_GET['refferer'])
header("Location:".urldecode($_GET['refferer']));
else {
$folderid = $_GET['folderid'];
header("Location:../out/out.ViewFolder.php?folderid=".$folderid);
}
elseif(isset($_GET['folderid']) && is_numeric($_GET['folderid']))
header("Location:../out/out.ViewFolder.php?folderid=".$_GET['folderid']);
else
header("Location:../index.php");
?>

View File

@ -218,7 +218,7 @@ if (is_bool($user)) {
// Check if password matches (if not a guest user)
// Assume that the password has been sent via HTTP POST. It would be careless
// (and dangerous) for passwords to be sent via GET.
if (($userid != $settings->_guestID) && (md5($pwd) != $user->getPwd())) {
if (($userid != $settings->_guestID) && (md5($pwd) != $user->getPwd()) || ($userid == $settings->_guestID) && $user->getPwd() && (md5($pwd) != $user->getPwd())) {
_printMessage(getMLText("login_error_title"), getMLText("login_error_text"));
/* if counting of login failures is turned on, then increment its value */
if($settings->_loginFailure) {

View File

@ -206,6 +206,10 @@ else if ($action == "edituser") {
$login = $_POST["login"];
$pwd = $_POST["pwd"];
if(isset($_POST['clearpwd']) && $_POST['clearpwd'])
$clearpwd = 1;
else
$clearpwd = 0;
if(isset($_POST["pwdexpiration"]))
$pwdexpiration = $_POST["pwdexpiration"];
else
@ -223,25 +227,28 @@ else if ($action == "edituser") {
$homefolder = (isset($_POST["homefolder"]) ? $_POST["homefolder"] : 0);
$quota = (isset($_POST["quota"]) ? (int) $_POST["quota"] : 0);
if ($editedUser->getLogin() != $login)
$editedUser->setLogin($login);
if($pwdexpiration)
$editedUser->setPwdExpiration($pwdexpiration);
if (isset($pwd) && ($pwd != "")) {
if($settings->_passwordStrength) {
$ps = new Password_Strength();
$ps->set_password($_POST["pwd"]);
$ps->set_password($pwd);
if($settings->_passwordStrengthAlgorithm == 'simple')
$ps->simple_calculate();
else
$ps->calculate();
$score = $ps->get_score();
if($score >= $settings->_passwordStrength) {
$editedUser->setPwd(md5($pwd));
} else {
if($score < $settings->_passwordStrength) {
UI::exitError(getMLText("set_password"),getMLText("password_strength_insuffient"));
}
} else {
}
}
if ($editedUser->getLogin() != $login)
$editedUser->setLogin($login);
if($pwdexpiration)
$editedUser->setPwdExpiration($pwdexpiration);
if(($role == SeedDMS_Core_User::role_guest) && $clearpwd) {
$editedUser->setPwd('');
} else {
if (isset($pwd) && ($pwd != "")) {
$editedUser->setPwd(md5($pwd));
}
}

View File

@ -723,18 +723,18 @@ $(document).ready(function() {
});
/* Dropping item on alert below clipboard */
$(document).on('dragenter', '#main-clipboard div.alert', function (e) {
$(document).on('dragenter', '.add-clipboard-area', function (e) {
e.stopPropagation();
e.preventDefault();
$(this).css('border', '2px dashed #0B85A1');
});
$(document).on('dragleave', '#main-clipboard div.alert', function (e) {
$(document).on('dragleave', '.add-clipboard-area', function (e) {
$(this).css('border', '0px solid white');
});
$(document).on('dragover', '#main-clipboard div.alert', function (e) {
$(document).on('dragover', '.add-clipboard-area', function (e) {
e.preventDefault();
});
$(document).on('drop', '#main-clipboard div.alert', function (e) {
$(document).on('drop', '.add-clipboard-area', function (e) {
$(this).css('border', '0px dotted #0B85A1');
onAddClipboard(e);
});

View File

@ -221,8 +221,8 @@ $(document).ready(function () {
}
$content = '';
$content .= " <ul id=\"main-menu-clipboard\" class=\"nav pull-right\">\n";
$content .= " <li class=\"dropdown\">\n";
$content .= " <a href=\"#\" class=\"dropdown-toggle\" data-toggle=\"dropdown\">".getMLText('clipboard')." (".count($clipboard['folders'])."/".count($clipboard['docs']).") <i class=\"icon-caret-down\"></i></a>\n";
$content .= " <li class=\"dropdown add-clipboard-area\">\n";
$content .= " <a href=\"#\" class=\"dropdown-toggle\" data-toggle=\"dropdown\" class=\"add-clipboard-area\">".getMLText('clipboard')." (".count($clipboard['folders'])."/".count($clipboard['docs']).") <i class=\"icon-caret-down\"></i></a>\n";
$content .= " <ul class=\"dropdown-menu\" role=\"menu\">\n";
foreach($clipboard['folders'] as $folderid) {
if($folder = $this->params['dms']->getFolder($folderid))
@ -1662,7 +1662,7 @@ $(function() {
$content .= "</table>";
} else {
}
$content .= "<div class=\"alert\">".getMLText("drag_icon_here")."</div>";
$content .= "<div class=\"alert add-clipboard-area\">".getMLText("drag_icon_here")."</div>";
return $content;
} /* }}} */

View File

@ -40,7 +40,7 @@ class SeedDMS_View_Timeline extends SeedDMS_Bootstrap_Style {
$previewwidthdetail = $this->params['previewWidthDetail'];
$timeout = $this->params['timeout'];
if($document) {
if($document && $version) {
$previewer = new SeedDMS_Preview_Previewer($cachedir, $previewwidthdetail, $timeout);
$previewer->createPreview($version);

View File

@ -48,7 +48,7 @@ function showKeywords(selectObj) {
}
sel = document.getElementById("selector");
sel.selectedIndex=0; //<?php print $selected ?>;
sel.selectedIndex=0;
showKeywords(sel);
$(document).ready(function() {

View File

@ -200,7 +200,7 @@ $(document).ready( function() {
</tr>
<tr>
<td><?php printMLText("password");?>:</td>
<td><input type="password" class="pwd" rel="strengthbar<?php echo $currUser ? $currUser->getID() : "0"; ?>" name="pwd" id="pwd"></td>
<td><input type="password" class="pwd" rel="strengthbar<?php echo $currUser ? $currUser->getID() : "0"; ?>" name="pwd" id="pwd"><?php if($currUser && $currUser->isGuest()) echo ' <input type="checkbox" name="clearpwd" value="1" /> '.getMLText('clear_password'); ?></td>
</tr>
<?php
if($passwordstrength > 0) {
@ -530,6 +530,7 @@ $(document).ready( function() {
<div class="ajax" data-view="UsrMgr" data-action="form" <?php echo ($seluser ? "data-query=\"userid=".$seluser->getID()."\"" : "") ?>></div>
</div>
</div>
</div>
<?php
$this->contentEnd();