You are here

function sms_muse_authenticate in SMS Framework 5

Menu callback for Javascript validate.

1 call to sms_muse_authenticate()
sms_muse_menu in modules/sms_muse/sms_muse.module
Create menu callback for JS

File

modules/sms_muse/sms_muse.module, line 238

Code

function sms_muse_authenticate() {
  $config = array(
    'sms_muse_user' => $_GET['username'],
    'sms_muse_password' => $_GET['password'],
    'sms_muse_soap' => $_GET['soap'],
    'sms_muse_service' => $_GET['service'],
  );
  $auth = sms_muse_command('auth', array(), $config);
  if ($auth == '1') {
    $result = 1;
  }
  else {
    $result = 0;
    $error = $auth['faultstring'];
  }
  print drupal_to_js(array(
    'authenticated' => $result,
    'error' => $error,
  ));
}