-
Notifications
You must be signed in to change notification settings - Fork 1
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
Opravy drobných chyb #6
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,12 +43,13 @@ function get_groups(){ | |
return new \WP_REST_Response($ssc_group->get_groups(),200); | ||
} | ||
|
||
/** | ||
* Create one item from the collection | ||
* | ||
* @param \WP_REST_Request $request Full data about the request. | ||
* @return \WP_Error|\WP_REST_Request | ||
*/ | ||
/** | ||
* Create one item from the collection | ||
* | ||
* @param \WP_REST_Request $request Full data about the request. | ||
* | ||
* @return \WP_REST_Response | ||
*/ | ||
public function create_item($request){ | ||
// Check if we got all the needed params | ||
$params_to_validate = array('email'); | ||
|
@@ -98,7 +99,7 @@ public function create_item($request){ | |
|
||
// Set the membership valid_to param | ||
$membership = new SSC_Membership($user_id); | ||
$valid_to = $request->get_param('valid_to') ? $request->get_param('valid_to') : ''; | ||
$valid_to = $request->get_param('valid_to') ?: ''; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nejsem si jist, ze toto v php 5.3 projde. |
||
$membership->set_valid_to($group,$valid_to); | ||
|
||
$user_groups[] = $group; | ||
|
@@ -119,10 +120,12 @@ public function create_item($request){ | |
// Get the post details | ||
$links = array(); | ||
$i = 0; | ||
|
||
// Foreach group from request | ||
// foreach($request->get_param('user_group') as $group){ | ||
// Foreach each group | ||
foreach((new SSC_Group())->get_user_groups($user_id) as $group){ | ||
$SSC_group = new SSC_Group(); | ||
foreach($SSC_group->get_user_groups($user_id) as $group){ | ||
// Scrub through posts and check, if some of the posts has that group assigned | ||
foreach($posts as $post){ | ||
$access = new SSC_Access(); | ||
|
@@ -165,13 +168,11 @@ public function create_item($request){ | |
} | ||
|
||
$replaceArray = array(// pole ktera je mozne nahradit | ||
'{pages}' => $pages, | ||
'{mail}' => $email, | ||
'{pages}' => $pages,// zpetna kompatibilita s v1.1 | ||
'{mail}' => $email,// zpetna kompatibilita s v1.1 | ||
'{login}' => $_login, | ||
'{password}' => $_password, | ||
'{login_url}' => wp_login_url(), | ||
'{pages}' => $pages,// zpetna kompatibilita s v1.1 | ||
'{mail}' => $email,// zpetna kompatibilita s v1.1 | ||
// '{login}' => $_login, | ||
// '{password}' => $_password, | ||
); | ||
|
@@ -198,12 +199,13 @@ public function create_item_permissions_check($request){ | |
return $ssc->validate_secure_key($request->get_param('hash')); | ||
} | ||
|
||
/** | ||
* Prepare the item for create or update operation | ||
* | ||
* @param \WP_REST_Request $request Request object | ||
* @return \WP_Error|object $prepared_item | ||
*/ | ||
/** | ||
* Prepare the item for create or update operation | ||
* | ||
* @param \WP_REST_Request $request Request object | ||
* | ||
* @return array $prepared_item | ||
*/ | ||
protected function prepare_item_for_database($request){ | ||
return array(); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Nejsem si jist, ze toto v php 5.3 projde.