Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add localusers contacts to core #8951

Closed
wants to merge 8 commits into from
Closed

Add localusers contacts to core #8951

wants to merge 8 commits into from

Conversation

LEDfan
Copy link
Member

@LEDfan LEDfan commented Jun 9, 2014

In this PR the currently implemented Localusers backend for the contacts app will be moved to core.

@DeepDiver1975 is this how I should implement it? The \OC\Contacts\Backend\LocalUsers class will be almost the same as \OCA\Contacts\Backend\Localusers. (which will be removed of course)

Some questions:

  • every contacts backend extends the \OCA\Contacts\Backend\AbstractBackend class. This should stay the same for the localusers class in core. Should I move the AbstractBackend class to the public namespace of core, and remove it out of the contacts app?
  • To update the DB with the contacts should I use hooks on user regristration, deleteing etc, or check if something has changed every time the contacts are fetched. (This is the current implementation.)
  • where should the DB schemes go?

@ghost
Copy link

ghost commented Jun 9, 2014

🚀 Test Passed. 🚀
Refer to this link for build results: https://ci.owncloud.org/job/pull-request-analyser/5483/

@@ -0,0 +1,169 @@
<?php
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This class/file is needed to let the LocalUsers backend work. Is it okay to move this to core?
Should I remove these classes from the Contacts app? (If so maybe move them to \OCP\?)

@LEDfan
Copy link
Member Author

LEDfan commented Jun 14, 2014

🎆 it's working :)
I had to add a handfull classes from the Contacts app to core, is this okay?

TODO's

16/06

  • delete avatar from contact when it's deleted from the user
  • support JPG images
  • move classess from the contacts app to core
    • \OCA\Contacts\Utils\TemporaryPhoto
    • \OCA\Contacts\VObject\VCard

17/]06
- [ ] add email from user to contact
- [ ] update email to contact when changed

@ghost
Copy link

ghost commented Jun 14, 2014

🚀 Test Passed. 🚀
Refer to this link for build results: https://ci.owncloud.org/job/pull-request-analyser/5604/

@ghost
Copy link

ghost commented Jun 14, 2014

🚀 Test Passed. 🚀
Refer to this link for build results: https://ci.owncloud.org/job/pull-request-analyser/5605/

@ghost
Copy link

ghost commented Jun 15, 2014

💣 Test Failed. 💣
Refer to this link for build results: https://ci.owncloud.org/job/pull-request-analyser/5611/

@ghost
Copy link

ghost commented Jun 15, 2014

🚀 Test Passed. 🚀
Refer to this link for build results: https://ci.owncloud.org/job/pull-request-analyser/5612/

@ghost
Copy link

ghost commented Jun 15, 2014

🚀 Test Passed. 🚀
Refer to this link for build results: https://ci.owncloud.org/job/pull-request-analyser/5613/

@LEDfan
Copy link
Member Author

LEDfan commented Jun 16, 2014

Avatars are now automatically uploaded to the contacts, even when they are changed.

@ghost
Copy link

ghost commented Jun 16, 2014

🚀 Test Passed. 🚀
Refer to this link for build results: https://ci.owncloud.org/job/pull-request-analyser/5618/

@ghost
Copy link

ghost commented Jun 16, 2014

🚀 Test Passed. 🚀
Refer to this link for build results: https://ci.owncloud.org/job/pull-request-analyser/5632/

@LEDfan
Copy link
Member Author

LEDfan commented Jun 17, 2014

Displaynames are now automatically uploaded to the contacts, even when they are changed.

@ghost
Copy link

ghost commented Jun 17, 2014

🚀 Test Passed. 🚀
Refer to this link for build results: https://ci.owncloud.org/job/pull-request-analyser/5652/

@LEDfan
Copy link
Member Author

LEDfan commented Jun 19, 2014

I think the work here is done.
I understand oC7 has higher prio, so I'll just leave this here open until oC7 is released?

@ghost
Copy link

ghost commented Jun 22, 2014

💣 Test Failed. 💣
Refer to this link for build results: https://ci.owncloud.org/job/pull-request-analyser/5682/

@LEDfan
Copy link
Member Author

LEDfan commented Jun 28, 2014

@owncloud-bot retest this please

@ghost
Copy link

ghost commented Jun 28, 2014

💣 Test Failed. 💣
Refer to this link for build results: https://ci.owncloud.org/job/pull-request-analyser/5824/

@ghost
Copy link

ghost commented Jun 28, 2014

💣 Test Failed. 💣
Refer to this link for build results: https://ci.owncloud.org/job/pull-request-analyser/5825/

@ghost
Copy link

ghost commented Jun 29, 2014

💣 Test Failed. 💣
Refer to this link for build results: https://ci.owncloud.org/job/pull-request-analyser/5826/

@ghost
Copy link

ghost commented Jun 29, 2014

💣 Test Failed. 💣
Refer to this link for build results: https://ci.owncloud.org/job/pull-request-analyser/5827/

@LEDfan LEDfan changed the title [WIP] Add localusers contacts to core Add localusers contacts to core Jun 29, 2014
@LEDfan
Copy link
Member Author

LEDfan commented Jun 29, 2014

I'm ready with this and this can be tested, can someone add a 5 To Review tag to this?

@jancborchardt about the implemantation:

  • when a user changes his avatar the avatar of the contact is updated for all ownCloud users
  • when a user changes his displaynames, there are 2 scenarios:
    • the contact's displayname is differnet than the user's old displayname -> the displayname of the contact is changed by the owner of the contact -> nothing is done
    • the contact's displayname euqals the old use's displayname -> the displayname of the contact is changed
  • the email address of the user isn't added to the contact nor updated
  • all contacts are stored in a special group in the contacts app
    localusers

This can be reviewed.

@LEDfan
Copy link
Member Author

LEDfan commented Jul 15, 2014

Refs http://stackoverflow.com/questions/16229004/oracle-cannot-insert-a-null-value-to-a-non-primary-key

It looks like the query needs to insert null as id instead of nothing, because the column is set as NOT NULL.

@scrutinizer-notifier
Copy link

The inspection completed: 33 new issues, 67 updated code elements

@LEDfan
Copy link
Member Author

LEDfan commented Jul 15, 2014

Now it fails on pgsql:

03:49:27 SQLSTATE[23502]: Not null violation: 7 ERROR:  null value in column "id" violates not-null constraint"<br />Offending command was: INSERT INTO `*PREFIX*vcategory` (`uid`,`type`,`category`,`id`) SELECT ?,?,?,? FROM `*PREFIX*vcategory` WHERE `uid` = ? AND `type` = ? AND `category` = ? AND `id` = ? HAVING COUNT(*) = 0<br />

@LEDfan
Copy link
Member Author

LEDfan commented Jul 15, 2014

I was wrong with the id. It's trying to insert NULL into uid. However the query says it's inserting false..... I'll revert the latest commit, but I have no idea what's causing this problem.

@DeepDiver1975
Copy link
Member

@LEDfan okay - I'm back on this pull request - sorry too much other things going on here

so we have still more than 1000 LOC? Still a big bunch - I'll have a closer look ...

@scrutinizer-notifier
Copy link

A new inspection was created.

@scrutinizer-notifier
Copy link

The inspection completed: 33 new issues, 67 updated code elements

@LEDfan
Copy link
Member Author

LEDfan commented Jul 15, 2014

@DeepDiver1975 I checkout this branch with an oracle DB server. Everything works as expected.
However when I create an user "false" I get the same error. I even can't log in with that user. EDIT: I used the wrong password If I create a "false" user on a MySQL database everything works.
It guess that owncloud internally send the username as boolean (bc there are no " around false in the errors) and this doesn't work with oracle.

@scrutinizer-notifier
Copy link

A new inspection was created.

@LEDfan
Copy link
Member Author

LEDfan commented Jul 18, 2014

@jancborchardt @DeepDiver1975
Because with #9641 the contacts doesn't show up in the Contacts app I tried to remove the abstractpimcollection abstractpimobject and IPIMObject files. It works fine without changing the code :)

TODO (for me)

@scrutinizer-notifier
Copy link

A new inspection was created.

@scrutinizer-notifier
Copy link

The inspection completed: 47 new issues, 48 updated code elements

@ghost
Copy link

ghost commented Jul 18, 2014

💣 Test Failed. 💣
Refer to this link for build results: https://ci.owncloud.org/job/pull-request-analyser/6316/

@ghost
Copy link

ghost commented Jul 18, 2014

💣 Test Failed. 💣
Refer to this link for build results: https://ci.owncloud.org/job/pull-request-analyser/6317/

@DeepDiver1975
Copy link
Member

Because with #9641 the contacts doesn't show up in the Contacts app I tried to remove the abstractpimcollection abstractpimobject and IPIMObject files. It works fine without changing the code :)

if we walk th path of #9641 this pull request is no longer needed.
the ability for contacts to read all addressbooks has to be implemented in the contacts app.

@jancborchardt
Copy link
Member

the ability for contacts to read all addressbooks has to be implemented in the contacts app.

Yeah, that’s what I meant. The core should only expose the local users through some kind of API. It’s up to the apps to implement the API then.

@jancborchardt
Copy link
Member

So @LEDfan should we close this then and focus on the lightweight solution in #9641? The Contacts app of course has to talk with the backend there.

@LEDfan
Copy link
Member Author

LEDfan commented Jul 21, 2014

@jancborchardt yup.

@LEDfan LEDfan closed this Jul 21, 2014
@lock lock bot locked as resolved and limited conversation to collaborators Aug 17, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants