Skip to content

Instantly share code, notes, and snippets.

<?php
if (!$this->config->get('config_customer_approval')) {
$customer_query = $this->db->query("SELECT * FROM " . DB_PREFIX . "customer WHERE LOWER(email) = '" . $this->db->escape(strtolower($email)) . "' AND password = '" . $this->db->escape(md5($password)) . "' AND status = '1'");
} else {
$customer_query = $this->db->query("SELECT * FROM " . DB_PREFIX . "customer WHERE LOWER(email) = '" . $this->db->escape(strtolower($email)) . "' AND password = '" . $this->db->escape(md5($password)) . "' AND status = '1' AND approved = '1'");
}
@cirpo
cirpo / gist:774602
Created January 11, 2011 15:54
cMailLogger Symfony mail logger
<?php
/**
* ncMAilLogger send mail logs messages.
*
* @package symfony
* @subpackage log
* @author alessandro cinelli a.k.a cirpo <[email protected]>
* @version SVN: $Id: sfFileLogger.class.php 10964 2008-08-19 18:33:50Z fabien $
*/
class cMailLogger extends sfLogger
@cirpo
cirpo / gist:774617
Created January 11, 2011 16:01
factories.yml
dev:
mailer:
class: sfMailer
param:
logging: %SF_LOGGING_ENABLED%
charset: %SF_CHARSET%
delivery_strategy: realtime
transport:
class: Swift_SmtpTransport
param:
<?php
$arrayCard = array();
for ($i = 100000; $i < 1000000; $i++)
{
$num = generateCardNumber($i);
echo "id: ".$i." card: ".$num."\n";
if(in_array($num, $arrayCard))
<?php
public static function generateCardNumber($uid)
{
$uid = str_pad(strrev($uid), 6, '0');
$quartine = array();
$quartine[] = str_pad(abs((131071 * $uid + 524287) % 10000), 4, '0', STR_PAD_LEFT);
$quartine[] = str_pad(abs((524287 * $uid + 131071) % 10000), 4, '0', STR_PAD_LEFT);
$quartine[] = str_pad(abs((8191 * $uid + 131071) % 10000), 4, '0', STR_PAD_LEFT);
SELECT
se.id as id,
email.value as email,
tessera.value as tessera
FROM
sym_entries se
LEFT JOIN sym_entries_data_119 email
ON
se.id = email.entry_id
show_article:
url: /article/:articleCode_:folderCode_:variationCode_:lineCode_:seasonCode_:colorCode
class: sfDoctrineRoute
options:
model: Article
type: object
segment_separators: [/, _]
param: { module: article, action: show, sf_format: html }
show_article:
url: /article/:articleCode-:folderCode-:variationCode-:lineCode-:seasonCode-:colorCode
class: sfDoctrineRoute
options:
model: Article
type: object
segment_separators: [/, -]
param: { module: article, action: show, sf_format: html }
imports:
- { resource: parameters.ini }
- { resource: security.yml }
framework:
charset: UTF-8
error_handler: null
csrf_protection:
enabled: true
secret: %csrf_secret%
var intervalKey;
var over = true;
$('#next').hover(
function(e)
{
over = true;
var move = function(){
if(over){
var p = '' + $('#event_block ul').position().left - 50 + '';