当前位置: 首页>>代码示例>>PHP>>正文


PHP vRequest::vmCheckToken方法代码示例

本文整理汇总了PHP中vRequest::vmCheckToken方法的典型用法代码示例。如果您正苦于以下问题:PHP vRequest::vmCheckToken方法的具体用法?PHP vRequest::vmCheckToken怎么用?PHP vRequest::vmCheckToken使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在vRequest的用法示例。


在下文中一共展示了vRequest::vmCheckToken方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: updateOrderItems

 function updateOrderItems()
 {
     vRequest::vmCheckToken();
     $model = VmModel::getModel('report');
     $model->updateOrderItems();
     $this->setRedirect($this->redirectPath, 'Order Items updated');
 }
开发者ID:lenard112,项目名称:cms,代码行数:7,代码来源:report.php

示例2: save

	/**
	 * Handle the save task
	 */
	function save($data = 0){

		vRequest::vmCheckToken();
		$model = VmModel::getModel('config');

		$data = vRequest::getPost();

		if(strpos($data['offline_message'],'|')!==false){
			$data['offline_message'] = str_replace('|','',$data['offline_message']);
		}

		$msg = '';
		if ($model->store($data)) {
			$msg = vmText::_('COM_VIRTUEMART_CONFIG_SAVED');
			// Load the newly saved values into the session.
			VmConfig::loadConfig();
		}

		$redir = 'index.php?option=com_virtuemart';
		if(vRequest::getCmd('task') == 'apply'){
			$redir = $this->redirectPath;
		}

		$this->setRedirect($redir, $msg);


	}
开发者ID:kosmosby,项目名称:medicine-prof,代码行数:30,代码来源:config.php

示例3: paste

 /**
  * Paste the table  in json format
  *
  */
 public function paste()
 {
     // TODO Test user ?
     $json = array();
     $json['fields'] = 'error';
     $json['msg'] = 'Invalid Token';
     $json['structure'] = 'empty';
     if (!vRequest::vmCheckToken(-1)) {
         echo json_encode($json);
         jexit();
     }
     $lang = vRequest::getvar('lg');
     $langs = VmConfig::get('active_languages', array());
     $language = JFactory::getLanguage();
     if (!in_array($lang, $langs)) {
         $json['msg'] = 'Invalid language ! ' . $lang;
         $json['langs'] = $langs;
         echo json_encode($json);
         jexit();
     }
     $lang = strtolower($lang);
     // Remove tag if defaut or
     // if ($language->getDefault() == $lang ) $dblang ='';
     $dblang = strtr($lang, '-', '_');
     $id = vRequest::getInt('id', 0);
     $viewKey = vRequest::getCmd('editView');
     // TODO temp trick for vendor
     if ($viewKey == 'vendor') {
         $id = 1;
     }
     $tables = array('category' => 'categories', 'product' => 'products', 'manufacturer' => 'manufacturers', 'manufacturercategories' => 'manufacturercategories', 'vendor' => 'vendors', 'paymentmethod' => 'paymentmethods', 'shipmentmethod' => 'shipmentmethods');
     if (!array_key_exists($viewKey, $tables)) {
         $json['msg'] = "Invalid view " . $viewKey;
         echo json_encode($json);
         jExit();
     }
     $tableName = '#__virtuemart_' . $tables[$viewKey] . '_' . $dblang;
     $db = JFactory::getDBO();
     $q = 'select * FROM `' . $tableName . '` where `virtuemart_' . $viewKey . '_id` =' . $id;
     $db->setQuery($q);
     if ($json['fields'] = $db->loadAssoc()) {
         $json['structure'] = 'filled';
         $json['msg'] = vmText::_('COM_VIRTUEMART_SELECTED_LANG') . ':' . $lang;
     } else {
         $json['structure'] = 'empty';
         $db->setQuery('SHOW COLUMNS FROM ' . $tableName);
         $tableDescribe = $db->loadAssocList();
         array_shift($tableDescribe);
         $fields = array();
         foreach ($tableDescribe as $key => $val) {
             $fields[$val['Field']] = $val['Field'];
         }
         $json['fields'] = $fields;
         $json['msg'] = vmText::sprintf('COM_VIRTUEMART_LANG_IS_EMPTY', $lang, vmText::_('COM_VIRTUEMART_' . strtoupper($viewKey)));
     }
     echo json_encode($json);
     jExit();
 }
开发者ID:lenard112,项目名称:cms,代码行数:62,代码来源:translate.php

示例4: mailAskquestion

 /**
  * Send the ask question email.
  * @author Kohl Patrick, Christopher Roussel
  */
 public function mailAskquestion()
 {
     vRequest::vmCheckToken();
     if (!class_exists('shopFunctionsF')) {
         require VMPATH_SITE . DS . 'helpers' . DS . 'shopfunctionsf.php';
     }
     $model = tmsModel::getModel('vendor');
     $mainframe = JFactory::getApplication();
     $vars = array();
     $min = tsmConfig::get('asks_minimum_comment_length', 50) + 1;
     $max = tsmConfig::get('asks_maximum_comment_length', 2000) - 1;
     $commentSize = vRequest::getString('comment');
     if (function_exists('mb_strlen')) {
         $commentSize = mb_strlen($commentSize);
     } else {
         $commentSize = strlen($commentSize);
     }
     $validMail = filter_var(vRequest::getVar('email'), FILTER_VALIDATE_EMAIL);
     $virtuemart_vendor_id = vRequest::getInt('virtuemart_vendor_id', 1);
     if (!class_exists('VirtueMartModelVendor')) {
         require VMPATH_ADMIN . DS . 'models' . DS . 'vendor.php';
     }
     $userId = VirtueMartModelVendor::getUserIdByVendorId($virtuemart_vendor_id);
     //$vendorUser = JFactory::getUser($userId);
     if ($commentSize < $min || $commentSize > $max || !$validMail) {
         $this->setRedirect(JRoute::_('index.php?option=com_virtuemart&view=vendor&task=contact&virtuemart_vendor_id=' . $virtuemart_vendor_id, FALSE), tsmText::_('COM_VIRTUEMART_COMMENT_NOT_VALID_JS'));
         return;
     }
     $user = JFactory::getUser();
     $fromMail = vRequest::getVar('email');
     //is sanitized then
     $fromName = vRequest::getVar('name', '');
     //is sanitized then
     $fromMail = str_replace(array('\'', '"', ',', '%', '*', '/', '\\', '?', '^', '`', '{', '}', '|', '~'), array(''), $fromMail);
     $fromName = str_replace(array('\'', '"', ',', '%', '*', '/', '\\', '?', '^', '`', '{', '}', '|', '~'), array(''), $fromName);
     if (!empty($user->id)) {
         if (empty($fromMail)) {
             $fromMail = $user->email;
         }
         if (empty($fromName)) {
             $fromName = $user->name;
         }
     }
     $vars['user'] = array('name' => $fromName, 'email' => $fromMail);
     $VendorEmail = $model->getVendorEmail($virtuemart_vendor_id);
     $vars['vendor'] = array('vendor_store_name' => $fromName);
     if (shopFunctionsF::renderMail('vendor', $VendorEmail, $vars, 'vendor')) {
         $string = 'COM_VIRTUEMART_MAIL_SEND_SUCCESSFULLY';
     } else {
         $string = 'COM_VIRTUEMART_MAIL_NOT_SEND_SUCCESSFULLY';
     }
     $mainframe->enqueueMessage(tsmText::_($string));
     // Display it all
     $view = $this->getView('vendor', 'html');
     $view->setLayout('mail_confirmed');
     $view->display();
 }
开发者ID:cuongnd,项目名称:etravelservice,代码行数:61,代码来源:vendor.php

示例5: save

 /**
  * Handle the save task
  *
  * @author Zasilkovna
  */
 function save($data = 0)
 {
     vRequest::vmCheckToken();
     $data = vRequest::getPost();
     $db =& JFactory::getDBO();
     $q = "UPDATE #__extensions SET custom_data='" . serialize($data) . "' WHERE element='zasilkovna'";
     $db->setQuery($q);
     $db->query();
     $redir = 'index.php?option=com_virtuemart';
     if (JRequest::getCmd('task') == 'apply') {
         $redir = $this->redirectPath;
     }
     $this->updateZasilkovnaOrders();
     $this->setRedirect($redir, $msg);
 }
开发者ID:Zasilkovna,项目名称:virtuemart3-joomla2,代码行数:20,代码来源:zasilkovna.php

示例6: save

 /**
  * Handle the save task
  *
  * @author RickG
  */
 function save($data = 0)
 {
     vRequest::vmCheckToken();
     $model = VmModel::getModel('config');
     $data = vRequest::getPost();
     //$data['offline_message'] = vRequest::get('offline_message', '', FILTER_UNSAFE_RAW, FILTER_FLAG_STRIP_LOW );
     //array(FILTER_FLAG_STRIP_LOW,!FILTER_FLAG_STRIP_HIGH,FILTER_FLAG_ENCODE_HIGH)
     if (strpos($data['offline_message'], '|') !== false) {
         $data['offline_message'] = str_replace('|', '', $data['offline_message']);
     }
     if ($model->store($data)) {
         $msg = vmText::_('COM_VIRTUEMART_CONFIG_SAVED');
         // Load the newly saved values into the session.
         VmConfig::loadConfig();
     } else {
         $msg = $model->getError();
     }
     $redir = 'index.php?option=com_virtuemart';
     if (vRequest::getCmd('task') == 'apply') {
         $redir = $this->redirectPath;
     }
     $this->setRedirect($redir, $msg);
 }
开发者ID:lenard112,项目名称:cms,代码行数:28,代码来源:config.php

示例7: table

 /** Save and delete from database
 	* all product custom_fields and xref
 	@ var   $table	: the xref table(eg. product,category ...)
 	@array $data	: array of customfields
 	@int     $id		: The concerned id (eg. product_id)
 	*/
 public function storeProductCustomfields($table, $datas, $id)
 {
     vRequest::vmCheckToken('Invalid token in storeProductCustomfields');
     //Sanitize id
     $id = (int) $id;
     //Table whitelist
     $tableWhiteList = array('product', 'category', 'manufacturer');
     if (!in_array($table, $tableWhiteList)) {
         return false;
     }
     // Get old IDS
     $db = JFactory::getDBO();
     $db->setQuery('SELECT `virtuemart_customfield_id` FROM `#__virtuemart_' . $table . '_customfields` as `PC` WHERE `PC`.virtuemart_' . $table . '_id =' . $id);
     $old_customfield_ids = $db->loadColumn();
     if (array_key_exists('field', $datas)) {
         foreach ($datas['field'] as $key => $fields) {
             if (!empty($datas['field'][$key]['virtuemart_product_id']) and (int) $datas['field'][$key]['virtuemart_product_id'] != $id) {
                 //aha the field is from the parent, what we do with it?
                 $fields['override'] = (int) $fields['override'];
                 $fields['disabler'] = (int) $fields['disabler'];
                 if ($fields['override'] != 0 or $fields['disabler'] != 0) {
                     //If it is set now as override, store it as clone, therefore set the virtuemart_customfield_id = 0
                     if ($fields['override'] != 0) {
                         $fields['override'] = $fields['virtuemart_customfield_id'];
                     }
                     if ($fields['disabler'] != 0) {
                         $fields['disabler'] = $fields['virtuemart_customfield_id'];
                     }
                     $fields['virtuemart_customfield_id'] = 0;
                 } else {
                     //we do not store customfields inherited by the parent, therefore
                     $key = array_search($fields['virtuemart_customfield_id'], $old_customfield_ids);
                     if ($key !== false) {
                         unset($old_customfield_ids[$key]);
                     }
                     continue;
                 }
             }
             if ($fields['field_type'] == 'C') {
                 $cM = VmModel::getModel('custom');
                 $c = $cM->getCustom($fields['virtuemart_custom_id'], '');
                 if (!empty($c->sCustomId)) {
                     $sCustId = $c->sCustomId;
                     $labels = array();
                     foreach ($fields['selectoptions'] as $k => $option) {
                         if ($option['voption'] == 'clabels' and !empty($option['clabel'])) {
                             $labels[$k] = $option['clabel'];
                         }
                     }
                     //for testing
                     foreach ($fields['options'] as $prodId => $lvalue) {
                         if ($prodId == $id) {
                             continue;
                         }
                         $db->setQuery('SELECT `virtuemart_customfield_id` FROM `#__virtuemart_' . $table . '_customfields` as `PC` WHERE `PC`.virtuemart_' . $table . '_id ="' . $prodId . '" AND `virtuemart_custom_id`="' . $sCustId . '" ');
                         $strIds = $db->loadColumn();
                         $i = 0;
                         foreach ($lvalue as $k => $value) {
                             if (!empty($labels[$k])) {
                                 $ts = array();
                                 $ts['field_type'] = 'S';
                                 $ts['virtuemart_product_id'] = $prodId;
                                 $ts['virtuemart_custom_id'] = $sCustId;
                                 if (isset($strIds[$i])) {
                                     $ts['virtuemart_customfield_id'] = $strIds[$i];
                                     unset($strIds[$i++]);
                                 }
                                 $ts['customfield_value'] = $value;
                                 $tableCustomfields = $this->getTable($table . '_customfields');
                                 $tableCustomfields->bindChecknStore($ts);
                             }
                         }
                         if (count($strIds) > 0) {
                             // delete old unused Customfields
                             $db->setQuery('DELETE FROM `#__virtuemart_' . $table . '_customfields` WHERE `virtuemart_customfield_id` in ("' . implode('","', $strIds) . '") ');
                             $db->execute();
                         }
                     }
                 }
             }
             $fields['virtuemart_' . $table . '_id'] = $id;
             $tableCustomfields = $this->getTable($table . '_customfields');
             $tableCustomfields->setPrimaryKey('virtuemart_product_id');
             if (!empty($datas['customfield_params'][$key]) and !isset($datas['clone'])) {
                 if (array_key_exists($key, $datas['customfield_params'])) {
                     $fields = array_merge((array) $fields, (array) $datas['customfield_params'][$key]);
                 }
             }
             $tableCustomfields->_xParams = 'customfield_params';
             if (!class_exists('VirtueMartModelCustom')) {
                 require VMPATH_ADMIN . DS . 'models' . DS . 'custom.php';
             }
             VirtueMartModelCustom::setParameterableByFieldType($tableCustomfields, $fields['field_type'], $fields['custom_element'], $fields['custom_jplugin_id']);
             $tableCustomfields->bindChecknStore($fields);
//.........这里部分代码省略.........
开发者ID:proyectoseb,项目名称:Matrix,代码行数:101,代码来源:customfields.php

示例8: storeMedia

 /**
  * This function stores a media and updates then the refered table
  *
  * @author Max Milbers
  * @author Patrick Kohl
  * @param array $data Data from a from
  * @param string $type type of the media  category,product,manufacturer,shop, ...
  */
 function storeMedia($data, $type)
 {
     vRequest::vmCheckToken('Invalid Token, while trying to save media ' . $type);
     if (empty($data['media_action'])) {
         $data['media_action'] = 'none';
     }
     //the active media id is not empty, so there should be something done with it
     if ((!empty($data['active_media_id']) and isset($data['virtuemart_media_id'])) || $data['media_action'] == 'upload') {
         $oldIds = $data['virtuemart_media_id'];
         $data['file_type'] = $type;
         $this->setId($data['active_media_id']);
         $virtuemart_media_id = $this->store($data);
         //added by Mike
         $this->setId($virtuemart_media_id);
         if (!empty($oldIds)) {
             if (!is_array($oldIds)) {
                 $oldIds = array($oldIds);
             }
             if (!empty($data['mediaordering']) && $data['media_action'] == 'upload') {
                 $data['mediaordering'][$virtuemart_media_id] = count($data['mediaordering']);
             }
             $virtuemart_media_ids = array_merge((array) $virtuemart_media_id, $oldIds);
             $data['virtuemart_media_id'] = array_unique($virtuemart_media_ids);
         } else {
             $data['virtuemart_media_id'] = $virtuemart_media_id;
         }
     }
     if (!empty($data['mediaordering'])) {
         asort($data['mediaordering']);
         $sortedMediaIds = array();
         foreach ($data['mediaordering'] as $k => $v) {
             $sortedMediaIds[] = $k;
         }
         $data['virtuemart_media_id'] = $sortedMediaIds;
     }
     //set the relations
     $table = $this->getTable($type . '_medias');
     // Bind the form fields to the country table
     $table->bindChecknStore($data);
     return $table->virtuemart_media_id;
 }
开发者ID:cybershocik,项目名称:Darek,代码行数:49,代码来源:media.php

示例9: updateXrefAndChildTables

 public function updateXrefAndChildTables($data, $tableName, $preload = FALSE)
 {
     vRequest::vmCheckToken();
     //First we load the xref table, to get the old data
     $product_table_Parent = $this->getTable($tableName);
     //We must go that way, because the load function of the vmtablexarry
     // is working different.
     if ($preload) {
         $product_table_Parent->load($data['virtuemart_product_id']);
     }
     $product_table_Parent->bindChecknStore($data);
     return $data;
 }
开发者ID:sam-akopyan,项目名称:hamradio,代码行数:13,代码来源:product.php

示例10: saveChildCustomRelation

 public function saveChildCustomRelation($table, $datas)
 {
     vRequest::vmCheckToken('Invalid token in saveChildCustomRelation');
     //Table whitelist
     $tableWhiteList = array('product', 'category', 'manufacturer');
     if (!in_array($table, $tableWhiteList)) {
         return false;
     }
     $db = JFactory::getDBO();
     // delete existings from modelXref and table customfields
     foreach ($datas as $child_id => $fields) {
         $fields['virtuemart_' . $table . '_id'] = $child_id;
         $db->setQuery('DELETE PC FROM `#__virtuemart_' . $table . '_customfields` as `PC`, `#__virtuemart_customs` as `C` WHERE `PC`.`virtuemart_custom_id` = `C`.`virtuemart_custom_id` AND field_type="C" and virtuemart_' . $table . '_id =' . $child_id);
         if (!$db->execute()) {
             vmError('Error in deleting child relation ');
             //.$db->getQuery()); Dont give hackers too much info
         }
         $tableCustomfields = $this->getTable($table . '_customfields');
         $tableCustomfields->bindChecknStore($fields);
     }
 }
开发者ID:naka211,项目名称:studiekorrektur,代码行数:21,代码来源:custom.php

示例11: remove

 /**
  * Delete all calcs selected
  *
  * @author Max Milbers
  * @param  array $cids categories to remove
  * @return boolean if the item remove was successful
  */
 public function remove($cids)
 {
     vRequest::vmCheckToken();
     $table = $this->getTable($this->_maintablename);
     $cat = $this->getTable('calc_categories');
     $sgrp = $this->getTable('calc_shoppergroups');
     $countries = $this->getTable('calc_countries');
     $states = $this->getTable('calc_states');
     $manufacturers = $this->getTable('calc_manufacturers');
     $ok = true;
     foreach ($cids as $id) {
         $id = (int) $id;
         vmdebug('remove ' . $id);
         if (!$table->delete($id)) {
             vmError(get_class($this) . '::remove ' . $id . ' ' . $table->getError());
             $ok = false;
         }
         if (!$cat->delete($id)) {
             vmError(get_class($this) . '::remove ' . $id . ' ' . $cat->getError());
             $ok = false;
         }
         if (!$sgrp->delete($id)) {
             vmError(get_class($this) . '::remove ' . $id . ' ' . $sgrp->getError());
             $ok = false;
         }
         if (!$countries->delete($id)) {
             vmError(get_class($this) . '::remove ' . $id . ' ' . $countries->getError());
             $ok = false;
         }
         if (!$states->delete($id)) {
             vmError(get_class($this) . '::remove ' . $id . ' ' . $states->getError());
             $ok = false;
         }
         // Mod. <mediaDESIGN> St.Kraft 2013-02-24
         if (!$manufacturers->delete($id)) {
             vmError(get_class($this) . '::remove ' . $id . ' ' . $manufacturers->getError());
             $ok = false;
         }
         // 			if(!class_exists('vmPSPlugin')) require(JPATH_VM_PLUGINS.DS.'vmpsplugin.php');
         JPluginHelper::importPlugin('vmcalculation');
         $dispatcher = JDispatcher::getInstance();
         $returnValues = $dispatcher->trigger('plgVmDeleteCalculationRow', array($id));
     }
     return $ok;
 }
开发者ID:lenard112,项目名称:cms,代码行数:52,代码来源:calc.php

示例12: updateDatabase

 /**
  * This is executing the update table commands to adjust tables to the latest layout
  * @author Max Milbers
  */
 function updateDatabase()
 {
     vRequest::vmCheckToken();
     if (!class_exists('com_virtuemartInstallerScript')) {
         require VMPATH_ADMIN . DS . 'install' . DS . 'script.virtuemart.php';
     }
     $updater = new com_virtuemartInstallerScript();
     $updater->update(false);
     $this->setRedirect($this->redirectPath, 'Database updated');
 }
开发者ID:brenot,项目名称:forumdesenvolvimento,代码行数:14,代码来源:updatesmigration.php

示例13: saveOrder

 /**
  * Save the categories order
  */
 public function saveOrder()
 {
     //ACL
     if (!vmAccess::manager('category.edit')) {
         JFactory::getApplication()->redirect('index.php?option=com_tsmart', tsmText::_('JERROR_ALERTNOAUTHOR'), 'error');
     }
     // Check for request forgeries
     vRequest::vmCheckToken();
     $cid = vRequest::getInt('cid', array());
     //is sanitized
     $model = tmsModel::getModel('category');
     $order = vRequest::getInt('order', array());
     $msg = '';
     if ($model->setOrder($cid, $order)) {
         $msg = tsmText::_('com_tsmart_NEW_ORDERING_SAVED');
     }
     $this->setRedirect('index.php?option=com_tsmart&view=category', $msg);
 }
开发者ID:cuongnd,项目名称:etravelservice,代码行数:21,代码来源:category.php

示例14: confirmation

    $path = JPATH_ROOT . DS . 'administrator' . DS . 'components' . DS . 'com_virtuemart' . DS . 'helpers' . DS . 'config.php';
    if (file_exists($path)) {
        require $path;
        tsmConfig::loadConfig();
    } else {
        $app = JFactory::getApplication();
        $app->enqueueMessage('VirtueMart Core is not installed, please install VirtueMart again, or uninstall the AIO component by the joomla extension manager');
        return false;
    }
}
if (!class_exists('tsmText')) {
    require JPATH_ROOT . DS . 'administrator' . DS . 'components' . DS . 'com_virtuemart' . DS . 'helpers' . DS . 'tsmtext.php';
}
$task = vRequest::getCmd('task');
if ($task == 'updateDatabase') {
    vRequest::vmCheckToken('Invalid Token, in ' . $task);
    $app = JFactory::getApplication();
    if (!class_exists('com_virtuemart_allinoneInstallerScript')) {
        require JPATH_ROOT . DS . 'administrator' . DS . 'components' . DS . 'com_tsmart_allinone' . DS . 'script.vmallinone.php';
    }
    $updater = new com_virtuemart_allinoneInstallerScript();
    $updater->vmInstall();
    $app->redirect('index.php?option=com_tsmart_allinone', 'Database updated');
}
?>
<script type="text/javascript">
<!--
function confirmation(message, destnUrl) {
	var answer = confirm(message);
	if (answer) {
		window.location = destnUrl;
开发者ID:cuongnd,项目名称:etravelservice,代码行数:31,代码来源:admin.tcpdf.php

示例15: store

 /**
  * Save the configuration record
  *
  * @author Max Milbers
  * @return boolean True is successful, false otherwise
  */
 function store(&$data)
 {
     vRequest::vmCheckToken();
     //We create a fresh config
     $config = VmConfig::loadConfig(false, true);
     //We load the config file
     $_raw = self::readConfigFile(FALSE);
     $_value = join('|', $_raw);
     //We set the config file values as parameters into the config
     $config->setParams($_value);
     //We merge the array from the file with the array from the form
     //in case it the form has the same key as the file, the value is taken from the form
     $config->_params = array_merge($config->_params, $data);
     //We need this to know if we should delete the cache
     $browse_cat_orderby_field = $config->get('browse_cat_orderby_field');
     $cat_brws_orderby_dir = $config->get('cat_brws_orderby_dir');
     $urls = array('assets_general_path', 'media_category_path', 'media_product_path', 'media_manufacturer_path', 'media_vendor_path');
     foreach ($urls as $urlkey) {
         $url = trim($config->get($urlkey));
         $length = strlen($url);
         if ($length <= 1) {
             vmdebug('Urlkey was TOO SHORT ' . $urlkey . ' = ' . $url . ' and length ' . $length, $_raw[$urlkey]);
             unset($config->_params[$urlkey]);
             continue;
         }
         if (strrpos($url, '/') != $length - 1) {
             $config->set($urlkey, $url . '/');
             vmInfo('Corrected media url ' . $urlkey . ' added missing /');
         }
     }
     //If empty it is not sent by the form, other forms do it by using a table to store,
     //the config is like a big xparams and so we check some values for this form manually
     /*$toSetEmpty = array('active_languages','inv_os','email_os_v','email_os_s');
     		foreach($toSetEmpty as $item){
     			if(!isset($data[$item])) {
     				$config->set($item,array());
     			}
     		}*/
     $checkCSVInput = array('pagseq', 'pagseq_1', 'pagseq_2', 'pagseq_3', 'pagseq_4', 'pagseq_5');
     foreach ($checkCSVInput as $csValueKey) {
         $csValue = $config->get($csValueKey);
         if (!empty($csValue)) {
             $sequenceArray = explode(',', $csValue);
             foreach ($sequenceArray as &$csV) {
                 $csV = (int) trim($csV);
             }
             $csValue = implode(',', $sequenceArray);
             $config->set($csValueKey, $csValue);
         }
     }
     if (!class_exists('JFolder')) {
         require JPATH_VM_LIBRARIES . DS . 'joomla' . DS . 'filesystem' . DS . 'folder.php';
     }
     $safePath = trim($config->get('forSale_path'));
     if (!empty($safePath)) {
         if (DS != '/' and strpos($safePath, '/') !== false) {
             $safePath = str_replace('/', DS, $safePath);
             vmInfo('Corrected safe path, replaced / by ' . DS);
         }
         $length = strlen($safePath);
         if (strrpos($safePath, DS) != $length - 1) {
             $safePath = $safePath . DS;
             vmInfo('Corrected safe path, added missing ' . DS);
         }
         $config->set('forSale_path', $safePath);
     } else {
         VmWarn('COM_VIRTUEMART_WARN_SAFE_PATH_NO_INVOICE', vmText::_('COM_VIRTUEMART_ADMIN_CFG_MEDIA_FORSALE_PATH'));
         /*	$safePath = JPATH_ROOT.DS.'administrator'.DS.'components'.DS.'com_virtuemart'.DS.'vmfiles';
         
         			$exists = JFolder::exists($safePath);
         			if(!$exists){
         				$created = JFolder::create($safePath);
         				$safePath = $safePath.DS;
         				if($created){
         					vmInfo('COM_VIRTUEMART_SAFE_PATH_DEFAULT_CREATED',$safePath);
         					// create htaccess file
         					$fileData = "order deny, allow\ndeny from all\nallow from none";
         					JLoader::import('joomla.filesystem.file');
         					$fileName = $safePath.DS.'.htaccess';
         					$result = JFile::write($fileName, $fileData);
         					if (!$result) {
         						VmWarn('COM_VIRTUEMART_HTACCESS_DEFAULT_NOT_CREATED',$safePath,$fileData);
         					}
         					$config->set('forSale_path',$safePath);
         				} else {
         					VmWarn('COM_VIRTUEMART_WARN_SAFE_PATH_NO_INVOICE',vmText::_('COM_VIRTUEMART_ADMIN_CFG_MEDIA_FORSALE_PATH'));
         				}
         			}*/
     }
     if (!class_exists('shopfunctions')) {
         require JPATH_VM_ADMINISTRATOR . DS . 'helpers' . DS . 'shopfunctions.php';
     }
     $safePath = shopFunctions::checkSafePath($safePath);
     if (!empty($safePath)) {
//.........这里部分代码省略.........
开发者ID:lenard112,项目名称:cms,代码行数:101,代码来源:config.php


注:本文中的vRequest::vmCheckToken方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。