1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-02 20:57:26 +02:00

Unusual default user_class behavior. Extra checks added.

This commit is contained in:
Cameron
2015-05-21 19:19:36 -07:00
parent 00bb2e2481
commit bc48a7efa5

View File

@@ -537,7 +537,7 @@ class UserHandler
{ {
if ($incInherited) if ($incInherited)
{ {
$classList = e107::getUserClass()->get_all_user_classes($var['user_class']); $classList = e107::getUserClass()->get_all_user_classes($userData['user_class']);
} }
else else
{ {
@@ -760,35 +760,40 @@ Following fields auto-filled in code as required:
$tp = e107::getParser(); $tp = e107::getParser();
$initClasses = array(); $initClasses = array();
$doClasses = FALSE; $doClasses = false;
$doProbation = FALSE; $doProbation = false;
$ret = FALSE; $ret = false;
switch($event) switch($event)
{ {
case 'userall': case 'userall':
$doClasses = TRUE; $doClasses = true;
$doProbation = TRUE; $doProbation = true;
break; break;
case 'userfull': case 'userfull':
if (!$pref['user_reg_veri'] || ($pref['init_class_stage'] == '2')) if(!$pref['user_reg_veri'] || (intval($pref['init_class_stage']) == 2))
{ {
$doClasses = TRUE; $doClasses = true;
} }
$doProbation = TRUE; $doProbation = true;
break; break;
case 'userpartial' : case 'userpartial' :
if ($pref['init_class_stage'] == '1') if(intval($pref['init_class_stage']) === 1)
{ {
// Set initial classes if to be done on partial signup, or if selected to add them now // Set initial classes if to be done on partial signup, or if selected to add them now
$doClasses = TRUE; $doClasses = true;
} }
$doProbation = TRUE; $doProbation = true;
break; break;
} }
if($doClasses) if($doClasses)
{ {
if (isset($pref['initial_user_classes'])) { $initClasses = explode(',',$pref['initial_user_classes']); } // Any initial user classes to be set at some stage if(isset($pref['initial_user_classes'])) // Any initial user classes to be set at some stage
{
$initClasses = explode(',', $pref['initial_user_classes']);
}
if($doProbation && (varset($pref['user_new_period'], 0) > 0)) if($doProbation && (varset($pref['user_new_period'], 0) > 0))
{ {
$initClasses[] = e_UC_NEWUSER; // Probationary user class $initClasses[] = e_UC_NEWUSER; // Probationary user class
@@ -805,6 +810,7 @@ Following fields auto-filled in code as required:
$ret = $user['user_class']; $ret = $user['user_class'];
} }
} }
return $ret; return $ret;
} }