I need this part of the code changed:
/**
* Check if a username+password pair is a valid login.
*/
function authenticate( $username, $password ) {
$dbr =& $this->getAuthPressDB();
$res =
$dbr->selectRow($this->getAuthPressUserTableName(),
"password",
"name=".$dbr->addQuotes($username),
"AuthPress::authenticate" );
if( $res && ( $res->passwd == MD5( $password ))) {
return true;
} else {
return false;
}
I am new to mediawiki, but am trying to get a handle on this powerful program.
I've uploaded a jpeg. It got stored in the images/ subdirectory as did a
thumb in the images/thumb subdirectory. Obviously permissions and
imagemagick are working.
However, when I use and [[Image:picture.jpg]], I get the full-sized image,
not the thumb. How do I refer to the thumb.
Also, in html, I could use the align="left" or align="right" to flow a
paragraph around the image. Is there an equivalent in mediawiki?
Thanks,
Ollie
--
|---------------------------|
| Ollie Acheson |
| Morristown, NJ |
|---------------------------|
I am trying to modify the AuthPress code to work with invisionboard 2.0. The
problem I am running into is the way the password is stored with invisionboard.
Usernames are stored in a table named "members" with a corresponding table row
id. The passwords are stored in a separate table named members_converge that
references the users table row id. The password has a "hash" and a "salt".
Can someone help me modify the password section of the below script to pull from
a separate table and use the hash/salt encryption? Hopefully this will be
helpful to other users also.
<?php
require_once('AuthPlugin.php');
class AuthPress extends AuthPlugin {
var $mAuthPressTablePrefix="";
var $mUseSeparateAuthPressDB=false;
var $mAuthPressDBServer;
var $mAuthPressDBName;
var $mAuthPressUser;
var $mAuthPressPassword;
var $mAuthPressDBconn = -1;
function AuthPress () {
global $wgDBserver, $wgDBname, $wgDBuser, $wgDBpassword;
$this->mAuthPressDBServer=$wgDBserver;
$this->mAuthPressDBName=$wgDBname;
$this->mAuthPressUser=$wgDBuser;
$this->mAuthPressPassword=$wgDBpassword;
}
function setAuthPressTablePrefix ( $prefix ) {
$this->mAuthPressTablePrefix=$prefix;
}
function getAuthPressUserTableName () {
return $this->mAuthPressTablePrefix."members";
}
function setAuthPressDBServer ($server) {
$this->mUseSeparateAuthPressDB=true;
$this->mAuthPressDBServer=$server;
}
function setAuthPressDBName ($dbname) {
$this->mUseSeparateAuthPressDB=true;
$this->mAuthPressDBName=$dbname;
}
function setAuthPressUser ($user) {
$this->mUseSeparateAuthPressDB=true;
$this->mAuthPressUser=$user;
}
function setAuthPressPassword ($password) {
$this->mUseSeparateAuthPressDB=true;
$this->mAuthPressPassword=$password;
}
function &getAuthPressDB () {
if( $this->mUseSeparateAuthPressDB ) {
//print $this->mAuthPressDBServer;
//print $this->mAuthPressUser;
//print $this->mAuthPressPassword;
//print $this->mAuthPressDBName;
if(! is_object($this->mDBconn) ) {
$this->mAuthPressDBconn =
new Database($this->mAuthPressDBServer,
$this->mAuthPressUser,
$this->mAuthPressPassword,
$this->mAuthPressDBName );
}
return $this->mAuthPressDBconn;
}
else {
return wfGetDB( DB_SLAVE );
}
}
/**
* Check whether there exists a user account with the given name.
*/
function userExists( $username ) {
$dbr =& $this->getAuthPressDB();
$res = $dbr->selectRow($this->getAuthPressUserTableName(),
"name",
"name=".$dbr->addQuotes($username),
"AuthPress::authenticate" );
if($res) {
return true;
} else {
return false;
}
}
/**
* Check if a username+password pair is a valid login.
*/
function authenticate( $username, $password ) {
$dbr =& $this->getAuthPressDB();
$res = $dbr->selectRow($this->getAuthPressUserTableName(),
"password",
"name=".$dbr->addQuotes($username),
"AuthPress::authenticate" );
if( $res && ( $res->passwd == MD5( $password ))) {
return true;
} else {
return false;
}
}
}
?>
I hope I am submitting this correctly so here goes ....
On my site - www.how2.za.net <http://www.how2.za.net> - when someone
searches for more than one word only the first word is searched for, can
anyone help me with this? Please check out the site to see what I mean.
Thanks, kilps
I was wondering if it is possible to restrict the random page feature from
going to certain namespace pages. Also, I don't know if it already only goes
to pages in the main namespace. If so, can I make a special link for a
random page for a certain namespace. For example, "Random article", "Random
talk page", etc. Thank you for any help you can give me, Shardsofmetal
Apparently this is what I'm referring to - I just set the title via
editing Mediawiki:MySpecialPage - thankyou!
-----Original Message-----
From: mediawiki-l-bounces(a)Wikimedia.org
[mailto:mediawiki-l-bounces@Wikimedia.org] On Behalf Of Jamie Bliss
Sent: Tuesday, June 21, 2005 5:14 PM
To: MediaWiki announcements and site admin list
Subject: Re: [Mediawiki-l] Re: How to create a new Special page
Are you refering to SpecialPage::getDescription()? (Which, by default,
calls wfMsg() with the lowercase version of the page name. So if your
special page is called SomeSpecialPageIWrote, you would want to look
at [[MediaWiki:somespecialpageiwrote]].)
On 6/21/05, Bart Q. Simon <bqs(a)bluefang.com> wrote:
> Yeah I'm aware that special pages are php (I made one that's working
> beautifully).
>
> I'm just trying to figure out a way to give a new special page a title
> without hard-coding it in PHP. I'm pretty sure there is a way to do it
> (I looked through my old custom-made special page, and there isn't a
> title in there - yet it still has the right title when I browse to
it).
>
> I recollect it being something like this, but not quite like this:
>
> http://meta.wikimedia.org/wiki/MediaWiki:Pagetitle
That appears to be for the HTML <title> tags. I assume you're talking
about the title at the top of the page.
>
> Maybe I'm losing it :).
That's entirely possible. However, this is not an authoritative source
in the areas of mental stability. ;)
--
-------------------------------------------------------------------
http://endeavour.zapto.org/astro73/
Thank you to JosephM for inviting me to Gmail!
Have lots of invites. Gmail now has 2GB.
_______________________________________________
MediaWiki-l mailing list
MediaWiki-l(a)Wikimedia.org
http://mail.wikipedia.org/mailman/listinfo/mediawiki-l
I was wondering how Wikipedia keeps from having the links for userpage and
talkpage visible for users who have edited pages, but haven't logged in.
Thank You, Shardsofmetal
i wrote a extension to embed gallery2 images into mediawiki 1.5.
Everything works fine, except one thing:
included templates were not parsed the same way as normal pages.
To explain:
I include a new tag like [[foto:1234]]
and the extensions works like this:
$wgExtensionFunctions[] = 'registerHook';
function registerHook(){ ... $wgHooks['ParserBeforeStrip'][] =
'replaceR'; }
function replaceR(&$article, $&text){ $text = preg_replace_callback([[]]
into <img src='' />... , $text ); }
Templates are already stripped before entering 'ParserBeforeStrip', so i
get no chance to replace 'before'.
The [[Foto:1234]] were already transformed into <a
href='/Foto:1234'>Foto:1234</a>
to see the problem:
http://www.transarte.net/mediawiki/index.php/Diskussion:Gallery2wiki
Andres Obrero
I'm considering moving from another wiki to MediaWiki software. This move needs to be made without loss of data from the old wiki (meaning we'll need to move over 10,000 documents and their revision history). Are there any tools for doing something like this, for any other wiki? It would be nice to have a starting point, rather than having to write entirely from scratch. I can convert their wikitext into WikiMedia's without a problem, but I'd love any help I can get with writing the data to the database.
Thanks,
Gabe