Merge branch 'seeddms-4.3.x' into seeddms-5.0.x

This commit is contained in:
Uwe Steinmann 2016-03-23 12:34:50 +01:00
commit d398f7733f
10 changed files with 38 additions and 26 deletions

View File

@ -1239,7 +1239,8 @@ class SeedDMS_Core_Document extends SeedDMS_Core_Object { /* {{{ */
if($attributes) { if($attributes) {
foreach($attributes as $attrdefid=>$attribute) { 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)) { if(!$content->setAttributeValue($this->_dms->getAttributeDefinition($attrdefid), $attribute)) {
$this->removeContent($content); $this->removeContent($content);
$db->rollbackTransaction(); $db->rollbackTransaction();

View File

@ -25,6 +25,9 @@
<license uri="http://opensource.org/licenses/gpl-license">GPL License</license> <license uri="http://opensource.org/licenses/gpl-license">GPL License</license>
<notes> <notes>
- all changes from 4.3.25 merged - all changes from 4.3.25 merged
- rename SeedDMS_Core_Group::getNotificationsByGroup() to getNotifications()
- use __construct() for all constructors
- fix setting multi value attributes for versions
</notes> </notes>
<contents> <contents>
<dir baseinstalldir="SeedDMS" name="/"> <dir baseinstalldir="SeedDMS" name="/">

View File

@ -33,10 +33,10 @@ $session->setSplashMsg(array('type'=>'success', 'msg'=>getMLText('splash_cleared
add_log_line(); add_log_line();
if($_GET['refferer']) if(isset($_GET['refferer']) && $_GET['refferer'])
header("Location:".urldecode($_GET['refferer'])); header("Location:".urldecode($_GET['refferer']));
else { elseif(isset($_GET['folderid']) && is_numeric($_GET['folderid']))
$folderid = $_GET['folderid']; header("Location:../out/out.ViewFolder.php?folderid=".$_GET['folderid']);
header("Location:../out/out.ViewFolder.php?folderid=".$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) // Check if password matches (if not a guest user)
// Assume that the password has been sent via HTTP POST. It would be careless // Assume that the password has been sent via HTTP POST. It would be careless
// (and dangerous) for passwords to be sent via GET. // (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")); _printMessage(getMLText("login_error_title"), getMLText("login_error_text"));
/* if counting of login failures is turned on, then increment its value */ /* if counting of login failures is turned on, then increment its value */
if($settings->_loginFailure) { if($settings->_loginFailure) {

View File

@ -198,6 +198,10 @@ else if ($action == "edituser") {
$login = $_POST["login"]; $login = $_POST["login"];
$pwd = $_POST["pwd"]; $pwd = $_POST["pwd"];
if(isset($_POST['clearpwd']) && $_POST['clearpwd'])
$clearpwd = 1;
else
$clearpwd = 0;
if(isset($_POST["pwdexpiration"])) if(isset($_POST["pwdexpiration"]))
$pwdexpiration = $_POST["pwdexpiration"]; $pwdexpiration = $_POST["pwdexpiration"];
else else
@ -215,25 +219,28 @@ else if ($action == "edituser") {
$homefolder = (isset($_POST["homefolder"]) ? $_POST["homefolder"] : 0); $homefolder = (isset($_POST["homefolder"]) ? $_POST["homefolder"] : 0);
$quota = (isset($_POST["quota"]) ? (int) $_POST["quota"] : 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 (isset($pwd) && ($pwd != "")) {
if($settings->_passwordStrength) { if($settings->_passwordStrength) {
$ps = new Password_Strength(); $ps = new Password_Strength();
$ps->set_password($_POST["pwd"]); $ps->set_password($pwd);
if($settings->_passwordStrengthAlgorithm == 'simple') if($settings->_passwordStrengthAlgorithm == 'simple')
$ps->simple_calculate(); $ps->simple_calculate();
else else
$ps->calculate(); $ps->calculate();
$score = $ps->get_score(); $score = $ps->get_score();
if($score >= $settings->_passwordStrength) { if($score < $settings->_passwordStrength) {
$editedUser->setPwd(md5($pwd));
} else {
UI::exitError(getMLText("set_password"),getMLText("password_strength_insuffient")); 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)); $editedUser->setPwd(md5($pwd));
} }
} }

View File

@ -723,18 +723,18 @@ $(document).ready(function() {
}); });
/* Dropping item on alert below clipboard */ /* 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.stopPropagation();
e.preventDefault(); e.preventDefault();
$(this).css('border', '2px dashed #0B85A1'); $(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'); $(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(); 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'); $(this).css('border', '0px dotted #0B85A1');
onAddClipboard(e); onAddClipboard(e);
}); });

View File

@ -221,8 +221,8 @@ $(document).ready(function () {
} }
$content = ''; $content = '';
$content .= " <ul id=\"main-menu-clipboard\" class=\"nav pull-right\">\n"; $content .= " <ul id=\"main-menu-clipboard\" class=\"nav pull-right\">\n";
$content .= " <li class=\"dropdown\">\n"; $content .= " <li class=\"dropdown add-clipboard-area\">\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 .= " <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"; $content .= " <ul class=\"dropdown-menu\" role=\"menu\">\n";
foreach($clipboard['folders'] as $folderid) { foreach($clipboard['folders'] as $folderid) {
if($folder = $this->params['dms']->getFolder($folderid)) if($folder = $this->params['dms']->getFolder($folderid))
@ -1506,7 +1506,7 @@ $(function() {
$content .= "</table>"; $content .= "</table>";
} else { } else {
} }
$content .= "<div class=\"alert\">".getMLText("drag_icon_here")."</div>"; $content .= "<div class=\"alert add-clipboard-area\">".getMLText("drag_icon_here")."</div>";
return $content; return $content;
} /* }}} */ } /* }}} */

View File

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

View File

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

View File

@ -194,7 +194,7 @@ $(document).ready( function() {
</tr> </tr>
<tr> <tr>
<td><?php printMLText("password");?>:</td> <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> </tr>
<?php <?php
if($passwordstrength > 0) { if($passwordstrength > 0) {
@ -489,6 +489,7 @@ $(document).ready( function() {
<div class="ajax" data-view="UsrMgr" data-action="form" <?php echo ($seluser ? "data-query=\"userid=".$seluser->getID()."\"" : "") ?>></div> <div class="ajax" data-view="UsrMgr" data-action="form" <?php echo ($seluser ? "data-query=\"userid=".$seluser->getID()."\"" : "") ?>></div>
</div> </div>
</div> </div>
</div>
<?php <?php
$this->contentEnd(); $this->contentEnd();