So, you have a script which basically pops up an HTML form? Sounds like you want to make a new special page. This would be a page that you can link to, and which can access MW's security features - so you can restrict it to people who have confirmed email addresses, eg.
Find another extension that does something similar, and merge your code into it.
Ian
-----Original Message----- From: Steve Finkelstein [mailto:sf@stevefink.net] Sent: Saturday, April 14, 2007 12:53 PM Pacific Standard Time To: mediawiki-l@lists.wikimedia.org Subject: [Mediawiki-l] Tie in a script?
All,
Not sure what the correct terminology is, assuming it might be a hook or extension. Either way - I have existing scripts which I've written in PHP that simply allow users to change their LDAP password, etc. I'm looking to throw this code (it's just a form with basic PHP+LDAP support) into MediaWiki so users can change their password from there. Currently I have it linked as an external link and for security purposes, this isn't favorable.
Is there any suggestions on how I can begin to go about this? The correct documentation etc would be much preferred.
Thanks all!
- Steve
_______________________________________________ MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
I found the frameworks on this page to be helpful in building special pages
http://meta.wikimedia.org/wiki/Writing_a_new_special_page
Jim On Apr 14, 2007, at 4:15 PM, Ian Smith wrote:
So, you have a script which basically pops up an HTML form? Sounds like you want to make a new special page. This would be a page that you can link to, and which can access MW's security features - so you can restrict it to people who have confirmed email addresses, eg.
Find another extension that does something similar, and merge your code into it.
Ian
-----Original Message----- From: Steve Finkelstein [mailto:sf@stevefink.net] Sent: Saturday, April 14, 2007 12:53 PM Pacific Standard Time To: mediawiki-l@lists.wikimedia.org Subject: [Mediawiki-l] Tie in a script?
All,
Not sure what the correct terminology is, assuming it might be a hook or extension. Either way - I have existing scripts which I've written in PHP that simply allow users to change their LDAP password, etc. I'm looking to throw this code (it's just a form with basic PHP+LDAP support) into MediaWiki so users can change their password from there. Currently I have it linked as an external link and for security purposes, this isn't favorable.
Is there any suggestions on how I can begin to go about this? The correct documentation etc would be much preferred.
Thanks all!
- Steve
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
===================================== Jim Hu Associate Professor Dept. of Biochemistry and Biophysics 2128 TAMU Texas A&M Univ. College Station, TX 77843-2128 979-862-4054
When writing a SpecialPage, I receive the following error:
PHP Fatal error: Class 'SpecialPage' not found
Do I have to explicitly include SpecialPage.php in my code? It doesn't list it as such in the page listed below by Jim.
- sf
Jim Hu wrote:
I found the frameworks on this page to be helpful in building special pages
http://meta.wikimedia.org/wiki/Writing_a_new_special_page
Jim On Apr 14, 2007, at 4:15 PM, Ian Smith wrote:
So, you have a script which basically pops up an HTML form? Sounds like you want to make a new special page. This would be a page that you can link to, and which can access MW's security features - so you can restrict it to people who have confirmed email addresses, eg.
Find another extension that does something similar, and merge your code into it.
Ian
-----Original Message----- From: Steve Finkelstein [mailto:sf@stevefink.net] Sent: Saturday, April 14, 2007 12:53 PM Pacific Standard Time To: mediawiki-l@lists.wikimedia.org Subject: [Mediawiki-l] Tie in a script?
All,
Not sure what the correct terminology is, assuming it might be a hook or extension. Either way - I have existing scripts which I've written in PHP that simply allow users to change their LDAP password, etc. I'm looking to throw this code (it's just a form with basic PHP+LDAP support) into MediaWiki so users can change their password from there. Currently I have it linked as an external link and for security purposes, this isn't favorable.
Is there any suggestions on how I can begin to go about this? The correct documentation etc would be much preferred.
Thanks all!
- Steve
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
===================================== Jim Hu Associate Professor Dept. of Biochemistry and Biophysics 2128 TAMU Texas A&M Univ. College Station, TX 77843-2128 979-862-4054
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
!DSPAM:1020,4621450a711213712038390!
What MW/php versions are you using? I didn't have to explicitly include, but I think MW autoloads the classes, which doesn't work in PHP4. That's my handwaving guess - the real experts can confirm or deny.
Jim On Apr 15, 2007, at 6:54 PM, Steve Finkelstein wrote:
When writing a SpecialPage, I receive the following error:
PHP Fatal error: Class 'SpecialPage' not found
Do I have to explicitly include SpecialPage.php in my code? It doesn't list it as such in the page listed below by Jim.
- sf
Jim Hu wrote:
I found the frameworks on this page to be helpful in building special pages
http://meta.wikimedia.org/wiki/Writing_a_new_special_page
Jim On Apr 14, 2007, at 4:15 PM, Ian Smith wrote:
So, you have a script which basically pops up an HTML form? Sounds like you want to make a new special page. This would be a page that you can link to, and which can access MW's security features - so you can restrict it to people who have confirmed email addresses, eg.
Find another extension that does something similar, and merge your code into it.
Ian
-----Original Message----- From: Steve Finkelstein [mailto:sf@stevefink.net] Sent: Saturday, April 14, 2007 12:53 PM Pacific Standard Time To: mediawiki-l@lists.wikimedia.org Subject: [Mediawiki-l] Tie in a script?
All,
Not sure what the correct terminology is, assuming it might be a hook or extension. Either way - I have existing scripts which I've written in PHP that simply allow users to change their LDAP password, etc. I'm looking to throw this code (it's just a form with basic PHP+LDAP support) into MediaWiki so users can change their password from there. Currently I have it linked as an external link and for security purposes, this isn't favorable.
Is there any suggestions on how I can begin to go about this? The correct documentation etc would be much preferred.
Thanks all!
- Steve
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
===================================== Jim Hu Associate Professor Dept. of Biochemistry and Biophysics 2128 TAMU Texas A&M Univ. College Station, TX 77843-2128 979-862-4054
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
!DSPAM:1020,4621450a711213712038390!
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
===================================== Jim Hu Associate Professor Dept. of Biochemistry and Biophysics 2128 TAMU Texas A&M Univ. College Station, TX 77843-2128 979-862-4054
MW - 1.9.3 PHP - 5.2.0
I've been referred to take a look at http://svn.wikimedia.org/viewvc/mediawiki/trunk/extensions/examples/SpecialI...
Looks simpler to manage for a newcomer to PHP.
- sf
Jim Hu wrote:
What MW/php versions are you using? I didn't have to explicitly include, but I think MW autoloads the classes, which doesn't work in PHP4. That's my handwaving guess - the real experts can confirm or deny.
Jim On Apr 15, 2007, at 6:54 PM, Steve Finkelstein wrote:
When writing a SpecialPage, I receive the following error:
PHP Fatal error: Class 'SpecialPage' not found
Do I have to explicitly include SpecialPage.php in my code? It doesn't list it as such in the page listed below by Jim.
- sf
Jim Hu wrote:
I found the frameworks on this page to be helpful in building special pages
http://meta.wikimedia.org/wiki/Writing_a_new_special_page
Jim On Apr 14, 2007, at 4:15 PM, Ian Smith wrote:
So, you have a script which basically pops up an HTML form? Sounds like you want to make a new special page. This would be a page that you can link to, and which can access MW's security features - so you can restrict it to people who have confirmed email addresses, eg.
Find another extension that does something similar, and merge your code into it.
Ian
-----Original Message----- From: Steve Finkelstein [mailto:sf@stevefink.net] Sent: Saturday, April 14, 2007 12:53 PM Pacific Standard Time To: mediawiki-l@lists.wikimedia.org Subject: [Mediawiki-l] Tie in a script?
All,
Not sure what the correct terminology is, assuming it might be a hook or extension. Either way - I have existing scripts which I've written in PHP that simply allow users to change their LDAP password, etc. I'm looking to throw this code (it's just a form with basic PHP+LDAP support) into MediaWiki so users can change their password from there. Currently I have it linked as an external link and for security purposes, this isn't favorable.
Is there any suggestions on how I can begin to go about this? The correct documentation etc would be much preferred.
Thanks all!
- Steve
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
===================================== Jim Hu Associate Professor Dept. of Biochemistry and Biophysics 2128 TAMU Texas A&M Univ. College Station, TX 77843-2128 979-862-4054
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
===================================== Jim Hu Associate Professor Dept. of Biochemistry and Biophysics 2128 TAMU Texas A&M Univ. College Station, TX 77843-2128 979-862-4054
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
!DSPAM:1020,4622bc678211644115261!
Hmm... seems like it should have worked then. But if there's an easier example go for it! I'll take a look at that myself.
On Apr 15, 2007, at 8:20 PM, Steve Finkelstein wrote:
MW - 1.9.3 PHP - 5.2.0
I've been referred to take a look at http://svn.wikimedia.org/viewvc/mediawiki/trunk/extensions/examples/ SpecialIncludable.php?revision=19503&view=markup
Looks simpler to manage for a newcomer to PHP.
- sf
Jim Hu wrote:
What MW/php versions are you using? I didn't have to explicitly include, but I think MW autoloads the classes, which doesn't work in PHP4. That's my handwaving guess - the real experts can confirm or deny.
Jim On Apr 15, 2007, at 6:54 PM, Steve Finkelstein wrote:
When writing a SpecialPage, I receive the following error:
PHP Fatal error: Class 'SpecialPage' not found
Do I have to explicitly include SpecialPage.php in my code? It doesn't list it as such in the page listed below by Jim.
- sf
Jim Hu wrote:
I found the frameworks on this page to be helpful in building special pages
http://meta.wikimedia.org/wiki/Writing_a_new_special_page
Jim On Apr 14, 2007, at 4:15 PM, Ian Smith wrote:
So, you have a script which basically pops up an HTML form? Sounds like you want to make a new special page. This would be a page that you can link to, and which can access MW's security features - so you can restrict it to people who have confirmed email addresses, eg.
Find another extension that does something similar, and merge your code into it.
Ian
-----Original Message----- From: Steve Finkelstein [mailto:sf@stevefink.net] Sent: Saturday, April 14, 2007 12:53 PM Pacific Standard Time To: mediawiki-l@lists.wikimedia.org Subject: [Mediawiki-l] Tie in a script?
All,
Not sure what the correct terminology is, assuming it might be a hook or extension. Either way - I have existing scripts which I've written in PHP that simply allow users to change their LDAP password, etc. I'm looking to throw this code (it's just a form with basic PHP+LDAP support) into MediaWiki so users can change their password from there. Currently I have it linked as an external link and for security purposes, this isn't favorable.
Is there any suggestions on how I can begin to go about this? The correct documentation etc would be much preferred.
Thanks all!
- Steve
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
===================================== Jim Hu Associate Professor Dept. of Biochemistry and Biophysics 2128 TAMU Texas A&M Univ. College Station, TX 77843-2128 979-862-4054
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
===================================== Jim Hu Associate Professor Dept. of Biochemistry and Biophysics 2128 TAMU Texas A&M Univ. College Station, TX 77843-2128 979-862-4054
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
!DSPAM:1020,4622bc678211644115261!
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
===================================== Jim Hu Associate Professor Dept. of Biochemistry and Biophysics 2128 TAMU Texas A&M Univ. College Station, TX 77843-2128 979-862-4054
Thanks again Jim.
I almost got it working with the following code: http://www.stevefink.net/mediawiki/ldaptools_body.php
My only issue here is with the following line:
$wgOut->addHTML('<form method="POST" action="'.$_SERVER['PHP_SELF'].'">');
This posts to the page and rewrites the URL as
https://host.foo.com/index.php/$_SERVER%5B%27PHP_SELF%27%5D
and completely breaks my form.
I think if I can get that fixed, my special page will be golden.
Any advice would be appreciated!
- sf
Jim Hu wrote:
Hmm... seems like it should have worked then. But if there's an easier example go for it! I'll take a look at that myself.
On Apr 15, 2007, at 8:20 PM, Steve Finkelstein wrote:
MW - 1.9.3 PHP - 5.2.0
I've been referred to take a look at http://svn.wikimedia.org/viewvc/mediawiki/trunk/extensions/examples/ SpecialIncludable.php?revision=19503&view=markup
Looks simpler to manage for a newcomer to PHP.
- sf
Jim Hu wrote:
What MW/php versions are you using? I didn't have to explicitly include, but I think MW autoloads the classes, which doesn't work in PHP4. That's my handwaving guess - the real experts can confirm or deny.
Jim On Apr 15, 2007, at 6:54 PM, Steve Finkelstein wrote:
When writing a SpecialPage, I receive the following error:
PHP Fatal error: Class 'SpecialPage' not found
Do I have to explicitly include SpecialPage.php in my code? It doesn't list it as such in the page listed below by Jim.
- sf
Jim Hu wrote:
I found the frameworks on this page to be helpful in building special pages
http://meta.wikimedia.org/wiki/Writing_a_new_special_page
Jim On Apr 14, 2007, at 4:15 PM, Ian Smith wrote:
So, you have a script which basically pops up an HTML form? Sounds like you want to make a new special page. This would be a page that you can link to, and which can access MW's security features - so you can restrict it to people who have confirmed email addresses, eg.
Find another extension that does something similar, and merge your code into it.
Ian
-----Original Message----- From: Steve Finkelstein [mailto:sf@stevefink.net] Sent: Saturday, April 14, 2007 12:53 PM Pacific Standard Time To: mediawiki-l@lists.wikimedia.org Subject: [Mediawiki-l] Tie in a script?
All,
Not sure what the correct terminology is, assuming it might be a hook or extension. Either way - I have existing scripts which I've written in PHP that simply allow users to change their LDAP password, etc. I'm looking to throw this code (it's just a form with basic PHP+LDAP support) into MediaWiki so users can change their password from there. Currently I have it linked as an external link and for security purposes, this isn't favorable.
Is there any suggestions on how I can begin to go about this? The correct documentation etc would be much preferred.
Thanks all!
- Steve
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
===================================== Jim Hu Associate Professor Dept. of Biochemistry and Biophysics 2128 TAMU Texas A&M Univ. College Station, TX 77843-2128 979-862-4054
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
===================================== Jim Hu Associate Professor Dept. of Biochemistry and Biophysics 2128 TAMU Texas A&M Univ. College Station, TX 77843-2128 979-862-4054
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
===================================== Jim Hu Associate Professor Dept. of Biochemistry and Biophysics 2128 TAMU Texas A&M Univ. College Station, TX 77843-2128 979-862-4054
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
!DSPAM:1020,4622c69f13307424076780!
Steve
I confess that in my Special page I just load up all the HTML is a single string variable $output and then do
$wgOut->addHTML( $output );
Also, I may be doing something that will break in some browsers, but I thought self was the default for <form method="POST">. I don't bother to send the URL back to the Special page and it seems to work in Safari and Firefox on the Mac, and in whatever browsers my students are using.
Jim
On Apr 15, 2007, at 11:31 PM, Steve Finkelstein wrote:
Thanks again Jim.
I almost got it working with the following code: http://www.stevefink.net/mediawiki/ldaptools_body.php
My only issue here is with the following line:
$wgOut->addHTML('<form method="POST"
action="'.$_SERVER['PHP_SELF'].'">');
This posts to the page and rewrites the URL as
https://host.foo.com/index.php/$_SERVER%5B%27PHP_SELF%27%5D
and completely breaks my form.
I think if I can get that fixed, my special page will be golden.
Any advice would be appreciated!
- sf
Jim Hu wrote:
Hmm... seems like it should have worked then. But if there's an easier example go for it! I'll take a look at that myself.
On Apr 15, 2007, at 8:20 PM, Steve Finkelstein wrote:
MW - 1.9.3 PHP - 5.2.0
I've been referred to take a look at http://svn.wikimedia.org/viewvc/mediawiki/trunk/extensions/examples/ SpecialIncludable.php?revision=19503&view=markup
Looks simpler to manage for a newcomer to PHP.
- sf
Jim Hu wrote:
What MW/php versions are you using? I didn't have to explicitly include, but I think MW autoloads the classes, which doesn't work in PHP4. That's my handwaving guess - the real experts can confirm or deny.
Jim On Apr 15, 2007, at 6:54 PM, Steve Finkelstein wrote:
When writing a SpecialPage, I receive the following error:
PHP Fatal error: Class 'SpecialPage' not found
Do I have to explicitly include SpecialPage.php in my code? It doesn't list it as such in the page listed below by Jim.
- sf
Jim Hu wrote:
I found the frameworks on this page to be helpful in building special pages
http://meta.wikimedia.org/wiki/Writing_a_new_special_page
Jim On Apr 14, 2007, at 4:15 PM, Ian Smith wrote:
> So, you have a script which basically pops up an HTML form? > Sounds > like you want to make a new special page. This would be a page > that you can link to, and which can access MW's security > features - > so you can restrict it to people who have confirmed email > addresses, eg. > > Find another extension that does something similar, and merge > your > code into it. > > Ian > > -----Original Message----- > From: Steve Finkelstein [mailto:sf@stevefink.net] > Sent: Saturday, April 14, 2007 12:53 PM Pacific Standard Time > To: mediawiki-l@lists.wikimedia.org > Subject: [Mediawiki-l] Tie in a script? > > All, > > Not sure what the correct terminology is, assuming it might be a > hook or > extension. Either way - I have existing scripts which I've > written in > PHP that simply allow users to change their LDAP password, etc. > I'm > looking to throw this code (it's just a form with basic PHP+LDAP > support) into MediaWiki so users can change their password from > there. > Currently I have it linked as an external link and for security > purposes, this isn't favorable. > > Is there any suggestions on how I can begin to go about this? > The > correct documentation etc would be much preferred. > > Thanks all! > > - Steve > > _______________________________________________ > MediaWiki-l mailing list > MediaWiki-l@lists.wikimedia.org > http://lists.wikimedia.org/mailman/listinfo/mediawiki-l > > _______________________________________________ > MediaWiki-l mailing list > MediaWiki-l@lists.wikimedia.org
> http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Jim Hu Associate Professor Dept. of Biochemistry and Biophysics 2128 TAMU Texas A&M Univ. College Station, TX 77843-2128 979-862-4054
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
===================================== Jim Hu Associate Professor Dept. of Biochemistry and Biophysics 2128 TAMU Texas A&M Univ. College Station, TX 77843-2128 979-862-4054
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
===================================== Jim Hu Associate Professor Dept. of Biochemistry and Biophysics 2128 TAMU Texas A&M Univ. College Station, TX 77843-2128 979-862-4054
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
!DSPAM:1020,4622c69f13307424076780!
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
===================================== Jim Hu Associate Professor Dept. of Biochemistry and Biophysics 2128 TAMU Texas A&M Univ. College Station, TX 77843-2128 979-862-4054
On 16/04/07, Steve Finkelstein sf@stevefink.net wrote:
$wgOut->addHTML('<form method="POST"
action="'.$_SERVER['PHP_SELF'].'">');
Variables won't be interpolated inside single quotes. Use something like:
global $wgTitle; $action = $wgTitle->escapeLocalUrl(); $wgOut->addHtml( "<form method="post" action="{$action}">" );
[The use of $wgTitle, or another constructed Title object representing the special page, is the standard method of obtaining a canonical URL in MediaWiki.]
Rob Church
Hi Rob,
I've tried your method and it's the same as omitting an action all together, which posts to PHP_SELF. The form ends up redirecting to a bad title page:
Bad title
From MedLime
Jump to: navigation, search
The requested page title was invalid, empty, or an incorrectly linked inter-language or inter-wiki title. It may contain one or more characters which cannot be used in titles.
Return to Main Page.
- Steve
Rob Church wrote:
On 16/04/07, Steve Finkelstein sf@stevefink.net wrote:
$wgOut->addHTML('<form method="POST"
action="'.$_SERVER['PHP_SELF'].'">');
Variables won't be interpolated inside single quotes. Use something like:
global $wgTitle; $action = $wgTitle->escapeLocalUrl(); $wgOut->addHtml( "<form method="post" action="{$action}">" );
[The use of $wgTitle, or another constructed Title object representing the special page, is the standard method of obtaining a canonical URL in MediaWiki.]
Rob Church
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
!DSPAM:1020,462331af64813712038390!
I hate replying to my own e-mail. However, after some discussion with more savvy MediaWiki type on IRC, its been discovered that MediaWiki does not like POST requests via forms, at least for SpecialPages. When I hit submit on my form using code from http://stevefink.net/mediawiki/ldaptools_body.php, a blank page comes up.
If anyone has any idea if there is a workaround, or if it's not possible so I can exhaust my efforts, that would be great.
Thanks much,
- sf
Steve Finkelstein wrote:
Hi Rob,
I've tried your method and it's the same as omitting an action all together, which posts to PHP_SELF. The form ends up redirecting to a bad title page:
Bad title From MedLime Jump to: navigation, search
The requested page title was invalid, empty, or an incorrectly linked inter-language or inter-wiki title. It may contain one or more characters which cannot be used in titles.
Return to Main Page.
- Steve
Rob Church wrote:
On 16/04/07, Steve Finkelstein sf@stevefink.net wrote:
$wgOut->addHTML('<form method="POST"
action="'.$_SERVER['PHP_SELF'].'">');
Variables won't be interpolated inside single quotes. Use something like:
global $wgTitle; $action = $wgTitle->escapeLocalUrl(); $wgOut->addHtml( "<form method="post" action="{$action}">" );
[The use of $wgTitle, or another constructed Title object representing the special page, is the standard method of obtaining a canonical URL in MediaWiki.]
Rob Church
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
!DSPAM:1020,4623873e109307424076780!
Hi Steve,
I'm confused about what you want to do. I just did an experiment using the Includable example you linked to. I replaced the function execute with:
function execute( $par = null ) { global $wgOut, $wgRequest; if ( $this->including() ) $out = "I'm being included"; else { $out = "I'm being viewed as a Special Page"; $this->foo = $wgRequest->getText('foo'); $out .= " Last submission:".$this->foo; $out .= "<form method='post'><input name='foo' type='text' value='".$this->foo."' size='20' maxlength='255'></form>"; $this->setHeaders(); }
$wgOut->addHtml( $out ); } }
It shows as Special:Includable and prints whatever was entered into the single input box to the screen when it reloads (I just submitted with return; if I was doing this for a real page I would add a submit button)
Hope this helps.
Jim
On Apr 16, 2007, at 11:13 AM, Steve Finkelstein wrote:
I hate replying to my own e-mail. However, after some discussion with more savvy MediaWiki type on IRC, its been discovered that MediaWiki does not like POST requests via forms, at least for SpecialPages. When I hit submit on my form using code from http://stevefink.net/mediawiki/ldaptools_body.php, a blank page comes up.
If anyone has any idea if there is a workaround, or if it's not possible so I can exhaust my efforts, that would be great.
Thanks much,
- sf
Steve Finkelstein wrote:
Hi Rob,
I've tried your method and it's the same as omitting an action all together, which posts to PHP_SELF. The form ends up redirecting to a bad title page:
Bad title From MedLime Jump to: navigation, search
The requested page title was invalid, empty, or an incorrectly linked inter-language or inter-wiki title. It may contain one or more characters which cannot be used in titles.
Return to Main Page.
- Steve
Rob Church wrote:
On 16/04/07, Steve Finkelstein sf@stevefink.net wrote:
$wgOut->addHTML('<form method="POST"
action="'.$_SERVER['PHP_SELF'].'">');
Variables won't be interpolated inside single quotes. Use something like:
global $wgTitle; $action = $wgTitle->escapeLocalUrl(); $wgOut->addHtml( "<form method="post" action="{$action}">" );
[The use of $wgTitle, or another constructed Title object representing the special page, is the standard method of obtaining a canonical URL in MediaWiki.]
Rob Church
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
!DSPAM:1020,4623873e109307424076780!
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
===================================== Jim Hu Associate Professor Dept. of Biochemistry and Biophysics 2128 TAMU Texas A&M Univ. College Station, TX 77843-2128 979-862-4054
Jim,
Thanks for all the responses.
We got my code working with POSTing a simple HTML form using SpecialPages. The problem is I was using exit(); in my code. This affected output which is buffered in MediaWiki. Thanks to lch on IRC for the find.
- Steve
Jim Hu wrote:
Hi Steve,
I'm confused about what you want to do. I just did an experiment using the Includable example you linked to. I replaced the function execute with:
function execute( $par = null ) { global $wgOut, $wgRequest; if ( $this->including() ) $out = "I'm being included"; else { $out = "I'm being viewed as a Special Page"; $this->foo = $wgRequest->getText('foo'); $out .= " Last submission:".$this->foo; $out .= "<form method='post'><input name='foo' type='text'
value='".$this->foo."' size='20' maxlength='255'></form>"; $this->setHeaders(); }
$wgOut->addHtml( $out ); }
}
It shows as Special:Includable and prints whatever was entered into the single input box to the screen when it reloads (I just submitted with return; if I was doing this for a real page I would add a submit button)
Hope this helps.
Jim
On Apr 16, 2007, at 11:13 AM, Steve Finkelstein wrote:
I hate replying to my own e-mail. However, after some discussion with more savvy MediaWiki type on IRC, its been discovered that MediaWiki does not like POST requests via forms, at least for SpecialPages. When I hit submit on my form using code from http://stevefink.net/mediawiki/ldaptools_body.php, a blank page comes up.
If anyone has any idea if there is a workaround, or if it's not possible so I can exhaust my efforts, that would be great.
Thanks much,
- sf
Steve Finkelstein wrote:
Hi Rob,
I've tried your method and it's the same as omitting an action all together, which posts to PHP_SELF. The form ends up redirecting to a bad title page:
Bad title From MedLime Jump to: navigation, search
The requested page title was invalid, empty, or an incorrectly linked inter-language or inter-wiki title. It may contain one or more characters which cannot be used in titles.
Return to Main Page.
- Steve
Rob Church wrote:
On 16/04/07, Steve Finkelstein sf@stevefink.net wrote:
$wgOut->addHTML('<form method="POST"
action="'.$_SERVER['PHP_SELF'].'">');
Variables won't be interpolated inside single quotes. Use something like:
global $wgTitle; $action = $wgTitle->escapeLocalUrl(); $wgOut->addHtml( "<form method="post" action="{$action}">" );
[The use of $wgTitle, or another constructed Title object representing the special page, is the standard method of obtaining a canonical URL in MediaWiki.]
Rob Church
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
===================================== Jim Hu Associate Professor Dept. of Biochemistry and Biophysics 2128 TAMU Texas A&M Univ. College Station, TX 77843-2128 979-862-4054
MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
!DSPAM:1020,46239900120161259319195!
I know part of the requirements for asking questions on this list are to know what you are talking about, but unfortunately I don't follow directions too well ;) I hope someone can help me anyways.
I just finished installation of Media wiki. I copied the localsettings.php file to the parent directory, and followed the link that it gave me which brought me to my new blank wiki. Before I had a chance to do anything I accidentally closed the browser window. Now I cannot get into the wiki. It is saying there is an internal server error or misconfiguration. Here is a link to the page with the error. www.drsecrets.com/wiki
Does anyone know how I managed to screw this up? And more importantly how I go about fixing it?
Thank you very much! Mike
--------------------------------- Ahhh...imagining that irresistible "new car" smell? Check outnew cars at Yahoo! Autos.
mediawiki-l@lists.wikimedia.org