Пример #1
0
 /**
  * Get instance of the SNIP client
  * @return SugarSNIP SNIP client instance
  */
 public static function getInstance()
 {
     if (!self::$instance) {
         self::$instance = new self();
     }
     return self::$instance;
 }
Пример #2
0
<?php

if (!defined('sugarEntry') || !sugarEntry) {
    die('Not A Valid Entry Point');
}
/*
 * Your installation or use of this SugarCRM file is subject to the applicable
 * terms available at
 * http://support.sugarcrm.com/06_Customer_Center/10_Master_Subscription_Agreements/.
 * If you do not agree to all of the applicable terms or do not have the
 * authority to bind the entity as an authorized representative, then do not
 * install or use this SugarCRM file.
 *
 * Copyright (C) SugarCRM Inc. All rights reserved.
 */
installLog("creating new user for Snip");
require_once 'modules/SNIP/SugarSNIP.php';
$snip = SugarSNIP::getInstance();
$snip->getSnipUser();
 /**
  * Import emails from the SNIP service.
  *
  * @param String $session -- Session ID returned by a previous call to login.
  * @exception 'SoapFault' -- The SOAP error, if any
  */
 public function snip_import_emails($session, $email)
 {
     $GLOBALS['log']->info('Begin: SugarWebServiceImpl->import_emails');
     $error = new SoapError();
     // TODO: permissions?
     if (!self::$helperObject->checkSessionAndModuleAccess($session, 'invalid_session', '', '', '', $error)) {
         $GLOBALS['log']->info('End: SugarWebServiceImpl->snip_import_emails denied.');
         return;
     }
     // if
     require_once 'modules/SNIP/SugarSNIP.php';
     $snip = SugarSNIP::getInstance();
     $snip->importEmail($email);
     $GLOBALS['log']->info('End: SugarWebServiceImpl->snip_import_emails');
     return array('results' => TRUE, 'count' => 1, 'message' => '');
 }