I want to add the Login link to the sidebar and used the **Special:UserLogin previousely and had some Java Script to return to the current page.
In MediaWiki 1.27 this stopped working and I have been searching for a solution to get this working again. I found this -
==========
$wgHooks['SkinBuildSidebar'][] = 'lfHideSidebar';
function lfHideSidebar( $skin, &$bar ) {
global $wgUser;
// Hide sidebar for anonymous users
if ( !$wgUser->isLoggedIn() ) {
$bar = array(
'navigation' => array(
array(
'text' => wfMessage( 'login' ) -> text(),
'href' => SpecialPage::getTitleFor( 'Login' )->getLocalURL(),
'id' => 'n-login',
'active' => ''
)
)
);
}
return true;
}
=========
Does anyone know how to use addReturnTo() with the getLocalURL(), or someother way to return to the current page after login?
Hey guys,
I have a problem with my mediawiki timezone settings. So the timestamp from
mediawiki is wrong.
The timestamp of my VM is the right but I have tried all of the given types
of settings and all failed.
So what can I do?
Best regards
Julian
The following code and comment appears in includes/db/Database.php:
protected function prepare( $sql, $func = 'DatabaseBase::prepare' ) {
/* MySQL doesn't support prepared statements (yet), so just
* pack up the query for reference. We'll manually replace
* the bits later.
*/
return array( 'query' => $sql, 'func' => $func );
}
However, the MySQL 5.7 documentation indicates that prepared statements are supported:
http://dev.mysql.com/doc/refman/5.7/en/sql-syntax-prepared-statements.html
Is the comment in Database.php outdated, and if so, could MediaWiki be made more secure against SQL injection by supporting prepared statements with recent versions of MySQL? Or does the support already exist, in spite of the comment?
Best wishes,
Tom
Wenlin Institute, Inc. SPC (a Social Purpose Corporation)
文林研究所社会目的公司
Software for Learning Chinese
E-mail: wenlin(a)wenlin.com Web: http://www.wenlin.com
Telephone: 1-877-4-WENLIN (1-877-493-6546)
☯
Hi everyone,
I need to use HTTP Basic Auth for outgoing HTTP connections. I could use MWHttpRequest directly to achieve this but wondered if this functionality could also be provided through the Http helper class.
The Http class provides get, post and request functions that do not allow to set HTTP headers other than the User Agent. But as this helper class is used by code I need to use, I would like to discuss two options (did not test the code), and open the discussion for other options.
Option 1: Pure HTTP Basic Auth support
Add two new well-defined options to the options parameter
- username
- password
In MWHttpRequest's constructor add the HTTP Authentication header:
if ( isset( $options['username'] ) && isset( $options['password'] ) )
$this->setHeader( 'Authorization', base64_encode( $options['username'] . ':' . $options['password'] ) );
Option 2: Support for any HTTP header
Add a single new option to the options parameter
- httpHeaders
In MWHttpRequest's constructor add the HTTP headers:
foreach ( $options['httpHeaders'] as $fieldName => $fieldValue )
$this->setHeader( $fieldName, $fieldValue )
Both solutions would work smoothly with Http.get, Http.post or Http.request.
I have no preference over one solution or the other. There might also be a third or a forth one that is much smarter...
Best regards
Christian