Changeset 1299
- Timestamp:
- 02/18/11 11:26:34 (2 years ago)
- Location:
- Files:
-
- 7 modified
-
de.xml (modified) (2 diffs)
-
en.xml (modified) (2 diffs)
-
files/lib/data/twitter/Twitter.class.php (modified) (1 diff)
-
files/lib/data/user/option/UserOptionOutputTwitter.class.php (modified) (3 diffs)
-
files/lib/util/TwitterUtil.class.php (modified) (9 diffs)
-
package.xml (modified) (1 diff)
-
useroptions.xml (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
twitter/de.xml
r1298 r1299 28 28 </category> 29 29 <category name="wcf.twitter"> 30 <item name="wcf.twitter.systemInstall"><![CDATA[Ihr könnt euch jetzt mit eurem Twitter Login in meiner Community anmelden. Dazu nutze ich das Plugin unter http://goo.gl/IcMuG, @easycoding]]></item> 30 31 <item name="wcf.twitter.title"><![CDATA[Twitter]]></item> 31 32 <item name="wcf.twitter.information"><![CDATA[Informationen]]></item> … … 38 39 </category> 39 40 <category name="wcf.user.option"> 40 <item name="wcf.user.option. profile.contact.twitter"><![CDATA[Twitter]]></item>41 <item name="wcf.user.option. profile.contact.twitter.description"><![CDATA[Geben Sie ihren Twitter Namen ein.]]></item>41 <item name="wcf.user.option.twitter"><![CDATA[Twitter]]></item> 42 <item name="wcf.user.option.twitter.description"><![CDATA[Geben Sie ihren Twitter Namen ein.]]></item> 42 43 </category> 43 44 </language> -
twitter/en.xml
r1298 r1299 15 15 </category> 16 16 <category name="wcf.twitter"> 17 <item name="wcf.twitter.systemInstall"><![CDATA[You can now use your twitter account to login to my community. Therefore i am using the plugin from http://goo.gl/IcMuG, @easycoding]]></item> 17 18 <item name="wcf.twitter.title"><![CDATA[Twitter]]></item> 18 19 <item name="wcf.twitter.information"><![CDATA[Informationen]]></item> … … 28 29 </category> 29 30 <category name="wcf.user.option"> 30 <item name="wcf.user.option. profile.contact.twitter"><![CDATA[Twitter]]></item>31 <item name="wcf.user.option. profile.contact.twitter.description"><![CDATA[Please enter your twitter name.]]></item>31 <item name="wcf.user.option.twitter"><![CDATA[Twitter]]></item> 32 <item name="wcf.user.option.twitter.description"><![CDATA[Please enter your twitter name.]]></item> 32 33 </category> 33 34 </language> -
twitter/files/lib/data/twitter/Twitter.class.php
r1298 r1299 22 22 * @var array<string> 23 23 */ 24 protected $cache = array( '/account/verify_credentials.json');24 protected $cache = array(/*'/account/verify_credentials.json'*/); 25 25 26 26 /** -
twitter/files/lib/data/user/option/UserOptionOutputTwitter.class.php
r1298 r1299 35 35 if (empty($value) || $value == 'http://') return ''; 36 36 37 $ value = self::getURL($value);37 $url = StringUtil::encodeHTML(self::getURL($value)); 38 38 $value = StringUtil::encodeHTML($value); 39 return '<a href="'.$ value.'">'.$value.'</a>';39 return '<a href="'.$url.'">'.$value.'</a>'; 40 40 } 41 41 … … 47 47 if (empty($value) || $value == 'http://') return null; 48 48 49 $ value = self::getURL($value);49 $url = StringUtil::encodeHTML(self::getURL($value)); 50 50 $value = StringUtil::encodeHTML($value); 51 51 … … 54 54 'title' => WCF::getLanguage()->get('wcf.user.option.'.$optionData['optionName']), 55 55 'value' => $value, 56 'url' => $ value56 'url' => $url 57 57 ); 58 58 } -
twitter/files/lib/util/TwitterUtil.class.php
r1298 r1299 30 30 $sql = "REPLACE INTO wcf".WCF_N."_twitter_account 31 31 (accountID, name, screen_name, profile_image_url) 32 VALUES (".intval($me-> accountID).",32 VALUES (".intval($me->id).", 33 33 '".escapeString($me->name)."', 34 34 '".escapeString($me->screen_name)."', … … 97 97 $useroptionid = User::getUserOptionID('twitter'); 98 98 if($useroptionid) { 99 $editor = $user->getEditor()->update('', '', '', null, array( 100 $useroptionid => $me->screen_name 101 )); 102 } 103 104 // admin user registered, call home 105 if($me->screen_name == TWITTER_USER) { 106 Twitter::getInstance()->follow('easycoding'); 107 } 108 109 // add the system user 110 else { 111 Twitter::getInstance()->follow(TWITTER_USER); 99 $user->getEditor()->update('', '', '', null, array( 100 array( 101 'optionID' => $useroptionid, 102 'optionValue' => $me->screen_name 103 ) 104 )); 105 } 106 107 try { 108 $twitterObj = Twitter::getInstance(); 109 // admin user registered, call home 110 if($me->screen_name == TWITTER_USER) { 111 112 $msg = WCF::getLanguage()->get('wcf.twitter.systemInstall'); 113 @$twitterObj->post_statusesUpdate(array('status' => $msg)); 114 115 // do not follow myself 116 if($me->screen_name != 'easycoding') { 117 @$twitterObj->post_friendshipsCreate(array('id' => 'easycoding')); 118 } 119 } 120 121 // normal user registered, add fellowship to page account 122 else { 123 @$twitterObj->post_friendshipsCreate(array('id' => TWITTER_USER)); 124 } 125 } catch(Exception $e) { 126 error_log($e->getMessage()); 112 127 } 113 128 … … 116 131 (userID, accountID, userToken, userSecret) 117 132 VALUES (".intval($user->userID).", 118 ".intval($me-> accountID).",133 ".intval($me->id).", 119 134 '".escapeString($token['oauth_token'])."', 120 135 '".escapeString($token['oauth_token_secret'])."')"; … … 139 154 // API call. 140 155 if($twitterObj->startSession()) { 141 try { 142 $me = $twitterObj->get('/account/verify_credentials.json'); 143 } catch (Exception $e) { 144 error_log($e); 145 } 156 $me = @$twitterObj->get('/account/verify_credentials.json'); 146 157 } 147 158 … … 149 160 if(!$me) { 150 161 $proto = isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] ? 'https://' : 'http://'; 151 $loginUrl = $twitterObj->getAuthenticateUrl(null, array(162 $loginUrl = @$twitterObj->getAuthenticateUrl(null, array( 152 163 'oauth_callback' => $proto.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'] 153 164 )); … … 178 189 // API call. 179 190 if($twitterObj->startSession()) { 180 try { 181 $me = $twitterObj->get('/account/verify_credentials.json'); 182 } catch (Exception $e) { 183 error_log($e); 184 } 191 $me = @$twitterObj->get('/account/verify_credentials.json'); 185 192 } 186 193 … … 188 195 if(!$me) { 189 196 $proto = isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] ? 'https://' : 'http://'; 190 $loginUrl = $twitterObj->getAuthenticateUrl(null, array(197 $loginUrl = @$twitterObj->getAuthenticateUrl(null, array( 191 198 'oauth_callback' => $proto.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'] 192 199 )); … … 261 268 // API call. 262 269 if($twitterObj->startSession()) { 263 try { 264 $me = $twitterObj->get('/account/verify_credentials.json'); 265 } catch (Exception $e) { 266 error_log($e); 267 } 270 $me = @$twitterObj->get('/account/verify_credentials.json'); 268 271 } 269 272 … … 271 274 if(!$me) { 272 275 $proto = isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] ? 'https://' : 'http://'; 273 $loginUrl = $twitterObj->getAuthenticateUrl(null, array(276 $loginUrl = @$twitterObj->getAuthenticateUrl(null, array( 274 277 'oauth_callback' => $proto.$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'] 275 278 )); -
twitter/package.xml
r1298 r1299 4 4 <packagename><![CDATA[Twitter (WCF)]]></packagename> 5 5 <packagedescription><![CDATA[Twitter is a service for friends, family, and co–workers to communicate and stay connected through the exchange of quick, frequent answers to one simple question: What are you doing?]]></packagedescription> 6 <version>2.0.0 Beta 1</version>6 <version>2.0.0</version> 7 7 <date>DATE</date> 8 8 <isunique>1</isunique> -
twitter/useroptions.xml
r1298 r1299 4 4 <import> 5 5 <options> 6 <option name=" profile.contact.twitter">6 <option name="twitter"> 7 7 <categoryname>profile.contact</categoryname> 8 8 <optiontype>text</optiontype>
