Location: PHPKode > projects > MembersGear > membersgear/admin/admin_configuration_generate.php
<?php
  require_once "../config/config.php";
  include_once(CONFIG_DIR.'/signup_form_configuration.php');
  include_once(CONFIG_DIR.'/global_configuration.php');                                           
  include_once(CONFIG_DIR.'/global_configuration_assign.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 site settings')==false)
  {
    Redirect('admin_nopermission.php',true);  
      
  }  
  if($_POST)
   {
      
     
        
        if(isset($_POST['generate_login']) )  
            $lsGenerate_login=$_POST['generate_login']; 
        else
           $lsGenerate_login='false';  

        
        $generate_login_prefix=trim($_POST['generate_login_prefix']); 
        
   
        $lsLogin_min_length=trim($_POST['login_min_length']);
        $lsLogin_max_length=trim($_POST['login_max_length']);
        if(isset($_POST['generate_password']) )
             $lsGenerate_password=$_POST['generate_password'];     
            
        else
            $lsGenerate_password='false'; 
           
        $lsPass_min_length=trim($_POST['pass_min_length']);
        $lsPass_max_length=trim($_POST['pass_max_length']);
        
        if(isset($_POST['unique_email']) )
               $lsUnique_email=trim($_POST['unique_email']);
              
        else
             $lsUnique_email='false'; 
             
        $lsUse_address_info=trim($_POST['use_address_info']);
        
        $ls_show_support_email=trim($_POST['show_support_email']);
        
        $lb_Enabled_Rotating_Login_Pages = trim($_POST['Enabled_Rotating_Login_Pages']);
        
        $lb_Enabled_Rotating_Logout_Pages = trim($_POST['Enabled_Rotating_Logout_Pages']);
        
        
        //$lsCurrency=trim($_POST['currency']);
        
        $lsUse_validate_info=trim($_POST['ddluservalidate']);
        
        
        $lsMembers_showpriceon_signup_page=trim($_POST['ddlpricesignup']);
        
        
        $lsMembers_showpricon_memberdefault_page=trim($_POST['ddlpricedefault']);
        
        
        
        
        $lb_show_delete_button = trim($_POST['ddldelaccbut']);  
        
        $lb_enable_one_time_offer = trim($_POST['ddlenableonetimeoffer']);  
         
        if(isset($_POST['live_mode']) )  
            $lsLive_mode=$_POST['live_mode']; 
        else
           $lsLive_mode='false';  
           
           
        $lsWbe_url=$_POST['wbe_url'];
        $wenUrlLen=strlen($lsWbe_url)-1;
           
        while(substr($lsWbe_url,$wenUrlLen,1)=="/")
         {
            $lsWbe_url=substr($lsWbe_url,0,$wenUrlLen);
            $wenUrlLen=strlen($lsWbe_url)-1;
         }
         
        /*
        $lsWeb_url_secure=$_POST['web_url_secure'];
        
        $secureWebUrlLen=strlen($lsWeb_url_secure)-1;     
    
        while(substr($lsWeb_url_secure,$secureWebUrlLen,1)=="/")
         {
            $lsWeb_url_secure=substr($lsWeb_url_secure,0,$secureWebUrlLen);
            $secureWebUrlLen=strlen($lsWeb_url_secure)-1;
         }*/
         
             
        $lsSite_title=trim(addslashes($_POST['site_title'])); 
        
        $lsSite_visit_url=trim(addslashes($_POST['site_visit_url']));  
        
        //$lsLogout_url=$_POST['logout_url'];
        
        $lsMax_login_attemp=trim($_POST['max_login_attemp']);
        
        $lsEnable_Captcha_On_Admin_Login_Page = (isset($_POST['captcha_on_admin_login_page']) and $_POST['captcha_on_admin_login_page'] != '') ? trim($_POST['captcha_on_admin_login_page']): 'false';
        
        $lsEnable_Captcha_On_User_Login_Page = (isset($_POST['captcha_on_user_login_page']) and $_POST['captcha_on_user_login_page'] != '') ? trim($_POST['captcha_on_user_login_page']) :'false';
  
        $lsUse_subscribelink=trim($_POST['ddlusersubscribelink']);
        $lsUse_affiliate_link=trim($_POST['show_affiliate']);
        
       
        $option_obj->update_option('MEMBER_GENERATE_USERNAME',$lsGenerate_login); 
        $_SESSION[SESSION_PREFIX.'MEMBER_GENERATE_USERNAME']= $lsGenerate_login;
        
        $option_obj->update_option('MEMBER_GENERATE_USERNAME_PREFIX',$generate_login_prefix);
        $_SESSION[SESSION_PREFIX.'MEMBER_GENERATE_USERNAME_PREFIX']= $generate_login_prefix;
        
        $option_obj->update_option('MEMBER_LOGIN_MIN_LENGTH',$lsLogin_min_length);
        $_SESSION[SESSION_PREFIX.'MEMBER_LOGIN_MIN_LENGTH']= $lsLogin_min_length;
        
        $option_obj->update_option('MEMBER_LOGIN_MAX_LENGTH',$lsLogin_max_length);
        $_SESSION[SESSION_PREFIX.'MEMBER_LOGIN_MAX_LENGTH']= $lsLogin_max_length;
         
        $option_obj->update_option('MEMBER_GENERATE_PASSWORD',$lsGenerate_password);
        $_SESSION[SESSION_PREFIX.'MEMBER_GENERATE_PASSWORD']= $lsGenerate_password;
        
        $option_obj->update_option('MEMBER_PASSWORD_MIN_LENGTH',$lsPass_min_length);
        $_SESSION[SESSION_PREFIX.'MEMBER_PASSWORD_MIN_LENGTH']= $lsPass_min_length;
        
        $option_obj->update_option('MEMBER_PASSWORD_MAX_LENGTH',$lsPass_max_length);
        $_SESSION[SESSION_PREFIX.'MEMBER_PASSWORD_MAX_LENGTH']= $lsPass_max_length;
         
        $option_obj->update_option('MEMBER_UNIQUE_EMAIL',$lsUnique_email);
        $_SESSION[SESSION_PREFIX.'MEMBER_UNIQUE_EMAIL']= $lsUnique_email;
        
        $option_obj->update_option('MEMBER_USE_ADDRESS_INFO',$lsUse_address_info);
        $_SESSION[SESSION_PREFIX.'MEMBER_USE_ADDRESS_INFO']= $lsUse_address_info;
        
        //$option_obj->update_option('MEMBER_CURRENCY',$lsCurrency);
        
        $option_obj->update_option('MEMBER_USE_VALIDATE_INFO',$lsUse_validate_info);
        $_SESSION[SESSION_PREFIX.'MEMBER_USE_VALIDATE_INFO']= $lsUse_validate_info;
        
        /* Added By Asmita for Show price on signup page dropdown*/
        $option_obj->update_option('MEMBER_SHOWPRICE_SIGNUP_PAGE',$lsMembers_showpriceon_signup_page);
        $_SESSION[SESSION_PREFIX.'MEMBER_SHOWPRICE_SIGNUP_PAGE']= $lsMembers_showpriceon_signup_page; 
        
        /*------------------------ End -------------------------*/
        
        
        /* Added By Asmita for Show price on members default page dropdown*/
        $option_obj->update_option('MEMBER_SHOWPRICE_MEMBERDEFAULT_PAGE',$lsMembers_showpricon_memberdefault_page);
        $_SESSION[SESSION_PREFIX.'MEMBER_SHOWPRICE_MEMBERDEFAULT_PAGE']= $lsMembers_showpricon_memberdefault_page; 
        
        /*------------------------ End -------------------------*/
        
        
        $option_obj->update_option('MEMBER_USE_SUBSCRIBELINK',$lsUse_subscribelink);
        $_SESSION[SESSION_PREFIX.'MEMBER_USE_SUBSCRIBELINK']= $lsUse_subscribelink;
      
        $option_obj->update_option('MEMBER_SHOW_AFFILIATE',$lsUse_affiliate_link);
        $_SESSION[SESSION_PREFIX.'MEMBER_SHOW_AFFILIATE']= $lsUse_affiliate_link;
      
        $option_obj->update_option('INCLUDE_DIR',PHYSICAL_DIR.'/includes');
        $_SESSION[SESSION_PREFIX.'INCLUDE_DIR']= PHYSICAL_DIR.'/includes';
      
        $option_obj->update_option('CONFIG_DIR',PHYSICAL_DIR.'/config');
        $_SESSION[SESSION_PREFIX.'CONFIG_DIR']= PHYSICAL_DIR.'/config';
        
        
      
        $lsWbe_url=addslashes($lsWbe_url);
        
        $option_obj->update_option('WEB_URL',$lsWbe_url);
        $_SESSION[SESSION_PREFIX.'WEB_URL']= $lsWbe_url;
        
       // $lsWeb_url_secure=addslashes($lsWeb_url_secure);                     
        
        //$option_obj->update_option('WEB_URL_SECURE',$lsWeb_url_secure);
       
        $option_obj->update_option('WEB_TITLE',$lsSite_title);
        $_SESSION[SESSION_PREFIX.'WEB_TITLE']= $lsSite_title;
        
        $option_obj->update_option('SITE_VISIT_URL',$lsSite_visit_url);
        $_SESSION[SESSION_PREFIX.'SITE_VISIT_URL']= $lsSite_visit_url;
        
      /* if(isset($_POST['live_mode']))
        {     
            if(strtolower($_POST['live_mode']) == 'true')
              $option_obj->update_option('PAYGEAR_WEB_URL','https://www.paygear.com');
            else
              $option_obj->update_option('PAYGEAR_WEB_URL','http://192.168.99.109/paygear');
        }
       else
          $option_obj->update_option('PAYGEAR_WEB_URL','http://192.168.99.109/paygear');     */
           
        $option_obj->update_option('USER_JS_DIR','/js');
        $_SESSION[SESSION_PREFIX.'USER_JS_DIR']=WEB_URL.'/js';
        
        $option_obj->update_option('USER_CSS_DIR','/css');
        $_SESSION[SESSION_PREFIX.'USER_CSS_DIR']=WEB_URL.'/css';     
   
        $option_obj->update_option('USER_IMAGE_DIR','/images');
        $_SESSION[SESSION_PREFIX.'USER_IMAGE_DIR']=WEB_URL.'/images';     
        
        $option_obj->update_option('ADMIN_JS_DIR','/admin/js');
        $_SESSION[SESSION_PREFIX.'ADMIN_JS_DIR']=WEB_URL.'/admin/js';
        
        $option_obj->update_option('ADMIN_CSS_DIR','/admin/css');
        $_SESSION[SESSION_PREFIX.'ADMIN_CSS_DIR']=WEB_URL.'/admin/css';
          
        $option_obj->update_option('ADMIN_IMAGE_DIR','/admin/images');
        $_SESSION[SESSION_PREFIX.'ADMIN_IMAGE_DIR']=WEB_URL.'/admin/images';
        
        $option_obj->update_option('PHYSICAL_UPLOADS_DIR',PHYSICAL_DIR.'/uploads');
        $_SESSION[SESSION_PREFIX.'PHYSICAL_UPLOADS_DIR']=PHYSICAL_DIR.'/uploads';
        
        $option_obj->update_option('VIRTUAL_UPLOADS_DIR','/uploads');
        $_SESSION[SESSION_PREFIX.'VIRTUAL_UPLOADS_DIR']=WEB_URL.'/uploads'; 
        
        $option_obj->update_option('LIVE_MODE',$lsLive_mode);
        $_SESSION[SESSION_PREFIX.'LIVE_MODE']=$lsLive_mode;
        
        $option_obj->update_option('USER_MAX_LOGIN_ATTAMPT',$lsMax_login_attemp);
        $_SESSION[SESSION_PREFIX.'USER_MAX_LOGIN_ATTAMPT']=$lsMax_login_attemp;
        
        $option_obj->update_option('CAPTCHA_ENABLE_ON_ADMINSTRATOR_LOGIN_PAGE',$lsEnable_Captcha_On_Admin_Login_Page);
        $_SESSION[SESSION_PREFIX.'CAPTCHA_ENABLE_ON_ADMINSTRATOR_LOGIN_PAGE']=$lsEnable_Captcha_On_Admin_Login_Page;
        
        $option_obj->update_option('CAPTCHA_ENABLE_ON_USER_LOGIN_PAGE',$lsEnable_Captcha_On_User_Login_Page);
        $_SESSION[SESSION_PREFIX.'CAPTCHA_ENABLE_ON_USER_LOGIN_PAGE']=$lsEnable_Captcha_On_User_Login_Page;
        
        if($ls_show_support_email=="true")
         {
                $option_obj->update_option('IS_USER_SUPPORT_LINK_VISIBLE','true');
                $_SESSION[SESSION_PREFIX.'IS_USER_SUPPORT_LINK_VISIBLE']='true';
                $option_obj->update_option('USER_SUPPORT_LINK','user_support.php');
                $_SESSION[SESSION_PREFIX.'USER_SUPPORT_LINK']='user_support';
         }
        else
         {
                $option_obj->update_option('IS_USER_SUPPORT_LINK_VISIBLE','false');
                $_SESSION[SESSION_PREFIX.'IS_USER_SUPPORT_LINK_VISIBLE']='false';
                $option_obj->update_option('USER_SUPPORT_LINK',' ');
                $_SESSION[SESSION_PREFIX.'USER_SUPPORT_LINK']=' ';
         }
         
         $option_obj->update_option('IS_ROTATING_LOGIN_PAGES_ENABLED',$lb_Enabled_Rotating_Login_Pages);
         $_SESSION[SESSION_PREFIX.'IS_ROTATING_LOGIN_PAGES_ENABLED']=$lb_Enabled_Rotating_Login_Pages;
         
         $option_obj->update_option('IS_ROTATING_LOGOUT_PAGES_ENABLED',$lb_Enabled_Rotating_Logout_Pages);
         $_SESSION[SESSION_PREFIX.'IS_ROTATING_LOGOUT_PAGES_ENABLED']=$lb_Enabled_Rotating_Logout_Pages;
         
         $option_obj->update_option('IS_USER_DELETE_BUTTON_VISIBLE',$lb_show_delete_button);
         $_SESSION[SESSION_PREFIX.'IS_USER_DELETE_BUTTON_VISIBLE']=$lb_show_delete_button;
         
         $option_obj->update_option('IS_ENABLE_ONE_TIME_OFFER',$lb_enable_one_time_offer);
         $_SESSION[SESSION_PREFIX.'IS_ENABLE_ONE_TIME_OFFER']=$lb_enable_one_time_offer;
    
    
         $message->SetMessage('Configuration Updated Successfully.');
         Redirect('admin_configuration_generate.php',true);
     
      
         
   }
   else
    {    

        $smarty->assign('msg',$message->GetMessage()); 
        if(isset($_GET['err']))
        {
         if($_GET['err']=='true')
           $smarty->assign('errmsg','true'); 
        }  
        $smarty->display('admin_configuration_generate.tpl');
    }
  ?>
Return current item: MembersGear