How do I get my iCAL URL
-
The doc says, “Once you have determined the URL of your iCal feed, visit your main Calendar page…”
How do I determine the URL of my iCAL feed?
The page I need help with: [log in to see the link]
-
Is it possible to password-protect the https://www.example.com/events.ics link, such as using a WordPress user’s user name and password?
-
This reply was modified 1 year, 6 months ago by
tahoar.
Create the directory wp-content/plugin-templates/events-manager/templates and then copy the file wp-content/plugins/events-manager/templates/templates/ical.php to that directory then modify the copied version of ical.php. You could for example add the following starting on line 2 of the file to only allow logged in users to access the feed:
if ( !is_user_logged_in() )
exit();Thank you. The code works, in that it outputs a zero-length file when a user isn’t logged in to a browser, but that’s not quite what I had in mind.
I want to subscribe to the events.ics vCalendar on my iPhone or Thunderbird email app. There’s no way to “log-in” to the WordPress site from the iPhone or Thunderbird settings. Their settings support a username & password, but not the same.
So, I’ll live without password access for now. I hope you can add this feature to the to-do list. Thanks again.
Add the following code snippet:
function my_login_redirect( $redirect_to, $user, $auth_error ) {
if ( isset( $_GET['redirect_to'] ) ) {
$redirect_to = $_GET['redirect_to'];
}
return $redirect_to;
}
add_filter( 'login_redirect', 'my_login_redirect', 10, 3 );You can use the Code Snippets plugin to add this code snippet.
Then change my suggested change to ical.php to the following code:
if (!is_user_logged_in()) {
$redirect_to = $_SERVER['REQUEST_URI'];
wp_safe_redirect(wp_login_url($redirect_to));
exit;
}This way it will redirect to the login page if they try to access events.ics without being logged in. After they login it will redirect back to the events.ics URL.
Thanks for trying. Your code snippets don’t affect a browser not logged-in to the site. From a Private Browsing Firefox instance not logged-in, however, entering the URL “https://www.jmcmustang.org/events.ics” results in an attempted redirect with this URL in the address bar:
https://www.jmcmustang.org/wp-login.php?redirect_to=%2Fwp-login.php%3Fredirect_to%3D%252Fwp-login.php%253Fredirect_to%253D%25252Fwp-login.php%25253Fredirect_to%25253D%2525252Fwp-login.php%2525253Fredirect_to%2525253D%252525252Fwp-login.php%252525253Fredirect_to%252525253D%25252525252Fwp-login.php%25252525253Fredirect_to%25252525253D%2525252525252Fwp-login.php%2525252525253Fredirect_to%2525252525253D%252525252525252Fwp-login.php%252525252525253Fredirect_to%252525252525253D%25252525252525252Fwp-login.php%25252525252525253Fredirect_to%25252525252525253D%2525252525252525252Fwp-login.php%2525252525252525253Fredirect_to%2525252525252525253D%252525252525252525252Fwp-login.php%252525252525252525253Fredirect_to%252525252525252525253D%25252525252525252525252Fwp-login.php%25252525252525252525253Fredirect_to%25252525252525252525253D%2525252525252525252525252Fwp-login.php%2525252525252525252525253Fredirect_to%2525252525252525252525253D%252525252525252525252525252Fwp-login.php%252525252525252525252525253Fredirect_to%252525252525252525252525253D%25252525252525252525252525252Fwp-login.php%25252525252525252525252525253Fredirect_to%25252525252525252525252525253D%2525252525252525252525252525252Fwp-login.php%2525252525252525252525252525253Fredirect_to%2525252525252525252525252525253D%252525252525252525252525252525252Fwp-login.php%252525252525252525252525252525253Fredirect_to%252525252525252525252525252525253D%25252525252525252525252525252525252Fwp-login.php%25252525252525252525252525252525253Fredirect_to%25252525252525252525252525252525253D%2525252525252525252525252525252525252Fwp-login.php%2525252525252525252525252525252525253Fredirect_to%2525252525252525252525252525252525253D%252525252525252525252525252525252525252Fevents.icsAn the browser reports this error: The page isn’t redirecting properly
I appreciate your trying, but I’m not confident that this approach will it pass the proper credentials from an app like Thunderbird, iPhone’s Calendar and Android using the vCalendar authentication API… even if the redirect works in a browser. I’m complete with this exchange. No need to pursue the browser redirect further. Thanks again.
-
This reply was modified 1 year, 6 months ago by
The topic ‘How do I get my iCAL URL’ is closed to new replies.