Changeset 1321
- Timestamp:
- 03/06/11 19:13:48 (2 years ago)
- Location:
- Files:
-
- 5 modified
-
eventlistener.xml (modified) (1 diff)
-
files/lib/system/event/listener/UserLoginTwitterListener.class.php (modified) (3 diffs)
-
files/lib/util/TwitterUtil.class.php (modified) (1 diff)
-
package.xml (modified) (1 diff)
-
useroptions.xml (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
twitter/eventlistener.xml
r1305 r1321 6 6 <eventclassname>SessionFactory</eventclassname> 7 7 <eventname>didInit</eventname> 8 <inherit>1</inherit> 8 9 <listenerclassfile>lib/system/event/listener/UserLoginTwitterListener.class.php</listenerclassfile> 9 10 </eventlistener> -
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 } -
twitter/files/lib/util/TwitterUtil.class.php
r1315 r1321 380 380 $groups = array(); 381 381 $activeOptions = array(); 382 383 // did skip the rules 384 if (MODULE_RULE && $session->getUser()->getPermission('admin.general.canIgnoreRules') == false) { 385 $activeOptions[] = array( 386 'optionID' => User::getUserOptionID('didSkipRulesTwitter'), 387 'optionValue' => 1 388 ); 389 } 382 390 383 391 $additionalFields = array(); -
twitter/package.xml
r1315 r1321 45 45 <languages languagecode="de">de.xml</languages> 46 46 <languages languagecode="de-informal">de.xml</languages> 47 <useroptions>useroptions.xml</useroptions> 47 48 </instructions> 48 49 <instructions type="update" fromversion="1.1.2"> -
twitter/useroptions.xml
r1299 r1321 10 10 <outputclass>UserOptionOutputTwitter</outputclass> 11 11 </option> 12 <option name="didSkipRulesTwitter"> 13 <categoryname>hidden</categoryname> 14 <optiontype>boolean</optiontype> 15 <defaultValue>0</defaultValue> 16 </option> 12 17 </options> 13 18 </import>
