• Resolved paz2222

    (@paz2222)


    Hi,

    First of all thanks for the plugin, it’s working perfectly on my project.

    My question: is there a way that the path to the .xap file can be protected/encrypted? My silverlight application is supposed to be available for paying subscribers only, so I need the path not to be public.

    Any ideas of how I can solve this?

    Thanks in advance πŸ™‚

    http://wordpress.org/extend/plugins/simply-silverlight/

Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Author david_wp

    (@david_wp)

    This feature is now available in version 1.0.1 of the plugin. Thanks for using Simply Silverlight.

    Thread Starter paz2222

    (@paz2222)

    Hi! thanks a lot for the new feature, it’s just what I was looking for.

    However there are a couple of things I’m not getting right…

    Under my Secure Path field in my settings, I’m getting the message “WARNING! The specified path does NOT exist.” The path I’m using is http://www.mywebsite.com/wp-content/plugins/simply-silverlight/secure/. This is where I put my .xap file. As a result my application isn’t showing…

    Any idea what might be causing this?

    Thanks again!

    Thread Starter paz2222

    (@paz2222)

    I just checked the source code of the page that embeds the application, and this is what it’s showing:

    <div id="silverlightControlHost" style="display:inline;float:;">
    <object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="1200" height="760">
    	<param name="source" value="http://www.mywebsite.com/index.php?simply-silverlight=Mysilverlightfile.xap"/>
    	<param name="background" value="black" />
    	<param name="minRuntimeVersion" value="3.0.50106.0" />
    	<param name="autoUpgrade" value="true" />
    	<a href="http://go.microsoft.com/fwlink/?LinkID=149156&v=3.0.50106.0" style="text-decoration:none">
    	<img src="http://go.microsoft.com/fwlink/?LinkId=161376" alt="Get Microsoft Silverlight" style="border-style:none"/>
    	</a>
    </object>
    <iframe id="_sl_historyFrame" style="visibility:hidden;height:0px;width:0px;border:0px"></iframe>
    </div>

    When I try to access the value for ‘source’, it just redirects me to my homepage. Thought this would give you a better idea of what could be wrong…

    Thanks!

    Plugin Author david_wp

    (@david_wp)

    First, thanks for using the plugin! Now to your question.

    The Secure Path field only accepts local filesystem paths, NOT web URLs. So a path like http://www.mywebsite.com/wp-content/plugins/simply-silverlight/secure/ will NEVER work. What you have to use is a local path, something more like c:\mywebsitepath\wp-content\plugins\simply-silverlight\secure\ if on a Windows host, or /mywebsitepath/wp-content/plugins/simply-silverlight/secure/ if on a Unix/Linux host.

    If your site is on shared hosting and you’re not sure what path to use, the plugin can help you out. You’ll need to reset all settings by clicking the Restore Defaults button at the bottom of the plugin settings page. This will, of course, reset ALL the global settings you may have changed including the Secure Path. I’d give this a try. Or…

    I’ve just uploaded a new version of Simply Silverlight, 1.0.2. In this version I made it possible to reset the default Secure Path WITHOUT having to reset all settings, in addition to a bug fix. In this version all you need to do is enter “default” into the Secure Path field and save changes.

    Let me know if you have any other issues.

    -David

    Thread Starter paz2222

    (@paz2222)

    Hi,

    Thanks for the update, I just managed to install the newer version.

    I have one question (I apologize if it’s stupid but my knowledge of this is quite limited) : when you give the example c:\mywebsitepath\wp-content\plugins\simply-silverlight\secure\, are you referring to the “Absolute Path”? On my hosting’s cpanel I’m provided with Absolute Path: e:\sites\single14\mywebsite\wp-content … etc. I tried to use this one and saved the changes. I got rid of the error message, but I still can’t see my application in my page…

    Any idea? Thanks again for your time!

    Plugin Author david_wp

    (@david_wp)

    Yes, use the absolute path on your host. The warning error is gone, so we know the path is valid. Make sure xap file is in your secure path. Verify secure=true attribute is on in code (e.g. [simply-silverlight xap=Mysilverlightfile.xap secure=true]. Login to your site and browse to the post/page with the Silverlight app. If it doesn’t display, then open the page’s source and grab the value for the Silverlight source like in your prior post (e.g. http://www.mywebsite.com/index.php?simply-silverlight=Mysilverlightfile.xap&#8221;). Attempt to browse to this path. If the xap can’t be found, you will receive an error message. If it can your browser should download it. Let me know what happens.

    Thread Starter paz2222

    (@paz2222)

    I just did everything you said, but the app still doesn’t appear on my page. So I copied and pasted the value for silverlight source on my browser, and I managed to download the xap file (when logged as an Admin). I got “There was a problem with the request” message when not logged in (I left the Access Control empty, so this seems to be working fine).

    Plugin Author david_wp

    (@david_wp)

    I’ve researched the problem and believe I have a solution for you. Edit the file simply-silverlight.php in the plugin’s folder. Look for these lines:

    header("Content-Disposition: attachment; filename=\"$requested_xap\"");
    readfile($filename);

    Right below the readfile($filename); add this line ob_end_flush();

    Save changes and try again. This should work. If it does, please let me know so I can update the plugin in the WordPress repository.

    Thank you for your patience.

    Thread Starter paz2222

    (@paz2222)

    That worked perfectly, the app is showing now!

    However, when I state in the Access Control that “Myfile.xap(Administrator)”, Subscribers and other Roles are not viewing the application in my page, apart from not being able to download the xap file (which is OK). Is there a way to solve this or that’s the way it’s supposed to work?

    Thanks AGAIN for your time! πŸ™‚

    Plugin Author david_wp

    (@david_wp)

    The behavior is by design. The Access Control ONLY controls access to the Silverlight .xap file source URL. It does NOT manage access for the containing page or post.

    If you would like to control access to the page/post as well, I would recommend Justin Tadlock’s Members plugin.

    This plugin will control access to the page/post for any user or role and even allows creating custom roles.

    A simple example. After activating the Members plugin, each post/page will have a Content Permission box at the bottom. If you would like to restrict ALL content on that page/post to Administrators only, simply check the Administrator box and update the page. Any non-Administrator attempting access will see a message (customizable) that the content is restricted.

    Used together with my Simply Silverlight plugin a complete access control solution to pages/posts with Silverlight content is possible.

    Thanks again for your interest and use of Simply Silverlight.

    Thread Starter paz2222

    (@paz2222)

    Thanks for the feedback, but I think I didn’t express myself well in the previous message. I’m already using a plugin that controls access to pages and posts (s2member), so this is sorted already.

    However, the problem I’m having is that when I state in Access Control that Myfile.xap(Administrator), only admin is able to access to the xap file and view the application in my page. Subscribers, on the other hand, can access the page, but can’t view the app embedded in it (they can’t access the xap file, which is OK).

    In short, what I’m looking for is that no one bar the admin can access or download the xap file, but can view the application embedded in the page (already controlled by another plugin).

    Thanks again for your patience… I’m almost there, I hope πŸ™‚

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘[Plugin: Simply Silverlight] protect path to the XAP file’ is closed to new replies.