Index: trunk/extensions/QrCode/QrCode.php |
— | — | @@ -22,7 +22,7 @@ |
23 | 23 | $wgExtensionCredits['parserhook'][] = array( |
24 | 24 | 'path' => __FILE__, |
25 | 25 | 'name' => 'QrCode', |
26 | | - 'version' => '0.06', |
| 26 | + 'version' => '0.07', |
27 | 27 | 'author' => array( 'David Raison' ), |
28 | 28 | 'url' => 'http://www.mediawiki.org/wiki/Extension:QrCode', |
29 | 29 | 'descriptionmsg' => 'qrcode-desc' |
— | — | @@ -149,7 +149,8 @@ |
150 | 150 | $tmpName = tempnam( $wgTmpDirectory, 'qrcode' ); |
151 | 151 | |
152 | 152 | QRcode::png( $this->_label, $tmpName, $this->_ecc, $this->_size, $this->_margin ); |
153 | | - wfDebug( "Generated qrcode file $tmpName with ecc ".$this->_ecc.", ".$this->_size." and boundary ".$this->_margin.".\n" ); |
| 153 | + wfDebug( "QrCode::_generate: Generated qrcode file $tmpName with ecc ".$this->_ecc |
| 154 | + .", ".$this->_size." and boundary ".$this->_margin.".\n" ); |
154 | 155 | |
155 | 156 | return $this->_publish( $tmpName ); |
156 | 157 | } |
— | — | @@ -162,14 +163,15 @@ |
163 | 164 | private function _getBot(){ |
164 | 165 | $bot = User::createNew( $this->_qrCodeBot ); |
165 | 166 | if( $bot != null ){ |
| 167 | + wfDebug( 'QrCode::_getBot: Created new user '.$this->_qrCodeBot."\n" ); |
166 | 168 | //$bot->setPassword( '' ); // doc says empty password disables, but this triggers an exception |
167 | 169 | } else { |
168 | 170 | $bot = User::newFromName( $this->_qrCodeBot ); |
169 | | - wfDebug( 'Created new user '.$this->_qrCodeBot ); |
170 | 171 | } |
171 | | - if( !$bot->isBot() ) { |
| 172 | + |
| 173 | + if( !$bot->isAllowed( 'bot' ) ) { // User::isBot() has been deprecated |
172 | 174 | $bot->addGroup( 'bot' ); |
173 | | - wfDebug( 'Added user '.$this->_qrCodeBot.' to Bot group' ); |
| 175 | + wfDebug( 'QrCode::_getBot: Added user '.$this->_qrCodeBot.' to Bot group'."\n" ); |
174 | 176 | } |
175 | 177 | |
176 | 178 | return $bot; |
— | — | @@ -178,7 +180,7 @@ |
179 | 181 | /** |
180 | 182 | * Handle mediawiki file repositories |
181 | 183 | * @param $tmpName, the file's temporary name |
182 | | - * @return boolean value for success or failure of file "upload" |
| 184 | + * @return boolean false on failure or wikitext on success |
183 | 185 | */ |
184 | 186 | private function _publish( $tmpName ){ |
185 | 187 | global $wgOut; |