- Timestamp:
- 03/06/11 19:13:48 (2 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
twitter/files/lib/system/event/listener/UserLoginTwitterListener.class.php
r1305 r1321 30 30 31 31 // did agree with rules? 32 case 'SessionFactory':32 default: 33 33 // didInit 34 $this->validateRuleAgree($eventObj->session);34 if($eventObj instanceof SessionFactory) $this->validateRuleAgree($eventObj->session); 35 35 break; 36 36 … … 96 96 97 97 // if the modul activate and the user is twitter user he must agree the rules after a change, and the user is not a guest. 98 if ($session->getUser()->userID && TwitterUtil::hasTwitterUser($session->getUser()->userID)) {98 if ($session->getUser()->userID && $session->getUser()->didSkipRulesTwitter) { 99 99 // select all packageids of the packages where the user is agree with the rules. 100 100 $packageIDs = $session->getVar('package_agrees'); … … 104 104 // we check the agreement, is the user agree with the rules, we put the package id in to the array and leave the event. 105 105 if (Ruleset::isUserAgree($session->getUser()->userID, PACKAGE_ID)) { 106 if (is_null($packageIDs) || !is_array($packageIDs)) 106 if (is_null($packageIDs) || !is_array($packageIDs)) { 107 107 $packageIDs = array(PACKAGE_ID); 108 else $packageIDs[] = PACKAGE_ID; 109 $session->register('package_agrees', $packageIDs); 108 } else { 109 $packageIDs[] = PACKAGE_ID; 110 } 111 $session->register('package_agrees', $packageIDs); 112 113 $session->getUser()->getEditor()->update(null, null, null, null, array( 114 array( 115 'optionID' => User::getUserOptionID('didSkipRulesTwitter'), 116 'optionValue' => 0 117 ) 118 )); 110 119 return; 111 120 }
