$errs["SysopPass2"] = "Passwords don't match!";
}
-$conf->License = importPost( "License", "none" );
+$conf->License = importRequest( "License", "none" );
if( $conf->License == "gfdl" ) {
$conf->RightsUrl = "http://www.gnu.org/copyleft/fdl.html";
$conf->RightsText = "GNU Free Documentation License 1.2";
} elseif( $conf->License == "none" ) {
$conf->RightsUrl = $conf->RightsText = $conf->RightsCode = $conf->RightsIcon = "";
} else {
- $conf->RightsUrl = importPost( "RightsUrl", "" );
- $conf->RightsText = importPost( "RightsText", "" );
- $conf->RightsCode = importPost( "RightsCode", "" );
- $conf->RightsIcon = importPost( "RightsIcon", "" );
+ $conf->RightsUrl = importRequest( "RightsUrl", "" );
+ $conf->RightsText = importRequest( "RightsText", "" );
+ $conf->RightsCode = importRequest( "RightsCode", "" );
+ $conf->RightsIcon = importRequest( "RightsIcon", "" );
}
if( $conf->posted && ( 0 == count( $errs ) ) ) {
$icon = urlencode( "$wgServer$wgUploadPath/wiki.png" );
$ccApp = htmlspecialchars( "http://creativecommons.org/license/?partner=$partner&exit_url=$exit&partner_icon_url=$icon" );
print "<a href=\"$ccApp\">choose</a>";
- ?></li>
- <li><?php aField( $conf, "RightsUrl", $conf->RightsUrl, "hidden" ); ?></li>
- <li><?php aField( $conf, "RightsText", $conf->RightsText, "hidden" ); ?></li>
- <li><?php aField( $conf, "RightsCode", $conf->RightsCode, "hidden" ); ?></li>
- <li><?php aField( $conf, "RightsIcon", $conf->RightsIcon, "hidden" ); ?></li>
+ ?> (link will wipe out any other data in this form!)
+ <?php if( $conf->License == "cc" ) { ?>
+ <ul>
+ <li><?php aField( $conf, "RightsIcon", "<img src=\"" . htmlspecialchars( $conf->RightsIcon ) . "\" alt='icon' />", "hidden" ); ?></li>
+ <li><?php aField( $conf, "RightsText", htmlspecialchars( $conf->RightsText ), "hidden" ); ?></li>
+ <li><?php aField( $conf, "RightsCode", "code: " . htmlspecialchars( $conf->RightsCode ), "hidden" ); ?></li>
+ <li><?php aField( $conf, "RightsUrl", "<a href=\"" . htmlspecialchars( $conf->RightsUrl ) . "\">" . htmlspecialchars( $conf->RightsUrl ) . "</a>", "hidden" ); ?></li>
+ </ul>
+ <?php } ?>
+ </li>
</ul>
</dd>
<dt>
die( $text . "\n\n</body>\n</html>" );
}
-function importPost( $name, $default = "" ) {
- if( isset( $_POST[$name] ) ) {
- $retval = $_POST[$name];
+function importVar( &$var, $name, $default = "" ) {
+ if( isset( $var[$name] ) ) {
+ $retval = $var[$name];
if ( get_magic_quotes_gpc() ) {
$retval = stripslashes( $retval );
}
return $retval;
}
+function importPost( $name, $default = "" ) {
+ return importVar( $_POST, $name, $default );
+}
+
+function importRequest( $name, $default = "" ) {
+ return importVar( $_REQUEST, $name, $default );
+}
+
function aField( &$conf, $field, $text, $type = "", $value = "" ) {
if( $type != "" ) {
$xtype = "type=\"$type\"";