phpBMS

Show
Ignore:
Timestamp:
01/07/10 18:13:51 (2 years ago)
Author:
brieb
Message:
  • more sucrity tightening with roles.
Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/phpbms/modules/mailchimp/adminsettings.php

    r686 r730  
    11<?php 
     2/* 
     3 $Rev: 267 $ | $LastChangedBy: brieb $ 
     4 $LastChangedDate: 2007-08-14 13:08:27 -0600 (Tue, 14 Aug 2007) $ 
     5 +-------------------------------------------------------------------------+ 
     6 | Copyright (c) 2004 - 2010, Kreotek LLC                                  | 
     7 | All rights reserved.                                                    | 
     8 +-------------------------------------------------------------------------+ 
     9 |                                                                         | 
     10 | Redistribution and use in source and binary forms, with or without      | 
     11 | modification, are permitted provided that the following conditions are  | 
     12 | met:                                                                    | 
     13 |                                                                         | 
     14 | - Redistributions of source code must retain the above copyright        | 
     15 |   notice, this list of conditions and the following disclaimer.         | 
     16 |                                                                         | 
     17 | - Redistributions in binary form must reproduce the above copyright     | 
     18 |   notice, this list of conditions and the following disclaimer in the   | 
     19 |   documentation and/or other materials provided with the distribution.  | 
     20 |                                                                         | 
     21 | - Neither the name of Kreotek LLC nor the names of its contributore may | 
     22 |   be used to endorse or promote products derived from this software     | 
     23 |   without specific prior written permission.                            | 
     24 |                                                                         | 
     25 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS     | 
     26 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT       | 
     27 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A | 
     28 | PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT      | 
     29 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,   | 
     30 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT        | 
     31 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,   | 
     32 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY   | 
     33 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT     | 
     34 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE   | 
     35 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.    | 
     36 |                                                                         | 
     37 +-------------------------------------------------------------------------+ 
     38*/ 
    239class mailchimpUpdate{ 
    340 
    441    function updateSettings($variables){ 
    5                  
     42 
    643                if(!isset($variables["mailchimp_secure"])) 
    744                        $variables["mailchimp_secure"] = 0; 
    8          
     45 
    946                /** 
    1047                  *   Check for a valid api key. 
     
    1249                if($variables["apikey_changed"] == "1" && $variables["mailchimp_apikey"] != ""){ 
    1350            include_once("include/MCAPI.class.php"); 
    14              
     51 
    1552            $api = new MCAPI($variables["mailchimp_apikey"]); 
    1653            $api->ping(); 
     
    2057                                return $variables; 
    2158            }//end if 
    22              
     59 
    2360        }//end if 
    24                  
    25                  
     61 
     62 
    2663                /** 
    27                   *  Check for valid list id  
     64                  *  Check for valid list id 
    2865                  */ 
    2966                if($variables["apilist_changed"] == "1" && $variables["mailchimp_list_id"] != ""){ 
    3067                        include_once("include/MCAPI.class.php"); 
    31                          
     68 
    3269                        /** 
    3370                          *  Check to see if api is already defined (from a possible api key check) 
     
    4380                                }//end if 
    4481                        }//end if 
    45                          
     82 
    4683                        /** 
    4784                          *   Look up the lists 
     
    5390                                return $variables; 
    5491                        }else{ 
    55                                  
     92 
    5693                                /** 
    57                                   *  Check to see if list id is valid  
     94                                  *  Check to see if list id is valid 
    5895                                  */ 
    5996                                $validId = false; 
     
    63100                                                break; 
    64101                                        }//endif 
    65                                  
     102 
    66103                                if(!$validId){ 
    67104                                        unset($variables["mailchimp_list_id"]); 
     
    69106                                        return $variables; 
    70107                                }else{ 
    71                                          
    72                                         /** 
    73                                           *  Check to see if the list has a uuid.  
     108 
     109                                        /** 
     110                                          *  Check to see if the list has a uuid. 
    74111                                          */ 
    75112                                        $hasUuid = false; 
     
    82119                                                return $variables; 
    83120                                        }//end if 
    84                                                  
     121 
    85122                                        $req = array(); 
    86123                                        foreach($mergeVars as $mergeVar){ 
    87                                                  
     124 
    88125                                                switch($mergeVar["tag"]){ 
    89                                                          
     126 
    90127                                                        case "UUID": 
    91128                                                                $hasUuid = true; 
    92129                                                                break; 
    93                                                          
     130 
    94131                                                        case "COMPANY": 
    95132                                                                $hasCompany = true; 
    96133                                                                break; 
    97                                                          
     134 
    98135                                                        case "TYPE": 
    99136                                                                $hasType = true; 
    100137                                                                break; 
    101                                                          
     138 
    102139                                                }//end switch 
    103                                                  
     140 
    104141                                        }//end foreach 
    105                                          
    106                                         /** 
    107                                           *  If it doesn't have a uuid field, create it.  
     142 
     143                                        /** 
     144                                          *  If it doesn't have a uuid field, create it. 
    108145                                          */ 
    109146                                        if(!$hasUuid){ 
     
    119156                                                        return $variables; 
    120157                                                }//end if 
    121                                                  
    122                                         }//end if 
    123                                          
    124                                         /** 
    125                                           *  If it doesn't have a company field, create it.  
     158 
     159                                        }//end if 
     160 
     161                                        /** 
     162                                          *  If it doesn't have a company field, create it. 
    126163                                          */ 
    127164                                        if(!$hasCompany){ 
     
    137174                                                        return $variables; 
    138175                                                }//end if 
    139                                                  
    140                                         }//end if 
    141                                          
    142                                         /** 
    143                                           *  If it doesn't have a type field, create it.  
     176 
     177                                        }//end if 
     178 
     179                                        /** 
     180                                          *  If it doesn't have a type field, create it. 
    144181                                          */ 
    145182                                        if(!$hasType){ 
     
    155192                                                        return $variables; 
    156193                                                }//end if 
    157                                                  
    158                                         }//end if 
    159                                          
    160                                          
    161                                         /** 
    162                                           *  If the date list id has changed, the last sync date must be reset:  
     194 
     195                                        }//end if 
     196 
     197 
     198                                        /** 
     199                                          *  If the date list id has changed, the last sync date must be reset: 
    163200                                          */ 
    164201                                        $variables["mailchimp_last_sync_date"] = ""; 
    165                                          
     202 
    166203                                }//end if 
    167                                  
     204 
    168205                        }//end if 
    169                          
     206 
    170207                }//end if 
    171          
     208 
    172209        return $variables; 
    173          
     210 
    174211    }//end function 
    175      
    176      
     212 
     213 
    177214}//end class 
    178215 
     
    186223                        $theinput = new inputField("mailchimp_apikey",$therecord["mailchimp_apikey"],"mailchimp apikey", false, NULL, 48); 
    187224                        $fields[] = $theinput; 
    188                          
     225 
    189226                        $theinput = new inputCheckbox("mailchimp_secure", $therecord["mailchimp_secure"], "use ssl connection"); 
    190227                        $fields[] = $theinput; 
    191                          
     228 
    192229                        $theinput = new inputField("mailchimp_list_id", $therecord["mailchimp_list_id"], "list id"); 
    193230                        $fields[] = $theinput; 
    194                          
     231 
    195232                        $theinput = new inputField("mailchimp_last_sync_date", $therecord["mailchimp_last_sync_date"], "last sync date"); 
    196233                        $theinput->setAttribute("class", "uneditable"); 
     
    207244        <legend>Main</legend> 
    208245 
    209          
     246 
    210247        <input type="hidden" id="apikey_changed" name="apikey_changed" value="0" /> 
    211          
     248 
    212249        <p> 
    213250                <span class="notes"> 
     
    216253                </span> 
    217254        </p> 
    218          
     255 
    219256    <p> 
    220257                <?php echo $theform->showField("mailchimp_apikey");?> 
phpBMS vulnerability assesment provided by Orvant Inc. Copyright © 2010 Kreotek, LLC. All Rights reserved.