Location: PHPKode > projects > MembersGear > membersgear/admin/admin_configuration_email.php
<?php
  require_once "../config/config.php";
  include_once(CONFIG_DIR.'/email_configuration.php');   
  require_once INCLUDE_DIR."/users_class.php"; 
  require_once PHYSICAL_DIR."/includes/system_get_set_options_class.php";
  
  $option_obj=new system_get_set_options_class();
  $users = new users_class();   
  if($users->IsAdminhavePermission($_SESSION[SESSION_PREFIX.'Admin_UserID'],'Can configure email system')==false)
  {
    Redirect('admin_nopermission.php',true);  
  }
  if($_POST)
   {
        
        $lsPhpMailerHost=addslashes($_POST['host']);
         if(isset($_POST['auth']) )  
             $lsPhpMailerAuth=addslashes($_POST['auth']); 
        else
           $lsPhpMailerAuth="false"; 
           
        $lsPhpMailerUsername=addslashes($_POST['authusername']);
        if($lsPhpMailerUsername==null or $lsPhpMailerUsername=="")
          $lsPhpMailerUsername=" ";
          
        $lsPhpMailerPassword=addslashes($_POST['authupassword']);
         
        if($lsPhpMailerPassword=="" or $lsPhpMailerPassword==null)
         $lsPhpMailerPassword=" "; 
          
        $lsPhpMailerPort=addslashes($_POST['port']);
        
         if($lsPhpMailerPort=="" or $lsPhpMailerPort==null) 
           $lsPhpMailerPort=" "; 
          
        $lsphpMaileremailfrom=addslashes($_POST['emailfrom']);
        $lsphpMaileremailfromName=addslashes($_POST['emailfromname']);
        $lsAdmin_Email_Address = addslashes($_POST['txt-admin-email']);
        $lsAdmin_Email_Address_Hdn = addslashes($_POST['hdn-admin-email']);
        $lsemailMethod=addslashes($_POST['mailMethod']);       
        
        $option_obj->update_option('PHPMAILER_HOST',$lsPhpMailerHost);   
        $_SESSION[SESSION_PREFIX.'PHPMAILER_HOST']= trim($lsPhpMailerHost);
          
        $option_obj->update_option('PHPMAILER_SMTPAUTH',$lsPhpMailerAuth); 
        $_SESSION[SESSION_PREFIX.'PHPMAILER_SMTPAUTH']= $lsPhpMailerAuth;
            
        $option_obj->update_option('PHPMAILER_USERNAME',$lsPhpMailerUsername);   
        $_SESSION[SESSION_PREFIX.'PHPMAILER_USERNAME']= trim($lsPhpMailerUsername);
          
        $option_obj->update_option('PHPMAILER_PASSWORD',$lsPhpMailerPassword);
        $_SESSION[SESSION_PREFIX.'PHPMAILER_PASSWORD']= trim($lsPhpMailerPassword);
             
        $option_obj->update_option('PHPMAILER_PORT',$lsPhpMailerPort);  
        $_SESSION[SESSION_PREFIX.'PHPMAILER_PORT']= trim($lsPhpMailerPort);
           
        $option_obj->update_option('PHPMAILER_EMAIL_FROM',$lsphpMaileremailfrom);  
        $_SESSION[SESSION_PREFIX.'PHPMAILER_EMAIL_FROM']= $lsphpMaileremailfrom;
           
        $option_obj->update_option('PHPMAILER_EMAIL_FROM_NAME',$lsphpMaileremailfromName); 
        $_SESSION[SESSION_PREFIX.'PHPMAILER_EMAIL_FROM_NAME']= $lsphpMaileremailfromName;
            
        $option_obj->update_option('ADMINISTRATOR_EMAIL_ADDRESS',$lsAdmin_Email_Address); 
        $_SESSION[SESSION_PREFIX.'ADMINISTRATOR_EMAIL_ADDRESS']= $lsAdmin_Email_Address;
            
        $option_obj->update_option('SEND_EMAIL_METHOD',$lsemailMethod); 
        $_SESSION[SESSION_PREFIX.'SEND_EMAIL_METHOD']= $lsemailMethod;
        
       
        
        $lsAcc_Locked = $_POST['ddl-acc-locked']; 
        $lsAcc_Locked_Email_Template_Name = $_POST['txt-acc-locked-email'];
        $lsAcc_Locked_Hdn_Template_ID = $_POST['hdn-acc-locked'];
        $option_obj->update_option('EMAIL_ACCOUNT_LOCKED',$lsAcc_Locked); 
        $_SESSION[SESSION_PREFIX.'EMAIL_ACCOUNT_LOCKED']= $lsAcc_Locked;
            
        $option_obj->update_option('EMAIL_ACCOUNT_LOCKED_TEMPLATE_ID',$lsAcc_Locked_Hdn_Template_ID);     
        $_SESSION[SESSION_PREFIX.'EMAIL_ACCOUNT_LOCKED_TEMPLATE_ID']= $lsAcc_Locked_Hdn_Template_ID;
        
        $option_obj->update_option('EMAIL_ACCOUNT_LOCKED_TEMPLATE_NAME',$lsAcc_Locked_Email_Template_Name); 
        $_SESSION[SESSION_PREFIX.'EMAIL_ACCOUNT_LOCKED_TEMPLATE_NAME']= $lsAcc_Locked_Email_Template_Name;    
     
     
        
        $lsPayment_Complete = $_POST['ddl-payment-complete'];
        $lsPayment_Complete_Email_Template_Name = $_POST['txt-payment-complete-email'];
        $lsPayment_Complete_Hdn_Template_ID = $_POST['hdn-payment-complete'];
        $option_obj->update_option('EMAIL_PAYMENT_COMPLETED',$lsPayment_Complete); 
        $_SESSION[SESSION_PREFIX.'EMAIL_PAYMENT_COMPLETED']= $lsPayment_Complete;
            
        $option_obj->update_option('EMAIL_PAYMENT_COMPLETED_TEMPLATE_ID',$lsPayment_Complete_Hdn_Template_ID);
        $_SESSION[SESSION_PREFIX.'EMAIL_PAYMENT_COMPLETED_TEMPLATE_ID']= $lsPayment_Complete_Hdn_Template_ID;
             
        $option_obj->update_option('EMAIL_PAYMENT_COMPLETED_TEMPLATE_NAME',$lsPayment_Complete_Email_Template_Name); 
        $_SESSION[SESSION_PREFIX.'EMAIL_PAYMENT_COMPLETED_TEMPLATE_NAME']= $lsPayment_Complete_Email_Template_Name;    
       
        
        $lsSubscription_signup = $_POST['ddl-subscription-signup'];
        $lsSubscription_signup_Notification = 0;//($_POST['txt-sub-signup-notification'] != '') ? $_POST['txt-sub-signup-notification'] : 0;
        $lsSubscription_signup_Email_Template_Name = $_POST['txt-sub-signup-email'];     
        $lsSubscription_signup_Hdn_Template_ID = $_POST['hdn-subscription-signup'];
        $option_obj->update_option('EMAIL_PRODUCT_SIGNUP',$lsSubscription_signup); 
        $_SESSION[SESSION_PREFIX.'EMAIL_PRODUCT_SIGNUP']= $lsSubscription_signup;
            
        $option_obj->update_option('EMAIL_PRODUCT_SIGNUP_DAYS',$lsSubscription_signup_Notification);  
        $_SESSION[SESSION_PREFIX.'EMAIL_PRODUCT_SIGNUP_DAYS']= $lsSubscription_signup_Notification;
           
        $option_obj->update_option('EMAIL_PRODUCT_SIGNUP_TEMPLATE_ID',$lsSubscription_signup_Hdn_Template_ID);
        $_SESSION[SESSION_PREFIX.'EMAIL_PRODUCT_SIGNUP_TEMPLATE_ID']= $lsSubscription_signup_Hdn_Template_ID;
             
        $option_obj->update_option('EMAIL_PRODUCT_SIGNUP_TEMPLATE_NAME',$lsSubscription_signup_Email_Template_Name);
        $_SESSION[SESSION_PREFIX.'EMAIL_PRODUCT_SIGNUP_TEMPLATE_NAME']= $lsSubscription_signup_Email_Template_Name;     
            
      
        
        $lsChange_Profile = $_POST['ddl-change-profile'];
        $lsChange_Profile_Email_Template_Name = $_POST['txt-change-profile-email'];
        $lsChange_Profile_Hdn_Template_ID = $_POST['hdn-change-profile'];
        $option_obj->update_option('EMAIL_CHANGE_PROFILE',$lsChange_Profile); 
        $_SESSION[SESSION_PREFIX.'EMAIL_CHANGE_PROFILE']= $lsChange_Profile;
            
        $option_obj->update_option('EMAIL_CHANGE_PROFILE_TEMPLATE_ID',$lsChange_Profile_Hdn_Template_ID);  
        $_SESSION[SESSION_PREFIX.'EMAIL_CHANGE_PROFILE_TEMPLATE_ID']= $lsChange_Profile_Hdn_Template_ID;
           
        $option_obj->update_option('EMAIL_CHANGE_PROFILE_TEMPLATE_NAME',$lsChange_Profile_Email_Template_Name);
        $_SESSION[SESSION_PREFIX.'EMAIL_CHANGE_PROFILE_TEMPLATE_NAME']= $lsChange_Profile_Email_Template_Name;
             
     
     
        $lsSubscription_Expire = $_POST['ddl-subscription-expires'];
        $lsSubscription_Expire_Notification = ($_POST['txt-sub-expire-notification'] != '') ? $_POST['txt-sub-expire-notification'] : 0;
        $lsSubscription_Expire_Email_Template_Name = $_POST['txt-sub-expire-email'];
        $lsSubscription_Expire_Hdn_Template_ID = $_POST['hdn-subscription-expires'];
        $option_obj->update_option('EMAIL_SUBSCRIPTION_ABOUT_TO_EXPIRED',$lsSubscription_Expire); 
        $_SESSION[SESSION_PREFIX.'EMAIL_SUBSCRIPTION_ABOUT_TO_EXPIRED']= $lsSubscription_Expire;
            
        $option_obj->update_option('EMAIL_SUBSCRIPTION_ABOUT_TO_EXPIRED_DAYS',$lsSubscription_Expire_Notification);  
        $_SESSION[SESSION_PREFIX.'EMAIL_SUBSCRIPTION_ABOUT_TO_EXPIRED_DAYS']= $lsSubscription_Expire_Notification;
           
        $option_obj->update_option('EMAIL_SUBSCRIPTION_ABOUT_TO_EXPIRED_TEMPLATE_NAME',$lsSubscription_Expire_Email_Template_Name);     
        $_SESSION[SESSION_PREFIX.'EMAIL_SUBSCRIPTION_ABOUT_TO_EXPIRED_TEMPLATE_NAME']= $lsSubscription_Expire_Email_Template_Name;
       
        $option_obj->update_option('EMAIL_SUBSCRIPTION_ABOUT_TO_EXPIRED_TEMPLATE_ID',$lsSubscription_Expire_Hdn_Template_ID);     
        $_SESSION[SESSION_PREFIX.'EMAIL_SUBSCRIPTION_ABOUT_TO_EXPIRED_TEMPLATE_ID']= $lsSubscription_Expire_Hdn_Template_ID;
  
        $lsUser_Forgot_Password = $_POST['ddl-forgot-password'];
        $lsUser_Forgot_Password_Hdn_Template_ID = $_POST['hdn-forgot-password'];
        $lsUser_Forgot_Password_Email_Template_Name = $_POST['txt-forgot-password-email'];
        $option_obj->update_option('EMAIL_FORGOT_PASSWORD',$lsUser_Forgot_Password);  
        $_SESSION[SESSION_PREFIX.'EMAIL_FORGOT_PASSWORD']= $lsUser_Forgot_Password;
           
        $option_obj->update_option('EMAIL_FORGOT_PASSWORD_TEMPLATE_ID',$lsUser_Forgot_Password_Hdn_Template_ID); 
        $_SESSION[SESSION_PREFIX.'EMAIL_FORGOT_PASSWORD_TEMPLATE_ID']= $lsUser_Forgot_Password_Hdn_Template_ID;
            
        $option_obj->update_option('EMAIL_FORGOT_PASSWORD_TEMPLATE_NAME',$lsUser_Forgot_Password_Email_Template_Name);
        $_SESSION[SESSION_PREFIX.'EMAIL_FORGOT_PASSWORD_TEMPLATE_NAME']= $lsUser_Forgot_Password_Email_Template_Name;
             
      
      
        
        $lsSubscription_Expired = $_POST['ddl-subscription-expired'];
        $lsSubscription_Expired_Notification = ($_POST['txt-sub-expired-notification'] != '') ? $_POST['txt-sub-expired-notification'] : 0;
        $lsSubscription_Expired_Email_Template_Name = $_POST['txt-sub-expired-email'];
        $lsSubscription_Expired_Hdn_Template_ID = $_POST['hdn-subscription-expired'];
        $option_obj->update_option('EMAIL_SUBSCRIPTION_IS_EXPIRED',$lsSubscription_Expired); 
        $_SESSION[SESSION_PREFIX.'EMAIL_SUBSCRIPTION_IS_EXPIRED']= $lsSubscription_Expired;
            
        $option_obj->update_option('EMAIL_SUBSCRIPTION_IS_EXPIRED_DAYS',$lsSubscription_Expired_Notification);
        $_SESSION[SESSION_PREFIX.'EMAIL_SUBSCRIPTION_IS_EXPIRED_DAYS']= $lsSubscription_Expired_Notification;
             
        $option_obj->update_option('EMAIL_SUBSCRIPTION_IS_EXPIRED_TEMPLATE_ID',$lsSubscription_Expired_Hdn_Template_ID); 
        $_SESSION[SESSION_PREFIX.'EMAIL_SUBSCRIPTION_IS_EXPIRED_TEMPLATE_ID']= $lsSubscription_Expired_Hdn_Template_ID;
            
        $option_obj->update_option('EMAIL_SUBSCRIPTION_IS_EXPIRED_TEMPLATE_NAME',$lsSubscription_Expired_Email_Template_Name);     
        $_SESSION[SESSION_PREFIX.'EMAIL_SUBSCRIPTION_IS_EXPIRED_TEMPLATE_NAME']= $lsSubscription_Expired_Email_Template_Name;
    
        
        $lsProduct_Payment_Pending = $_POST['ddl-payment-pending'];
        $lsProduct_Payment_Pending_Notification = 0;//($_POST['txt-payment-pending-notify'] != '') ? $_POST['txt-payment-pending-notify'] : 0;
        $lsProduct_Payment_Pending_Email_Template_Name = $_POST['txt-payment-pending-email'];
        $lsProduct_Payment_Pending_Hdn_Template_ID = $_POST['hdn-payment-pending'];
        $option_obj->update_option('EMAIL_PRODUCT_PAYMENT_PENDING',$lsProduct_Payment_Pending);  
        $_SESSION[SESSION_PREFIX.'EMAIL_PRODUCT_PAYMENT_PENDING']= $lsProduct_Payment_Pending;
           
        $option_obj->update_option('EMAIL_PRODUCT_PAYMENT_PENDING_DAYS',$lsProduct_Payment_Pending_Notification);    
        $_SESSION[SESSION_PREFIX.'EMAIL_PRODUCT_PAYMENT_PENDING_DAYS']= $lsProduct_Payment_Pending_Notification;
         
        $option_obj->update_option('EMAIL_PRODUCT_PAYMENT_PENDING_TEMPLATE_ID',$lsProduct_Payment_Pending_Hdn_Template_ID); 
        $_SESSION[SESSION_PREFIX.'EMAIL_PRODUCT_PAYMENT_PENDING_TEMPLATE_ID']= $lsProduct_Payment_Pending_Hdn_Template_ID;
        
        $option_obj->update_option('EMAIL_PRODUCT_PAYMENT_PENDING_TEMPLATE_NAME',$lsProduct_Payment_Pending_Email_Template_Name);     
        $_SESSION[SESSION_PREFIX.'EMAIL_PRODUCT_PAYMENT_PENDING_TEMPLATE_NAME']= $lsProduct_Payment_Pending_Email_Template_Name;
        
      
      
        $lsProduct_Payment_Failed = $_POST['ddl-payment-failed'];
        $lsProduct_Payment_Failed_Notification = 0;//($_POST['txt-payment-failed-notify'] != '') ? $_POST['txt-payment-failed-notify'] : 0;
        $lsProduct_Payment_Failed_Email_Template_Name = $_POST['txt-payment-failed-email'];
        $lsProduct_Payment_Failed_Hdn_Template_ID = $_POST['hdn-payment-failed'];
        
        $option_obj->update_option('EMAIL_PRODUCT_PAYMENT_FAILED',$lsProduct_Payment_Failed);     
        $_SESSION[SESSION_PREFIX.'EMAIL_PRODUCT_PAYMENT_FAILED']= $lsProduct_Payment_Failed;
        
        $option_obj->update_option('EMAIL_PRODUCT_PAYMENT_FAILED_DAYS',$lsProduct_Payment_Failed_Notification);   
        $_SESSION[SESSION_PREFIX.'EMAIL_PRODUCT_PAYMENT_FAILED_DAYS']= $lsProduct_Payment_Failed_Notification;
          
        $option_obj->update_option('EMAIL_PRODUCT_PAYMENT_FAILED_TEMPLATE_ID',$lsProduct_Payment_Failed_Hdn_Template_ID); 
        $_SESSION[SESSION_PREFIX.'EMAIL_PRODUCT_PAYMENT_FAILED_TEMPLATE_ID']= $lsProduct_Payment_Failed_Hdn_Template_ID;
            
        $option_obj->update_option('EMAIL_PRODUCT_PAYMENT_FAILED_TEMPLATE_NAME',$lsProduct_Payment_Failed_Email_Template_Name);     
        $_SESSION[SESSION_PREFIX.'EMAIL_PRODUCT_PAYMENT_FAILED_TEMPLATE_NAME']= $lsProduct_Payment_Failed_Email_Template_Name;
        
        
       $message->SetMessage('Email Configuration updated successully.');
       
       Redirect('admin_configuration_email.php',true);     
        
        
       
   }
   else
    {    
        if($message->IsMessageExists())
        {    
            $lsmsg=$message->GetMessage();
            if($_GET['err']=='true')
              $smarty->assign('err','true');
            //echo "<div class=\"succmsg\" style=\"text-align:center;width:200px\">$lsmsg</div>";
            $smarty->assign('msg',$lsmsg);
        }
        $smarty->display('admin_configuration_email.tpl');
    }
  ?>
Return current item: MembersGear