Projects
Kolab:16:Enterprise
iRony
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 42
View file
iRony.spec
Changed
@@ -38,7 +38,7 @@ %global upstream_version 0.4.8 Name: iRony -Version: 0.4.8.3 +Version: 0.4.8.4 Release: 1%{?dist} Summary: DAV for Kolab Groupware
View file
debian.changelog
Changed
@@ -1,4 +1,4 @@ -irony (0.4.8.3-1~kolab1) unstable; urgency=low +irony (0.4.8.4-1~kolab1) unstable; urgency=low * New release
View file
iRony-0.4.8.tar.gz/composer.json
Changed
@@ -3,15 +3,9 @@ "description": "iRony - The Kolab WebDAV/CalDAV/CardDAV Server", "license": "AGPL-3.0", "version": "0.4-dev", - "repositories": - { - "type": "vcs", - "url": "https://git.kolab.org/diffusion/PNL/php-net_ldap.git" - } - , "require": { - "php": ">=5.4.1", - "sabre/dav" : "~2.1.6" + "php": ">=7.2", + "sabre/dav" : "~4.5.1" }, "require-dev": { "pear/pear-core-minimal": "~1.10.1", @@ -22,6 +16,6 @@ "pear/net_smtp": "~1.7.1", "pear/net_ldap2": "~2.2.0", "kolab/net_ldap3": "dev-master", - "phpunit/phpunit": "~4.4.0" + "phpunit/phpunit": "^9.6" } }
View file
iRony-0.4.8.tar.gz/composer.json-dist
Changed
@@ -4,7 +4,7 @@ "license": "AGPL-3.0", "version": "0.4-dev", "require": { - "php": ">=5.3.3" + "php": ">=7.2" }, "autoload": { "psr-0": {
View file
iRony-0.4.8.tar.gz/lib/Kolab/CardDAV/ContactsBackend.php
Changed
@@ -681,12 +681,12 @@ $vc = new VObject\Component\VCard(); $vc->VERSION = '3.0'; // always set to 3.0 and let Sabre/DAV convert to 4.0 if necessary $vc->PRODID = '-//Kolab//iRony DAV Server ' . KOLAB_DAV_VERSION . '//Sabre//Sabre VObject ' . VObject\Version::VERSION . '//EN'; + $vc->UID = $contact'uid'; - $vc->add('UID', $contact'uid'); $vc->add('FN', $contact'name'); // distlists are KIND:group - if ($contact'_type' == 'distribution-list') { + if (isset($contact'_type') && $contact'_type' == 'distribution-list') { // group cards are actually vcard version 4 if (!$this->is_apple()) { $vc->version = '4.0'; @@ -709,10 +709,18 @@ $vc->add($prop_prefix . 'MEMBER', $value); } } - else if ($contact'surname' . $contact'firstname' . $contact'middlename' . $contact'prefix' . $contact'suffix' != '') { - $n = $vc->create('N'); - $n->setParts(array(strval($contact'surname'), strval($contact'firstname'), strval($contact'middlename'), strval($contact'prefix'), strval($contact'suffix'))); - $vc->add($n); + else { + $allname = ($contact'surname' ?? '') + . ($contact'firstname' ?? '') + . ($contact'middlename' ?? '') + . ($contact'prefix' ?? '') + . ($contact'suffix' ?? ''); + + if ($allname != '') { + $n = $vc->create('N'); + $n->setParts(array($contact'surname' ?? '', $contact'firstname' ?? '', $contact'middlename' ?? '', $contact'prefix' ?? '', $contact'suffix' ?? '')); + $vc->add($n); + } } if (!empty($contact'nickname')) @@ -760,7 +768,7 @@ } } - if (!empty($contact'email')) { + if (!empty($contact'phone')) { foreach ((array)$contact'phone' as $phone) { $type = $this->phonetypes$phone'type' ?? $phone'type'; $params = !empty($type) ? array('type' => explode(',', strtoupper($type))) : array(); @@ -1079,8 +1087,9 @@ } } - if (is_array($contact'im')) + if (isset($contact'im') && is_array($contact'im')) { $contact'im' = array_unique($contact'im'); + } return $contact; }
View file
iRony-0.4.8.tar.gz/test/Unit/CardDAV/ContactsBackend.php
Changed
@@ -1,14 +1,10 @@ <?php use Kolab\CardDAV\ContactsBackend; +use PHPUnit\Framework\TestCase; -class ContactsBackendTest extends PHPUnit_Framework_TestCase +class ContactsBackendTest extends TestCase { - function setUp() - { - } - - /** * Test vCard PHOTO (T1082) */ @@ -23,7 +19,7 @@ $vcard = $backend->to_vcard($contact); - $this->assertRegexp('/PHOTO;ENCODING=b;TYPE=GIF:R0l/', $vcard); + $this->assertMatchesRegularExpression('/PHOTO;ENCODING=b;TYPE=GIF:R0l/', $vcard); } /** @@ -37,7 +33,7 @@ $vcard = "BEGIN:VCARD\nVERSION:$version\nN:Thompson;Default;;;\nUID:1\n$input\nEND:VCARD"; $contact = $backend->parse_vcard($vcard); - $this->assertSame($output, $contact'photo'); + $this->assertSame($output, $contact'photo' ?? null); } function data_T2043() @@ -64,7 +60,7 @@ $vcard = "BEGIN:VCARD\nVERSION:4.0\nN:Thompson;Default;;;\nUID:1\n$input\nEND:VCARD"; $contact = $backend->parse_vcard($vcard); - if ($result = $contact$key) { + if ($result = ($contact$key ?? null)) { $result = $result->format('Ymd'); } @@ -84,4 +80,39 @@ array("ANNIVERSARY;VALUE=text:circa 1800", null, 'anniversary'), ); } + + /** + * Test basic vCard generation + */ + function test_to_vcard() + { + $backend = new ContactsBackend(); + $contact = array( + 'uid' => '123', + 'name' => 'Test', + 'phone' => array( + array ( + 'number' => '+48', + 'type' => 'home', + ), + ), + ); + + $vcard = $backend->to_vcard($contact); + + $prodid = '-//Kolab//iRony DAV Server ' . KOLAB_DAV_VERSION . '//Sabre//Sabre VObject ' . Sabre\VObject\Version::VERSION . '//EN'; + $expected = <<<EOF + BEGIN:VCARD\r + VERSION:3.0\r + PRODID:$prodid\r + UID:123\r + FN:Test\r + TEL;TYPE=HOME:+48\r + END:VCARD\r + EOF; + + $this->assertSame(trim($expected), trim($vcard)); + + // TODO: Test all contact/group properties + } }
View file
iRony.dsc
Changed
@@ -2,7 +2,7 @@ Source: irony Binary: irony Architecture: all -Version: 1:0.4.8.3-1~kolab1 +Version: 1:0.4.8.4-1~kolab1 Maintainer: Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> Uploaders: Paul Klos <kolab@klos2day.nl> Homepage: http://www.kolab.org/
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.