| 35 | | #!/bin/bash |
| 36 | | user="$1" |
| 37 | | pass="$2" |
| 38 | | app_id="$3" |
| 39 | | out=$(curl -s "https://members.mayfirst.org:8080/check?user=$user&password=$pass&app_id=$3") |
| 40 | | [ "$out" = "yes" ] && exit 0 |
| 41 | | exit 1 |
| | 48 | <?php |
| | 49 | |
| | 50 | function authenticate_user($user, $password, $app_id) { |
| | 51 | $url = 'https://members.mayfirst.org:8080/check'; |
| | 52 | $vars = 'user=' . $user . '&password=' . $password . |
| | 53 | '&app_id=' . $app_id; |
| | 54 | |
| | 55 | $ch = curl_init( $url ); |
| | 56 | curl_setopt( $ch, CURLOPT_POST, 1); |
| | 57 | curl_setopt( $ch, CURLOPT_POSTFIELDS, $vars); |
| | 58 | curl_setopt( $ch, CURLOPT_HEADER, 0); |
| | 59 | curl_setopt( $ch, CURLOPT_RETURNTRANSFER, 1); |
| | 60 | |
| | 61 | $response = curl_exec( $ch ); |
| | 62 | |
| | 63 | if($response == "yes") return TRUE; |
| | 64 | return FALSE; |
| | 65 | } |