[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r4179 - in i18nHTML/src: admin i18nHTML
From: |
grothoff |
Subject: |
[GNUnet-SVN] r4179 - in i18nHTML/src: admin i18nHTML |
Date: |
Wed, 3 Jan 2007 21:09:19 -0800 (PST) |
Author: grothoff
Date: 2007-01-03 21:09:13 -0800 (Wed, 03 Jan 2007)
New Revision: 4179
Modified:
i18nHTML/src/admin/accounts.php
i18nHTML/src/admin/add_language.php
i18nHTML/src/admin/commitMassTranslation.php
i18nHTML/src/admin/commitTranslation.php
i18nHTML/src/admin/editor.php
i18nHTML/src/admin/index.php
i18nHTML/src/admin/languages.php
i18nHTML/src/admin/login.php
i18nHTML/src/admin/login_form.php
i18nHTML/src/admin/signup.php
i18nHTML/src/admin/signup_form.php
i18nHTML/src/admin/status.php
i18nHTML/src/admin/tables.php
i18nHTML/src/admin/vote.php
i18nHTML/src/i18nHTML/i18nhtml.php
Log:
stuff
Modified: i18nHTML/src/admin/accounts.php
===================================================================
--- i18nHTML/src/admin/accounts.php 2007-01-03 22:37:36 UTC (rev 4178)
+++ i18nHTML/src/admin/accounts.php 2007-01-04 05:09:13 UTC (rev 4179)
@@ -26,7 +26,7 @@
generateLanguageBar();
H2("i18nHTML account administration");
-if ( (uid <= 0) || ($level <= 0) ) {
+if ( ($uid <= 0) || ($level <= 0) ) {
W("Only authorized users can administer accounts.");
die();
}
@@ -45,17 +45,21 @@
echo "<table border=2>";
echo "<tr><th>Login</th><th>Real
name</th><th>Level</th><th>Actions</th></tr>\n";
while ($num-- > 0) {
- $row = mysql_fetch_array($row);
- $log = $row['login'];
+ $row = mysql_fetch_array($result);
+ $log = $row['username'];
$rn = $row['realname'];
$lev = $row['level'];
$cid = $row['uid'];
echo "<tr><td>$log</td><td>$rn</td><td>$lev</td>";
echo "<td>";
- echo "<a href=\"manage_account.php?cid=$cid&action=delete\">delete</a>,";
- echo "<a href=\"manage_account.php?cid=$cid&action=kill\">kill</a>,";
- echo "<a href=\"manage_account.php?cid=$cid&action=promote\">promote</a>,";
- echo "<a href=\"manage_account.php?cid=$cid&action=demote\">demote</a>";
+ if ($log != "legacy") {
+ echo "<a href=\"manage_account.php?cid=$cid&action=delete\">delete</a>,";
+ echo "<a href=\"manage_account.php?cid=$cid&action=kill\">kill</a>,";
+ echo "<a href=\"manage_account.php?cid=$cid&action=promote\">promote</a>,";
+ echo "<a href=\"manage_account.php?cid=$cid&action=demote\">demote</a>";
+ } else {
+ echo "none";
+ }
echo "</td></tr>\n";
}
echo "</table>";
Modified: i18nHTML/src/admin/add_language.php
===================================================================
--- i18nHTML/src/admin/add_language.php 2007-01-03 22:37:36 UTC (rev 4178)
+++ i18nHTML/src/admin/add_language.php 2007-01-04 05:09:13 UTC (rev 4179)
@@ -23,7 +23,6 @@
echo "<html><head>";
TITLE("i18nHTML language addition");
echo "</head><body>";
-generateLanguageBar();
if ($uid != 1) {
W("Only the administrator can add new languages.");
die();
@@ -52,6 +51,9 @@
W("Language %s added.",
$newlang);
+BP();
+intlink("languages.php", "Add another language");
+EP();
generateFooter();
echo "</body></html>\n";
?>
\ No newline at end of file
Modified: i18nHTML/src/admin/commitMassTranslation.php
===================================================================
--- i18nHTML/src/admin/commitMassTranslation.php 2007-01-03 22:37:36 UTC
(rev 4178)
+++ i18nHTML/src/admin/commitMassTranslation.php 2007-01-04 05:09:13 UTC
(rev 4179)
@@ -98,5 +98,6 @@
echo "</a>";
if ($t == 1)
translateLink($b);
+generateFooter();
echo "</body></html>";
?>
Modified: i18nHTML/src/admin/commitTranslation.php
===================================================================
--- i18nHTML/src/admin/commitTranslation.php 2007-01-03 22:37:36 UTC (rev
4178)
+++ i18nHTML/src/admin/commitTranslation.php 2007-01-04 05:09:13 UTC (rev
4179)
@@ -75,6 +75,7 @@
W("The number of percent signs in source text and translation does not
match.");
W("Note that you must preserve all %%s expressions unchanged.");
W("Also, a single displayed %% sign must be translated into two (%%%%)
such signs.");
+ generateFooter();
echo "</body></html>";
} else {
$query = "INSERT INTO " . $i18nHTMLsqlPrefix . "map VALUES(\"$text_sql\",
\"$lang\", " .
@@ -91,6 +92,7 @@
echo "</head><body>";
W("Commit ('%s') failed: ", $query);
echo mysql_error();
+ generateFooter();
echo "</body></html>";
}
}
Modified: i18nHTML/src/admin/editor.php
===================================================================
--- i18nHTML/src/admin/editor.php 2007-01-03 22:37:36 UTC (rev 4178)
+++ i18nHTML/src/admin/editor.php 2007-01-04 05:09:13 UTC (rev 4179)
@@ -1,6 +1,6 @@
<?php
/*
- (C) 2003, 2004, 2005 Christian Grothoff
+ (C) 2003, 2004, 2005, 2007 Christian Grothoff
This code is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published
@@ -138,6 +138,7 @@
W("Translations submitted to the webpage must be released to the public domain
to ensure that we will not have any legal trouble.");
W("If you have concerns or remarks regarding this policy, feel free to bring
them to our attention.");
+HR();
generateFooter();
echo "</body></html>\n";
?>
Modified: i18nHTML/src/admin/index.php
===================================================================
--- i18nHTML/src/admin/index.php 2007-01-03 22:37:36 UTC (rev 4178)
+++ i18nHTML/src/admin/index.php 2007-01-04 05:09:13 UTC (rev 4179)
@@ -17,15 +17,17 @@
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
-include("i18nHTML/i18nhtml.php");
-include("login.php");
+include_once("i18nHTML/i18nhtml.php");
+include_once("login.php");
DOCTYPE("HTML", "Transitional");
echo "<html><head>";
TITLE("WWW translation: Administration");
echo "</head><body>";
+generateLanguageBar();
+BP();
W("This is the %s administrative interface.",
extlink_("http://gnunet.org/i18nHTML/","i18nHTML"));
-
+EP();
H2("Translation");
echo "<ul>\n";
@@ -40,12 +42,16 @@
H2("Account management");
echo "<ul>\n";
+
+LILI("logout.php", "Logout");
+
// allow admins to delete accounts (& all translations)
// of lower-level or to grant administrative priviledges
LILI("accounts.php", "Manage acconts");
// have a table with legal languages (for signing up)
LILI("languages.php", "Setup languages");
+
echo "</ul>\n";
Modified: i18nHTML/src/admin/languages.php
===================================================================
--- i18nHTML/src/admin/languages.php 2007-01-03 22:37:36 UTC (rev 4178)
+++ i18nHTML/src/admin/languages.php 2007-01-04 05:09:13 UTC (rev 4179)
@@ -30,20 +30,19 @@
<form name="lang_form" method="post" action="add_language.php">
<table cellspacing="1">
<tr>
-<td width="25%"><?php W("New language");?></td>
-<td width="75%"><input type="text" name="newlang" size="32" maxlength="32"
/></td>
+<td width="25%" align="right"><?php W("New language: ");?></td>
+<td width="75%" align="left"><input type="text" name="newlang" size="16"
maxlength="32" /></td>
</tr>
<tr>
-<td width="25%"><?php W("Default translations apply");?></td>
-<td width="75%"><input type="checkbox" name="def" value="1" /></td>
+<td width="25%" align="right"><?php W("Default translations apply: ");?></td>
+<td width="75%" align="left"><input type="checkbox" name="def" value="1"
/></td>
</tr>
<tr>
-<td colspan="2"><input type="submit" class="button" value="<?php
W("Submit");?>"/></td>
+<td colspan="2" align="center"><input type="submit" class="button"
value="<?php W("Submit");?>"/></td>
</tr>
</table>
</form>
</div>
-<hr>
<?php
generateFooter();
?>
Modified: i18nHTML/src/admin/login.php
===================================================================
--- i18nHTML/src/admin/login.php 2007-01-03 22:37:36 UTC (rev 4178)
+++ i18nHTML/src/admin/login.php 2007-01-04 05:09:13 UTC (rev 4179)
@@ -29,7 +29,7 @@
if ( (isset($_SESSION['username'])) &&
(isset($_SESSION['password'])) ) {
$username = mysql_real_escape_string($_SESSION['username']);
- $password = mysql_real_escape_string(crypt($_SESSION['password']));
+ $password = mysql_real_escape_string(crypt($_SESSION['password'], "salty"));
$query = "SELECT allowed,uid,level FROM " . $i18nHTMLsqlPrefix .
"accounts WHERE username=\"$username\" AND password=\"$password\"";
$result = mysql_query($query, $connection);
@@ -40,7 +40,7 @@
while ($num > 0) {
$row = mysql_fetch_array($result);
$allowed = $row["allowed"];
- if ($allowed == $xlang) {
+ if ($allowed == $lang) {
$uid = $row["uid"];
$level = $row["level"];
break;
@@ -48,13 +48,10 @@
$num--;
}
if ($uid == -1)
- $error_message = W_("Invalid login `%s` or password `%s`!",
- ARRAY($username,
- $password));
+ $error_message = W_("Invalid login or password for selected language!");
}
if ($uid == -1) {
include("login_form.php");
exit();
}
-
?>
\ No newline at end of file
Modified: i18nHTML/src/admin/login_form.php
===================================================================
--- i18nHTML/src/admin/login_form.php 2007-01-03 22:37:36 UTC (rev 4178)
+++ i18nHTML/src/admin/login_form.php 2007-01-04 05:09:13 UTC (rev 4179)
@@ -24,11 +24,17 @@
echo "</head><body>";
generateLanguageBar();
H2("i18nHTML login");
+BP();
if (isset($error_message))
echo $error_message;
+W("Note that your account is tied to a particular language.");
+BR();
+W("The currently selected language is `%s'.",
+ $lang);
+EP();
+echo "<div align=center>\n";
+echo "<form name=\"login_form\" method=\"post\"
action=\"index.php?xlang=$lang\">\n";
?>
-<div align=center>
-<form name="login_form" method="post" action="login.php">
<table cellspacing="1">
<tr>
<td width="25%"><?php W("Login");?></td>
@@ -39,7 +45,7 @@
<td><input type="password" name="password" size="32" maxlength="128" /></td>
</tr>
<tr>
-<td colspan=2><input type="submit" class="button" value="<?php W("Login");?>"
/></td>
+<td colspan=2><input type="submit" class="button" value="<?php
TRANSLATE("Login");?>" /></td>
</tr>
</table>
</form>
Modified: i18nHTML/src/admin/signup.php
===================================================================
--- i18nHTML/src/admin/signup.php 2007-01-03 22:37:36 UTC (rev 4178)
+++ i18nHTML/src/admin/signup.php 2007-01-04 05:09:13 UTC (rev 4179)
@@ -17,14 +17,6 @@
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
-include_once("i18nHTML/i18nhtml.php");
-DOCTYPE("HTML", "Transitional");
-echo "<html><head>";
-TITLE("i18nHTML account creation");
-echo "</head><body>";
-generateLanguageBar();
-H2("i18nHTML account creation");
-
function mkpass($length = 8) {
$password = "";
$possible = "0123456789abcdefghijkmnopqrstuvwxyz";
@@ -45,6 +37,14 @@
$_SESSION['language'] = $_POST['language'];
if (isset($_POST['realname']))
$_SESSION['realname'] = $_POST['realname'];
+
+include_once("i18nHTML/i18nhtml.php");
+DOCTYPE("HTML", "Transitional");
+echo "<html><head>";
+TITLE("i18nHTML account creation");
+echo "</head><body>";
+H2("i18nHTML account creation");
+
if ( (isset($_SESSION['username'])) &&
(isset($_SESSION['language'])) &&
(isset($_SESSION['email'])) ) {
@@ -69,29 +69,30 @@
if ($result)
$num = mysql_numrows($result);
if ($num > 0) {
- $row = mysql_fetch_array($row);
+ $row = mysql_fetch_array($result);
W("Somebody with the name '%s' is already using this login. Please try
another login.\n",
$row['realname']);
} else {
if (mail($email,
"Your i18nHTML password",
- "Somebody, possibly you, requested an i18nHTML account.\n" .
- "If this was not you, ignore this e-mail.\n" .
- "Otherwise, your password is '$password'.")) {
+ "Somebody, possibly you, requested an i18nHTML\naccount $login
for translations\n into $lang.\n\n" .
+ "If this was not you, ignore this e-mail.\n\n" .
+ "Otherwise, your password is '$password'.\n" .
+ "You may want to preserve this e-mail\n" .
+ "since i18nHTML does not allow you to\n" .
+ "recover or change your password later.")) {
$password = mysql_real_escape_string($password);
- $password = crypt($password);
- $query = "INSERT INTO " . $i18nHTMLsqlPrefix . "accounts
VALUES(\"$username\",\"$password\",\"$realname\",\"$language\",0);";
+ $password = crypt($password, "salty");
+ $query = "INSERT INTO " . $i18nHTMLsqlPrefix . "accounts
(username,password,realname,allowed,level)
VALUES(\"$login\",\"$password\",\"$realname\",\"$language\",0);";
mysql_query($query, $connection);
W("E-mail with password sent, login %s.\n",
- extlink_("login.php", "here"));
+ extlink_("login.php?xlang=$language", "here"));
} else {
W("Failed to sent E-mail with password.\n");
}
}
- } else {
- W("Invalid inputs.\n");
}
- }
+}
generateFooter();
echo "</body></html>\n";
?>
\ No newline at end of file
Modified: i18nHTML/src/admin/signup_form.php
===================================================================
--- i18nHTML/src/admin/signup_form.php 2007-01-03 22:37:36 UTC (rev 4178)
+++ i18nHTML/src/admin/signup_form.php 2007-01-04 05:09:13 UTC (rev 4179)
@@ -52,19 +52,24 @@
while ($num-- > 0) {
$row = mysql_fetch_array($result);
$dblang = $row['lang'];
- echo "<input type=\"radio\" name=\"language\" value=\"$dblang\">$dblang
/>";
+ echo "<input type=\"radio\" name=\"language\"
value=\"$dblang\">$dblang</input>";
}
?>
</td>
</tr>
<tr>
-<td colspan="2"><input type="submit" class="button" value="<?php
W("Signup");?>"/></td>
+<td colspan="2"><input type="submit" class="button" value="<?php
TRANSLATE("Signup");?>"/></td>
</tr>
</table>
</form>
</div>
-<hr>
<?php
+W("Note that each account is only authorized for translations into the
selected language.");
+W("You will only be able to login for that particular language.");
+W("If you want to translate to multiple languages, you will need to register
multiple accounts.");
+W("The system does not store your e-mail address in the database.");
+W("As a result, there is no way to recover your password if you loose it!");
+HR();
generateFooter();
?>
</body>
Modified: i18nHTML/src/admin/status.php
===================================================================
--- i18nHTML/src/admin/status.php 2007-01-03 22:37:36 UTC (rev 4178)
+++ i18nHTML/src/admin/status.php 2007-01-04 05:09:13 UTC (rev 4179)
@@ -94,6 +94,10 @@
printf("<tr><td>%s</td><td>%s</td></tr>\n", $a, $b);
}
echo "</table></center>\n";
+BP();
+intlink("index.php", "i18nHTML administration index");
+EP();
+HR();
generateFooter();
echo "</body></html>";
?>
Modified: i18nHTML/src/admin/tables.php
===================================================================
--- i18nHTML/src/admin/tables.php 2007-01-03 22:37:36 UTC (rev 4178)
+++ i18nHTML/src/admin/tables.php 2007-01-04 05:09:13 UTC (rev 4179)
@@ -44,7 +44,7 @@
}
// setup root account
-$query="INSERT INTO ${i18nHTMLsqlPrefix}accounts VALUES (\"root\", \"" .
mysql_real_escape_string(crypt($i18nHTMLsqlAdminPass)) . "\",
\"Administrator\", \"$i18nHTMLsrcLang\", 9999, 1)";
+$query="INSERT INTO ${i18nHTMLsqlPrefix}accounts VALUES (\"root\", \"" .
mysql_real_escape_string(crypt($i18nHTMLsqlAdminPass, "salty")) . "\",
\"Administrator\", \"$i18nHTMLsrcLang\", 9999, 1)";
"INDEX(c(10)), INDEX(lang(4)), INDEX(count))";
echo $query;
mysql_query($query, $connection);
@@ -64,6 +64,6 @@
}
W("Tables created.");
-
+generateFooter();
echo "</body></html>";
?>
\ No newline at end of file
Modified: i18nHTML/src/admin/vote.php
===================================================================
--- i18nHTML/src/admin/vote.php 2007-01-03 22:37:36 UTC (rev 4178)
+++ i18nHTML/src/admin/vote.php 2007-01-04 05:09:13 UTC (rev 4179)
@@ -20,7 +20,7 @@
// This file records votes from users for translations.
// For sentences with multiple translations, the one with the most
// votes is displayed.
-include("i18nHTML/i18nhtml.php");
+include_once("i18nHTML/i18nhtml.php");
include("login.php");
DOCTYPE("HTML", "Transitional");
echo "<html><head>";
@@ -35,7 +35,7 @@
$text_sql = quote_smart($text);
$translation_sql = quote_smart(to_unicode($translation));
-$query = "SELECT ranking FROM ".$i18nHTMLsqlPrefix."map WHERE " .
+$query = "SELECT ranking FROM ${i18nHTMLsqlPrefix}map WHERE " .
"name=\"$text_sql\" AND lang=\"$lang\" AND
translation=\"$translation_sql\"";
$result = mysql_query($query, $connection);
$num = 0;
@@ -44,7 +44,7 @@
if ($num > 0) {
$row = mysql_fetch_array($result);
$ranking = $row["ranking"] + 1;
- $query = "UPDATE ".$i18nHTMLsqlPrefix."map SET ranking=\"$ranking\" WHERE " .
+ $query = "UPDATE ${i18nHTMLsqlPrefix}map SET ranking=\"$ranking\" WHERE " .
"name=\"$text_sql\" AND lang=\"$lang\" AND
translation=\"$translation_sql\"";
mysql_query($query, $connection);
W("Ranking of translation is now: ");
@@ -53,5 +53,7 @@
W("Translation '%s' of '%s' does not exist (bug?).",
ARRAY($translation, $text));
}
+HR();
+generateFooter();
echo "</body></html>\n";
?>
Modified: i18nHTML/src/i18nHTML/i18nhtml.php
===================================================================
--- i18nHTML/src/i18nHTML/i18nhtml.php 2007-01-03 22:37:36 UTC (rev 4178)
+++ i18nHTML/src/i18nHTML/i18nhtml.php 2007-01-04 05:09:13 UTC (rev 4179)
@@ -798,6 +798,8 @@
echo " <a href=\"$back&editor=1\">" . W_("enter translation mode") .
"</a>";
else
W(" Translation Mode Active (for this page only)");
+ echo " ";
+ intlink($i18nHTMLbase, "go to i18nHTML administration page");
echo "</small></center>\n";
}
echo "</p>\n";
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r4179 - in i18nHTML/src: admin i18nHTML,
grothoff <=