* @return string homepage URL.
*/
function getHomePage() {
+ if (!preg_match("/^[a-zA-Z][a-zA-Z0-9+.-]*:/",
+ $this->data_array['homepage'])) {
+ $this->data_array['homepage'] = util_url_prefix() .
+ $this->data_array['homepage'];
+ }
return $this->data_array['homepage'];
}
}
/**
- * Construct the base URL http[s]://forge_name[:port]
+ * Return URL prefix (http:// or https://)
*
- * @return string base URL
+ * @return string URL prefix
*/
-function util_make_base_url() {
+function util_url_prefix() {
if (forge_get_config('use_ssl')) {
- $url = "https://" ;
+ return "https://";
} else {
- $url = "http://" ;
+ return "http://";
}
+}
+
+/**
+ * Construct the base URL http[s]://forge_name[:port]
+ *
+ * @return string base URL
+ */
+function util_make_base_url() {
+ $url = util_url_prefix();
$url .= forge_get_config('web_host') ;
if (forge_get_config('https_port') && (forge_get_config('https_port') != 443)) {
$url .= ":".forge_get_config('https_port') ;
}
return $url;
}
+
/**
* Construct full URL from a relative path
*
// ################# Homepage Link
echo '<div class="public-area-box" rel="doap:homepage">';
- if ( util_check_url($project->getHomePage())) {
- echo util_make_link ($project->getHomePage(), $HTML->getHomePic(_('Home Page')) . ' ' . _('Project Home Page'), false, true);
- } else {
- echo util_make_link ('http://' . $project->getHomePage(), $HTML->getHomePic(_('Home Page')) . ' ' . _('Project Home Page'), false, true);
- }
+ echo util_make_link($project->getHomePage(),
+ $HTML->getHomePic(_('Home Page')) . ' ' .
+ _('Project Home Page'), false, true);
echo "</div>\n";
// ################## ArtifactTypes
-- Roland Mas <lolando@debian.org> Mon, 26 Mar 2012 20:10:13 +0200
-fusionforge (5.2~rc1-2) UNRELEASED; urgency=low
+fusionforge (5.2~rc1-2+) UNRELEASED; urgency=low
+
+ * Updated Debconf translations for Swedish (thanks to Martin Bagge)
+ (closes: #677411).
+ * Fixes to Mediawiki plugin (including for interwiki).
+
+ -- Roland Mas <lolando@debian.org> Thu, 14 Jun 2012 16:05:37 +0200
+
+fusionforge (5.2~rc1-2) unstable; urgency=low
* Use more of the system-provided Jquery.
* Reinstate code running the Mediawiki SQL initialisation code from the
package's postinst (closes: #677373).
- -- Roland Mas <lolando@debian.org> Wed, 13 Jun 2012 17:55:48 +0200
+ -- Roland Mas <lolando@debian.org> Wed, 13 Jun 2012 18:58:30 +0200
fusionforge (5.2~rc1-1) unstable; urgency=low
-# Translation of @PACKAGENAME@ debconf template to Swedish
-# Copyright (C) 2009 Martin Bagge <brother@bsnet.se>
-# This file is distributed under the same license as the @PACKAGENAME@ package.
+# Translation of fusionforge debconf template to Swedish
+# Copyright (C) 2012 Martin Bagge <brother@bsnet.se>
+# This file is distributed under the same license as the fusionforge package.
#
# Martin Ågren <martin.agren@gmail.com>, 2008.
-# Martin Bagge <brother@bsnet.se>, 2009
+# Martin Bagge <brother@bsnet.se>, 2009, 2012
msgid ""
msgstr ""
"Project-Id-Version: @PACKAGENAME@_4.6.99+svn6580-1_sv\n"
"Report-Msgid-Bugs-To: fusionforge@packages.debian.org\n"
"POT-Creation-Date: 2012-05-29 18:26+0200\n"
-"PO-Revision-Date: 2008-07-29 18:44+0200\n"
-"Last-Translator: Martin Ågren <martin.agren@gmail.com>\n"
+"PO-Revision-Date: 2012-06-13 20:58+0100\n"
+"Last-Translator: Martin Bagge / brother <brother@bsnet.se>\n"
"Language-Team: Swedish <debian-l10n-swedish@lists.debian.org>\n"
"Language: sv\n"
"MIME-Version: 1.0\n"
"X-Poedit-Language: Swedish\n"
"X-Poedit-Country: Sweden\n"
"X-Generator: KBabel 1.11.4\n"
-"Plural-Forms: nplurals=2; plural=(n != 1);\n"
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#. Type: string
#. Description
#. Type: string
#. Description
#: ../dsf-in/common.templates:3001
-#, fuzzy
#| msgid "@FORGENAME@/FusionForge system name:"
msgid "@FORGENAME@ system name:"
msgstr "@FORGENAME@ systemnamn:"
#. Type: password
#. Description
#: ../dsf-in/db-postgresql.templates:2001
-#, fuzzy
#| msgid ""
#| "The @FORGENAME@ administrator account will have full privileges on the "
#| "system. It will be used to approve the creation of new projects."
"The @FORGENAME@ administrator account will have full privileges on the "
"forge. It will be used to approve the creation of new projects."
msgstr ""
-"Administratörskontot för @FORGENAME@ kommer att ha alla rättigheter i "
-"@FORGENAME@-systemet. Det behövs för att godkänna skapandet av projekten."
+"Administratörskontot för @FORGENAME@ kommer att ha maximala rättigheter i "
+"forge-systemet. Det behövs för att godkänna skapandet av nya projekt."
#. Type: password
#. Description
#: ../dsf-in/db-postgresql.templates:2001
-#, fuzzy
#| msgid "Please choose the password for this account."
msgid "Please choose the password for this forge account."
-msgstr "Mata in lösenordet för detta konto."
+msgstr "Ange lösenordet för det här forge-kontot."
#. Type: password
#. Description
#. Choices
#: ../dsf-in/db-postgresql.templates:4001
msgid "install the new version configured by @PACKAGE@"
-msgstr ""
+msgstr "installera den nya versionens inställningar för @PACKAGE@"
#. Type: select
#. Choices
#: ../dsf-in/db-postgresql.templates:4001
msgid "keep the local version currently installed"
-msgstr ""
+msgstr "behåll den lokalt justerade versionen som förnärvarande är installerad"
#. Type: select
#. Choices
#: ../dsf-in/db-postgresql.templates:4001
msgid "show the differences between the versions"
-msgstr ""
+msgstr "visa skillnaderna mellan versionerna"
#. Type: select
#. Choices
#: ../dsf-in/db-postgresql.templates:4001
msgid "show a side-by-side difference between the versions"
-msgstr ""
+msgstr "visa skillnaderna mellan versionerna sida-vid-sida"
#. Type: select
#. Choices
#: ../dsf-in/db-postgresql.templates:4001
msgid "start a new shell to examine the situation"
-msgstr ""
+msgstr "starta ett nytt skal för att undersöka situationen"
#. Type: select
#. Description
#: ../dsf-in/db-postgresql.templates:4002
msgid "What do you want to do about configuration file ${BASENAME}?"
-msgstr ""
+msgstr "Vad vill du göra med inställningsfilen ${BASENAME}?"
#. Type: select
#. Description
"The configuration file ${FILE} needs to be modified by @PACKAGE@, whereas it "
"is also a configuration file of the postgresql package."
msgstr ""
+"Inställningsfilen ${FILE} behöver justeras av @PACKAGE@, detta är också "
+"inställningsfilen för postgresql-paketet."
#. Type: boolean
#. Description
. "/$project";
cron_debug("Checking $project...");
+ $res = db_query_params("SET search_path=public", array());
$res = db_query_params('DELETE FROM plugin_mediawiki_interwiki WHERE iw_prefix=$1', array($project));
$url = util_make_url('/plugins/mediawiki/wiki/' . $project . '/index.php/$1');
$res = db_query_params('INSERT INTO plugin_mediawiki_interwiki VALUES ($1, $2, 1, 0)',
*/
require_once("$IP/includes/db/DatabasePostgres.php");
-class DatabaseForge extends DataBasePostgres{
- function DatabaseForge($server=false, $user=false, $password=false,
- $dbName=false, $failFunction=false, $flags=0) {
+class DatabaseForge extends DatabasePostgres {
+ function __construct($server=false, $user=false, $password=false,
+ $dbName=false, $failFunction=false, $flags=0) {
global $wgDBtype;
$wgDBtype = "postgres";
- return DatabasePostgres::DatabasePostgres($server, $user,
- $password, $dbName, $failFunction, $flags);
+ return parent::__construct($server, $user,
+ $password, $dbName, $failFunction, $flags);
}
- function tableName($name) {
+ function fieldInfo($table, $field) {
+ switch ($table) {
+ case 'interwiki':
+ break;
+ default:
+ return DatabasePostgres::fieldInfo($table, $field);
+ }
+
+ global $wgDBmwschema;
+
+ $save_wgDBmwschema = $wgDBmwschema;
+ $wgDBmwschema = 'public';
+ $v = DatabasePostgres::fieldInfo($table, $field);
+ $wgDBmwschema = $save_wgDBmwschema;
+ return $v;
+ }
+
+ function open($server, $user, $password, $dbName) {
+ $v = DatabasePostgres::open($server, $user, $password, $dbName);
+
+ global $wgDBmwschema;
+ if ($this->schemaExists($wgDBmwschema)) {
+ if (method_exists ($this,"addIdentifierQuotes")) {
+ $safeschema = $this->addIdentifierQuotes($wgDBmwschema);
+ } else {
+ $safeschema = $wgDBmwschema;
+ }
+ $this->doQuery("SET search_path TO $safeschema,public");
+ }
+
+ return $v;
+ }
+
+ function query($sql, $fname='', $tempIgnore=false) {
+ /* ugh! */
+ $chk = "ALTER TABLE interwiki ";
+ $csz = strlen($chk);
+ if (substr($sql, 0, $csz) == $chk) {
+ $sql = "ALTER TABLE public.interwiki " .
+ substr($sql, $csz);
+ }
+ return DatabasePostgres::query($sql, $fname,$tempIgnore);
+ }
+
+ function tableName($name, $format='quoted') {
+ global $wgDBmwschema;
+
switch ($name) {
case 'interwiki':
- return 'public.plugin_mediawiki_interwiki';
+ $v = 'plugin_mediawiki_interwiki';
+ break;
default:
- return DatabasePostgres::tableName($name);
+ return DatabasePostgres::tableName($name, $format);
+ }
+
+ if ($wgDBmwschema != 'public') {
+ $v = 'public.' . $v;
}
+ return $v;
}
}
* Mediawiki plugin of FusionForge.
*/
+/* C style inclusion guard. Yes, I know. Don’t comment on it. */
+if (!isset($fusionforge_plugin_mediawiki_LocalSettings_included)) {
+$fusionforge_plugin_mediawiki_LocalSettings_included = true;
+
require_once dirname(__FILE__) . '/../../../www/env.inc.php';
require_once $gfcommon.'include/pre.php';
require_once $gfcommon.'include/RBACEngine.class.php';
$path = array( $IP, "$IP/includes", "$IP/languages" );
set_include_path( implode( PATH_SEPARATOR, $path ) . PATH_SEPARATOR . get_include_path() );
+require_once( "$IP/includes/AutoLoader.php" );
+require_once( "$IP/includes/Defines.php" );
require_once( "$IP/includes/DefaultSettings.php" );
if ( $wgCommandLineMode ) {
die( "This script must be run from the command line\n" );
}
}
+
$g = group_get_object_by_name($fusionforgeproject) ;
$wgSitename = $g->getPublicName() . " Wiki";
$wgScriptPath = "/plugins/mediawiki/wiki/$fusionforgeproject" ;
$user->mId=$mwu->getID();
$user->loadFromId() ;
- $user->loadGroups() ;
$current_groups = $user->getGroups() ;
$available_roles = RBACEngine::getInstance()->getAvailableRoles() ;
// mode: php
// c-file-style: "bsd"
// End:
+
+/* !isset($fusionforge_plugin_mediawiki_LocalSettings_included) */
+}