Fixed : Registeration Problem
Fixed : Usernamem Duplicated and cb_form validation Fixed : Call Conversion Cron function as soon as cb hit the file Fixed : MC Clean Function
This commit is contained in:
parent
6e4e0d7547
commit
f57be99556
6 changed files with 86 additions and 21 deletions
|
@ -12,7 +12,8 @@ $in_bg_cron = true;
|
|||
ini_set('mysql.connect_timeout','6000');
|
||||
|
||||
include(dirname(__FILE__)."/../includes/config.inc.php");
|
||||
|
||||
//Calling Cron Functions
|
||||
cb_call_functions('video_convert_cron');
|
||||
|
||||
$server_friendly = config('server_friendly_conversion');
|
||||
if($server_friendly=='yes')
|
||||
|
@ -51,9 +52,6 @@ include(dirname(__FILE__)."/../includes/config.inc.php");
|
|||
die();
|
||||
}
|
||||
}
|
||||
|
||||
//Calling Cron Functions
|
||||
cb_call_functions('video_convert_cron');
|
||||
|
||||
|
||||
$SYSTEM_OS = $row['sys_os'] ? $row['sys_os'] : 'linux';
|
||||
|
|
|
@ -194,7 +194,7 @@ class Upload{
|
|||
if(!$field['clean_func'] || (!apply_func($field['clean_func'],$val) && !is_array($field['clean_func'])))
|
||||
$val = mysql_clean($val);
|
||||
else
|
||||
$val = apply_func($field['clean_func'],sql_free('|no_mc|'.$val));
|
||||
$val = apply_func($field['clean_func'],sql_free($val));
|
||||
|
||||
if(empty($val) && !empty($field['default_value']))
|
||||
$val = $field['default_value'];
|
||||
|
|
|
@ -224,6 +224,9 @@ class userquery extends CBCategory{
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Function used to check weather user is login or not
|
||||
* it will also check weather user has access or not
|
||||
|
@ -2394,10 +2397,13 @@ class userquery extends CBCategory{
|
|||
|
||||
$userfields = $this->load_profile_fields($array);
|
||||
$signup_fields = $this->load_signup_fields($array);
|
||||
$custom_signup_fields = $this->load_custom_signup_fields($array);
|
||||
|
||||
|
||||
$cat_field = $signup_fields['cat'];
|
||||
array_merge($userfields,$cat_field);
|
||||
validate_cb_form($userfields,$array);
|
||||
|
||||
// pr();
|
||||
foreach($userfields as $field)
|
||||
{
|
||||
$name = formObj::rmBrackets($field['name']);
|
||||
|
@ -2616,6 +2622,43 @@ class userquery extends CBCategory{
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
//Adding Custom Field
|
||||
if(is_array($custom_signup_fields))
|
||||
{
|
||||
foreach($custom_signup_fields as $field)
|
||||
{
|
||||
$name = formObj::rmBrackets($field['name']);
|
||||
$val = $array[$name];
|
||||
|
||||
if($field['use_func_val'])
|
||||
$val = $field['validate_function']($val);
|
||||
|
||||
|
||||
if(!empty($field['db_field']))
|
||||
$uquery_field[] = $field['db_field'];
|
||||
|
||||
if(is_array($val))
|
||||
{
|
||||
$new_val = '';
|
||||
foreach($val as $v)
|
||||
{
|
||||
$new_val .= "#".$v."# ";
|
||||
}
|
||||
$val = $new_val;
|
||||
}
|
||||
if(!$field['clean_func'] || (!function_exists($field['clean_func']) && !is_array($field['clean_func'])))
|
||||
$val = mysql_clean($val);
|
||||
else
|
||||
$val = apply_func($field['clean_func'],sql_free('|no_mc|'.$val));
|
||||
|
||||
|
||||
if(!empty($field['db_field']))
|
||||
$uquery_val[] = $val;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(!error() && is_array($uquery_field))
|
||||
{
|
||||
$db->update(tbl($this->dbtbl['users']),$uquery_field,$uquery_val," userid='".mysql_clean($array['userid'])."'");
|
||||
|
@ -2729,11 +2772,8 @@ class userquery extends CBCategory{
|
|||
function username_exists($i)
|
||||
{
|
||||
global $db;
|
||||
$db->select(tbl($this->dbtbl['users']),"username"," username='$i'");
|
||||
if($db->num_rows>0)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
//echo test;
|
||||
return $db->count(tbl($this->dbtbl['users']),"username"," username='$i'");
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -2774,9 +2814,27 @@ class userquery extends CBCategory{
|
|||
/**
|
||||
* Load Custom Signup Field
|
||||
*/
|
||||
function load_custom_signup_fields($array)
|
||||
function load_custom_signup_fields($data,$ck_display_admin=FALSE,$ck_display_user=FALSE)
|
||||
{
|
||||
return false;
|
||||
$array = $this->custom_signup_fields;
|
||||
foreach($array as $key => $fields)
|
||||
{
|
||||
$ok = 'yes';
|
||||
if($ck_display_admin)
|
||||
{
|
||||
if($fields['display_admin'] == 'no_display')
|
||||
$ok = 'no';
|
||||
}
|
||||
|
||||
if($ok=='yes')
|
||||
{
|
||||
if(!$fields['value'])
|
||||
$fields['value'] = $data[$fields['db_field']];
|
||||
$new_array[$key] = $fields;
|
||||
}
|
||||
}
|
||||
|
||||
return $new_array;
|
||||
}
|
||||
|
||||
|
||||
|
@ -3434,6 +3492,7 @@ class userquery extends CBCategory{
|
|||
$cond .=" AND ";
|
||||
$cond .= " usr_status='".$params['status']."'";
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//Setting Category Condition
|
||||
|
|
|
@ -2032,7 +2032,7 @@
|
|||
function user_exists($user)
|
||||
{
|
||||
global $userquery;
|
||||
return $userquery->duplicate_user($user);
|
||||
return $userquery->username_exists($user);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -2780,6 +2780,7 @@
|
|||
$funct_err = is_valid_value($field['validate_function'],$val);
|
||||
if($block!=true)
|
||||
{
|
||||
|
||||
//Checking Syntax
|
||||
if(!$funct_err)
|
||||
{
|
||||
|
@ -2787,25 +2788,30 @@
|
|||
e($function_error_msg);
|
||||
elseif(!empty($invalid_err))
|
||||
e($invalid_err);
|
||||
}elseif(!is_valid_syntax($field['syntax_type'],$val))
|
||||
}
|
||||
|
||||
if(!is_valid_syntax($field['syntax_type'],$val))
|
||||
{
|
||||
if(!empty($invalid_err))
|
||||
e($invalid_err);
|
||||
}
|
||||
elseif(isset($max_len))
|
||||
if(isset($max_len))
|
||||
{
|
||||
if($length > $max_len || $length < $min_len)
|
||||
e(sprintf(lang('please_enter_val_bw_min_max'),
|
||||
$title,$min_len,$field['max_length']));
|
||||
}elseif(function_exists($field['db_value_check_func']))
|
||||
}
|
||||
if(function_exists($field['db_value_check_func']))
|
||||
{
|
||||
|
||||
$db_val_result = $field['db_value_check_func']($val);
|
||||
if($db_val_result != $field['db_value_exists'])
|
||||
if(!empty($field['db_value_err']))
|
||||
e($field['db_value_err']);
|
||||
elseif(!empty($invalid_err))
|
||||
e($invalid_err);
|
||||
}elseif($field['relative_type']!='')
|
||||
}
|
||||
if($field['relative_type']!='')
|
||||
{
|
||||
switch($field['relative_type'])
|
||||
{
|
||||
|
|
|
@ -27,7 +27,8 @@ if($userquery->login_check('',true)){
|
|||
* Signing up new user
|
||||
*/
|
||||
if(isset($_POST['signup'])){
|
||||
if(!$userquery->is_registration_allowed())
|
||||
|
||||
if(!config('allow_registeration'))
|
||||
e(lang('usr_reg_err'));
|
||||
else
|
||||
{
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
{assign var='optionFields' value=$Upload->loadOptionFields($v)}
|
||||
{assign var='locationFields' value=$Upload->loadLocationFields($v)}
|
||||
|
||||
{assign var='custom_fields' value=$Upload->load_custom_upload_fields($data,TRUE)}
|
||||
{assign var='custom_form_fields' value=$Upload->load_custom_form_fields($v,TRUE)}
|
||||
|
||||
|
||||
|
@ -97,10 +98,10 @@
|
|||
|
||||
|
||||
{* Loading Custom Fields *}
|
||||
{if $custom_form_fields.0.title !=''}
|
||||
{if $custom_fields.0.title !=''}
|
||||
<fieldset class="fieldset">
|
||||
<legend>{lang code='more_options'}</legend>
|
||||
{foreach from=$custom_form_fields item=field}
|
||||
{foreach from=$custom_fields item=field}
|
||||
<div class="account_field_block">
|
||||
<div class="account_field_label" align="right"><strong><label for="{$field.id}">{$field.title}</label></strong></div>
|
||||
<div class="account_field">{$field.hint_1}{ANCHOR place=$field.anchor_before}{$formObj->createField($field)}
|
||||
|
|
Loading…
Add table
Reference in a new issue