Possible to get Prestashop back office token from external? - token

Good morning to everyone.
I'm developing a complex project, where the store (made by prestashop) is just a part of it.
For this reason, I have a main folder and inside it there are a store folder, containing all the prestashop files, and various other folders containing other sections of the project.
In one of these sections, I would like to add a button that takes me directly to the prestashop back office page to add a new product, but to do this I need to get the authentication token.
Do you have any solution to obtain this token, in a section (directory) other than that of Prestashop?

Include the PrestaShop config.php, and you can use all of the PrestaShop functions and methods
require_once dirname(__FILE__) . '/../../../config/config.inc.php';
And now you can create the token with by calling the
$tokenProducts = Tools::getAdminTokenLite(
'AdminProducts'
);

Related

Copy exchange 2013 rules using profman

I want to copy exiting profile rules and add them into new profile.
It is possible using the "profman.dll" ?
Profman library allows manipulating MAPI profiles, but not rules.
You can find your client-defined rules listed as associated content (hidden) for the Inbox folder. Try using MFCMAPI for exploring Outlook internals.
Not using Profman - the rules are stored in the Inbox and can be accessed using RDOExchangeMailboxStore.Rules collection. You can copy them one at a time adjusting the relevant folder entry ids as necessary.

Microsoft Graph API SharePoint Files Search

I try to search for files on SharePoint Document Library (e.g. the default 'root'). I created a few test-files by uploading them or create new Office files online and made some search-requests, e.g. https://graph.microsoft.com/v1.0/sites/root/drive/root/search(q='{query}') and until yesterday everything worked fine.
Now I started to edit files on SharePoint or created/uploaded new ones and with this edited or new files, I have the problem that I get no result when I search for them. "old" files, I created when I started I find although, as long as I don't edit them.
To get access I registered an App inside the AAD and gave it the needed permissions (
Sites.Read.All, Sites.ReadWrite.All, Files.Read.All, Files.ReadWrite.All
and a direct access to a specific file with https://graph.microsoft.com/v1.0/sites/root/drive/items/{item-id}/ works also well.
Search will read data from indexed data, but crawling and re-indexing of a library need to take some time. So you the code return null for the new files:
https://graph.microsoft.com/v1.0/sites/root/drive/root/search(q='{query}')
The following code get the library data directly but not based on the indexed data, so it works well.
https://graph.microsoft.com/v1.0/sites/root/drive/items/{item-id}/

Labels creation in gmail account using mailcore2

I am building an ios app in which I am presenting emails from the user's gmail inbox on a UITableView. Now I have gotten a new requirement i.e. to create labels (through code) and move the selected emails from inbox to those labels (through code). I am supposed to achieve this task using mailcore 2 . I have no idea how to go with it, need your help plz
You can create folders with -[MCOIMAPSession createFolderOperation:] which takes the path of the folder relative to the root path of the server and delimited with the default delimiter of that account (which can be fetched with an MCOIMAPNamespaceOperation). To move emails into that folder destructively (all the messages are removed from the old and put into the new), you can use -[MCOIMAPSession copyMessagesOperationWithFolder:uids:destFolder:], then call -[MCOIMAPSession storeFlagsOperationWithFolder:uids:kind:flags:] passing along the old folder, the UIDs you just copied, and MCOIMAPStoreFlagsRequestKindAdd as the kind, and MCOMessageFlagDeleted as the flag. Non-destructive requests just involve a copy operation.
To add labels to a message, use -[MCOIMAPSession storeLabelsOperationWithFolder:uids:kind:labels:] with an array of strings for the labels to apply.

Create a combined view list in SharePoint 2007

I like to have a main page Web part with a link to each one of the shared documents in our portal.
The problem is that they are from different libraries and also I want the SharePoint to keep track of check in and check outs of the files. When I use, Content Editor to add the links, and then click on the list, it download a copy of file and saved changes do not change the original document.
I thought about creating a modified view in that specific library and filter out just one file. Then put that file in the front page. But, the first problem is that the file is 2 or 3 level deep in hierarchy. Also, even if I manage to do that, what should I do about different files in different libraries?
Please Advise

How To Dynamically Route to Downloads

Basically, this is what my app does:
It sends an AJAX request
The server creates a file
The server sends back the URL of the
file location
The client-side will attempt to
create a dialog to download the file
at that location (probably using a
frame? I haven't got this far yet).
My question is, how do I dynamically route to the files I create so that they are accessible when you browse to them? If I don't add a route for them, then they will get a 404 if they try and access the directory they're in.
The files are currently stored in a folder in public.
Would the best way to deal with this make the folder somehow not require a route, so that it can be browsed to directly, and then have an index page on it so they can't view the full list of files? If so, please let me know how I can accomplish this. And on a side note, if you have an idea of how I can accomplish JS displaying the download dialog let me know.
It's Rails 3 by the way.
Thanks!
For a full private set of files: choose a place for your files outside your public directory, then configure X-SendFile support in your web server and finally use send_file in your rails application.

Resources