New purchase questions - multiple domains & restricting user access

darren_james

New Member
Mar 2, 2018
4
1
3
48
Hi,

We've just bought Wurlie. I have a couple of questions on how best to set it up.

Multiple domains
I see I can add additional domains to Wurlie. Is there any specific DNS requirements on how to point the domains at the application? For example, I'd like to run the site on a primary domain primary.com, but have secondary options for adding redirects, eg domain1.com, domain2/com

Locking down Wurlie
We want to use this as an internal tool that won't be available for public use. Basically only logged in admin users will be able to create shortened Urls. I don't see any option anywhere where I can prompt users to login before creating Urls - am I missing something? Ideally I want to disable all user registrations.

I've attached a support export. Note that live site will be running on Apache in a Docker Container in Amazon Web Services

Many thanks.
 

Attachments

Last edited:
  • Like
Reactions: donvic21

darren_james

New Member
Mar 2, 2018
4
1
3
48
Further to my question, I see there is an option "Do you want to allow guest users to create short urls?" (see attached).

Even when this is set to "no", with no user logged in (new Chrome Incognito Window) I can still create short Urls. Is this a bug?
 

Attachments

adam

Administrator
Staff member
Dec 5, 2009
2,046
108
63
Multiple domains
I see I can add additional domains to Wurlie. Is there any specific DNS requirements on how to point the domains at the application? For example, I'd like to run the site on a primary domain primary.com, but have secondary options for adding redirects, eg domain1.com, domain2/com
There's not really any specific DNS requirements. The additional domains simply redirect to the main, so you can create the domains (in cPanel for example) as 'add on' domains which point to a sub-folder on the main site. Then there's an .htaccess file you place in here to handle the redirects. We're looking at simplifying this further so you can just point them at the main script, but that's not quite ready.

Locking down Wurlie
We want to use this as an internal tool that won't be available for public use. Basically only logged in admin users will be able to create shortened Urls. I don't see any option anywhere where I can prompt users to login before creating Urls - am I missing something? Ideally I want to disable all user registrations.
That option you mention above should force a user to register before allowing urls to be created. Although it wont stop registered users from creating urls. I've tested this on our demo site and it seems to work as expected, see the error below:
1520157967394.png
To limit it by admin users you'd need to amend the template code. In _indexAction.inc.php find:
PHP:
if(SITE_CONFIG_GUEST_USERS_CREATE_URLS == 'no' && $Auth->loggedIn == false)
{
    redirect(WEB_ROOT . '/register.'.SITE_CONFIG_PAGE_EXTENSION.'?error='.urlencode(t('url_generation_limited_to_registered_users_only', 'Sorry, but you must have an account to create short urls on this site.'))); 
}
Replace with:
PHP:
if($Auth->level != 'admin')
{
    setError(t("error_only_admin_users", "Sorry only admin users can create urls."));
}
That will block all non admin users from creating urls. You could also remove the form and links in the template code if you want to hide the form completely.