Posted on 01-23-2018 06:34 AM
Hello!
We're starting to use the new Self Service URL format for staff communication.
Policies take the following URL format:jamfselfservice://content?entity=policy&id=792&action=view
Due to Google Mail's stripping of application-specific hyperlinks, we have to create a PHP redirect that identifies the requested entity
, id
and action
, then constructs the Self Service query. This works great! Now we'd like to create URLs that open Self Service and point to Library categories instead of specific Policies; is anyone aware of the format these links would use? I'd assume it's something along the lines of:jamfselfservice://content?entity=category&id=1
... but obviously it's not that, and I couldn't find any documentation referencing the possible entity names. Thank you!
Posted on 01-30-2018 07:29 AM
Hi @cornwella ,
how are these PHP redirects created? We are in the same situation with Gmail and no working hyperlinks to policies.
thanks
Posted on 01-30-2018 07:52 AM
Hi @jensm ,
below is the code we use. We called our file self.php
. You can adjust it to your needs!
<?php
// Self Service Redirect
// This script takes URL parameters for Jamf's Self Service module
// and creates a redirect, in order to work around Google Mail's link
// stripping of app-specific URLs (e.g. non-HTTP/HTTPS/FTP links).
// Example:
// jamfselfservice://content?entity=policy&id=792&action=view
// ... can be linked as ...
// http://(your server)/self.php?entity=policy&id=792&action=view
if ((!isset($_GET['entity'])) || (!isset($_GET['id'])) || (!isset($_GET['action']))) {
header("Location: jamfselfservice://content");
} else {
$entity = stripslashes($_GET['entity']);
$id = (int)$_GET['id'];
$action = stripslashes($_GET['action']);
// Add possible value options here to prevent generation of arbitrary links.
// There may be more, but these are the only ones I've found so far.
if (($entity == "policy") && (($action == "view") || ($action == "execute"))) {
header("Location: jamfselfservice://content?entity=" . $entity . "&id=" . $id ."&action=". $action);
} else {
echo "Invalid URL parameters.";
echo "<p><b>entity:</b> policy<br> <b>action:</b> view, execute </p>";
}
}
exit();
?>
Posted on 01-25-2024 04:11 PM
I see this is an older thread by was wondering if you made any improvements to this script especially now that Jamf has published Self Service URL Scheme documentation here:
Particularly to add support for Search links, as well as Categories.
Posted on 01-30-2018 08:08 AM
thanks @cornwella ,
where do i have to put self.php in?
Posted on 01-30-2018 09:29 AM
You can host it on any PHP-enabled web server that is accessible to the recipients of your email.
If you don't already have one, here's a good guide on how to get started (you can skip MySQL, though it does come in handy).
Posted on 01-31-2018 12:44 AM
thanks @cornwella , now i get it.
Posted on 09-11-2019 02:38 PM