diff --git a/composer.json b/composer.json index d4be623..3a06309 100644 --- a/composer.json +++ b/composer.json @@ -1,5 +1,5 @@ { - "require": { - "google/recaptcha": "~1.1" - } + "require": { + "google/recaptcha": "~1.1" + } } \ No newline at end of file diff --git a/constants.php b/constants.php index 994297c..bbb7d18 100644 --- a/constants.php +++ b/constants.php @@ -13,9 +13,9 @@ * See the License for the specific language governing permissions and * limitations under the License. **/ - define('SUBDOMAIN',''); - define('TOKEN',''); - define('SECRET', ''); - define('SITEKEY', ''); - define('NOTE', ''); + define('SUBDOMAIN',''); + define('TOKEN',''); + define('SECRET', ''); + define('SITEKEY', ''); + define('NOTE', ''); ?> \ No newline at end of file diff --git a/index.php b/index.php index c0dfdb0..b2b2772 100644 --- a/index.php +++ b/index.php @@ -32,74 +32,74 @@ // Get team data from slack if($reply['ok']){ - $img = $reply['team']['icon']['image_68']; - $name = $reply['team']['name']; + $img = $reply['team']['icon']['image_68']; + $name = $reply['team']['name']; - foreach($reply['users'] as $val) { + foreach($reply['users'] as $val) { - $total = $total + 1; - if('active' == $val['presence']) { - $active = $active + 1; - } - } + $total = $total + 1; + if('active' == $val['presence']) { + $active = $active + 1; + } + } } ?> - - Join <?php echo $name; ?> on Slack! - - - - - - - -
+ + Join <?php echo $name; ?> on Slack! + + + + + + + +
-
- - + - -
+
+ + + + +
-
Join on Slack.
+
Join on Slack.
-
users online now of registered.
+
users online now of registered.
-
- - -

Already have an account? Click here to go to Slack.

-
-

Note:

- -
+
+ + +

Already have an account? Click here to go to Slack.

+
+

Note:

+ +
- + - - + + diff --git a/signup.php b/signup.php index 814199a..a3e31db 100644 --- a/signup.php +++ b/signup.php @@ -30,51 +30,51 @@ if ($resp->isSuccess()) { - if (!filter_var($email, FILTER_VALIDATE_EMAIL)) { + if (!filter_var($email, FILTER_VALIDATE_EMAIL)) { - $out["message"] = "Invalid Email"; - } else { + $out["message"] = "Invalid Email"; + } else { - $slackInviteUrl = 'https://'.SUBDOMAIN.'.slack.com/api/users.admin.invite?t='.time(); + $slackInviteUrl = 'https://'.SUBDOMAIN.'.slack.com/api/users.admin.invite?t='.time(); - // add fileds - $fields .= "email=".urlencode($email)."&"; - $fields .= "token=".TOKEN."&"; - $fields .= "set_active=true&"; - $fields .= "_attempts=1"; + // add fileds + $fields .= "email=".urlencode($email)."&"; + $fields .= "token=".TOKEN."&"; + $fields .= "set_active=true&"; + $fields .= "_attempts=1"; - // open connection - $ch = curl_init(); + // open connection + $ch = curl_init(); - // set the url, number of POST vars, POST data - curl_setopt($ch, CURLOPT_URL, $slackInviteUrl); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); - curl_setopt($ch, CURLOPT_POST, 4); - curl_setopt($ch, CURLOPT_POSTFIELDS, $fields); + // set the url, number of POST vars, POST data + curl_setopt($ch, CURLOPT_URL, $slackInviteUrl); + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + curl_setopt($ch, CURLOPT_POST, 4); + curl_setopt($ch, CURLOPT_POSTFIELDS, $fields); - // send the request to Slack - $reply = json_decode(curl_exec($ch), true); - curl_close($ch); + // send the request to Slack + $reply = json_decode(curl_exec($ch), true); + curl_close($ch); - // output - if ($reply['ok'] == false) { - // error sending invite - if($reply['error'] == "already_in_team") { - $out["message"] = "You have already joined this Slack!"; - } elseif($reply['error'] == "already_invited") { - $out["message"] = "Your invite has already been sent!"; - } else { - $out["message"] = "Error Code: ".$reply['error']; - } - } else { - // invitation was sent sucessfully - $out["message"] = "Invitation sent!"; - $out["ok"] = true; - } - } - //send JSON response back - echo (json_encode($out, JSON_PRETTY_PRINT)); + // output + if ($reply['ok'] == false) { + // error sending invite + if($reply['error'] == "already_in_team") { + $out["message"] = "You have already joined this Slack!"; + } elseif($reply['error'] == "already_invited") { + $out["message"] = "Your invite has already been sent!"; + } else { + $out["message"] = "Error Code: ".$reply['error']; + } + } else { + // invitation was sent sucessfully + $out["message"] = "Invitation sent!"; + $out["ok"] = true; + } + } + //send JSON response back + echo (json_encode($out, JSON_PRETTY_PRINT)); } else { - $out["message"] = "ReCAPTCHA Error. Refresh and try again!"; - echo (json_encode($out, JSON_PRETTY_PRINT)); + $out["message"] = "ReCAPTCHA Error. Refresh and try again!"; + echo (json_encode($out, JSON_PRETTY_PRINT)); } \ No newline at end of file diff --git a/style.css b/style.css index e0461ea..7462f8f 100644 --- a/style.css +++ b/style.css @@ -1,5 +1,5 @@ /* - Copyright 2015, Google, Inc. + Copyright 2015, Google, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at @@ -13,57 +13,57 @@ limitations under the License. */ html{ - font-family: sans-serif; + font-family: sans-serif; } .form{ - margin:auto; - width: 300px; + margin:auto; + width: 300px; } .form-item{ - font-size: 12px; - height: 32px; - line-height: 32px; - margin-top: 10px; - text-align: center; - width: 300px; + font-size: 12px; + height: 32px; + line-height: 32px; + margin-top: 10px; + text-align: center; + width: 300px; } .button{ - color: #fff; - font-weight: bold; - border-width: 0; - background: #E01563; - text-transform: uppercase; - cursor: pointer; - padding: 0; - transition: background-color 150ms ease-in, color 150ms ease-in; + color: #fff; + font-weight: bold; + border-width: 0; + background: #E01563; + text-transform: uppercase; + cursor: pointer; + padding: 0; + transition: background-color 150ms ease-in, color 150ms ease-in; } .logo{ - width: 48px; - height: 48px; - vertical-align:middle; + width: 48px; + height: 48px; + vertical-align:middle; } .plus{ - margin: 20px; - color: #D6D6D6; + margin: 20px; + color: #D6D6D6; } footer{ - color: #D6D6D6; - font-size: 11px; - margin: 200px auto 0; - width: 300px; - text-align: center; + color: #D6D6D6; + font-size: 11px; + margin: 200px auto 0; + width: 300px; + text-align: center; } footer a:active, footer a:visited{ - color: #D6D6D6; + color: #D6D6D6; } .muted{ - font-size: 0.7em; + font-size: 0.7em; } .muted a{ - color: grey; + color: grey; } .note{ - color: grey; + color: grey; } \ No newline at end of file