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 a new admin section for Imprint and Privacy Policy settings #31552

Merged
merged 1 commit into from
Jun 6, 2018
Merged

Conversation

VicDeo
Copy link
Member

@VicDeo VicDeo commented May 28, 2018

Description

PHP backend to add links to Imprint and Privacy Policy

Related Issue

https://github.com/owncloud/enterprise/issues/2537

Motivation and Context

Allows admin to specify a links to privacy policy or imprint

How Has This Been Tested?

  1. By visiting settings -> admin ->general and setting/resetting the controls
  2. CLI:
    php occ config:app:get core legal.imprint_url
    php occ config:app:get core legal.privacy_policy_url
    php occ config:app:set core legal.imprint_url new_value
    php occ config:app:set core legal.privacy_policy_url new_value

Screenshots (if appropriate):

legal

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@VicDeo VicDeo added this to the development milestone May 28, 2018
@VicDeo VicDeo self-assigned this May 28, 2018
@codecov
Copy link

codecov bot commented May 28, 2018

Codecov Report

Merging #31552 into master will increase coverage by 0.02%.
The diff coverage is 100%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master   #31552      +/-   ##
============================================
+ Coverage     62.87%   62.89%   +0.02%     
- Complexity    18410    18418       +8     
============================================
  Files          1151     1154       +3     
  Lines         69114    69157      +43     
  Branches       1260     1260              
============================================
+ Hits          43456    43499      +43     
  Misses        25289    25289              
  Partials        369      369
Flag Coverage Δ Complexity Δ
#javascript 52.39% <ø> (ø) 0 <ø> (ø) ⬇️
#phpunit 64.1% <100%> (+0.02%) 18418 <8> (+8) ⬆️
Impacted Files Coverage Δ Complexity Δ
settings/routes.php 100% <ø> (ø) 0 <0> (ø) ⬇️
lib/private/Settings/SettingsManager.php 72.72% <100%> (+0.17%) 44 <0> (ø) ⬇️
settings/Controller/LegalSettingsController.php 100% <100%> (ø) 3 <3> (?)
settings/Panels/Admin/Legal.php 100% <100%> (ø) 4 <4> (?)
settings/templates/panels/admin/legal.php 100% <100%> (ø) 0 <0> (?)
settings/Application.php 55.62% <100%> (+2.03%) 34 <1> (+1) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cebbb4e...91a9d68. Read the comment docs.

@VicDeo VicDeo force-pushed the e2537 branch 2 times, most recently from b0c6064 to b94f064 Compare May 28, 2018 22:09
* @return array
*/
public function setPrivacyPolicyUrl($privacy_policy) {
$this->config->setSystemValue(
Copy link
Member

Choose a reason for hiding this comment

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

👎 never write to configuration.php from webui . Think about clusteted Setups.

Either Store in DB or don't offer a was to Set via ui/occ

Copy link
Member Author

Choose a reason for hiding this comment

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

@DeepDiver1975 thanks for heads up

Copy link
Contributor

Choose a reason for hiding this comment

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

also: no underscores in variable names

Copy link
Member Author

Choose a reason for hiding this comment

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

ok, got it: don't do in your panel controller what other panels/controllers do :)

@mmattel
Copy link
Contributor

mmattel commented May 29, 2018

  • to be filled in --> some description please
  • Add a new admin section --> Add a new admin section for legal content

@PVince81 PVince81 changed the title Add a new admin section Add a new admin section for Imprint and Privacy Policy settings May 29, 2018
@VicDeo VicDeo dismissed DeepDiver1975’s stale review May 29, 2018 11:52

values are stored into DB now

@michaelstingl
Copy link

@VicDeo Could post a screenshot?

@VicDeo VicDeo added enhancement p2-high Escalation, on top of current planning, release blocker labels May 29, 2018
@VicDeo
Copy link
Member Author

VicDeo commented May 29, 2018

@michaelstingl updated the PR description

@mmattel
Copy link
Contributor

mmattel commented May 29, 2018

Documentation relevant !

@PVince81
Copy link
Contributor

PVince81 commented Jun 6, 2018

Style of the input fields doesn't look so nice but then looking at other ones there doesn't seem to be a proper convention for how they should look like.

@VicDeo Many such fields have a colon : after the label, maybe just add that and it will look nicer. Or move the input fields to the next row.

Thoughts @felixheidecke ?

Copy link
Contributor

@PVince81 PVince81 left a comment

Choose a reason for hiding this comment

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

@VicDeo please add a colon to the label and I think we can merge this.

Then we carry on with other updates in separate PRs

@VicDeo
Copy link
Member Author

VicDeo commented Jun 6, 2018

@PVince81 added
colons

Copy link
Contributor

@PVince81 PVince81 left a comment

Choose a reason for hiding this comment

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

Colon all the things ! 👍

@VicDeo
Copy link
Member Author

VicDeo commented Jun 6, 2018

Stable10: #31666

@felixheidecke
Copy link
Contributor

felixheidecke commented Jun 7, 2018

@VicDeo … I need help getting $this->config->getAppValue('core', 'legal.imprint_url', '') to work in lib/private/legacy/defaults.php. I'm more of a JS guy :-P

Tried use OCP\IConfig; and referencing it in the constructor … buuuuut nothing happens. Can you point me to the right approach?

@VicDeo
Copy link
Member Author

VicDeo commented Jun 7, 2018

@felixheidecke

I need help getting $this->config->getAppValue('core', 'legal.imprint_url', '') to work in lib/private/legacy/defaults.php.

Trying to resolve the same task (passing links into templates) for emails in my local branch at the moment, will ping you after push

@VicDeo
Copy link
Member Author

VicDeo commented Jun 7, 2018

@felixheidecke here you go af2a6ed

@PVince81 PVince81 modified the milestones: development, QA Jun 13, 2018
@settermjd
Copy link
Contributor

settermjd commented Jul 5, 2018

@VicDeo, I just attempted to use it and encountered the following error:

./occ config:app:set core legal.imprint_url https://localhost:8060/impressum
                                                                  
  Too many arguments, expected arguments "command" "app" "name".  

config:app:set [--output [OUTPUT]] [--value VALUE] [--update-only] [--] <app> <name>

./occ config:app:set core legal.imprint_url and ./occ config:app:get core legal.privacy_policy_url work. However, I can also run ./occ config:app:get core legal. and no error or message is displayed.

@phil-davis
Copy link
Contributor

For set, it needs --value in the command.

@lock
Copy link

lock bot commented Jul 30, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Jul 30, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
3 - To Review enhancement p2-high Escalation, on top of current planning, release blocker
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants