[ Index ]
 

Code source de SugarCRM 5.0.0beta1

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/ -> removeme.php (source)

   1  <?php
   2  if(!defined('sugarEntry')) define('sugarEntry', true);
   3  /**

   4   * SugarCRM is a customer relationship management program developed by

   5   * SugarCRM, Inc. Copyright (C) 2004 - 2007 SugarCRM Inc.

   6   * 

   7   * This program is free software; you can redistribute it and/or modify it under

   8   * the terms of the GNU General Public License version 3 as published by the

   9   * Free Software Foundation.

  10   * 

  11   * This program is distributed in the hope that it will be useful, but WITHOUT

  12   * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS

  13   * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more

  14   * details.

  15   * 

  16   * You should have received a copy of the GNU General Public License along with

  17   * this program; if not, see http://www.gnu.org/licenses or write to the Free

  18   * Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA

  19   * 02110-1301 USA.

  20   * 

  21   * You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,

  22   * SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.

  23   * 

  24   * The interactive user interfaces in modified source and object code versions

  25   * of this program must display Appropriate Legal Notices, as required under

  26   * Section 5 of the GNU General Public License version 3.

  27   * 

  28   * In accordance with Section 7(b) of the GNU General Public License version 3,

  29   * these Appropriate Legal Notices must retain the display of the "Powered by

  30   * SugarCRM" logo. If the display of the logo is not reasonably feasible for

  31   * technical reasons, the Appropriate Legal Notices must display the words

  32   * "Powered by SugarCRM".

  33   */
  34  
  35  
  36  
  37  require_once ('include/entryPoint.php');
  38  require_once ('modules/Campaigns/utils.php');
  39  
  40  if (!empty($_REQUEST['remove'])) clean_string($_REQUEST['remove'], "STANDARD");
  41  if (!empty($_REQUEST['from'])) clean_string($_REQUEST['from'], "STANDARD");
  42  
  43  if(!empty($_REQUEST['identifier'])) {
  44      $keys=log_campaign_activity($_REQUEST['identifier'],'removed');
  45      global $current_language;
  46      $mod_strings = return_module_language($current_language, 'Campaigns');
  47  
  48      if (!empty($keys) && $keys['target_type'] == 'Users'){
  49          //Users cannot opt out of receiving emails, print out warning message.

  50          echo $mod_strings['LBL_USERS_CANNOT_OPTOUT'];       
  51       }elseif(!empty($keys) && isset($keys['campaign_id']) && !empty($keys['campaign_id'])){
  52          //we need to unsubscribe the user from this particular campaign

  53          require_once ('include/modules.php');
  54          $beantype = $beanList[$keys['target_type']];
  55          require_once($beanFiles[$beantype]);
  56          $focus = new $beantype();
  57  
  58  
  59  
  60  
  61          $focus->retrieve($keys['target_id']);
  62  
  63  
  64  
  65          unsubscribe($keys['campaign_id'], $focus); 
  66      
  67      }elseif(!empty($keys)){
  68          $id = $keys['target_id'];
  69          $module = trim($keys['target_type']);
  70          $class = $beanList[$module];
  71          require_once($beanFiles[$class]);
  72          $mod = new $class();
  73          $db = & PearDatabase::getInstance();
  74  
  75          $id = $db->quote($id);
  76  
  77          //no opt out for users.

  78          if(ereg('^[0-9A-Za-z\-]*$', $id) && $module != 'Users'){
  79              //record this activity in the campaing log table..

  80              $query = "UPDATE $mod->table_name SET email_opt_out='on' WHERE id ='$id'";
  81              $status=$db->query($query);
  82              if($status){
  83                  echo "*";
  84              }
  85          }
  86      }
  87          //Print Confirmation Message.

  88          echo $mod_strings['LBL_ELECTED_TO_OPTOUT'];
  89      
  90  }
  91  sugar_cleanup();
  92  ?>


Généré le : Tue Sep 11 10:48:47 2007 par Balluche grâce à PHPXref 0.7