# Sysop SQL queries
# The sql user shouldn't have too many rights other the database, restrict
-# it to SELECT only on 'cur' table for example
+# it to SELECT only on 'page', 'revision' and 'text' tables for example
#
/** Dangerous if not configured properly. */
$wgAllowSysopQueries = false;
*/
$wgNoFollowLinks = true;
+/**
+ * Specifies the minimal length of a user password. If set to
+ * 0, empty passwords are allowed.
+ */
+$wgMinimalPasswordLength = 0;
+
} else {
die();
}
-?>
\ No newline at end of file
+?>
function savePreferences() {
global $wgUser, $wgLang, $wgOut;
global $wgEnableUserEmail, $wgEnableEmail;
- global $wgEmailAuthentication;
+ global $wgEmailAuthentication, $wgMinimalPasswordLength;
+;
if ( '' != $this->mNewpass ) {
if ( $this->mNewpass != $this->mRetypePass ) {
return;
}
+ if ( strlen( $this->mNewpass ) < $wgMinimalPasswordLength ) {
+ $this->mainPrefsForm( wfMsg( 'passwordtooshort', $wgMinimalPasswordLength ) );
+ return;
+ }
+
if (!$wgUser->checkPassword( $this->mOldpass )) {
$this->mainPrefsForm( wfMsg( 'wrongpassword' ) );
return;
global $wgUser, $wgOut;
global $wgMaxNameChars;
global $wgMemc, $wgAccountCreationThrottle, $wgDBname, $wgIP;
+ global $wgMinimalPasswordLength;
if (!$wgUser->isAllowedToCreateAccount()) {
$this->userNotPrivilegedMessage();
- return;
+ return false;
}
if ( 0 != strcmp( $this->mPassword, $this->mRetype ) ) {
$this->mainLoginForm( wfMsg( 'badretype' ) );
- return;
+ return false;
}
$name = trim( $this->mName );
ucFirst($name) != $u->getName() )
{
$this->mainLoginForm( wfMsg( 'noname' ) );
- return;
+ return false;
}
if ( wfReadOnly() ) {
$wgOut->readOnlyPage();
- return;
+ return false;
}
if ( 0 != $u->idForName() ) {
$this->mainLoginForm( wfMsg( 'userexists' ) );
- return;
+ return false;
+ }
+
+ if ( strlen( $this->mPassword ) < $wgMinimalPasswordLength ) {
+ $this->mainLoginForm( wfMsg( 'passwordtooshort', $wgMinimalPasswordLength ) );
+ return false;
}
if ( $wgAccountCreationThrottle ) {
}
if ( $value > $wgAccountCreationThrottle ) {
$this->throttleHit( $wgAccountCreationThrottle );
- return;
+ return false;
}
}
'specialloguserlabel' => 'User: ',
'speciallogtitlelabel' => 'Title: ',
+'passwordtooshort' => 'Your password is too short. It must have at least $1 characters.',
+
);
#--------------------------------------------------------------------------
# labels for User: and Title: on Special:Log pages
'specialloguserlabel' => 'Benutzer: ',
'speciallogtitlelabel' => 'Titel: ',
+'passwordtooshort' => 'Ihr Passwort ist zu kurz. Es muss mindestens $1 Zeichen lang sein.',
);