Skip to content

Commit 7572933

Browse files
Provide default implementation of /chat that uses Laddr::$chatLinker
1 parent de6fd34 commit 7572933

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

site-root/chat.php

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,8 @@
11
<?php
22

3-
// TODO: delete/comment this line and use this file to implement a gateway to your group's chat system
4-
return RequestHandler::throwError('The administrator of this site has not yet implemented a redirect to your chat provider');
3+
if (Laddr::$chatLinker) {
4+
$url = call_user_func(Laddr::$chatLinker, !empty($_GET['channel']) ? $_GET['channel'] : null);
5+
Site::redirect($url);
6+
}
57

6-
// $_GET['channel'] may be provided to indicate a specific channel to redirect to
7-
8-
// EXAMPLE 1: Redirect to Slack with authentication provided via SAML Single Sign On
9-
//$GLOBALS['Session']->requireAuthentication();
10-
//Site::redirect('https://codeforphilly.slack.com/sso/saml/start?redir=%2Fmessages%2F'.urlencode(!empty($_GET['channel']) ? $_GET['channel'] : 'general').'%2F');
11-
12-
// EXAMPLE 2: Redirect to Slack without SSO
13-
//Site::redirect('https://codeforphilly.slack.com/messages/'.urlencode(!empty($_GET['channel']) ? $_GET['channel'] : 'general').'/');
8+
RequestHandler::throwError('The administrator of this site has not yet configured Laddr:$chatLinker');

0 commit comments

Comments
 (0)