コード例 #1
0
 public function update(Codendi_Request $request, Response $response)
 {
     $emailgateway_mode = $request->get('emailgateway_mode');
     if ($emailgateway_mode && $this->config->setEmailgatewayMode($emailgateway_mode)) {
         $response->addFeedback(Feedback::INFO, $GLOBALS['Language']->getText('admin_main', 'successfully_updated'));
     }
     $response->redirect($_SERVER['REQUEST_URI']);
 }
コード例 #2
0
 public function update(Codendi_Request $request, Response $response)
 {
     $emailgateway_mode = $request->get('emailgateway_mode');
     if ($emailgateway_mode && $this->config->setEmailgatewayMode($emailgateway_mode)) {
         $response->addFeedback(Feedback::INFO, $GLOBALS['Language']->getText('plugin_tracker_config', 'successfully_updated'));
     }
     $this->event_manager->processEvent(Event::UPDATE_ALIASES, null);
     $response->redirect($_SERVER['REQUEST_URI']);
 }
コード例 #3
0
 /**
  * @return Tracker_Artifact_MailGateway_IncomingMessage
  */
 public function build(array $raw_mail)
 {
     $incoming_message = null;
     if ($this->tracker_config->isTokenBasedEmailgatewayEnabled()) {
         $incoming_message = $this->incoming_message_token_builder->build($raw_mail);
     } elseif ($this->tracker_config->isInsecureEmailgatewayEnabled()) {
         $incoming_message = $this->buildIncomingMessageInInsecureMode($raw_mail);
     }
     return $incoming_message;
 }
コード例 #4
0
 public function process(Codendi_Request $request, Response $response, PFUser $user)
 {
     $this->checkUserIsSiteadmin($user, $response);
     switch ($request->get('action')) {
         case 'update':
             $this->csrf->check();
             $this->controller->update($request, $response);
             break;
         default:
             $this->controller->index($this->csrf, $response);
     }
 }
コード例 #5
0
 public function __construct(CSRFSynchronizerToken $csrf, $title, $localinc_path, TrackerPluginConfig $config)
 {
     $this->title = $title;
     $this->csrf_token = $csrf->fetchHTMLInput();
     $this->is_insecure_emailgateway_enabled = $config->isInsecureEmailgatewayEnabled();
     $this->is_token_based_emailgateway_enabled = $config->isTokenBasedEmailgatewayEnabled();
     $this->is_emailgateway_disabled = $config->isEmailgatewayDisabled();
     $this->email_gateway = $GLOBALS['Language']->getText('plugin_tracker_config', 'email_gateway');
     $this->email_gateway_desc = $GLOBALS['Language']->getText('plugin_tracker_config', 'email_gateway_desc');
     $this->disable = $GLOBALS['Language']->getText('plugin_tracker_config', 'disable');
     $this->disable_desc = $GLOBALS['Language']->getText('plugin_tracker_config', 'disable_desc');
     $this->token = $GLOBALS['Language']->getText('plugin_tracker_config', 'token');
     $this->token_desc = $GLOBALS['Language']->getText('plugin_tracker_config', 'token_desc');
     $this->insecure = $GLOBALS['Language']->getText('plugin_tracker_config', 'insecure');
     $this->insecure_desc = $GLOBALS['Language']->getText('plugin_tracker_config', 'insecure_desc');
     $this->save_conf = $GLOBALS['Language']->getText('admin_main', 'save_conf');
     $this->is_localinc_obsolete = $this->isLocalIncObsolete($localinc_path);
     $this->localinc_obsolete_message = $GLOBALS['Language']->getText('plugin_tracker_config', 'localinc_obsolete_message', $localinc_path);
 }
コード例 #6
0
 public function enable_insecure_emailgateway()
 {
     return $this->config->isInsecureEmailgatewayEnabled();
 }
コード例 #7
0
 /**
  * @see Event::BACKEND_ALIAS_GET_ALIASES
  */
 public function backend_alias_get_aliases($params)
 {
     $config = new TrackerPluginConfig(new TrackerPluginConfigDao());
     $src_dir = ForgeConfig::get('codendi_dir');
     $script = $src_dir . '/plugins/tracker/bin/emailgateway-wrapper.sh';
     $command = "sudo -u codendiadm {$script}";
     if ($config->isTokenBasedEmailgatewayEnabled() || $config->isInsecureEmailgatewayEnabled()) {
         $params['aliases'][] = new System_Alias(self::EMAILGATEWAY_TOKEN_ARTIFACT_UPDATE, "\"|{$command}\"");
     }
     if ($config->isInsecureEmailgatewayEnabled()) {
         $params['aliases'][] = new System_Alias(self::EMAILGATEWAY_INSECURE_ARTIFACT_CREATION, "\"|{$command}\"");
         $params['aliases'][] = new System_Alias(self::EMAILGATEWAY_INSECURE_ARTIFACT_UPDATE, "\"|{$command}\"");
     }
 }
コード例 #8
0
 /**
  * @return bool
  */
 public function canUpdateArtifactInInsecureMode(Tracker $tracker)
 {
     return $this->tracker_plugin_config->isInsecureEmailgatewayEnabled() && $tracker->isEmailgatewayEnabled();
 }
コード例 #9
0
 /**
  * @see Event::BACKEND_ALIAS_GET_ALIASES
  */
 public function backend_alias_get_aliases($params)
 {
     $config = new TrackerPluginConfig(new TrackerPluginConfigDao());
     if (!$config->isTokenBasedEmailgatewayEnabled()) {
         return;
     }
     $src_dir = ForgeConfig::get('codendi_dir');
     $script = $src_dir . '/plugins/tracker/bin/emailgateway-wrapper.sh';
     $command = "sudo -u codendiadm {$script}";
     $params['aliases'][] = new System_Alias(self::EMAILGATEWAY_USERNAME, "\"|{$command}\"");
 }