Skip to content

Commit a2ac2f1

Browse files
Add example chat.php redirect script
1 parent 5567fac commit a2ac2f1

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

site-root/chat.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?php
2+
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');
5+
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').'/');

0 commit comments

Comments
 (0)