|
From: <os...@us...> - 2014-03-13 16:21:27
|
Revision: 5193
http://sourceforge.net/p/oscss/svn/5193
Author: oscim
Date: 2014-03-13 16:21:25 +0000 (Thu, 13 Mar 2014)
Log Message:
-----------
Fix
Modified Paths:
--------------
trunk/catalog/admin/includes/classes/emailUtility.php
trunk/catalog/admin/includes/modules/pages/customers.php
trunk/catalog/templates/defaut/Childs_tpl/module.php
Modified: trunk/catalog/admin/includes/classes/emailUtility.php
===================================================================
--- trunk/catalog/admin/includes/classes/emailUtility.php 2014-03-13 09:20:34 UTC (rev 5192)
+++ trunk/catalog/admin/includes/classes/emailUtility.php 2014-03-13 16:21:25 UTC (rev 5193)
@@ -1,16 +1,19 @@
<?php if (!defined('HTTP_SERVER')) die('You can not access this file directly!');
/**
- @licence GPL 2005-2013 The osCSS developers - osCSS Open Source E-commerce
+ @licence GPL 2005-2014 The osCSS developers - osCSS Open Source E-commerce
@portion code Copyright (c) 2002 osCommerce
@package osCSS-2 <www http://www.oscss.org>
- @version 2.1.1
+ @version 2.2.0
@date 17/11/11, 15:27
@author oscim <mail aur...@os...> <www http://www.oscim.fr>
@encode UTF-8
- @class emailUtility
+ @file emailUtility.php
*/
+/**
+ @class emailUtility
+*/
class emailUtility {
@@ -260,5 +263,92 @@
return $t;
}
+
+
+ /**
+ * \brief test forme email
+ * @param $email string
+ */
+ public static function tep_validate_email($email) {
+ $valid_address = true;
+
+ $mail_pat = '^(.+)@(.+)$';
+ $valid_chars = "[^] \(\)<>@,;:\.\\\"\[]";
+ $atom = "$valid_chars+";
+ $quoted_user='(\"[^\"]*\")';
+ $word = "($atom|$quoted_user)";
+ $user_pat = "^$word(\.$word)*$";
+ $ip_domain_pat='^\[([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\]$';
+ $domain_pat = "^$atom(\.$atom)*$";
+
+ if (preg_match('/'.$mail_pat.'/i', $email, $components)) {
+ $user = $components[1];
+ $domain = $components[2];
+ // validate user
+ if (preg_match('/'.$user_pat.'/i', $user)) {
+ // validate domain
+ if (preg_match('/'.$ip_domain_pat.'/i', $domain, $ip_components)) {
+ // this is an IP address
+ for ($i=1;$i<=4;$i++) {
+ if ($ip_components[$i] > 255) {
+ $valid_address = false;
+ break;
+ }
+ }
+ }
+ else {
+ // Domain is a name, not an IP
+ if (preg_match('/'.$domain_pat.'/i', $domain)) {
+ /* domain name seems valid, but now make sure that it ends in a valid TLD or ccTLD
+ and that there's a hostname preceding the domain or country. */
+ $domain_components = explode(".", $domain);
+ // Make sure there's a host name preceding the domain.
+ if (sizeof($domain_components) < 2) {
+ $valid_address = false;
+ } else {
+ $top_level_domain = strtolower($domain_components[sizeof($domain_components)-1]);
+ // Allow all 2-letter TLDs (ccTLDs)
+ if (preg_match('/^[a-z][a-z]$/i', $top_level_domain) != 1) {
+ $tld_pattern = '';
+ // Get authorized TLDs from text file
+ $tlds = file(DIR_WS_INCLUDES . 'tld.txt');
+ while (list(,$line) = each($tlds)) {
+ // Get rid of comments
+ $words = explode('#', $line);
+ $tld = trim($words[0]);
+ // TLDs should be 3 letters or more
+ if (preg_match('/^[a-z]{3,}$/i', $tld) == 1) {
+ $tld_pattern .= '^' . $tld . '$|';
+ }
+ }
+ // Remove last '|'
+ $tld_pattern = substr($tld_pattern, 0, -1);
+ if (preg_match("/$tld_pattern/i", $top_level_domain) == 0) {
+ $valid_address = false;
+ }
+ }
+ }
+ }
+ else {
+ $valid_address = false;
+ }
+ }
+ }
+ else {
+ $valid_address = false;
+ }
+ }
+ else {
+ $valid_address = false;
+ }
+ if ($valid_address && _cst_bool('ENTRY_EMAIL_ADDRESS_CHECK') == 'true') {
+ if (!checkdnsrr($domain, "MX") && !checkdnsrr($domain, "A")) {
+ $valid_address = false;
+ }
+ }
+ return $valid_address;
+ }
+
+
}
?>
Modified: trunk/catalog/admin/includes/modules/pages/customers.php
===================================================================
--- trunk/catalog/admin/includes/modules/pages/customers.php 2014-03-13 09:20:34 UTC (rev 5192)
+++ trunk/catalog/admin/includes/modules/pages/customers.php 2014-03-13 16:21:25 UTC (rev 5193)
@@ -607,6 +607,15 @@
@remarks normal page
*/
case 'insert':
+
+ if(!tep_action_check('edit', self::FILENAME))
+ tep_redirect(tep_href_link(self::FILENAME));
+ global $languages_id;
+
+ $_id=sqlcustomer::create(array('password'=>'', 'email'=>'', 'language_id'=>$languages_id) );
+
+ tep_redirect(tep_href_link(self::FILENAME, tep_get_all_get_params(array('action','cPath','cID'),false).'cID=' . $_id.'&action=edit'));
+ break;
case 'update':
$array = array();
$array['post'] = $_POST;
@@ -648,7 +657,7 @@
if (strlen($testobj->customers_email_address) < ENTRY_EMAIL_ADDRESS_MIN_LENGTH)
throw new Exception(__("L'adresse email est trop courte, min:").ENTRY_EMAIL_ADDRESS_MIN_LENGTH);
- if (!self::tep_validate_email($testobj->customers_email_address))
+ if (!emailUtility::tep_validate_email($testobj->customers_email_address))
throw new Exception(ENTRY_EMAIL_ADDRESS_CHECK_ERROR);
if(self::$Id > 0 && ! sqlcustomer::userTestNotExists($testobj->customers_email_address) )
@@ -755,7 +764,7 @@
}
// throw new Exception(__("L'adresse email est trop courte, min:").ENTRY_EMAIL_ADDRESS_MIN_LENGTH);
- elseif (!self::tep_validate_email($ref)){
+ elseif (!emailUtility::tep_validate_email($ref)){
self::$Info['isValidRef'] = false;
self::PutMessage(
@@ -1065,93 +1074,8 @@
- /**
- * \brief test forme email
- * @param $email string
- */
- private static function tep_validate_email($email) {
- $valid_address = true;
- $mail_pat = '^(.+)@(.+)$';
- $valid_chars = "[^] \(\)<>@,;:\.\\\"\[]";
- $atom = "$valid_chars+";
- $quoted_user='(\"[^\"]*\")';
- $word = "($atom|$quoted_user)";
- $user_pat = "^$word(\.$word)*$";
- $ip_domain_pat='^\[([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\]$';
- $domain_pat = "^$atom(\.$atom)*$";
- if (preg_match('/'.$mail_pat.'/i', $email, $components)) {
- $user = $components[1];
- $domain = $components[2];
- // validate user
- if (preg_match('/'.$user_pat.'/i', $user)) {
- // validate domain
- if (preg_match('/'.$ip_domain_pat.'/i', $domain, $ip_components)) {
- // this is an IP address
- for ($i=1;$i<=4;$i++) {
- if ($ip_components[$i] > 255) {
- $valid_address = false;
- break;
- }
- }
- }
- else {
- // Domain is a name, not an IP
- if (preg_match('/'.$domain_pat.'/i', $domain)) {
- /* domain name seems valid, but now make sure that it ends in a valid TLD or ccTLD
- and that there's a hostname preceding the domain or country. */
- $domain_components = explode(".", $domain);
- // Make sure there's a host name preceding the domain.
- if (sizeof($domain_components) < 2) {
- $valid_address = false;
- } else {
- $top_level_domain = strtolower($domain_components[sizeof($domain_components)-1]);
- // Allow all 2-letter TLDs (ccTLDs)
- if (preg_match('/^[a-z][a-z]$/i', $top_level_domain) != 1) {
- $tld_pattern = '';
- // Get authorized TLDs from text file
- $tlds = file(DIR_WS_INCLUDES . 'tld.txt');
- while (list(,$line) = each($tlds)) {
- // Get rid of comments
- $words = explode('#', $line);
- $tld = trim($words[0]);
- // TLDs should be 3 letters or more
- if (preg_match('/^[a-z]{3,}$/i', $tld) == 1) {
- $tld_pattern .= '^' . $tld . '$|';
- }
- }
- // Remove last '|'
- $tld_pattern = substr($tld_pattern, 0, -1);
- if (preg_match("/$tld_pattern/i", $top_level_domain) == 0) {
- $valid_address = false;
- }
- }
- }
- }
- else {
- $valid_address = false;
- }
- }
- }
- else {
- $valid_address = false;
- }
- }
- else {
- $valid_address = false;
- }
- if ($valid_address && ENTRY_EMAIL_ADDRESS_CHECK == 'true') {
- if (!checkdnsrr($domain, "MX") && !checkdnsrr($domain, "A")) {
- $valid_address = false;
- }
- }
- return $valid_address;
- }
-
-
-
-
}
Modified: trunk/catalog/templates/defaut/Childs_tpl/module.php
===================================================================
--- trunk/catalog/templates/defaut/Childs_tpl/module.php 2014-03-13 09:20:34 UTC (rev 5192)
+++ trunk/catalog/templates/defaut/Childs_tpl/module.php 2014-03-13 16:21:25 UTC (rev 5193)
@@ -33,16 +33,23 @@
<?php } ?>
-
- <div class="row">
-
<?php /**
* Loop Data
*/
- foreach($themodule->module_db->content as $ele): ?>
-
+ $i = 0; foreach($themodule->module_db->content as $ele): ?>
+
+ <?php if( $i%4 ==0 ) : ?>
+ <?php if( $i>0 ) : ?>
+ </div>
+ <?php endif; ?>
+ <div class="row">
+ <?php endif; ?>
+
+
<div class=" one <?php echo $ele->type ?>">
+
+
<?php if($ele->type =='product'): /** PRODUCTS */ ?>
<section class="col-sm-3 col-xs-6 outerblock">
<div class="innerblock">
@@ -115,9 +122,11 @@
</section>
<?php endif; ?>
</div>
- <?php endforeach; ?>
+
+
+ <?php $i++; endforeach; ?>
- </div>
+ </div> <!--Last Div for loop and class row -->
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|