-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Add passwordEnabled field to postHookData #28822
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
Conversation
lib/private/Share20/Manager.php
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wouldn't this pass the password string instead of a boolean ?
call it "passwordEnabled" and set it to true if a password is set instead
23828c5 to
56d5241
Compare
|
Updated the PR to return true/false if password is enabed/disabled. |
56d5241 to
f6a814a
Compare
lib/private/Share20/Manager.php
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it always null or can it sometimes be empty string after clearing ? please check
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if I replace is_null with empty then also it's working. I have verified it by creating public link with password and creating public link without password.
When the password field is cleared after set the hook related to that is https://github.com/owncloud/core/blob/master/lib/private/Share20/Manager.php#L733 post_update_password.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem with empty() will be when someone sets the share password to "0". PHP is very annoying.
97b7e07 to
b34a5d3
Compare
lib/private/Share20/Manager.php
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no need for true : false, it is implicitly boolean when you have a condition
PVince81
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 otherwise
SergioBertolinSG
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixes the issue.
5cec8fa to
0bd8977
Compare
Add passwordEnabled field to postHookData A boolean value which help us know if password is provided during share creation or not. Signed-off-by: Sujith H <[email protected]>
0bd8977 to
7b1c8c8
Compare
|
Backport to stable10 of this PR: #28827 |
|
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. |
Add passwordDisabled field to postHookData
Signed-off-by: Sujith H [email protected]
Description
Adding additional parameter passwordDisabled to the postHookData. This data would help us to determine if password is enabled for the share or not while creating the share.
Related Issue
Motivation and Context
This would help us know if the share was created with password or not.
How Has This Been Tested?
Screenshots (if appropriate):
Types of changes
Checklist: