getShortVersion(), '3.0', '<')){ return JFactory::getDBO()->getTableFields($tables); } $results = array(); settype($tables, 'array'); foreach ($tables as $table) { $results[$table] = JFactory::getDbo()->getTableColumns($table, $typeOnly); } return $results; } $option = JRequest::getCmd('option'); $task = JRequest::getCmd('task'); jimport('joomla.filesystem.file'); jimport('joomla.filesystem.folder'); if(version_compare($version->getShortVersion(), '1.6', '>=')){ if ( !JFactory::getUser()->authorise('breezingforms.admin', 'com_breezingforms')) { return JError::raiseWarning(404, JText::_('JERROR_ALERTNOAUTHOR')); } } // 1.7.5 to 1.8 cleanup if(JFile::exists(JPATH_ADMINISTRATOR.DS.'components'.DS.'com_breezingforms'.DS.'install.secimage.php')){ JFile::delete(JPATH_ADMINISTRATOR.DS.'components'.DS.'com_breezingforms'.DS.'install.secimage.php'); } if(JFile::exists(JPATH_ADMINISTRATOR.DS.'components'.DS.'com_breezingforms'.DS.'uninstall.secimage.php')){ JFile::delete(JPATH_ADMINISTRATOR.DS.'components'.DS.'com_breezingforms'.DS.'uninstall.secimage.php'); } if(!JFolder::exists(JPATH_SITE.DS.'media'.DS.'breezingforms')){ JFolder::create(JPATH_SITE.DS.'media'.DS.'breezingforms'); } if(!JFile::exists(JPATH_SITE.DS.'media'.DS.'breezingforms'.DS.'index.html')){ JFile::copy( JPATH_SITE.DS.'components'.DS.'com_breezingforms'.DS.'index.html', JPATH_SITE.DS.'media'.DS.'breezingforms'.DS.'index.html' ); } #### MAIL TEMPLATES if(!JFolder::exists(JPATH_SITE.DS.'media'.DS.'breezingforms'.DS.'mailtpl')){ JFolder::copy( JPATH_ADMINISTRATOR.DS.'components'.DS.'com_breezingforms'.DS.'mailtpl'.DS, JPATH_SITE.DS.'media'.DS.'breezingforms'.DS.'mailtpl'.DS ); } #### PDF TEMPLATES if(!JFolder::exists(JPATH_SITE.DS.'media'.DS.'breezingforms'.DS.'pdftpl')){ JFolder::copy( JPATH_ADMINISTRATOR.DS.'components'.DS.'com_breezingforms'.DS.'pdftpl'.DS, JPATH_SITE.DS.'media'.DS.'breezingforms'.DS.'pdftpl'.DS ); } #### DOWNLOAD TEMPLATES if(!JFolder::exists(JPATH_SITE.DS.'media'.DS.'breezingforms'.DS.'downloadtpl')){ JFolder::copy( JPATH_SITE.DS.'components'.DS.'com_breezingforms'.DS.'downloadtpl'.DS, JPATH_SITE.DS.'media'.DS.'breezingforms'.DS.'downloadtpl'.DS ); } #### UPLOADS if(!JFolder::exists(JPATH_SITE.DS.'media'.DS.'breezingforms'.DS.'uploads')){ JFolder::create(JPATH_SITE.DS.'media'.DS.'breezingforms'.DS.'uploads'); JFile::copy( JPATH_SITE.DS.'components'.DS.'com_breezingforms'.DS.'uploads'.DS.'index.html', JPATH_SITE.DS.'media'.DS.'breezingforms'.DS.'uploads'.DS.'index.html' ); } #### THEMES if(!JFolder::exists(JPATH_SITE.DS.'media'.DS.'breezingforms'.DS.'themes')){ JFile::write(JPATH_SITE.DS.'media'.DS.'breezingforms'.DS.'BFISNEW',$wpisnew); JFolder::copy( JPATH_SITE.DS.'components'.DS.'com_breezingforms'.DS.'themes'.DS.'quickmode'.DS, JPATH_SITE.DS.'media'.DS.'breezingforms'.DS.'quickmode'.DS ); JFolder::move( JPATH_SITE.DS.'media'.DS.'breezingforms'.DS.'quickmode'.DS, JPATH_SITE.DS.'media'.DS.'breezingforms'.DS.'themes'.DS ); } if(!JFolder::exists(JPATH_SITE.DS.'media'.DS.'breezingforms'.DS.'themes'.DS.'images')){ JFolder::copy( JPATH_SITE.DS.'components'.DS.'com_breezingforms'.DS.'themes'.DS.'quickmode'.DS.'images'.DS, JPATH_SITE.DS.'media'.DS.'breezingforms'.DS.'themes'.DS.'images'.DS ); } if(!JFile::exists(JPATH_SITE.DS.'media'.DS.'breezingforms'.DS.'themes'.DS.'jq.mobile.1.4.min.css')){ JFile::copy( JPATH_SITE.DS.'components'.DS.'com_breezingforms'.DS.'themes'.DS.'quickmode'.DS.'jq.mobile.1.4.min.css', JPATH_SITE.DS.'media'.DS.'breezingforms'.DS.'themes'.DS.'jq.mobile.1.4.min.css' ); } if(!JFile::exists(JPATH_SITE.DS.'media'.DS.'breezingforms'.DS.'themes'.DS.'jq.mobile.1.4.icons.min.css')){ JFile::copy( JPATH_SITE.DS.'components'.DS.'com_breezingforms'.DS.'themes'.DS.'quickmode'.DS.'jq.mobile.1.4.icons.min.css', JPATH_SITE.DS.'media'.DS.'breezingforms'.DS.'themes'.DS.'jq.mobile.1.4.icons.min.css' ); } if(!JFile::exists(JPATH_SITE.DS.'media'.DS.'breezingforms'.DS.'themes'.DS.'ajax-loader.gif')){ JFile::copy( JPATH_SITE.DS.'components'.DS.'com_breezingforms'.DS.'themes'.DS.'quickmode'.DS.'ajax-loader.gif', JPATH_SITE.DS.'media'.DS.'breezingforms'.DS.'themes'.DS.'ajax-loader.gif' ); } #### DELETE SYSTEM THEMES FILES FROM MEDIA FOLDER (the ones in the original themes path are being used) if(JFile::exists(JPATH_SITE.DS.'media'.DS.'breezingforms'.DS.'themes'.DS.'system.css')){ JFile::delete(JPATH_SITE.DS.'media'.DS.'breezingforms'.DS.'themes'.DS.'system.css'); } if(JFile::exists(JPATH_SITE.DS.'media'.DS.'breezingforms'.DS.'themes'.DS.'system.ie7.css')){ JFile::delete(JPATH_SITE.DS.'media'.DS.'breezingforms'.DS.'themes'.DS.'system.ie7.css'); } if(JFile::exists(JPATH_SITE.DS.'media'.DS.'breezingforms'.DS.'themes'.DS.'system.ie6.css')){ JFile::delete(JPATH_SITE.DS.'media'.DS.'breezingforms'.DS.'themes'.DS.'system.ie6.css'); } if(JFile::exists(JPATH_SITE.DS.'media'.DS.'breezingforms'.DS.'themes'.DS.'system.ie.css')){ JFile::delete(JPATH_SITE.DS.'media'.DS.'breezingforms'.DS.'themes'.DS.'system.ie.css'); } /** * * SAME CHECKS FOR CAPTCHA AS IN FRONTEND, SINCE THEY DONT SHARE THE SAME SESSION * */ if(JRequest::getBool('bfReCaptcha')){ @ob_end_clean(); require_once(JPATH_SITE.'/administrator/components/com_breezingforms/libraries/Zend/Json/Decoder.php'); require_once(JPATH_SITE.'/administrator/components/com_breezingforms/libraries/Zend/Json/Encoder.php'); $db = JFactory::getDBO(); $db->setQuery( "Select * From #__facileforms_forms Where id = " . $db->Quote( JRequest::getInt('form',-1) ) ); $list = $db->loadObjectList(); if(count($list) == 0){ exit; } $form = $list[0]; $areas = Zend_Json::decode($form->template_areas); foreach($areas As $area){ foreach($area['elements'] As $element){ if($element['bfType'] == 'ReCaptcha'){ if(!function_exists('recaptcha_check_answer')){ require_once(JPATH_SITE . '/administrator/components/com_breezingforms/libraries/recaptcha/recaptchalib.php'); } $publickey = $element['pubkey']; // you got this from the signup page $privatekey = $element['privkey']; $resp = recaptcha_check_answer ($privatekey, $_SERVER["REMOTE_ADDR"], isset( $_POST["recaptcha_challenge_field"] ) ? $_POST["recaptcha_challenge_field"] : '' , isset($_POST["recaptcha_response_field"]) ? $_POST["recaptcha_response_field"] : '' ); JFactory::getSession()->set('bfrecapsuccess',false); if ($resp->is_valid) { echo 'success'; JFactory::getSession()->set('bfrecapsuccess',true); } else { die ("The reCAPTCHA wasn't entered correctly. Go back and try it again." . "(reCAPTCHA said: " . $resp->error . ")"); } exit; } } } exit; } else if(JRequest::getBool('checkCaptcha')){ ob_end_clean(); require_once(JPATH_SITE . '/components/com_breezingforms/images/captcha/securimage.php'); $securimage = new Securimage(); if(!$securimage->check(str_replace('?','',JRequest::getVar('value', '')))){ echo 'capResult=>false'; } else { echo 'capResult=>true'; } exit; } $mainframe = JFactory::getApplication(); $cache = JFactory::getCache('com_content'); $cache->clean(); // since joomla 1.6.2, load some behaviour to get the core.js files loaded if (version_compare($version->getShortVersion(), '1.6', '>=')) { JHtml::_('behavior.framework'); } JHtml::_('behavior.tooltip'); // purge ajax save $sourcePath = JPATH_SITE . DS . 'media' . DS . 'breezingforms' . DS . 'ajax_cache'.DS; if (@file_exists($sourcePath) && @is_readable($sourcePath) && @is_dir($sourcePath) && $handle = @opendir($sourcePath)) { while (false !== ($file = @readdir($handle))) { if($file!="." && $file!="..") { $parts = explode('_', $file); if(count($parts)==3 && $parts[0] == 'ajaxsave') { if (@JFile::exists($sourcePath.$file) && @is_readable($sourcePath.$file)) { $fileCreationTime = @filectime($sourcePath.$file); $fileAge = time() - $fileCreationTime; if($fileAge >= 86400) { @JFile::delete($sourcePath.$file); } } } } } @closedir($handle); } /** * DB UPGRADE BEGIN */ $tables = bf_getTableFields( JFactory::getDBO()->getTableList() ); if(isset($tables[JFactory::getDBO()->getPrefix().'facileforms_forms'])){ /** * New as of 1.7.3 */ // workaround for joomla bug (bf plugin in articles), introduced since joomla 3.1.5 if(!isset( $tables[JFactory::getDBO()->getPrefix().'breezingforms'])){ JFactory::getDBO()->setQuery("CREATE TABLE IF NOT EXISTS `#__breezingforms` (`id` int(11) NOT NULL, `language` varchar(255) NOT NULL)"); JFactory::getDBO()->query(); } if(!isset( $tables[JFactory::getDBO()->getPrefix().'facileforms_forms']['mb_alt_mailfrom'] )){ JFactory::getDBO()->setQuery("ALTER TABLE `#__facileforms_forms` ADD `mb_alt_mailfrom` VARCHAR( 255 ) NOT NULL DEFAULT '' AFTER `alt_mailfrom` "); JFactory::getDBO()->query(); } if(!isset( $tables[JFactory::getDBO()->getPrefix().'facileforms_forms']['mb_alt_fromname'] )){ JFactory::getDBO()->setQuery("ALTER TABLE `#__facileforms_forms` ADD `mb_alt_fromname` VARCHAR( 255 ) NOT NULL DEFAULT '' AFTER `alt_fromname` "); JFactory::getDBO()->query(); } if(!isset( $tables[JFactory::getDBO()->getPrefix().'facileforms_forms']['mb_custom_mail_subject'] )){ JFactory::getDBO()->setQuery("ALTER TABLE `#__facileforms_forms` ADD `mb_custom_mail_subject` VARCHAR( 255 ) NOT NULL DEFAULT '' AFTER `custom_mail_subject` "); JFactory::getDBO()->query(); } if(!isset( $tables[JFactory::getDBO()->getPrefix().'facileforms_forms']['mb_emailntf'] )){ JFactory::getDBO()->setQuery("ALTER TABLE `#__facileforms_forms` ADD `mb_emailntf` tinyint( 1 ) NOT NULL DEFAULT 1 AFTER `emailntf` "); JFactory::getDBO()->query(); } if(!isset( $tables[JFactory::getDBO()->getPrefix().'facileforms_forms']['mb_emaillog'] )){ JFactory::getDBO()->setQuery("ALTER TABLE `#__facileforms_forms` ADD `mb_emaillog` tinyint( 1 ) NOT NULL DEFAULT 1 AFTER `emaillog` "); JFactory::getDBO()->query(); } if(!isset( $tables[JFactory::getDBO()->getPrefix().'facileforms_forms']['mb_emailxml'] )){ JFactory::getDBO()->setQuery("ALTER TABLE `#__facileforms_forms` ADD `mb_emailxml` tinyint( 1 ) NOT NULL DEFAULT 0 AFTER `emailxml` "); JFactory::getDBO()->query(); } if(!isset( $tables[JFactory::getDBO()->getPrefix().'facileforms_forms']['email_type'] )){ JFactory::getDBO()->setQuery("ALTER TABLE `#__facileforms_forms` ADD `email_type` tinyint( 1 ) NOT NULL DEFAULT 0 AFTER `mb_emailxml` "); JFactory::getDBO()->query(); } if(!isset( $tables[JFactory::getDBO()->getPrefix().'facileforms_forms']['mb_email_type'] )){ JFactory::getDBO()->setQuery("ALTER TABLE `#__facileforms_forms` ADD `mb_email_type` tinyint( 1 ) NOT NULL DEFAULT 0 AFTER `email_type` "); JFactory::getDBO()->query(); } if(!isset( $tables[JFactory::getDBO()->getPrefix().'facileforms_forms']['email_custom_template'] )){ JFactory::getDBO()->setQuery("ALTER TABLE `#__facileforms_forms` ADD `email_custom_template` TEXT AFTER `mb_email_type` "); JFactory::getDBO()->query(); } if(!isset( $tables[JFactory::getDBO()->getPrefix().'facileforms_forms']['mb_email_custom_template'] )){ JFactory::getDBO()->setQuery("ALTER TABLE `#__facileforms_forms` ADD `mb_email_custom_template` TEXT AFTER `email_custom_template` "); JFactory::getDBO()->query(); } if(!isset( $tables[JFactory::getDBO()->getPrefix().'facileforms_forms']['email_custom_html'] )){ JFactory::getDBO()->setQuery("ALTER TABLE `#__facileforms_forms` ADD `email_custom_html` tinyint( 1 ) NOT NULL DEFAULT 0 AFTER `mb_email_custom_template` "); JFactory::getDBO()->query(); } if(!isset( $tables[JFactory::getDBO()->getPrefix().'facileforms_forms']['mb_email_custom_html'] )){ JFactory::getDBO()->setQuery("ALTER TABLE `#__facileforms_forms` ADD `mb_email_custom_html` tinyint( 1 ) NOT NULL DEFAULT 0 AFTER `email_custom_html` "); JFactory::getDBO()->query(); } ///// // New as of 1.7.2 ///// if(!isset( $tables[JFactory::getDBO()->getPrefix().'facileforms_forms']['alt_mailfrom'] )){ JFactory::getDBO()->setQuery("ALTER TABLE `#__facileforms_forms` ADD `alt_mailfrom` VARCHAR( 255 ) NOT NULL DEFAULT '' AFTER `id` "); JFactory::getDBO()->query(); } if(!isset( $tables[JFactory::getDBO()->getPrefix().'facileforms_forms']['alt_fromname'] )){ JFactory::getDBO()->setQuery("ALTER TABLE `#__facileforms_forms` ADD `alt_fromname` VARCHAR( 255 ) NOT NULL DEFAULT '' AFTER `alt_mailfrom` "); JFactory::getDBO()->query(); } if(!isset( $tables[JFactory::getDBO()->getPrefix().'facileforms_forms']['mailchimp_email_field'] )){ JFactory::getDBO()->setQuery("ALTER TABLE `#__facileforms_forms` ADD `mailchimp_email_field` VARCHAR( 255 ) NOT NULL DEFAULT '' AFTER `alt_fromname` "); JFactory::getDBO()->query(); } if(!isset( $tables[JFactory::getDBO()->getPrefix().'facileforms_forms']['mailchimp_checkbox_field'] )){ JFactory::getDBO()->setQuery("ALTER TABLE `#__facileforms_forms` ADD `mailchimp_checkbox_field` VARCHAR( 255 ) NOT NULL DEFAULT '' AFTER `mailchimp_email_field` "); JFactory::getDBO()->query(); } if(!isset( $tables[JFactory::getDBO()->getPrefix().'facileforms_forms']['mailchimp_api_key'] )){ JFactory::getDBO()->setQuery("ALTER TABLE `#__facileforms_forms` ADD `mailchimp_api_key` VARCHAR( 255 ) NOT NULL DEFAULT '' AFTER `mailchimp_checkbox_field` "); JFactory::getDBO()->query(); } if(!isset( $tables[JFactory::getDBO()->getPrefix().'facileforms_forms']['mailchimp_list_id'] )){ JFactory::getDBO()->setQuery("ALTER TABLE `#__facileforms_forms` ADD `mailchimp_list_id` VARCHAR( 255 ) NOT NULL DEFAULT '' AFTER `mailchimp_api_key` "); JFactory::getDBO()->query(); } if(!isset( $tables[JFactory::getDBO()->getPrefix().'facileforms_forms']['mailchimp_double_optin'] )){ JFactory::getDBO()->setQuery("ALTER TABLE `#__facileforms_forms` ADD `mailchimp_double_optin` TINYINT( 1 ) NOT NULL DEFAULT 1 AFTER `mailchimp_list_id` "); JFactory::getDBO()->query(); } if(!isset( $tables[JFactory::getDBO()->getPrefix().'facileforms_forms']['mailchimp_mergevars'] )){ JFactory::getDBO()->setQuery("ALTER TABLE `#__facileforms_forms` ADD `mailchimp_mergevars` TEXT AFTER `mailchimp_double_optin` "); JFactory::getDBO()->query(); } if(!isset( $tables[JFactory::getDBO()->getPrefix().'facileforms_forms']['mailchimp_text_html_mobile_field'] )){ JFactory::getDBO()->setQuery("ALTER TABLE `#__facileforms_forms` ADD `mailchimp_text_html_mobile_field` VARCHAR( 255 ) NOT NULL DEFAULT '' AFTER `mailchimp_mergevars` "); JFactory::getDBO()->query(); } if(!isset( $tables[JFactory::getDBO()->getPrefix().'facileforms_forms']['mailchimp_send_errors'] )){ JFactory::getDBO()->setQuery("ALTER TABLE `#__facileforms_forms` ADD `mailchimp_send_errors` TINYINT( 1 ) NOT NULL DEFAULT 0 AFTER `mailchimp_text_html_mobile_field` "); JFactory::getDBO()->query(); } if(!isset( $tables[JFactory::getDBO()->getPrefix().'facileforms_forms']['mailchimp_update_existing'] )){ JFactory::getDBO()->setQuery("ALTER TABLE `#__facileforms_forms` ADD `mailchimp_update_existing` TINYINT( 1 ) NOT NULL DEFAULT 0 AFTER `mailchimp_send_errors` "); JFactory::getDBO()->query(); } if(!isset( $tables[JFactory::getDBO()->getPrefix().'facileforms_forms']['mailchimp_replace_interests'] )){ JFactory::getDBO()->setQuery("ALTER TABLE `#__facileforms_forms` ADD `mailchimp_replace_interests` TINYINT( 1 ) NOT NULL DEFAULT 0 AFTER `mailchimp_update_existing` "); JFactory::getDBO()->query(); } if(!isset( $tables[JFactory::getDBO()->getPrefix().'facileforms_forms']['mailchimp_send_welcome'] )){ JFactory::getDBO()->setQuery("ALTER TABLE `#__facileforms_forms` ADD `mailchimp_send_welcome` TINYINT( 1 ) NOT NULL DEFAULT 0 AFTER `mailchimp_replace_interests` "); JFactory::getDBO()->query(); } if(!isset( $tables[JFactory::getDBO()->getPrefix().'facileforms_forms']['mailchimp_default_type'] )){ JFactory::getDBO()->setQuery("ALTER TABLE `#__facileforms_forms` ADD `mailchimp_default_type` VARCHAR( 255 ) NOT NULL DEFAULT 'text' AFTER `mailchimp_send_welcome` "); JFactory::getDBO()->query(); } if(!isset( $tables[JFactory::getDBO()->getPrefix().'facileforms_forms']['mailchimp_delete_member'] )){ JFactory::getDBO()->setQuery("ALTER TABLE `#__facileforms_forms` ADD `mailchimp_delete_member` TINYINT( 1 ) NOT NULL DEFAULT 0 AFTER `mailchimp_default_type` "); JFactory::getDBO()->query(); } if(!isset( $tables[JFactory::getDBO()->getPrefix().'facileforms_forms']['mailchimp_send_goodbye'] )){ JFactory::getDBO()->setQuery("ALTER TABLE `#__facileforms_forms` ADD `mailchimp_send_goodbye` TINYINT( 1 ) NOT NULL DEFAULT 1 AFTER `mailchimp_delete_member` "); JFactory::getDBO()->query(); } if(!isset( $tables[JFactory::getDBO()->getPrefix().'facileforms_forms']['mailchimp_send_notify'] )){ JFactory::getDBO()->setQuery("ALTER TABLE `#__facileforms_forms` ADD `mailchimp_send_notify` TINYINT( 1 ) NOT NULL DEFAULT 1 AFTER `mailchimp_send_goodbye` "); JFactory::getDBO()->query(); } if(!isset( $tables[JFactory::getDBO()->getPrefix().'facileforms_forms']['mailchimp_unsubscribe_field'] )){ JFactory::getDBO()->setQuery("ALTER TABLE `#__facileforms_forms` ADD `mailchimp_unsubscribe_field` VARCHAR( 255 ) NOT NULL DEFAULT '' AFTER `mailchimp_send_notify` "); JFactory::getDBO()->query(); } // salesforce if(!isset( $tables[JFactory::getDBO()->getPrefix().'facileforms_forms']['salesforce_token'] )){ JFactory::getDBO()->setQuery("ALTER TABLE `#__facileforms_forms` ADD `salesforce_token` VARCHAR( 255 ) NOT NULL DEFAULT '' AFTER `mailchimp_unsubscribe_field` "); JFactory::getDBO()->query(); } if(!isset( $tables[JFactory::getDBO()->getPrefix().'facileforms_forms']['salesforce_username'] )){ JFactory::getDBO()->setQuery("ALTER TABLE `#__facileforms_forms` ADD `salesforce_username` VARCHAR( 255 ) NOT NULL DEFAULT '' AFTER `salesforce_token` "); JFactory::getDBO()->query(); } if(!isset( $tables[JFactory::getDBO()->getPrefix().'facileforms_forms']['salesforce_password'] )){ JFactory::getDBO()->setQuery("ALTER TABLE `#__facileforms_forms` ADD `salesforce_password` VARCHAR( 255 ) NOT NULL DEFAULT '' AFTER `salesforce_username` "); JFactory::getDBO()->query(); } if(!isset( $tables[JFactory::getDBO()->getPrefix().'facileforms_forms']['salesforce_type'] )){ JFactory::getDBO()->setQuery("ALTER TABLE `#__facileforms_forms` ADD `salesforce_type` VARCHAR( 255 ) NOT NULL DEFAULT '' AFTER `salesforce_password` "); JFactory::getDBO()->query(); } if(!isset( $tables[JFactory::getDBO()->getPrefix().'facileforms_forms']['salesforce_fields'] )){ JFactory::getDBO()->setQuery("ALTER TABLE `#__facileforms_forms` ADD `salesforce_fields` TEXT AFTER `salesforce_type` "); JFactory::getDBO()->query(); } if(!isset( $tables[JFactory::getDBO()->getPrefix().'facileforms_forms']['salesforce_enabled'] )){ JFactory::getDBO()->setQuery("ALTER TABLE `#__facileforms_forms` ADD `salesforce_enabled` TINYINT( 1 ) NOT NULL DEFAULT 0 AFTER `salesforce_fields` "); JFactory::getDBO()->query(); } // dropbox if(!isset( $tables[JFactory::getDBO()->getPrefix().'facileforms_forms']['dropbox_email'] )){ JFactory::getDBO()->setQuery("ALTER TABLE `#__facileforms_forms` ADD `dropbox_email` VARCHAR( 255 ) NOT NULL DEFAULT '' AFTER `salesforce_fields` "); JFactory::getDBO()->query(); } if(!isset( $tables[JFactory::getDBO()->getPrefix().'facileforms_forms']['dropbox_password'] )){ JFactory::getDBO()->setQuery("ALTER TABLE `#__facileforms_forms` ADD `dropbox_password` VARCHAR( 255 ) NOT NULL DEFAULT '' AFTER `dropbox_email` "); JFactory::getDBO()->query(); } if(!isset( $tables[JFactory::getDBO()->getPrefix().'facileforms_forms']['dropbox_folder'] )){ JFactory::getDBO()->setQuery("ALTER TABLE `#__facileforms_forms` ADD `dropbox_folder` TEXT AFTER `dropbox_password` "); JFactory::getDBO()->query(); } if(!isset( $tables[JFactory::getDBO()->getPrefix().'facileforms_forms']['dropbox_submission_enabled'] )){ JFactory::getDBO()->setQuery("ALTER TABLE `#__facileforms_forms` ADD `dropbox_submission_enabled` TINYINT( 1 ) NOT NULL DEFAULT 0 AFTER `dropbox_folder` "); JFactory::getDBO()->query(); } if(!isset( $tables[JFactory::getDBO()->getPrefix().'facileforms_forms']['dropbox_submission_types'] )){ JFactory::getDBO()->setQuery("ALTER TABLE `#__facileforms_forms` ADD `dropbox_submission_types` VARCHAR( 255 ) NOT NULL DEFAULT 'pdf' AFTER `dropbox_submission_enabled` "); JFactory::getDBO()->query(); } if(!isset( $tables[JFactory::getDBO()->getPrefix().'facileforms_forms']['tags_content'] )){ JFactory::getDBO()->setQuery("ALTER TABLE `#__facileforms_forms` ADD `tags_content` text NOT NULL AFTER `dropbox_submission_types` "); JFactory::getDBO()->query(); } if(!isset( $tables[JFactory::getDBO()->getPrefix().'facileforms_forms']['tags_content_template'] )){ JFactory::getDBO()->setQuery("ALTER TABLE `#__facileforms_forms` ADD `tags_content_template` mediumtext NOT NULL AFTER `tags_content` "); JFactory::getDBO()->query(); } if(!isset( $tables[JFactory::getDBO()->getPrefix().'facileforms_forms']['tags_content_template_default_element'] )){ JFactory::getDBO()->setQuery("ALTER TABLE `#__facileforms_forms` ADD `tags_content_template_default_element` int(11) NOT NULL DEFAULT '0' AFTER `tags_content_template` "); JFactory::getDBO()->query(); } if(!isset( $tables[JFactory::getDBO()->getPrefix().'facileforms_forms']['tags_content_default_category'] )){ JFactory::getDBO()->setQuery("ALTER TABLE `#__facileforms_forms` ADD `tags_content_default_category` int(11) NOT NULL DEFAULT '0' AFTER `tags_content_template_default_element` "); JFactory::getDBO()->query(); } if(!isset( $tables[JFactory::getDBO()->getPrefix().'facileforms_forms']['tags_content_default_state'] )){ JFactory::getDBO()->setQuery("ALTER TABLE `#__facileforms_forms` ADD `tags_content_default_state` int(11) NOT NULL DEFAULT '1' AFTER `tags_content_default_category` "); JFactory::getDBO()->query(); } if(!isset( $tables[JFactory::getDBO()->getPrefix().'facileforms_forms']['tags_content_default_access'] )){ JFactory::getDBO()->setQuery("ALTER TABLE `#__facileforms_forms` ADD `tags_content_default_access` int(11) NOT NULL DEFAULT '1' AFTER `tags_content_default_state` "); JFactory::getDBO()->query(); } if(!isset( $tables[JFactory::getDBO()->getPrefix().'facileforms_forms']['tags_content_default_language'] )){ JFactory::getDBO()->setQuery("ALTER TABLE `#__facileforms_forms` ADD `tags_content_default_language` VARCHAR( 7 ) NOT NULL DEFAULT '*' AFTER `tags_content_default_access` "); JFactory::getDBO()->query(); } if(!isset( $tables[JFactory::getDBO()->getPrefix().'facileforms_forms']['tags_content_default_featured'] )){ JFactory::getDBO()->setQuery("ALTER TABLE `#__facileforms_forms` ADD `tags_content_default_featured` int(11) NOT NULL DEFAULT '0' AFTER `tags_content_default_language` "); JFactory::getDBO()->query(); } if(!isset( $tables[JFactory::getDBO()->getPrefix().'facileforms_forms']['tags_content_default_publishup'] )){ JFactory::getDBO()->setQuery("ALTER TABLE `#__facileforms_forms` ADD `tags_content_default_publishup` VARCHAR( 255 ) NOT NULL DEFAULT '0000-00-00 00:00:00' AFTER `tags_content_default_featured` "); JFactory::getDBO()->query(); } if(!isset( $tables[JFactory::getDBO()->getPrefix().'facileforms_forms']['tags_content_default_publishdown'] )){ JFactory::getDBO()->setQuery("ALTER TABLE `#__facileforms_forms` ADD `tags_content_default_publishdown` VARCHAR( 255 ) NOT NULL DEFAULT '0000-00-00 00:00:00' AFTER `tags_content_default_publishup` "); JFactory::getDBO()->query(); } if(!isset( $tables[JFactory::getDBO()->getPrefix().'facileforms_forms']['tags_form'] )){ JFactory::getDBO()->setQuery("ALTER TABLE `#__facileforms_forms` ADD `tags_form` text NOT NULL AFTER `tags_content_default_publishdown` "); JFactory::getDBO()->query(); } if(!isset( $tables[JFactory::getDBO()->getPrefix().'facileforms_forms']['autoheight'] )){ JFactory::getDBO()->setQuery("ALTER TABLE `#__facileforms_forms` ADD `autoheight` TINYINT( 1 ) NOT NULL DEFAULT 0 AFTER `tags_form` "); JFactory::getDBO()->query(); } if(!isset( $tables[JFactory::getDBO()->getPrefix().'facileforms_forms']['filter_state'] )){ JFactory::getDBO()->setQuery("ALTER TABLE `#__facileforms_forms` ADD `filter_state` TEXT NOT NULL"); JFactory::getDBO()->query(); } } if(version_compare($version->getShortVersion(), '3.1', '>=')){ JFactory::getDbo()->setQuery("Select type_id From #__content_types Where type_alias = 'com_breezingforms.form'"); $tag_typeid = JFactory::getDbo()->loadResult(); if(!$tag_typeid){ $contenttype['type_id'] = 0; $contenttype['type_title'] = 'BreezingForms'; $contenttype['type_alias'] = 'com_breezingforms.form'; $contenttype['table'] = ''; $contenttype['rules'] = ''; $contenttype['router'] = 'BreezingformsHelperRoute::getFormRoute'; $contenttype['field_mappings'] = ''; $table = JTable::getInstance('Contenttype', 'JTable'); $table->save($contenttype); } } /** * DB UPGRADE END */ require_once(JPATH_SITE . '/administrator/components/com_breezingforms/libraries/crosstec/classes/BFTabs.php'); require_once(JPATH_SITE . '/administrator/components/com_breezingforms/libraries/crosstec/classes/BFText.php'); require_once(JPATH_SITE . '/administrator/components/com_breezingforms/libraries/crosstec/classes/BFTableElements.php'); require_once(JPATH_SITE . '/administrator/components/com_breezingforms/libraries/crosstec/functions/helpers.php'); require_once(JPATH_SITE . '/administrator/components/com_breezingforms/libraries/crosstec/constants.php'); jimport('joomla.version'); $version = new JVersion(); if(version_compare($version->getShortVersion(), '1.6', '>=')){ JSubMenuHelper::addEntry( BFText::_('COM_BREEZINGFORMS_MANAGERECS'), 'index.php?option=com_breezingforms&act=managerecs', JRequest::getVar('act','') == 'managerecs' || JRequest::getVar('act','') == 'recordmanagement' || JRequest::getVar('act','') == ''); JSubMenuHelper::addEntry( BFText::_('COM_BREEZINGFORMS_MANAGEFORMS'), 'index.php?option=com_breezingforms&act=manageforms', JRequest::getVar('act','') == 'manageforms' || JRequest::getVar('act','') == 'easymode' || JRequest::getVar('act','') == 'quickmode'); JSubMenuHelper::addEntry( BFText::_('COM_BREEZINGFORMS_MANAGESCRIPTS'), 'index.php?option=com_breezingforms&act=managescripts', JRequest::getVar('act','') == 'managescripts'); JSubMenuHelper::addEntry( BFText::_('COM_BREEZINGFORMS_MANAGEPIECES'), 'index.php?option=com_breezingforms&act=managepieces', JRequest::getVar('act','') == 'managepieces'); JSubMenuHelper::addEntry( BFText::_('COM_BREEZINGFORMS_INTEGRATOR'), 'index.php?option=com_breezingforms&act=integrate', JRequest::getVar('act','') == 'integrate'); JSubMenuHelper::addEntry( BFText::_('COM_BREEZINGFORMS_MANAGEMENUS'), 'index.php?option=com_breezingforms&act=managemenus', JRequest::getVar('act','') == 'managemenus'); JSubMenuHelper::addEntry( BFText::_('COM_BREEZINGFORMS_CONFIG'), 'index.php?option=com_breezingforms&act=configuration', JRequest::getVar('act','') == 'configuration'); JSubMenuHelper::addEntry( BFText::_('Docs & Support'), 'http://crosstec.de/en/support/breezingforms-documentation.html' ); } $_POST = bf_stripslashes_deep($_POST); $_GET = bf_stripslashes_deep($_GET); $_REQUEST = bf_stripslashes_deep($_REQUEST); $db = JFactory::getDBO(); /* * Temporary section end */ global $errors, $errmode; global $ff_mospath, $ff_admpath, $ff_compath, $ff_request; global $ff_mossite, $ff_admsite, $ff_admicon, $ff_comsite; global $ff_config, $ff_compatible, $ff_install; $my = JFactory::getUser(); if (!isset($ff_compath)) { // joomla! jimport('joomla.version'); $version = new JVersion(); if(version_compare($version->getShortVersion(), '1.6', '<')){ if ($my->usertype != 'Super Administrator' && $my->usertype != 'Administrator') { JFactory::getApplication()->redirect( 'index.php', BFText::_('COM_BREEZINGFORMS_NOT_AUTHORIZED') ); } // if } // get paths $comppath = '/components/com_breezingforms'; $ff_admpath = dirname(__FILE__); $ff_mospath = str_replace('\\','/',dirname(dirname(dirname($ff_admpath)))); $ff_admpath = str_replace('\\','/',$ff_admpath); $ff_compath = $ff_mospath.$comppath; require_once($ff_admpath.'/toolbar.facileforms.php'); } // if $errors = array(); $errmode = 'die'; // die or log // compatibility check if (!$ff_compatible) { echo '