You are here

function GLExchange::isSubmitterValid in GlobalLink Connect for Drupal 7.7

* Validate Submission submitter * *

Parameters

* $shortCode: * Project shortcode * @param * $submitter * Username to validate

1 call to GLExchange::isSubmitterValid()
GLExchange::_validateSubmission in gl_ws/glc/GLExchange.php

File

gl_ws/glc/GLExchange.php, line 818

Class

GLExchange

Code

function isSubmitterValid($shortCode, $newSubmitter) {
  $getSubmittersRequest = new getSubmitters();
  $getSubmittersRequest->projectShortCode = $shortCode;
  $submitters = $this->userProfileService
    ->getSubmitters($getSubmittersRequest)->return;
  if (isset($submitters)) {
    foreach ($submitters as &$submitter) {
      if (isset($submitter)) {
        $info = $submitter;
        if (isset($submitter->userInfo)) {
          $info = $submitter->userInfo;
        }
        if ($info->userName == $newSubmitter && ($info->enabled == '1' || $info->enabled == 1 || $info->enabled == 'true' || $info->enabled == true)) {
          return true;
        }
      }
    }
  }
  return false;
}