symfony2 file download manager - file

I'm looking for a Bundle for Symfony2 which will allow specific user access to download files like .zip .pdf. Users can login and download files that they are authorized to access.As long as the user is "Authenticated" and have the correct roles.
I would also like the ability to send someone a download URL which has a specific life time, and dies once the download has been successful.
I have looked on packagist.org and the nearest I can find is chilldev/file-manager-bundle, However it does not have the access control and URL generation. I have also looked in knpbundles.com and could not find anything.
Does anyone know of a bundle which has the type of functionality? It will save me a load of development time.

IMHO there is no such bundle. You need to code the security stuff on your own or try to combine some existing bundles.
Worth to have a look at:
Sonata Project https://github.com/sonata-project
FriendsOfSymfony https://github.com/FriendsOfSymfony

it may be a bit late but, I recommend checking this bundle: NzoFileDownloaderBundle

Related

Hybris Powertool B2B demo is showing a 404

I am new to Hybris, I have succeeded in standing up the Powertools B2B site and have discovered a 404 error. I would like to learn how to trouble shoot this 404 error along with other such errors.
Steps to reproduce:
Start up the OOTB version of Hybris 1811 with Powertools B2B site configured
In Backoffice, change the password for user screwdriverslover#pronto-hw.com
Log into the Powertools storefront with user screwdriverslover#pronto-hw.com
In the upper right select My Account > Returns History
And you will get a big 404 page not found.
How would I go about tracking down this error? While I seek the solution, the steps to find the solution are far more important to me right now.
You need to check the log (console or log file) to find the root cause.
The page/component you are trying to access might not have been created as part of the initialization. In Hybris, the pages/components are part of the content catalog. If the page/component you are trying to access has not have been created, you will need to import relevant ImpEx. The other possibility might be the wrong URL configured for this page. You can check all these things in the backoffice application.
Update: copying the following text from my comment:-
You need to put into localextensions.xml, the extensions and addons responsible for order management. In the case of addons, you will also need to install the addon using ant addoninstall. A simple way to do it is to install b2c_b2b_acc_oms recipe. Alternatively, look into the build.gradle file of b2c_b2b_acc_oms for the OMS (Order Management System) extensions and addons and include/install them manually. When you are doing it manually, make sure to clean, build, and update your application using ant clean all updatesystem.

After configuring a Manifest for an App Registration in AzureAD, I am unable to save the Manifest

I am an owner of an App Registration in AzureAD. The SAVE button is greyed out when I try to save the manifest. I am able to get an error if I upload the manifest. The error is generic, "Failed to save manifest." I am looking for a troubleshooting path. I will not turn down solutions either.
I've added myself as an Application Administrator, but it didn't work.
It depends on what you modified.
Please double-check the content comparison before and after the modification to locate the properties that may be problematic.
When you try to upload a previously downloaded manifest, you may see the above error. This is likely because the manifest editor now supports a newer version of the schema, which doesn't match with the one you're trying to upload. We recommend try the following.
1.Edit the attributes individually in the manifest editor instead of uploading a previously downloaded manifest. Use the manifest reference table to understand the syntax and semantics of old and new attributes so that you can successfully edit the attributes you're interested in.
2.If your workflow requires you to save the manifests in your source repository for use later, we suggest rebasing the saved manifests in your repository with the one you see in the App registrations experience.
Here is a similar SO thread you could refer to.

Access Sitecore DB from API in Console application

I would like to accesss the sitecore DB and items from console application like
Sitecore.Data.Database db = Sitecore.Context.Database
or
Sitecore.Data.Database db = Sitecore.Data.Database.GetDatabase("master")
how do I configure and setup my console application to access the DB as above?
Thanks Everyone for the suggestion, I am really interested in config changes, I used webservice, but it has very limited methods. For example, if I would like create an Item with the template and insert the item with prepopulated value, there is no such option. The reason I am looking for the console apporach is I would like to import the contents from XML or excel sheet and push those to the sitecore tree, eventually use the scheduled task to run the console app periodically. I do not want to copy the entire web.config and app_config. If anyone has already done this, could you please post your steps and necessary config changes?
You have two options I think:
1) Import the Sitecore bits of a website's web.config into your console application's app.config, so that the Sitecore API "just works"
I'm sure I read a blog post about this, but I can't find the reference right now. (I will have another look) But I think the simple but long winded approach is to copy all of the <sitecore/> element and all the separate files it references. I'm fairly sure you can whittle this down to a subset of the config required for data access with a bit of thinking.
2) Don't use the Sitecore API directly, connect to a web service that exposes access to it remotely.
There are a few of these that already exist. Sitecore itself exposes one, Sitecore Rocks has one, and Hedgehog TDS has one too. And you can always write your own (since any web service running inside the Sitecore ASP.Net app can make database calls and report values back and forth - just remember to consider security if this web service might end up exposed externally for any reason)
John West links to some relevant stuff here:
http://www.sitecore.net/Learn/Blogs/Technical-Blogs/John-West-Sitecore-Blog/Posts/2013/09/Getting-Data-Out-of-the-Sitecore-ASPNET-CMS.aspx
-- Edited to add --
I've not found the blog post I remember. But I came across this SO thread:
Accessing Sitecore API from a CLI tool
which refers to this blog post:
http://www.experimentsincode.com/?p=232
which I think gives the info you'll need for option 1.
(And it reminds me that, of course, when you copy the config stuff you have to copy the Sitecore binaries into your app's folder as well)
I would just like to expand on #JermDavis' post and note that Sitecore isn't a big fan of being accessed when not in a web application. However, if you still want to do this, you will need to make sure that you have all of the necessary configuration settings from the web.config and App_Config of your site in your console application's app.config file.
Moreover, you will never be able to call Sitecore.Context in a console application, as the Sitecore Context sits on top of the HttpContext which means that it must be an application and have a valid request for you to use it. What you are looking for is something more along the lines of Sitecore.Configuration.Factory.GetDatabase("master").
Good luck and happy coding :)
This sounds like a job for the Sitecore Item Web API. I use the Sitecore Item Web API whenever I need to access Sitecore data from the master database outside the context of the Content Management server or outside of the context of the Sitecore application. The Web API definitely does not allow you to do everything that the standard Sitecore API does but it can act as a good base and I now extend upon the Web API instead of writing my own custom web services whenever possible.
Thanks to JemDavis's advise.
After I copied the configuration and made changes to config section to get rid of conflicts. I copied almost all of Sitrecore, analytics and lucene dlls, it worked great.
Only thing you have to remember is, copy the app_config folder to the same location where your dlls are.
Thanks again JemDavis....

Open and Save Word files through internet

I have a situation that override my knowledge. Here is situation:
A simple web based system store a Word files. Users create them locally, then upload them to server. After that, another user can download, edit and upload again. All that is okay, but that steps of repeating Download/Upload cause troubles - in case when user forgot to upload after he make changes. The prerequisites is that they want to use only Word, so i can't use any web editors like CKEditor or Google Documents.
So - a question - is there a way to let users open/save that DOC files with Word without setting a VPN?
Server is a Windows 2008, and language is ASP.NET / classicASP. User access system via browsers.
I think you can embed a plugin called aceoffix in your web system, if the customers do not have to download, upload and save back to server. With aceoffix they can edit online and save back to the server directly. It is exactly the same interface as MS Office. Hope this will be helpful.
How about a tiny app (on clients) to act as a syncronizer (using FTP) ?
I think an embedded Word viewer would be something quite complex to pull off - especially if they require the native, proper and exact Word look/menus.
One alternative is to provide a plugin to your users, where they can access/sync documents directly from/to the server. But then you aren't using the a web site but a local plugin, which comes with its own headaches of course.
Creating a Word plugin is a nice way to make it seem like something "in the Office program" when you have actually created it yourself, so that your user don't have to feel like they are using another program. My idea is that you could create a way for users to load a Word file from the server, do changes to it and then upload them back to the server automatically.

Deploying CakePHP on sub domain redirects to wrong location

I am trying to deploy my locahost CakePHP website to a subdomain. I am able to view the website but it is not working correctly when I try to login or register.
It does not show me any validation error nor does it allow me to login or register and it is landing on the below URL:
subdomain.example.com/webroot/index.php?url=users/login
where it should be something like:
subdomain.example.com/users/login
I am using Go Daddy shared hosting.
The older settings defined at http://bakery.cakephp.org/articles/cguyer/2009/10/18/mod-rewrite-on-godaddy-shared-hosting has solved the issue.
Thank you every one for your help.
This sounds (and looks) like an Apache rewrite issue. There are a couple of things you need to look at:
Check to make sure the .htaccess files are were they are expected. You should have one in the app directory and another in the webroot directory. Sometimes when we compress and/or transfer files to the webserver, the .htaccess files get left behind.
Make sure that the server you are running the site on has rewrite turned on. This may require that you call support at Go Daddy. But my experience is they are always willing to help.
Good luck!

Resources