Skip to content
This repository has been archived by the owner on Dec 27, 2023. It is now read-only.

Commit

Permalink
Merge branch '2016.11-develop' into 2016.09
Browse files Browse the repository at this point in the history
  • Loading branch information
pschuele committed Nov 23, 2016
2 parents 5e2d7a2 + 68c8dd5 commit d79a95b
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 18 deletions.
5 changes: 4 additions & 1 deletion tests/tine20/Felamimail/Frontend/JsonTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -829,7 +829,7 @@ public function testReplyMessage()
$message = $this->_sendMessage();

$replyMessage = $this->_getReply($message);
$returned = $this->_json->saveMessage($replyMessage);
$this->_json->saveMessage($replyMessage);

$result = $this->_getMessages();

Expand All @@ -843,6 +843,9 @@ public function testReplyMessage()
$originalMessage = $mail;
}
}

$this->assertTrue(isset($replyMessageFound['id']) && isset($originalMessage['id']));

$replyMessageFound = $this->_json->getMessage($replyMessageFound['id']);
$originalMessage = $this->_json->getMessage($originalMessage['id']);

Expand Down
4 changes: 3 additions & 1 deletion tine20/Calendar/Frontend/Json.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,9 @@ public function getRegistryData()
try {
$defaultCalendarArray = Tinebase_Container::getInstance()->getContainerById($defaultCalendarId)->toArray();
$defaultCalendarArray['account_grants'] = Tinebase_Container::getInstance()->getGrantsOfAccount(Tinebase_Core::getUser(), $defaultCalendarId)->toArray();
$defaultCalendarArray['ownerContact'] = Addressbook_Controller_Contact::getInstance()->getContactByUserId($defaultCalendarArray['owner_id'])->toArray();
if ($defaultCalendarArray['type'] != Tinebase_Model_Container::TYPE_SHARED) {
$defaultCalendarArray['ownerContact'] = Addressbook_Controller_Contact::getInstance()->getContactByUserId($defaultCalendarArray['owner_id'])->toArray();
}
} catch (Exception $e) {
// remove default cal pref
Tinebase_Core::getPreference('Calendar')->deleteUserPref(Calendar_Preference::DEFAULTCALENDAR);
Expand Down
8 changes: 7 additions & 1 deletion tine20/Sales/js/CustomerEditDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,19 @@ Tine.Sales.CustomerEditDialog = Ext.extend(Tine.widgets.dialog.EditDialog, {
form = this.getForm();

isValid = Tine.Sales.CustomerEditDialog.superclass.isValid.call(this)

if (Ext.isEmpty(form.findField('adr_street').getValue()) && Ext.isEmpty(form.findField('adr_pobox').getValue())) {
isValid = false;
var msg = this.app.i18n._('Either street or postbox is required!');
form.markInvalid( {'adr_street': msg, 'adr_pobox': msg});
}

var number = form.findField('number').getValue();
if (number.match(/[^0-9^]+/)) {
isValid = false;
form.markInvalid( {'number': this.app.i18n._('Only numbers are allowed!')});
}

return isValid;
},

Expand Down
28 changes: 17 additions & 11 deletions tine20/Tinebase/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -618,17 +618,23 @@ protected static function _syncUserHook(Tinebase_Model_FullUser $user, $userProp
{
$result = true;
$hookClass = Tinebase_Config::getInstance()->get(Tinebase_Config::SYNC_USER_HOOK_CLASS);
if ($hookClass && class_exists($hookClass)) {
$hook = new $hookClass();
if (method_exists($hook, 'syncUser')) {
if (Tinebase_Core::isLogLevel(Zend_Log::DEBUG)) Tinebase_Core::getLogger()->debug(__METHOD__ . '::' . __LINE__
. ' Calling ' . $hookClass . '::syncUser() ...');

try {
$result = call_user_func_array(array($hook, 'syncUser'), array($user, $userProperties));
} catch (Tinebase_Exception $te) {
Tinebase_Exception::log($te);
return false;
if ($hookClass) {
if (! class_exists($hookClass)) {
@include($hookClass . '.php');
}

if (class_exists($hookClass)) {
$hook = new $hookClass();
if (method_exists($hook, 'syncUser')) {
if (Tinebase_Core::isLogLevel(Zend_Log::DEBUG)) Tinebase_Core::getLogger()->debug(__METHOD__ . '::' . __LINE__
. ' Calling ' . $hookClass . '::syncUser() ...');

try {
$result = call_user_func_array(array($hook, 'syncUser'), array($user, $userProperties));
} catch (Tinebase_Exception $te) {
Tinebase_Exception::log($te);
return false;
}
}
}
}
Expand Down
14 changes: 10 additions & 4 deletions tine20/Tinebase/WebDav/Collection/AbstractContainerTree.php
Original file line number Diff line number Diff line change
Expand Up @@ -168,11 +168,14 @@ public function getChild($name)
if ($name instanceof Tinebase_Model_Container) {
$container = $name;
} elseif ($this->_useIdAsName) {
// first try to fetch by uuid ...
try {
if (Tinebase_Core::isLogLevel(Zend_Log::DEBUG)) Tinebase_Core::getLogger()->debug(
__METHOD__ . '::' . __LINE__ . ' First try to fetch container by uuid ..');
$container = Tinebase_Container::getInstance()->getByProperty((string) $name, 'uuid');
} catch (Tinebase_Exception_NotFound $tenf) {
// ... if that fails by id
if (Tinebase_Core::isLogLevel(Zend_Log::DEBUG)) Tinebase_Core::getLogger()->debug(
__METHOD__ . '::' . __LINE__ . ' If that fails by id ...');

$container = Tinebase_Container::getInstance()->getContainerById($name);
}
} else {
Expand Down Expand Up @@ -240,8 +243,11 @@ public function getChild($name)
throw new \Sabre\DAV\Exception\NotFound("Directory $this->_path/$name not found");
}

if (!Tinebase_Core::getUser()->hasGrant($container, Tinebase_Model_Grants::GRANT_READ) ||
!Tinebase_Core::getUser()->hasGrant($container, Tinebase_Model_Grants::GRANT_SYNC)) {
if (! Tinebase_Core::getUser()->hasGrant($container, Tinebase_Model_Grants::GRANT_READ) ||
! Tinebase_Core::getUser()->hasGrant($container, Tinebase_Model_Grants::GRANT_SYNC)) {
if (Tinebase_Core::isLogLevel(Zend_Log::NOTICE)) Tinebase_Core::getLogger()->notice(
__METHOD__ . '::' . __LINE__ . ' User ' . Tinebase_Core::getUser()->getId()
. ' has neither READ nor SYNC grants for container ' . $container->getId());
throw new \Sabre\DAV\Exception\NotFound("Directory $this->_path/$name not found");
}

Expand Down

0 comments on commit d79a95b

Please sign in to comment.