I asked a similar question earlier, but it was one of a bunch of questions, most of which I later solved. So I figured I would create a new question only about this.
In developers.facebook => $MY_APP => app settings => open graph => dashboard, you have options to manage your actions and objects. When I try to edit an action, for example by changing its name, or the object reference it points to, these changes wil ostensibly be saved, but when I refresh the page, it will not have the changes (for the object reference) or the url for the object will not change (for changing the action name).
For example,
When I change the name of action1 to action2, from "get code" the page will still be
https://graph.facebook.com/me/myapp:$action1
Furthermore, calling myapp:$action2 will not work, and when I call myapp:$action1 the action that shows up in my timeline is still $action1.
I may also wish to change the title of my object, from say title1 to title2. However, when I try to change the action so that the reference is to title2, the changes refuse to save.
Is there a solution to this, or should I just delete everything and start anew without making mistakes? I tried deleting the actions and objects and making new ones with the old names, but the moment a make an action with the old name all the old fields are filled out and I can't change them again.
Thanks.
EDIT: to change url and name stuff, those are in advanced options inside the action type edit page. Thanks Paul for pointing that out.
The graph api name is in the Advanced section of the ActionType edit page.
For your second question, I don't really understand why your Object Type name won't change. Do you mean the value of og:type isn't changing or the "Name" field? The second one is also in advanced.
Related
I created an extension with the extension builder.
On saving I get this message:
The object was updated. Please be aware that this action is publicly accessible unless you implement an access check. See https://docs.typo3.org/typo3cms/extensions/extension_builder/User/Index.html
How can I fix this issue? Yes I read the page but there are no useful hints.
Since the question is how you can "fix the issue": There is no issue, it is a warning, you can remove it and make your request secure. (As in the other answer.)
The "hint" on the page is actually very straightforward. The "issue", that a user is able to manipulate the url and make the server to execute a not wanted action.
Here is an example:
You have a list of users of your page and you can open thier public porfile for more information:
https://yourdomain.com/list/?tx_ext_plugin['action']=show&tx_ext_plugin['userId']=41.
So if I want to make some trouble, I change the action "show" to "delete" and may I am able to delete the poor user "41" from the db. That is bad.
https://yourdomain.com/list/?tx_ext_plugin['action']=delete&tx_ext_plugin['userId']=41.
So since it is you business logic typo3 offers no out of the box solution for this. That is why this warning from extension builder says, that you need to make actions to prevent misuse.
Regarding how to implemnt a better security here are some thoughts about the Access Control and some ideas what to implement in your actions:
1) FE
You can separate your actions into different plugins. So if you have a public list action it can not be modified to the plugin that responsible for the delete action. How is it possible? TYPO3 will look the page record in your database. And will render it, and if there is a plugin on the page with the signature "tx_ext_plugin" then it will get the sent parameters. In this case you have the possibility to add the different plugins to different pages so changing the signature of it for an attacker won't help, because:
If the delete action is not registered by the plugin, TYPO3 will
throw an exception.
If you are trying to change the whole signature the page won't be able to identify the plugin.
You can add the edit / delete plugin to pages where a user has to be logged in. You can even manage multiple usergroups. Like normal user can only edit its profile, but a premium user can make further changes. You can use in fluid a view helper IfHasRole that can show parts of your template for defined user groups. (There is an ifAuthenticated ViewHelper too)
You can take the extension "femanager" as an example. There is a controller "EditController", that covers actions like "update" and "delete". For example before making the update action there is a check if the logged in user has the same user id as the record which going to be changed. If you have a complex example you can make a check on the user group also.
2) BE
It is actually almost the same as frontend.
BUT instead of plugins / user groups assigned in page settings. You can use different mountpoints, so BE users can not see folders where they are not allow to edit / delete.
You have those two ViewHelper for the BE too. There names are: f:be:security.ifAuthenticated and f:be:security:ifHasRole. However ifAuthenticated is also for FE, in a BE context it does not make sense.
You have also the possibility to identify the id and userGroups of the BE user and you can make your own checks before you let an action run.
You have also the possibility to turn on / off a module for a certain BE group.
+1: It is nothing to do with any action but just to list it too. There is also the possibility to allow / disallow field for BE Users by editing a record through the List mode in the BE.
Extension builder creates dummy actions to update and create records. Those example actions do not contain any security checks, whether the caller actually is allowed to do so.
So it is your job to add adequate access control to those methods. E.g. make sure the current user (be it Frontend or Backend) is actually allowed to update the model in question.
I'm looking at some code which has broken the saving of changes of a List item in SP2010. In the constructor of the Event Receiver the HttpContext is being stored as a local variable then in the ItemUpdating at the end a query parameter containing the return url is retrieved and passed the SPUtility.Redirect(...). This has the effect of canceling any changes that were made in the edit form. So following so scenarios I've found online I'm storing the HttpContext as a static class object and redirecting in the ItemUpdated event and edits are now persisted followed by a redirect to where we are expecting.
I have a concern though with storing a specific user's HttpContext as a static on a class which will potentially be hijacked if another user does the same action between the time user 1 sets the context initially and prior to the redirect. User 2 will overwrite the context and there are potential issues.
The only other option I can think of as a quick way out would be to store a static Dictionary where the key is the user id then remove the entry just prior to redirecting so as to not leave stray HttpContext instances leaking.
So looking at the accepted solution from here the first response by servy42 states The fact that it works for a few trivial test cases at first doesn't make it a viable solution. but doesn't suggest a viable solution.
There's another option best approach may be changing Save Button in ribbon such that when clicked, a ECMA script first save your Item, then redirect to other page, or open other page in dialog. suggested further down but is that the only other way to go?
I'm fairly new to SP and just trying to navigate through the wealth of wrong ways of doing things with my limited knowledge, whilst unfortunately being stuck with SP2010.
Any thoughts on how to go about this?
============
Edit: Further info as requested
So there are two sites one say called A which will have a sub site called B. A has a List and adding an item to that list triggers event receivers which creates sub site B and other related stuff. If I modify the B "item" from the SharePoint list of Bs then I don't need to redirect and returning to the list is fine. If I'm looking and a neatly rendered Gantt chart on A listing the Bs the if I edit B after clicking Save we need to come back to A. If I'm on B there's an edit button as well so I want to return to B after editing and clicking save.
So we have the source= appended when we go to the edit screen. From some reading I've done it seems SharePoint will pick that up and redirect. One of the fields on the edit page is the relative url beneath the A site and if that changes then the redirect url will no longer be valid and throw a 404 so we replace the old B sub path with the newly entered value. But we then need code to redirect to the new location.
I am not quite sure whether i understand your requirements correctly. But i will give it a try. Just a quick summary of what i understood (correct me if i am wrong...):
You have a Root Web in a site collection with a list
Each entry in that list corresponds to a subsite which will be created on List Item creation (ER) below the Root Web as a subsite
List items can be edited from both the List in the root web as well as from the subsite it maps to
On editing from the subsite you want to return to the subsite after saving
My approach would be this:
Follow the steps described in this article SP Dialog and List Forms
Open a dialog on the subsite that links to the edit form of the root web.
After saving the user finds himself already where he should be
Hope this helps... Cheers!
Edit: Just read the requirement about changing of url. Create a custom Edit Form which you enhance with some js that passes values back to the origin site -> Parameters in dialogs. You may then react accordingly in the javascript callback and redirect to the new url.
In a test app I've set up an object (race) and an action (run). I'm now trying to set up a story that combines both of these.
Ideally the race object references a place on my app. But I've been experimenting with many configurations trying to get this to work — none successfully.
In the 'edit attachment' popup is a field 'highlighted points'. I believe this should provide a dropdown list of selectable options? It currently is not, and if I type free text into this field, it is not saved.
What am I doing wrong?
The race page on my app includes the following:
And the course pages include
>>>' />
>>' %> />
On Facebook, course is configured as a Place, race has the course property assigned. But I am unable to select race.course:location in the map popup.
I have also tried various configurations, including defining the lat/lon explicitly on the race page and defining appropriate properties on FB.
I am still unable to select the highlighted points value.
Am I missing something?
Have a look at the answer at
Open Graph Map layout
This should be able to guide you.
Also
https://developers.facebook.com/docs/reference/opengraph/object-type/place/#properties
When I try to share same content twice I get following Error
User is already associated to the object type, website, on a unique action type Like. Original Action ID: 1394xxxxxx....
Can someone please help me with this?
I already referred this link -
Error: (#3501) User is already associated to the object type, article, on a unique action type Like. Original Action ID: 10202808015141547
but did not find the steps mentioned there(settings of Open Graph action)
Can you please post the code you are using when sharing the content?
Form what I understand from this, it's all correct:
You are "sharing" an action twice, as you mention,
The "sharing" is probably actually a Like,
Objects can only be Liked once by an User,
The error message also refers to the Like as an unique action type,
To fix this, you have to either:
Check your code that you are actually sharing something, and not liking,
Even with sharing, FB will check if you did not recently shared it. If you do so, it might be spamming or an error on your side,
If you want an other Open Graph action then Liking, create them and make them non-unqiue.
The above is all derived from the context. If this sound incorrect to you, please post the exact code you use for sharing.
I'm trying to create a reference registration system in Wordpress. The idea is that the user will click a link which will contain wp-login.php?action=register&ref=12345
I'm hooking into the 'register_form' action hook and adding a reference number hidden input and on registration use that reference number to do whatever i need to do with it.
The issue appears when the user gets something wrong in the registration form. The problem is that he will be taken to wherever the action attribute of the register form states which is "wp-login.php?action=register" without the ref parameter. I'm looking for a way to modify that action attribute. I've looked in the wp-login.php file and it seems that there's no filter there.
I know there's always javascript, but is there another wordpressy way to do this?
I think you'll get tons of clues from this affiliates plugin, you can download it and checkout the code from http://wordpress.org/extend/plugins/affiliates/
Good luck,
Virgil!