Page Menu
Home
In-Portal Phabricator
Search
Configure Global Search
Log In
Files
F1092827
in-portal
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Mon, Aug 11, 1:46 AM
Size
10 KB
Mime Type
text/x-diff
Expires
Wed, Aug 13, 1:46 AM (16 h, 22 m)
Engine
blob
Format
Raw Data
Handle
707789
Attached To
rINP In-Portal
in-portal
View Options
Index: trunk/kernel/units/users/users_tag_processor.php
===================================================================
--- trunk/kernel/units/users/users_tag_processor.php (revision 2727)
+++ trunk/kernel/units/users/users_tag_processor.php (revision 2728)
@@ -1,153 +1,167 @@
<?php
class UsersTagProcessor extends kDBTagProcessor
{
function LogoutLink($params)
{
$pass = Array('pass' => 'all,m,u', 'u_event' => 'OnLogout');
$logout_template = $this->SelectParam($params, 'template,t');
return $this->Application->HREF($logout_template, '', $pass);
}
function UseUsernames($params)
{
return $this->Application->ConfigValue('Email_As_Login') != 1;
}
function RegistrationEnabled($params)
{
return $this->Application->ConfigValue('User_Allow_New') != 2;
}
function SuggestRegister($params)
{
return !$this->Application->LoggedIn() && !$this->Application->ConfigValue('Comm_RequireLoginBeforeCheckout') && $this->RegistrationEnabled($params);
}
function ConfirmPasswordLink($params)
{
//global $m_var_list_update, $var_list_update, $objSession, $objConfig;
$template = "forgotpw_reset_result";
$tmp_user_id = $this->Application->RecallVar("tmp_user_id");
$saved_denerated_code = $this->Application->GetVar('saved_denerated_code');
if ($saved_denerated_code){
$code = $saved_denerated_code;
}
else {
$code = md5($this->GenerateCode());
$this->Application->SetVar('saved_denerated_code', $code);
}
$sql = 'UPDATE '.TABLE_PREFIX.'PortalUser SET PwResetConfirm="'.$code.'", PwRequestTime='.mktime().' WHERE PortalUserId='.$tmp_user_id;
$this->Conn->Query($sql);
$params = array_merge($params, array('pass'=>'m', 'user_key'=>$code));
$main_processor =& $this->Application->recallObject('m_TagProcessor');
return $main_processor->T($params);
}
function GenerateCode()
{
list($usec, $sec) = explode(" ",microtime());
$id_part_1 = substr($usec, 4, 4);
$id_part_2 = mt_rand(1,9);
$id_part_3 = substr($sec, 6, 4);
$digit_one = substr($id_part_1, 0, 1);
if ($digit_one == 0) {
$digit_one = mt_rand(1,9);
$id_part_1 = ereg_replace("^0","",$id_part_1);
$id_part_1=$digit_one.$id_part_1;
}
return $id_part_1.$id_part_2.$id_part_3;
}
function ForgottenPassword($params){
return $this->Application->GetVar('ForgottenPassword');
}
function TestCodeIsValid($param){
$passed_key = $this->Application->GetVar('user_key');
$user_object = &$this->Application->recallObject('u.forgot');
$user_current_object = &$this->Application->recallObject('u');
if (strlen(trim($passed_key)) == 0) {
$user_current_object->ErrorMsgs['code_is_not_valid'] = $this->Application->Phrase('lu_code_is_not_valid');
$user_current_object->FieldErrors['PwResetConfirm']['pseudo'] = 'code_is_not_valid';
return false;
}
if($user_object->Load(array('PwResetConfirm'=>$passed_key)))
{
$exp_time = $user_object->GetDBField('PwRequestTime') + 3600;
if ($exp_time > mktime())
{
} else {
$user_current_object->ErrorMsgs['code_expired'] = $this->Application->Phrase('lu_code_expired');
$user_current_object->FieldErrors['PwResetConfirm']['pseudo'] = 'code_expired';
return false;
}
} else {
$user_current_object->ErrorMsgs['code_is_not_valid'] = $this->Application->Phrase('lu_code_is_not_valid');
$user_current_object->FieldErrors['PwResetConfirm']['pseudo'] = 'code_is_not_valid';
return false;
}
return true;
}
/**
* Returns sitem administrator email
*
* @param Array $params
* @return string
*/
function SiteAdminEmail($params)
{
return $this->Application->ConfigValue('Smtp_AdminMailFrom');
}
function AffiliatePaymentTypeChecked($params)
{
static $checked = false;
+
+ if( $this->Application->GetVar('PaymentTypeId') )
+ {
+ $apt_object =& $this->Application->recallObject('apt.active');
+ if( $this->Application->GetVar('PaymentTypeId') == $apt_object->GetDBField('PaymentTypeId') )
+ {
+ return 1;
+ }
+ else
+ {
+ return 0;
+ }
+ }
+
if(!$checked)
{
$checked = true;
return 1;
}
else
{
return 0;
}
}
function HasError($params)
{
$res = parent::HasError($params) || $this->Application->GetVar('MustAgreeToTerms');
$res = $res || $this->Application->GetVar('SSNRequiredError');
return $res;
}
}
?>
\ No newline at end of file
Property changes on: trunk/kernel/units/users/users_tag_processor.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.8
\ No newline at end of property
+1.9
\ No newline at end of property
Index: trunk/core/units/users/users_tag_processor.php
===================================================================
--- trunk/core/units/users/users_tag_processor.php (revision 2727)
+++ trunk/core/units/users/users_tag_processor.php (revision 2728)
@@ -1,153 +1,167 @@
<?php
class UsersTagProcessor extends kDBTagProcessor
{
function LogoutLink($params)
{
$pass = Array('pass' => 'all,m,u', 'u_event' => 'OnLogout');
$logout_template = $this->SelectParam($params, 'template,t');
return $this->Application->HREF($logout_template, '', $pass);
}
function UseUsernames($params)
{
return $this->Application->ConfigValue('Email_As_Login') != 1;
}
function RegistrationEnabled($params)
{
return $this->Application->ConfigValue('User_Allow_New') != 2;
}
function SuggestRegister($params)
{
return !$this->Application->LoggedIn() && !$this->Application->ConfigValue('Comm_RequireLoginBeforeCheckout') && $this->RegistrationEnabled($params);
}
function ConfirmPasswordLink($params)
{
//global $m_var_list_update, $var_list_update, $objSession, $objConfig;
$template = "forgotpw_reset_result";
$tmp_user_id = $this->Application->RecallVar("tmp_user_id");
$saved_denerated_code = $this->Application->GetVar('saved_denerated_code');
if ($saved_denerated_code){
$code = $saved_denerated_code;
}
else {
$code = md5($this->GenerateCode());
$this->Application->SetVar('saved_denerated_code', $code);
}
$sql = 'UPDATE '.TABLE_PREFIX.'PortalUser SET PwResetConfirm="'.$code.'", PwRequestTime='.mktime().' WHERE PortalUserId='.$tmp_user_id;
$this->Conn->Query($sql);
$params = array_merge($params, array('pass'=>'m', 'user_key'=>$code));
$main_processor =& $this->Application->recallObject('m_TagProcessor');
return $main_processor->T($params);
}
function GenerateCode()
{
list($usec, $sec) = explode(" ",microtime());
$id_part_1 = substr($usec, 4, 4);
$id_part_2 = mt_rand(1,9);
$id_part_3 = substr($sec, 6, 4);
$digit_one = substr($id_part_1, 0, 1);
if ($digit_one == 0) {
$digit_one = mt_rand(1,9);
$id_part_1 = ereg_replace("^0","",$id_part_1);
$id_part_1=$digit_one.$id_part_1;
}
return $id_part_1.$id_part_2.$id_part_3;
}
function ForgottenPassword($params){
return $this->Application->GetVar('ForgottenPassword');
}
function TestCodeIsValid($param){
$passed_key = $this->Application->GetVar('user_key');
$user_object = &$this->Application->recallObject('u.forgot');
$user_current_object = &$this->Application->recallObject('u');
if (strlen(trim($passed_key)) == 0) {
$user_current_object->ErrorMsgs['code_is_not_valid'] = $this->Application->Phrase('lu_code_is_not_valid');
$user_current_object->FieldErrors['PwResetConfirm']['pseudo'] = 'code_is_not_valid';
return false;
}
if($user_object->Load(array('PwResetConfirm'=>$passed_key)))
{
$exp_time = $user_object->GetDBField('PwRequestTime') + 3600;
if ($exp_time > mktime())
{
} else {
$user_current_object->ErrorMsgs['code_expired'] = $this->Application->Phrase('lu_code_expired');
$user_current_object->FieldErrors['PwResetConfirm']['pseudo'] = 'code_expired';
return false;
}
} else {
$user_current_object->ErrorMsgs['code_is_not_valid'] = $this->Application->Phrase('lu_code_is_not_valid');
$user_current_object->FieldErrors['PwResetConfirm']['pseudo'] = 'code_is_not_valid';
return false;
}
return true;
}
/**
* Returns sitem administrator email
*
* @param Array $params
* @return string
*/
function SiteAdminEmail($params)
{
return $this->Application->ConfigValue('Smtp_AdminMailFrom');
}
function AffiliatePaymentTypeChecked($params)
{
static $checked = false;
+
+ if( $this->Application->GetVar('PaymentTypeId') )
+ {
+ $apt_object =& $this->Application->recallObject('apt.active');
+ if( $this->Application->GetVar('PaymentTypeId') == $apt_object->GetDBField('PaymentTypeId') )
+ {
+ return 1;
+ }
+ else
+ {
+ return 0;
+ }
+ }
+
if(!$checked)
{
$checked = true;
return 1;
}
else
{
return 0;
}
}
function HasError($params)
{
$res = parent::HasError($params) || $this->Application->GetVar('MustAgreeToTerms');
$res = $res || $this->Application->GetVar('SSNRequiredError');
return $res;
}
}
?>
\ No newline at end of file
Property changes on: trunk/core/units/users/users_tag_processor.php
___________________________________________________________________
Modified: cvs2svn:cvs-rev
## -1 +1 ##
-1.8
\ No newline at end of property
+1.9
\ No newline at end of property
Event Timeline
Log In to Comment