From: <ste...@us...> - 2013-01-06 22:23:03
|
Revision: 12340 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=12340&view=rev Author: stephenjust Date: 2013-01-06 22:22:55 +0000 (Sun, 06 Jan 2013) Log Message: ----------- [stkaddons] Added "important" flag for news messages Modified Paths: -------------- stkaddons/trunk/include/xmlWrite.php stkaddons/trunk/manage-panel.php stkaddons/trunk/manage.php stkaddons/trunk/table.sql Modified: stkaddons/trunk/include/xmlWrite.php =================================================================== --- stkaddons/trunk/include/xmlWrite.php 2013-01-06 12:12:47 UTC (rev 12339) +++ stkaddons/trunk/include/xmlWrite.php 2013-01-06 22:22:55 UTC (rev 12340) @@ -64,6 +64,9 @@ $writer->writeAttribute('content',$result['content']); if (strlen($result['condition']) > 0) $writer->writeAttribute('condition',$result['condition']); + if ($result['important']) { + $writer->writeAttribute('important', 'true'); + } $writer->endElement(); } @@ -303,6 +306,34 @@ } $writer->fullEndElement(); } + + // Write music section + $writer->startElement('music'); + + $music_query = 'SELECT * FROM `'.DB_PREFIX.'music`'; + $music_handle = sql_query($music_query); + if ($music_handle) { + for ($i = 0; $i < mysql_num_rows($music_handle); $i++) { + $music = mysql_fetch_assoc($music_handle); + + if (!file_exists(UP_LOCATION.'music/'.$music['file'])) { + continue; + } + $writer->startElement('addon'); + $writer->writeAttribute('id', $music['id']); + $writer->writeAttribute('title', $music['title']); + $writer->writeAttribute('artist', $music['artist']); + $writer->writeAttribute('license', $music['license']); + $writer->writeAttribute('gain', $music['gain']); + $writer->writeAttribute('length', $music['length']); + $writer->writeAttribute('file', DOWN_LOCATION.'music/'.$music['file']); + $writer->writeAttribute('size', filesize(UP_LOCATION.'music/'.$music['file'])); + $writer->writeAttribute('xml-filename', $music['xml_filename']); + $writer->endElement(); + } + } + + $writer->fullEndElement(); // End document tag $writer->fullEndElement(); Modified: stkaddons/trunk/manage-panel.php =================================================================== --- stkaddons/trunk/manage-panel.php 2013-01-06 12:12:47 UTC (rev 12339) +++ stkaddons/trunk/manage-panel.php 2013-01-06 22:22:55 UTC (rev 12340) @@ -207,6 +207,7 @@ echo '<td>'.htmlspecialchars(_('Message:')).'</td><td><input type="text" name="message" id="news_message" size="60" maxlength="140" /></td></tr><tr>'; echo '<td>'.htmlspecialchars(_('Condition:')).'</td><td><input type="text" name="condition" id="news_condition" size="60" maxlength="255" /></td></tr><tr>'; echo '<td>'.htmlspecialchars(_('Display on Website:')).'</td><td><input type="checkbox" name="web_display" id="web_display" checked /></td></tr>'; + echo '<td>'.htmlspecialchars(_('Important (creates notification):')).'</td><td><input type="checkbox" name="important" id="important" /></td></tr>'; echo '<td></td><td><input type="submit" value="'.htmlspecialchars(_('Create Message')).'" /></td></tr></table>'; echo '</form>'; echo 'Todo:<ol><li>Allow selecting from a list of conditions rather than typing. Too typo-prone.</li><li>Type semicolon-delimited expressions, e.g. <tt>stkversion > 0.7.0;addonid not installed;</tt>.</li><li>Allow editing in future, in case of goofs or changes.</li></ol>'; @@ -230,6 +231,7 @@ <th>'.htmlspecialchars(_('Author:')).'</th> <th>'.htmlspecialchars(_('Condition:')).'</th> <th>'.htmlspecialchars(_('Web:')).'</th> + <th>'.htmlspecialchars(_('Important:')).'</th> <th>'.htmlspecialchars(_('Actions:')).'</th></tr>'; for ($result = sql_next($handle); $result; $result = sql_next($handle)) { @@ -239,6 +241,7 @@ echo '<td>'.$result['user'].'</td>'; echo '<td>'.$result['condition'].'</td>'; echo '<td>'.$result['web_display'].'</td>'; + echo '<td>'.$result['important'].'</td>'; echo '<td><a href="#" onClick="loadFrame(\'news\', \'manage-panel.php?action=del_news\', '.$result['id'].')">Delete</a></td>'; echo '</tr>'; } Modified: stkaddons/trunk/manage.php =================================================================== --- stkaddons/trunk/manage.php 2013-01-06 12:12:47 UTC (rev 12339) +++ stkaddons/trunk/manage.php 2013-01-06 22:22:55 UTC (rev 12340) @@ -114,6 +114,10 @@ if (!isset($_POST['web_display'])) $_POST['web_display'] = 0; elseif ($_POST['web_display'] == 'on') $_POST['web_display'] = 1; else $_POST['web_display'] = 1; + + if (!isset($_POST['important'])) $_POST['important'] = 0; + elseif ($_POST['important'] == 'on') $_POST['important'] = 1; + else $_POST['important'] = 0; $new_message = mysql_real_escape_string($_POST['message']); $condition = mysql_real_escape_string($_POST['condition']); @@ -128,10 +132,11 @@ } $web_display = (int)$_POST['web_display']; + $important = (int)$_POST['important']; $reqSql = 'INSERT INTO `'.DB_PREFIX."news` - (`author_id`,`content`,`condition`,`web_display`,`active`) + (`author_id`,`content`,`condition`,`important`,`web_display`,`active`) VALUES - ({$_SESSION['userid']},'$new_message','$condition',$web_display,1)"; + ({$_SESSION['userid']},'$new_message','$condition',$important,$web_display,1)"; $handle = sql_query($reqSql); if ($handle) { echo htmlspecialchars(_('Created message.')).'<br />'; Modified: stkaddons/trunk/table.sql =================================================================== --- stkaddons/trunk/table.sql 2013-01-06 12:12:47 UTC (rev 12339) +++ stkaddons/trunk/table.sql 2013-01-06 22:22:55 UTC (rev 12340) @@ -144,6 +144,7 @@ `author_id` int(11) unsigned NOT NULL default '0', `content` char(140) default NULL, `condition` varchar(255) default NULL, + `important` tinyint(1) NOT NULL default '0', `web_display` tinyint(1) NOT NULL default '1', `active` tinyint(1) NOT NULL default '1', `dynamic` int(1) unsigned NOT NULL default '0', This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ste...@us...> - 2013-01-26 20:06:50
|
Revision: 12427 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=12427&view=rev Author: stephenjust Date: 2013-01-26 20:06:38 +0000 (Sat, 26 Jan 2013) Log Message: ----------- [stkaddons] Update Translations Modified Paths: -------------- stkaddons/trunk/CREDITS stkaddons/trunk/image/flags.png stkaddons/trunk/include/Template.class.php stkaddons/trunk/include/menu.php stkaddons/trunk/locale/ca_ES/LC_MESSAGES/translations.mo stkaddons/trunk/locale/de_DE/LC_MESSAGES/translations.mo stkaddons/trunk/locale/es_ES/LC_MESSAGES/translations.mo stkaddons/trunk/locale/fr_FR/LC_MESSAGES/translations.mo stkaddons/trunk/locale/gd_GB/LC_MESSAGES/translations.mo stkaddons/trunk/locale/gen-mo.sh stkaddons/trunk/locale/gl_ES/LC_MESSAGES/translations.mo stkaddons/trunk/locale/hu_HU/LC_MESSAGES/translations.mo stkaddons/trunk/locale/id_ID/LC_MESSAGES/translations.mo stkaddons/trunk/locale/it_IT/LC_MESSAGES/translations.mo stkaddons/trunk/locale/nl_NL/LC_MESSAGES/translations.mo stkaddons/trunk/locale/pt_BR/LC_MESSAGES/translations.mo stkaddons/trunk/locale/ru_RU/LC_MESSAGES/translations.mo stkaddons/trunk/locale/translations-ca.po stkaddons/trunk/locale/translations-de.po stkaddons/trunk/locale/translations-es.po stkaddons/trunk/locale/translations-fr.po stkaddons/trunk/locale/translations-gd.po stkaddons/trunk/locale/translations-gl.po stkaddons/trunk/locale/translations-hu.po stkaddons/trunk/locale/translations-id.po stkaddons/trunk/locale/translations-it.po stkaddons/trunk/locale/translations-nl.po stkaddons/trunk/locale/translations-pt_BR.po stkaddons/trunk/locale/translations-ru.po stkaddons/trunk/locale/translations-zh_TW.po stkaddons/trunk/locale/zh_TW/LC_MESSAGES/translations.mo Added Paths: ----------- stkaddons/trunk/locale/eu_ES/ stkaddons/trunk/locale/eu_ES/LC_MESSAGES/ stkaddons/trunk/locale/eu_ES/LC_MESSAGES/translations.mo stkaddons/trunk/locale/translations-eu.po Modified: stkaddons/trunk/CREDITS =================================================================== --- stkaddons/trunk/CREDITS 2013-01-26 19:29:23 UTC (rev 12426) +++ stkaddons/trunk/CREDITS 2013-01-26 20:06:38 UTC (rev 12427) @@ -5,6 +5,7 @@ == Translations == Adrián Chaves Fernández (gallaecio) +Asier Iturralde Sarasola Auria asciimonster Bendetto Modified: stkaddons/trunk/image/flags.png =================================================================== (Binary files differ) Modified: stkaddons/trunk/include/Template.class.php =================================================================== --- stkaddons/trunk/include/Template.class.php 2013-01-26 19:29:23 UTC (rev 12426) +++ stkaddons/trunk/include/Template.class.php 2013-01-26 20:06:38 UTC (rev 12427) @@ -109,6 +109,7 @@ 'tracks' => File::link('addons.php?type=tracks',htmlspecialchars(_('Tracks'))), 'arenas' => File::link('addons.php?type=arenas',htmlspecialchars(_('Arenas'))), 'about' => File::link('about.php',htmlspecialchars(_('About'))), + 'privacy' => File::link('privacy.php', htmlspecialchars(_('Privacy'))), 'stk_home' => File::link('http://supertuxkart.sourceforge.net',htmlspecialchars(_('STK Homepage'))) ); Template::$smarty->assign('show_welcome',User::$logged_in); @@ -134,8 +135,10 @@ array('ca_ES',-96,-99,'CA'), array('de_DE',0,-33,'DE'), array('es_ES',-96,-66,'ES'), + array('eu-ES', -144, -66, 'EU'), array('fr_FR',0,-66,'FR'), array('ga_IE',0,-99,'GA'), + array('gd_GB',-144, -33,'GD'), array('gl_ES',-48,0,'GL'), array('id_ID',-48,-33,'ID'), array('it_IT',-96,-33,'IT'), Modified: stkaddons/trunk/include/menu.php =================================================================== --- stkaddons/trunk/include/menu.php 2013-01-26 19:29:23 UTC (rev 12426) +++ stkaddons/trunk/include/menu.php 2013-01-26 20:06:38 UTC (rev 12427) @@ -92,8 +92,10 @@ array('ca_ES',-96,-99,'CA'), array('de_DE',0,-33,'DE'), array('es_ES',-96,-66,'ES'), + array('eu-ES', -144, -66, 'EU'), array('fr_FR',0,-66,'FR'), array('ga_IE',0,-99,'GA'), + array('gd_GB',-144, -33,'GD'), array('gl_ES',-48,0,'GL'), array('id_ID',-48,-33,'ID'), array('it_IT',-96,-33,'IT'), Modified: stkaddons/trunk/locale/ca_ES/LC_MESSAGES/translations.mo =================================================================== (Binary files differ) Modified: stkaddons/trunk/locale/de_DE/LC_MESSAGES/translations.mo =================================================================== (Binary files differ) Modified: stkaddons/trunk/locale/es_ES/LC_MESSAGES/translations.mo =================================================================== (Binary files differ) Added: stkaddons/trunk/locale/eu_ES/LC_MESSAGES/translations.mo =================================================================== (Binary files differ) Property changes on: stkaddons/trunk/locale/eu_ES/LC_MESSAGES/translations.mo ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Modified: stkaddons/trunk/locale/fr_FR/LC_MESSAGES/translations.mo =================================================================== (Binary files differ) Modified: stkaddons/trunk/locale/gd_GB/LC_MESSAGES/translations.mo =================================================================== (Binary files differ) Modified: stkaddons/trunk/locale/gen-mo.sh =================================================================== --- stkaddons/trunk/locale/gen-mo.sh 2013-01-26 19:29:23 UTC (rev 12426) +++ stkaddons/trunk/locale/gen-mo.sh 2013-01-26 20:06:38 UTC (rev 12427) @@ -1,5 +1,6 @@ msgfmt translations-ca.po -o ca_ES/LC_MESSAGES/translations.mo msgfmt translations-es.po -o es_ES/LC_MESSAGES/translations.mo +msgfmt translations-eu.po -o eu_ES/LC_MESSAGES/translations.mo msgfmt translations-fr.po -o fr_FR/LC_MESSAGES/translations.mo msgfmt translations-ga.po -o ga_IE/LC_MESSAGES/translations.mo msgfmt translations-gd.po -o gd_GB/LC_MESSAGES/translations.mo Modified: stkaddons/trunk/locale/gl_ES/LC_MESSAGES/translations.mo =================================================================== (Binary files differ) Modified: stkaddons/trunk/locale/hu_HU/LC_MESSAGES/translations.mo =================================================================== (Binary files differ) Modified: stkaddons/trunk/locale/id_ID/LC_MESSAGES/translations.mo =================================================================== (Binary files differ) Modified: stkaddons/trunk/locale/it_IT/LC_MESSAGES/translations.mo =================================================================== (Binary files differ) Modified: stkaddons/trunk/locale/nl_NL/LC_MESSAGES/translations.mo =================================================================== (Binary files differ) Modified: stkaddons/trunk/locale/pt_BR/LC_MESSAGES/translations.mo =================================================================== (Binary files differ) Modified: stkaddons/trunk/locale/ru_RU/LC_MESSAGES/translations.mo =================================================================== (Binary files differ) Modified: stkaddons/trunk/locale/translations-ca.po =================================================================== --- stkaddons/trunk/locale/translations-ca.po 2013-01-26 19:29:23 UTC (rev 12426) +++ stkaddons/trunk/locale/translations-ca.po 2013-01-26 20:06:38 UTC (rev 12427) @@ -7,26 +7,31 @@ msgstr "" "Project-Id-Version: stk\n" "Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n" -"POT-Creation-Date: 2012-06-22 13:23-0600\n" -"PO-Revision-Date: 2012-06-23 14:10+0000\n" +"POT-Creation-Date: 2012-12-12 06:38-0700\n" +"PO-Revision-Date: 2012-12-23 09:56+0000\n" "Last-Translator: Marc Coll Carrillo <Unknown>\n" "Language-Team: Catalan <ca...@li...>\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2012-12-12 19:32+0000\n" -"X-Generator: Launchpad (build 16361)\n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Launchpad-Export-Date: 2013-01-26 19:48+0000\n" +"X-Generator: Launchpad (build 16451)\n" -#: ../about.php:32 ../include/menu.php:84 +#: ../about.php:35 ../include/Template.class.php:111 ../include/menu.php:79 msgid "About" msgstr "Quant a" -#: ../about.php:32 ../addons.php:48 ../login.php:33 ../manage.php:25 -#: ../password-reset.php:25 ../register.php:25 +#: ../about.php:35 ../login.php:112 ../manage.php:25 ../password-reset.php:27 +#: ../register.php:24 msgid "STK Add-ons" msgstr "Complements del STK" -#: ../about.php:43 +#: ../about.php:38 +msgid "About STK Add-Ons" +msgstr "Quant a la web de complements del STK" + +#: ../about.php:42 msgid "" "SuperTuxKart is a Free 3D kart racing game, with many tracks, characters and " "items for you to try." @@ -34,7 +39,7 @@ "SuperTuxKart és un joc de carreres de karts en 3D lliure, amb molts " "circuits, personatges i elements per provar." -#: ../about.php:44 +#: ../about.php:43 msgid "" "Since version 0.7.1, SuperTuxKart has had the ability to fetch important " "messages from the STKAddons website. Since 0.7.2, the game has included a " @@ -44,7 +49,7 @@ "missatges importants des de la web STKAddons. Des de la 0.7.2, el joc inclou " "un gestor de complements integrat." -#: ../about.php:45 +#: ../about.php:44 #, php-format msgid "" "SuperTuxKart now has over %d karts, %d tracks, and %d arenas available in-" @@ -53,7 +58,7 @@ "SuperTuxKart té ara més de %d karts, %d circuits, i %d arenes disponibles " "per jugar gràcies al servei de complements." -#: ../about.php:46 +#: ../about.php:45 msgid "" "Of course, the artists who create all of this content must be thanked too. " "Without them, the add-on website would not be as great as it is today." @@ -62,15 +67,15 @@ "contingut. Sense ells, la web de complements no seria tan estupenda com és " "avui." -#: ../about.php:47 ../about.php:52 +#: ../about.php:46 ../about.php:54 msgid "Donate!" msgstr "Doneu!" -#: ../about.php:47 ../about.php:52 +#: ../about.php:46 ../about.php:54 msgid "Website" msgstr "Lloc web" -#: ../about.php:50 +#: ../about.php:52 msgid "" "TuxFamily is a non-profit organization. It provides free services for " "projects and contents dealing with the free software philosophy (free as in " @@ -82,7 +87,7 @@ "lliure. Accepten qualsevol projecte publicat sota una llicència lliure (GPL, " "BSD, CC-BY-SA, Art Libre...)." -#: ../about.php:51 +#: ../about.php:53 msgid "" "TuxFamily operates the servers on which STKAddons runs, for free. Because of " "them, we can provide the add-on service for SuperTuxKart. Each month, over a " @@ -95,10 +100,6 @@ "molt la seva generositat envers nosaltres i envers altres projectes de codi " "obert." -#: ../about.php:54 -msgid "Credits" -msgstr "Crèdits" - #: ../addons-panel.php:44 msgid "" "This page cannot be loaded because an invalid add-on type was provided." @@ -110,24 +111,26 @@ msgid "Unknown Type" msgstr "Tipus desconegut" -#. I18N: Menu link -#: ../addons.php:39 ../include/menu.php:54 ../include/menu.php:65 -#: ../index.php:68 +#: ../addons.php:39 ../include/Template.class.php:109 ../include/menu.php:49 +#: ../include/menu.php:60 ../index.php:47 msgid "Tracks" msgstr "Circuits" -#. I18N: Menu link -#: ../addons.php:42 ../include/menu.php:59 ../include/menu.php:64 -#: ../index.php:58 +#: ../addons.php:42 ../include/Template.class.php:108 ../include/menu.php:54 +#: ../include/menu.php:59 ../index.php:44 msgid "Karts" msgstr "Karts" -#. I18N: Menu link -#: ../addons.php:45 ../include/menu.php:55 ../include/menu.php:60 -#: ../index.php:78 +#: ../addons.php:45 ../include/Template.class.php:110 ../include/menu.php:50 +#: ../include/menu.php:55 ../index.php:50 msgid "Arenas" msgstr "Arenes" +#. I18N: Index page title +#: ../addons.php:48 ../include/top.php:31 ../index.php:39 ../users.php:38 +msgid "SuperTuxKart Add-ons" +msgstr "Complements del SuperTuxKart" + #: ../addons.php:74 msgid "Invalid addon type." msgstr "Tipus de complement invàlid." @@ -136,61 +139,69 @@ msgid "Saved properties." msgstr "Propietats desades." -#: ../addons.php:115 +#: ../addons.php:104 msgid "Saved status." msgstr "Estat desat." -#: ../addons.php:127 +#: ../addons.php:111 msgid "Saved notes." msgstr "Notes desades." -#: ../addons.php:138 +#: ../addons.php:117 msgid "Deleted addon." msgstr "Complement esborrat." -#: ../addons.php:150 +#: ../addons.php:123 +msgid "Deleted add-on revision." +msgstr "" + +#: ../addons.php:129 msgid "File updated." msgstr "Fitxer actualitzat." -#: ../addons.php:160 +#: ../addons.php:134 msgid "Set image." msgstr "Estableix la imatge." -#: ../addons.php:172 +#: ../addons.php:141 msgid "Set icon." msgstr "Estableix la icona." -#: ../addons.php:182 +#: ../addons.php:146 msgid "Deleted file." msgstr "Fitxer esborrat." +#: ../addons.php:151 +msgid "Marked game versions in which this add-on is included." +msgstr "Marqueu les versions del joc en les que s'inclou aquest complement." + #: ../disabled.php:40 msgid "This page is currently disabled." msgstr "Aquesta pàgina es troba deshabilitada actualment." -#: ../disabled.php:41 ../include/security.php:48 +#: ../disabled.php:41 ../include/AccessControl.class.php:91 msgid "You will be redirected to the home page." msgstr "Sereu redirigit a la pàgina d'inici." #. I18N: Heading for general error page -#: ../error.php:49 +#: ../error.php:48 msgid "An Error Occurred" msgstr "S'ha produït un error" #. I18N: Error message for general error page -#: ../error.php:51 +#: ../error.php:50 msgid "Something broke! We'll try to fix it as soon as we can!" msgstr "" "Alguna cosa s'ha espatllat. Mirarem d'arreglar-ho tan aviat com sigui " "possible." #. I18N: Heading for HTTP 403 Forbidden error page -#: ../error.php:55 +#: ../error.php:54 msgid "403 - Forbidden" msgstr "403 - Prohibit" #. I18N: Error message for HTTP 403 Forbidden error page -#: ../error.php:57 +#: ../error.php:56 msgid "" "You're not supposed to be here. Click one of the links in the menu above to " "find some better content." @@ -199,23 +210,32 @@ "trobar coses més interessants." #. I18N: Heading for HTTP 404 Not Found error page -#: ../error.php:61 +#: ../error.php:60 msgid "404 - Not Found" msgstr "404 - No s'ha trobat" #. I18N: Error message for HTTP 404 Not Found error page -#: ../error.php:63 +#: ../error.php:62 msgid "" "We can't find what you are looking for. The link you followed may be broken." msgstr "" "No s'ha trobat el que esteu buscant. L'enllaç que heu seguit podria estar " "trencat." -#: ../include/Addon.class.php:55 +#: ../include/AccessControl.class.php:90 +msgid "You do not have permission to access this page." +msgstr "No teniu permís per accedir a aquesta pàgina" + +#: ../include/Addon.class.php:57 msgid "The requested add-on does not exist." msgstr "El complement demanat no existeix." -#: ../include/Addon.class.php:125 +#: ../include/Addon.class.php:119 ../include/Addon.class.php:198 +#, php-format +msgid "Texture not found: %s" +msgstr "No s'ha trobat la textura: %s" + +#: ../include/Addon.class.php:133 msgid "" "An add-on with this ID already exists. Please try to upload your add-on " "again later." @@ -223,171 +243,163 @@ "Ja existeix un complement amb aquest ID. Si us plau, proveu de pujar el " "vostre complement més tard." -#: ../include/Addon.class.php:131 +#: ../include/Addon.class.php:139 msgid "The add-on you are trying to create already exists." msgstr "El complement que esteu intentant crear ja existeix." -#: ../include/Addon.class.php:133 +#: ../include/Addon.class.php:141 msgid "Creating a new add-on..." msgstr "S'està creant un nou complement..." -#: ../include/Addon.class.php:149 +#: ../include/Addon.class.php:157 msgid "Your add-on could not be uploaded." msgstr "El vostre complement no s'ha pogut pujar." -#: ../include/Addon.class.php:195 +#: ../include/Addon.class.php:207 msgid "The file you are trying to create already exists." msgstr "El fitxer que esteu intentant crear ja existeix." -#: ../include/Addon.class.php:199 ../include/Addon.class.php:276 -#: ../include/Addon.class.php:324 ../include/parseUpload.php:273 -#: ../users.php:58 ../users.php:75 +#: ../include/Addon.class.php:211 ../include/Addon.class.php:288 +#: ../include/Addon.class.php:339 ../include/Addon.class.php:347 +#: ../include/Upload.class.php:247 ../users.php:58 ../users.php:75 msgid "You do not have the necessary permissions to perform this action." msgstr "No teniu els permisos necessaris per dur a terme aquesta acció." -#: ../include/Addon.class.php:273 +#: ../include/Addon.class.php:285 msgid "You must be logged in to perform this action." msgstr "Heu d'estar connectat per dur a terme aquesta acció." -#: ../include/Addon.class.php:284 +#: ../include/Addon.class.php:299 msgid "Failed to find files associated with this addon." msgstr "No s'han pogut trobar els fitxers associats amb aquest complement." -#: ../include/Addon.class.php:291 +#: ../include/Addon.class.php:306 msgid "Failed to delete file:" msgstr "No s'ha pogut esborrar el fitxer:" -#: ../include/Addon.class.php:299 +#: ../include/Addon.class.php:314 msgid "Failed to remove file records for this addon." msgstr "" "No s'ha pogut eliminar els registres dels fitxers d'aquest complement." -#: ../include/Addon.class.php:304 +#: ../include/Addon.class.php:319 msgid "Failed to remove ratings for this add-on." msgstr "No s'han pogut eliminar les valoracions d'aquest complement." -#: ../include/Addon.class.php:311 +#: ../include/Addon.class.php:326 msgid "Failed to remove add-on revisions." msgstr "No s'ha pogut eliminar les revisions d'aquest complement." -#: ../include/Addon.class.php:315 +#: ../include/Addon.class.php:330 msgid "Failed to remove addon." msgstr "No s'ha pogut eliminar el complement." -#: ../include/Addon.class.php:327 +#: ../include/Addon.class.php:342 msgid "Failed to delete file." msgstr "No s'ha pogut esborrar el fitxer." -#: ../include/Addon.class.php:394 ../include/AddonViewer.class.php:404 -#: ../include/AddonViewer.class.php:571 ../include/AddonViewer.class.php:581 -#: ../include/AddonViewer.class.php:593 ../include/AddonViewer.class.php:596 +#: ../include/Addon.class.php:350 +msgid "The revision you are trying to delete does not exist." +msgstr "La revisió que esteu intentant esborrar no existeix." + +#: ../include/Addon.class.php:352 +msgid "You cannot delete the last revision of an add-on." +msgstr "No podeu esborrar la darrera revisió d'un complement." + +#: ../include/Addon.class.php:354 +msgid "" +"You cannot delete the latest revision of an add-on. Please mark a different " +"revision to be the latest revision first." +msgstr "" +"No podeu esborrar la darrera revisió d'un complement. Si us plau, marqueu " +"abans una altra revisió com la darrera." + +#: ../include/Addon.class.php:358 +msgid "The add-on file could not be queued for deletion." +msgstr "" +"El fitxer del complement no s'ha pogut enviar a la cua per ser esborrat." + +#: ../include/Addon.class.php:366 +msgid "The add-on revision could not be deleted." +msgstr "La revisió del complement no s'ha pogut esborrar." + +#: ../include/Addon.class.php:437 ../include/AddonViewer.class.php:357 +#: ../include/AddonViewer.class.php:539 ../include/AddonViewer.class.php:549 +#: ../include/AddonViewer.class.php:561 ../include/AddonViewer.class.php:564 msgid "Unknown" msgstr "Desconegut" -#: ../include/Addon.class.php:539 ../include/Addon.class.php:560 -#: ../include/Addon.class.php:582 ../include/Addon.class.php:612 +#: ../include/Addon.class.php:620 ../include/Addon.class.php:641 +#: ../include/Addon.class.php:663 ../include/Addon.class.php:676 +#: ../include/Addon.class.php:711 msgid "You do not have the neccessary permissions to perform this action." msgstr "No teniu els permisos necessaris per dur a terme aquesta acció." -#: ../include/Addon.class.php:547 +#: ../include/Addon.class.php:628 msgid "Failed to update the description record for this add-on." msgstr "" "No s'ha pogut actualitzar el registre de la descripció d'aquest complement." -#: ../include/Addon.class.php:568 +#: ../include/Addon.class.php:649 msgid "Failed to update the designer record for this add-on." msgstr "" "No s'ha pogut actualitzar el registre del dissenyador d'aquest complement." -#: ../include/Addon.class.php:590 +#: ../include/Addon.class.php:671 msgid "Failed to update the image record for this add-on." msgstr "" "No s'ha pogut actualitzar el registre de la imatge d'aquest complement." -#: ../include/Addon.class.php:597 +#: ../include/Addon.class.php:696 msgid "Failed to update the license record for this add-on." msgstr "" "No s'ha pogut actualitzar el registre de la llicència d'aquest complement." -#: ../include/Addon.class.php:605 +#: ../include/Addon.class.php:704 msgid "Failed to update the name record for this add-on." msgstr "No s'ha pogut actualitzar el registre del nom d'aquest complement." -#: ../include/AddonViewer.class.php:76 -#, php-format -msgid "Download %s" -msgstr "Descarrega %s" - -#: ../include/AddonViewer.class.php:84 ../include/AddonViewer.class.php:87 -#: ../include/AddonViewer.class.php:288 ../include/AddonViewer.class.php:291 -msgid "File not found." -msgstr "No s'ha trobat el fitxer." - -#: ../include/AddonViewer.class.php:113 ../include/AddonViewer.class.php:127 +#: ../include/AddonViewer.class.php:100 ../include/AddonViewer.class.php:214 msgid "Upload Image" msgstr "Puja una imatge" -#: ../include/AddonViewer.class.php:122 -msgid "Images" -msgstr "Imatges" +#: ../include/AddonViewer.class.php:108 ../manage-panel.php:258 +msgid "Type:" +msgstr "Tipus:" -#: ../include/AddonViewer.class.php:152 -msgid "No images have been uploaded for this addon yet." -msgstr "Encara no s'ha pujat cap imatge per aquest complement." - -#: ../include/AddonViewer.class.php:169 ../include/AddonViewer.class.php:358 -msgid "Unapprove" -msgstr "Rebutja" - -#: ../include/AddonViewer.class.php:171 ../include/AddonViewer.class.php:360 -msgid "Approve" -msgstr "Aprova" - -#: ../include/AddonViewer.class.php:177 -msgid "Set Icon" -msgstr "Estableix la icona" - -#: ../include/AddonViewer.class.php:181 -msgid "Set Image" -msgstr "Estableix la imatge" - -#: ../include/AddonViewer.class.php:183 ../include/AddonViewer.class.php:363 -msgid "Delete File" -msgstr "Esborra el fitxer" - -#: ../include/AddonViewer.class.php:199 +#: ../include/AddonViewer.class.php:109 msgid "Arena" msgstr "Arena" -#: ../include/AddonViewer.class.php:199 ../manage-panel.php:166 -msgid "Type:" -msgstr "Tipus:" - -#: ../include/AddonViewer.class.php:204 ../include/AddonViewer.class.php:405 +#: ../include/AddonViewer.class.php:112 ../include/AddonViewer.class.php:358 msgid "Designer:" msgstr "Dissenyador:" -#: ../include/AddonViewer.class.php:205 +#: ../include/AddonViewer.class.php:116 msgid "Upload date:" msgstr "Pujat el dia:" -#: ../include/AddonViewer.class.php:206 +#: ../include/AddonViewer.class.php:120 msgid "Submitted by:" msgstr "Enviat per:" -#: ../include/AddonViewer.class.php:207 +#: ../include/AddonViewer.class.php:124 msgid "Revision:" msgstr "Revisió:" -#: ../include/AddonViewer.class.php:208 +#: ../include/AddonViewer.class.php:128 msgid "Compatible with:" msgstr "Compatible amb:" -#: ../include/AddonViewer.class.php:210 -msgid "Your Rating: " -msgstr "La vostra valoració: " +#: ../include/AddonViewer.class.php:132 +msgid "License" +msgstr "Llicència" -#: ../include/AddonViewer.class.php:217 +#: ../include/AddonViewer.class.php:136 +msgid "Permalink" +msgstr "Enllaç permanent" + +#: ../include/AddonViewer.class.php:143 msgid "" "Warning: This addon may not display correctly on some systems. It uses " "textures that may not be compatible with all video cards." @@ -396,202 +408,381 @@ "servir textures que podrien no ser compatibles amb totes les targetes " "gràfiques." -#: ../include/AddonViewer.class.php:224 -msgid "License" -msgstr "Llicència" +#: ../include/AddonViewer.class.php:147 +msgid "Your Rating:" +msgstr "La vostra valoració:" -#: ../include/AddonViewer.class.php:232 -msgid "Permalink" -msgstr "Enllaç permanent" +#: ../include/AddonViewer.class.php:154 +#, php-format +msgid "Download %s" +msgstr "Descarrega %s" -#: ../include/AddonViewer.class.php:251 +#: ../include/AddonViewer.class.php:161 +msgid "Download this add-on in game!" +msgstr "Descarregueu-vos aquest complement des del joc!" + +#: ../include/AddonViewer.class.php:169 msgid "Revisions" msgstr "Revisions" -#: ../include/AddonViewer.class.php:257 +#: ../include/AddonViewer.class.php:173 msgid "Upload Revision" msgstr "Puja una revisió" -#: ../include/AddonViewer.class.php:285 +#: ../include/AddonViewer.class.php:200 #, php-format msgid "Download revision %u" msgstr "Descarrega la revisió %u" -#: ../include/AddonViewer.class.php:288 ../include/AddonViewer.class.php:291 -msgid "Revision" -msgstr "Revisió" +#: ../include/AddonViewer.class.php:210 +msgid "Images" +msgstr "Imatges" -#: ../include/AddonViewer.class.php:306 +#: ../include/AddonViewer.class.php:217 +msgid "No images have been uploaded for this addon yet." +msgstr "Encara no s'ha pujat cap imatge per aquest complement." + +#: ../include/AddonViewer.class.php:238 ../include/AddonViewer.class.php:303 +msgid "Unapprove" +msgstr "Rebutja" + +#: ../include/AddonViewer.class.php:240 ../include/AddonViewer.class.php:305 +msgid "Approve" +msgstr "Aprova" + +#: ../include/AddonViewer.class.php:246 +msgid "Set Icon" +msgstr "Estableix la icona" + +#: ../include/AddonViewer.class.php:250 +msgid "Set Image" +msgstr "Estableix la imatge" + +#: ../include/AddonViewer.class.php:252 ../include/AddonViewer.class.php:308 +msgid "Delete File" +msgstr "Esborra el fitxer" + +#: ../include/AddonViewer.class.php:272 msgid "Source Files" msgstr "Fitxers font" -#: ../include/AddonViewer.class.php:311 +#: ../include/AddonViewer.class.php:276 msgid "Upload Source File" msgstr "Puja el fitxer font" -#: ../include/AddonViewer.class.php:339 +#: ../include/AddonViewer.class.php:279 msgid "No source files have been uploaded for this addon yet." msgstr "Encara no s'ha pujat cap fitxer font per aquest complement." -#: ../include/AddonViewer.class.php:350 -msgid "Not Approved" -msgstr "No aprovat" - -#: ../include/AddonViewer.class.php:351 +#: ../include/AddonViewer.class.php:295 #, php-format msgid "Source File %u" msgstr "Fitxer font %u" -#: ../include/AddonViewer.class.php:352 +#: ../include/AddonViewer.class.php:297 +msgid "Not Approved" +msgstr "No aprovat" + +#: ../include/AddonViewer.class.php:298 msgid "Download" msgstr "Descarrega" -#: ../include/AddonViewer.class.php:380 ../include/AddonViewer.class.php:438 +#: ../include/AddonViewer.class.php:333 ../include/AddonViewer.class.php:401 msgid "Featured" msgstr "Destacat" -#: ../include/AddonViewer.class.php:382 ../include/AddonViewer.class.php:432 +#: ../include/AddonViewer.class.php:335 ../include/AddonViewer.class.php:395 msgid "Alpha" msgstr "Alfa" -#: ../include/AddonViewer.class.php:384 ../include/AddonViewer.class.php:433 +#: ../include/AddonViewer.class.php:337 ../include/AddonViewer.class.php:396 msgid "Beta" msgstr "Beta" -#: ../include/AddonViewer.class.php:386 ../include/AddonViewer.class.php:434 +#: ../include/AddonViewer.class.php:339 ../include/AddonViewer.class.php:397 msgid "Release-Candidate" msgstr "Versió provisional" -#: ../include/AddonViewer.class.php:388 ../include/AddonViewer.class.php:437 +#: ../include/AddonViewer.class.php:341 ../include/AddonViewer.class.php:400 msgid "DFSG Compliant" msgstr "Compleix les DFSG" -#: ../include/AddonViewer.class.php:398 +#: ../include/AddonViewer.class.php:351 msgid "You do not have the necessary privileges to perform this action." msgstr "No teniu els privilegis necessaris per dur a terme aquesta acció." -#: ../include/AddonViewer.class.php:400 +#: ../include/AddonViewer.class.php:353 msgid "Configuration" msgstr "Configuració" -#: ../include/AddonViewer.class.php:410 +#: ../include/AddonViewer.class.php:363 msgid "Description:" msgstr "Descripció:" -#: ../include/AddonViewer.class.php:410 +#: ../include/AddonViewer.class.php:363 #, php-format msgid "Max %u characters" msgstr "Màxim %u caràcters" -#: ../include/AddonViewer.class.php:416 +#: ../include/AddonViewer.class.php:369 msgid "Save Properties" msgstr "Desa les propietats" -#: ../include/AddonViewer.class.php:422 +#: ../include/AddonViewer.class.php:375 msgid "Delete Addon" msgstr "Esborra el complement" -#: ../include/AddonViewer.class.php:426 +#: ../include/AddonViewer.class.php:380 +msgid "Included in Game Versions:" +msgstr "Inclós en les versions del joc:" + +#: ../include/AddonViewer.class.php:382 +msgid "Start:" +msgstr "" + +#: ../include/AddonViewer.class.php:383 +msgid "End:" +msgstr "" + +#: ../include/AddonViewer.class.php:384 +msgid "Save" +msgstr "Desa" + +#: ../include/AddonViewer.class.php:389 msgid "Status Flags:" msgstr "Indicadors d'estat:" -#: ../include/AddonViewer.class.php:430 +#: ../include/AddonViewer.class.php:393 msgid "Approved" msgstr "Aprovat" -#: ../include/AddonViewer.class.php:431 +#: ../include/AddonViewer.class.php:394 msgid "Invisible" msgstr "Invisible" -#: ../include/AddonViewer.class.php:435 +#: ../include/AddonViewer.class.php:398 msgid "Latest" msgstr "Més recent" -#: ../include/AddonViewer.class.php:439 +#: ../include/AddonViewer.class.php:402 msgid "Invalid Textures" msgstr "Textures invàlides" -#: ../include/AddonViewer.class.php:446 ../include/AddonViewer.class.php:546 +#: ../include/AddonViewer.class.php:409 ../include/AddonViewer.class.php:514 #, php-format msgid "Rev %u:" msgstr "Rev %u:" -#: ../include/AddonViewer.class.php:537 +#: ../include/AddonViewer.class.php:498 +#, php-format +msgid "Delete revision %d" +msgstr "Esborra la revisió %d" + +#: ../include/AddonViewer.class.php:505 msgid "Save Changes" msgstr "Desa els canvis" -#: ../include/AddonViewer.class.php:541 +#: ../include/AddonViewer.class.php:509 msgid "Notes from Moderator to Submitter:" msgstr "Notes del moderador per a qui l'ha enviat:" -#: ../include/AddonViewer.class.php:558 +#: ../include/AddonViewer.class.php:526 msgid "Save Notes" msgstr "Desa les notes" -#: ../include/File.class.php:33 +#: ../include/File.class.php:39 msgid "Insufficient permissions." msgstr "Permisos insuficients." -#: ../include/File.class.php:53 +#: ../include/File.class.php:78 msgid "The file to extract does not exist." msgstr "El fitxer a extreure no existeix." -#: ../include/File.class.php:65 ../include/File.class.php:94 +#: ../include/File.class.php:90 ../include/File.class.php:119 msgid "Could not open archive file. It may be corrupted." msgstr "No s'ha pogut obrir l'arxiu. Potser està corromput." -#: ../include/File.class.php:69 ../include/File.class.php:98 +#: ../include/File.class.php:94 ../include/File.class.php:123 msgid "Failed to extract archive file." msgstr "No s'ha pogut extreure l'arxiu." -#: ../include/File.class.php:105 +#: ../include/File.class.php:130 msgid "Unknown archive type." msgstr "Tipus d'arxiu desconegut." -#: ../include/File.class.php:118 +#: ../include/File.class.php:281 ../include/Upload.class.php:400 msgid "Unknown file upload error." msgstr "Error desconegut pujant el fitxer." -#: ../include/File.class.php:122 ../include/File.class.php:124 +#: ../include/File.class.php:285 ../include/File.class.php:287 +#: ../include/Upload.class.php:404 ../include/Upload.class.php:406 msgid "Uploaded file is too large." msgstr "El fitxer pujat és massa gran." -#: ../include/File.class.php:126 +#: ../include/File.class.php:289 ../include/Upload.class.php:408 msgid "Uploaded file is incomplete." msgstr "El fitxer pujat està incomplet." -#: ../include/File.class.php:128 +#: ../include/File.class.php:291 ../include/Upload.class.php:410 msgid "No file was uploaded." msgstr "No s'ha pujat cap fitxer." -#: ../include/File.class.php:130 +#: ../include/File.class.php:293 ../include/Upload.class.php:412 msgid "There is no TEMP directory to store the uploaded file in." msgstr "No hi ha cap directori temporal per desa-hi el fitxer pujat." -#: ../include/File.class.php:132 +#: ../include/File.class.php:295 ../include/Upload.class.php:414 msgid "Unable to write uploaded file to disk." msgstr "No s'ha pogut escriure a disc el fitxer pujat." -#: ../include/File.class.php:147 +#: ../include/File.class.php:310 ../include/Upload.class.php:427 msgid "Uploaded image files must be either PNG or Jpeg files." msgstr "Els fitxers d'imatge pujats han de ser PNG o JPEG." -#: ../include/File.class.php:151 +#: ../include/File.class.php:314 ../include/Upload.class.php:431 msgid "The file you uploaded was not the correct type." msgstr "El fitxer que heu pujat no era del tipus correcte." -#: ../include/File.class.php:288 ../include/parseUpload.php:60 +#: ../include/File.class.php:489 ../include/Upload.class.php:63 msgid "Failed to move uploaded file." msgstr "No s'ha pogut moure el fitxer pujat." -#: ../include/File.class.php:306 +#: ../include/File.class.php:507 msgid "The uploaded image file is invalid." msgstr "El fitxer d'imatge pujat és invàlid." -#: ../include/File.class.php:330 ../include/parseUpload.php:177 +#: ../include/File.class.php:531 ../include/Upload.class.php:158 msgid "Failed to associate image file with addon." msgstr "No s'ha pogut associar la imatge amb el complement." +#: ../include/SMail.class.php:96 +msgid "No moderator mailing-list email is set." +msgstr "" +"No s'ha establert cap adreça per a la llista de correu dels moderadors." + +#: ../include/Template.class.php:101 ../include/menu.php:38 +#, php-format +msgid "Welcome, %s" +msgstr "Benvingut/da, %s" + +#: ../include/Template.class.php:102 ../include/menu.php:42 +msgid "Home" +msgstr "Inici" + +#: ../include/Template.class.php:103 ../include/menu.php:75 ../login.php:112 +#: ../password-reset.php:228 +msgid "Login" +msgstr "Inici de sessió" + +#: ../include/Template.class.php:104 ../include/menu.php:66 +msgid "Log out" +msgstr "Tanca la sessió" + +#: ../include/Template.class.php:105 ../include/menu.php:67 ../users.php:38 +msgid "Users" +msgstr "Usuaris" + +#: ../include/Template.class.php:106 ../include/menu.php:68 +msgid "Upload" +msgstr "Puja" + +#: ../include/Template.class.php:107 ../include/menu.php:70 ../manage.php:25 +msgid "Manage" +msgstr "Gestiona" + +#: ../include/Template.class.php:112 ../include/menu.php:122 +msgid "STK Homepage" +msgstr "Web del STK" + +#: ../include/Template.class.php:131 ../include/menu.php:85 +msgid "Languages" +msgstr "Idiomes" + +#: ../include/Upload.class.php:96 +msgid "" +"A valid License.txt file was not found. Please add a License.txt file to " +"your archive and re-submit it." +msgstr "" +"No s'ha trobat cap fitxer License.txt. Si us plau, afegiu un fitxer " +"License.txt al vostre arxiu i torneu-lo a enviar." + +#: ../include/Upload.class.php:193 +msgid "Invalid add-on type." +msgstr "Tipus de complement invàlid." + +#: ../include/Upload.class.php:199 +msgid "Failed to re-pack archive file." +msgstr "No s'ha pogut reempaquetar l'arxiu." + +#: ../include/Upload.class.php:207 +msgid "Failed to associate archive file with addon." +msgstr "No s'ha pogut associar l'arxiu amb el complement." + +#: ../include/Upload.class.php:223 +msgid "Successfully uploaded source archive." +msgstr "L'arxiu font s'ha pujat correctament." + +#: ../include/Upload.class.php:224 ../include/Upload.class.php:271 +msgid "Continue." +msgstr "Continua." + +#: ../include/Upload.class.php:240 +msgid "" +"You are trying to add a new revision of an add-on that does not exist." +msgstr "" +"Esteu intentant afegir una nova revisió d'un complement que no existeix." + +#: ../include/Upload.class.php:256 +msgid "" +"Your add-on was uploaded successfully. It will be reviewed by our moderators " +"before becoming publicly available." +msgstr "" +"El vostre complement ha estat pujat correctament. Serà revisat per els " +"nostres moderadors abans d'estar disponible públicament." + +#: ../include/Upload.class.php:257 +msgid "Click here to upload the sources to your add-on now." +msgstr "Feu clic aquí per pujar els fitxers font del vostre complement ara." + +#: ../include/Upload.class.php:258 +msgid "" +"(Uploading the sources to your add-on enables others to improve your work " +"and also ensure your add-on will not be lost in the future if new " +"SuperTuxKart versions are not compatible with the current format.)" +msgstr "" +"(Pujar els fitxers font del vostre complement permet als altres millorar la " +"vostra feina, i també assegura que el vostre complement no es perdrà en el " +"futur si les noves versions del SuperTuxKart no són compatibles amb el " +"format actual)." + +#: ../include/Upload.class.php:259 +msgid "Click here to view your add-on." +msgstr "Feu clic aquí per veure el vostre complement." + +#: ../include/Upload.class.php:270 +msgid "Successfully uploaded image." +msgstr "La imatge s'ha pujat correctament." + +#: ../include/Upload.class.php:288 +msgid "" +"Some invalid files were found in the uploaded add-on. These files have been " +"removed from the archive:" +msgstr "" +"S'han trobat alguns fitxers invàlids en el complement pujat. Aquests fitxers " +"han estat eliminats de l'arxiu:" + +#: ../include/Upload.class.php:367 +msgid "" +"Some images in this add-on do not have dimensions that are a power of two." +msgstr "" +"Algunes imatges d'aquest complement no tenen dimensions que siguin una " +"potència de dos." + +#: ../include/Upload.class.php:368 +msgid "This may cause display errors on some video cards." +msgstr "" +"Això podria provocar errors de visualització en algunes targetes gràfiques." + #: ../include/User.class.php:85 msgid "Failed to log in." msgstr "No s'ha pogut connectar." @@ -604,11 +795,42 @@ msgid "You must be logged in to change a password." msgstr "Cal que esteu connectat per canviar una contrasenya." -#: ../include/User.class.php:153 ../password-reset.php:223 +#: ../include/User.class.php:153 ../password-reset.php:224 msgid "Failed to change your password." msgstr "No s'ha pogut canviar la vostra contrasenya." -#: ../include/User.class.php:217 ../users.php:90 +#: ../include/User.class.php:220 +msgid "You must agree to the terms to register." +msgstr "Heu d'acceptar els termes per poder-vos registrar." + +#: ../include/User.class.php:227 ../password-reset.php:104 +msgid "An error occurred trying to validate your username." +msgstr "S'ha produït un error intentant validar el vostre nom d'usuari." + +#: ../include/User.class.php:228 ../include/User.class.php:238 +#: ../include/User.class.php:253 ../include/User.class.php:262 +#: ../password-reset.php:105 ../password-reset.php:121 +#: ../password-reset.php:156 ../password-reset.php:210 +msgid "Please contact a website administrator." +msgstr "Si us plau, contacteu amb l'administrador de la web." + +#: ../include/User.class.php:230 +msgid "Your username has already been used." +msgstr "El vostre nom d'usuari ja s'ha fet servir." + +#: ../include/User.class.php:237 +msgid "An error occurred trying to validate your email address." +msgstr "S'ha produït un error validant la vostra adreça de correu." + +#: ../include/User.class.php:240 +msgid "Your email address has already been used." +msgstr "La vostra adreça de correu ja s'ha fet servir." + +#: ../include/User.class.php:252 +msgid "An error occurred while creating your account." +msgstr "S'ha produït un error mentre es creava el vostre compte." + +#: ../include/User.class.php:299 ../users.php:90 msgid "Me" msgstr "Jo" @@ -661,8 +883,8 @@ msgid "basicUser" msgstr "basicUser" -#: ../include/coreUser.php:87 ../login.php:114 ../password-reset.php:39 -#: ../register.php:36 +#: ../include/coreUser.php:87 ../login.php:45 ../password-reset.php:46 +#: ../register.php:35 msgid "Username:" msgstr "Nom d'usuari:" @@ -691,7 +913,7 @@ msgstr "Desa la configuració" #: ../include/coreUser.php:143 ../include/coreUser.php:151 -#: ../password-reset.php:81 +#: ../password-reset.php:180 ../password-reset.php:252 msgid "Change Password" msgstr "Canvia la contrasenya" @@ -699,13 +921,14 @@ msgid "Old Password:" msgstr "Contrasenya anterior:" -#: ../include/coreUser.php:147 ../password-reset.php:40 -#: ../password-reset.php:73 ../register.php:37 ../register.php:42 +#: ../include/coreUser.php:147 ../password-reset.php:172 +#: ../password-reset.php:244 ../register.php:36 ../register.php:41 #, php-format msgid "Must be at least %d characters long." msgstr "Ha de tenir almenys %d caràcters." -#: ../include/coreUser.php:147 ../password-reset.php:72 +#: ../include/coreUser.php:147 ../password-reset.php:171 +#: ../password-reset.php:243 msgid "New Password:" msgstr "Nova contrasenya:" @@ -741,184 +964,7 @@ msgid "Your old password is not correct." msgstr "La vostra contrasenya anterior no és correcta." -#: ../include/mail.php:78 -msgid "No moderator mailing-list email is set." -msgstr "" -"No s'ha establert cap adreça per a la llista de correu dels moderadors." - -#: ../include/menu.php:43 -#, php-format -msgid "Welcome, %s" -msgstr "Benvingut/da, %s" - -#: ../include/menu.php:47 -msgid "Home" -msgstr "Inici" - -#: ../include/menu.php:71 -msgid "Log out" -msgstr "Tanca la sessió" - -#: ../include/menu.php:72 ../users.php:38 -msgid "Users" -msgstr "Usuaris" - -#: ../include/menu.php:73 -msgid "Upload" -msgstr "Puja" - -#: ../include/menu.php:75 ../manage.php:25 -msgid "Manage" -msgstr "Gestiona" - -#: ../include/menu.php:80 ../login.php:33 ../password-reset.php:226 -msgid "Login" -msgstr "Inici de sessió" - -#: ../include/menu.php:90 -msgid "Languages" -msgstr "Idiomes" - -#: ../include/menu.php:107 -msgid "STK Homepage" -msgstr "Web del STK" - -#: ../include/parseUpload.php:24 -msgid "Failed to upload your file." -msgstr "No s'ha pogut pujar el seu fitxer." - -#: ../include/parseUpload.php:48 -msgid "Successfully uploaded image." -msgstr "La imatge s'ha pujat correctament." - -#: ../include/parseUpload.php:49 ../include/parseUpload.php:252 -msgid "Continue." -msgstr "Continua." - -#: ../include/parseUpload.php:80 -msgid "Invalid archive file. The archive must contain the addon's xml file." -msgstr "" -"Fitxer d'arxiu invàlid. L'arxiu ha de contenir el fitxer XML del complement." - -#: ../include/parseUpload.php:94 -msgid "" -"Some invalid files were found in the uploaded add-on. These files have been " -"removed from the archive:" -msgstr "" -"S'han trobat alguns fitxers invàlids en el complement pujat. Aquests fitxers " -"han estat eliminats de l'arxiu:" - -#: ../include/parseUpload.php:103 -msgid "Upload was recognized as a kart." -msgstr "El fitxer pujat s'ha reconegut com un kart." - -#: ../include/parseUpload.php:108 -msgid "Upload was recognized as a track." -msgstr "El fitxer pujat s'ha reconegut com un circuit." - -#: ../include/parseUpload.php:116 -msgid "" -"Failed to read the add-on's XML file. Please make sure you are using the " -"latest version of the kart or track exporter." -msgstr "" -"No s'ha pogut llegir el fitxer XML del complement. Si us plau, assegureu-vos " -"de que esteu fent servir la darrera versió de l'exportador de karts o de " -"circuits." - -#: ../include/parseUpload.php:121 -msgid "Failed to write new XML file:" -msgstr "No s'ha pogut escriure el nou fitxer XML:" - -#: ../include/parseUpload.php:127 -msgid "This track is an arena." -msgstr "Aquest circuit és una arena." - -#: ../include/parseUpload.php:136 -msgid "" -"A valid License.txt file was not found. Please add a License.txt file to " -"your archive and re-submit it." -msgstr "" -"No s'ha trobat cap fitxer License.txt. Si us plau, afegiu un fitxer " -"License.txt al vostre arxiu i torneu-lo a enviar." - -#: ../include/parseUpload.php:198 -msgid "" -"Some images in this add-on do not have dimensions that are a power of two." -msgstr "" -"Algunes imatges d'aquest complement no tenen dimensions que siguin una " -"potència de dos." - -#: ../include/parseUpload.php:199 -msgid "This may cause display errors on some video cards." -msgstr "" -"Això podria provocar errors de visualització en algunes targetes gràfiques." - -#: ../include/parseUpload.php:216 -msgid "Invalid add-on type." -msgstr "Tipus de complement invàlid." - -#: ../include/parseUpload.php:223 -msgid "Failed to re-pack archive file." -msgstr "No s'ha pogut reempaquetar l'arxiu." - -#: ../include/parseUpload.php:232 -msgid "Failed to associate archive file with addon." -msgstr "No s'ha pogut associar l'arxiu amb el complement." - -#: ../include/parseUpload.php:251 -msgid "Successfully uploaded source archive." -msgstr "L'arxiu font s'ha pujat correctament." - -#: ../include/parseUpload.php:265 -msgid "" -"You are trying to add a new revision of an add-on that does not exist." -msgstr "" -"Esteu intentant afegir una nova revisió d'un complement que no existeix." - -#: ../include/parseUpload.php:295 -msgid "" -"Your add-on was uploaded successfully. It will be reviewed by our moderators " -"before becoming publicly available." -msgstr "" -"El vostre complement ha estat pujat correctament. Serà revisat per els " -"nostres moderadors abans d'estar disponible públicament." - -#: ../include/parseUpload.php:296 -msgid "Click here to upload the sources to your add-on now." -msgstr "Feu clic aquí per pujar els fitxers font del vostre complement ara." - -#: ../include/parseUpload.php:297 -msgid "" -"(Uploading the sources to your add-on enables others to improve your work " -"and also ensure your add-on will not be lost in the future if new " -"SuperTuxKart versions are not compatible with the current format.)" -msgstr "" -"(Pujar els fitxers font del vostre complement permet als altres millorar la " -"vostra feina, i també assegura que el vostre complement no es perdrà en el " -"futur si les noves versions del SuperTuxKart no són compatibles amb el " -"format actual)." - -#: ../include/parseUpload.php:298 -msgid "Click here to view your add-on." -msgstr "Feu clic aquí per veure el vostre complement." - -#: ../include/security.php:47 -msgid "You do not have the rights to access this page." -msgstr "No teniu permís per accedir a aquesta pàgina." - -#: ../include/security.php:69 -msgid "You must be logged in to access this page." -msgstr "Heu d'estar connectat per accedir a aquesta pàgina." - -#: ../include/security.php:70 -msgid "You will be redirected to the login page." -msgstr "Sereu redirigit a la pàgina d'entrada." - -#: ../include/top.php:31 ../users.php:38 -msgid "SuperTuxKart Add-ons" -msgstr "Complements del SuperTuxKart" - -#: ../include/xmlWrite.php:137 +#: ../include/xmlWrite.php:138 msgid "The following file could not be found:" msgstr "El següent fitxer no s'ha pogut trobar:" @@ -931,192 +977,248 @@ "Aquest és el dipòsit oficial de complements del SuperTuxKart. Conté karts i " "circuits extres per al joc." -#. I18N: Menu link -#: ../index.php:88 -msgid "Help" -msgstr "Ajuda" - -#: ../index.php:100 +#: ../index.php:63 #, php-format msgid "The most downloaded kart is %s." msgstr "El kart més descarregat és %s." -#: ../index.php:101 +#: ../index.php:64 #, php-format msgid "The most downloaded track is %s." msgstr "El circuit més descarregat és %s." -#: ../login.php:48 +#: ../login.php:49 ../register.php:40 +msgid "Password:" +msgstr "Contrasenya:" + +#: ../login.php:52 +msgid "Log In" +msgstr "Inici de sessió" + +#: ../login.php:55 +msgid "Create an account." +msgstr "Crea un compte." + +#: ../login.php:56 +msgid "Forgot password?" +msgstr "Heu oblidat la contrasenya?" + +#: ../login.php:67 msgid "Failed to logout." msgstr "No s'ha pogut desconnectar." -#: ../login.php:55 +#: ../login.php:70 msgid "You have been logged out." msgstr "Heu estat desconnectat." -#: ../login.php:56 ../login.php:69 ../login.php:95 +#: ../login.php:71 ../login.php:92 ../login.php:104 #, php-format msgid "Click %shere%s if you do not automatically redirect." msgstr "Feu clic %saquí%s si no sou redirigit automàticament." -#: ../login.php:68 -msgid "You are already logged in." -msgstr "Ja esteu connectat." - -#: ../login.php:94 +#: ../login.php:91 #, php-format msgid "Welcome, %s!" msgstr "Benvingut/da, %s!" -#: ../login.php:116 ../register.php:41 -msgid "Password:" -msgstr "Contrasenya:" +#: ../login.php:103 +msgid "You are already logged in." +msgstr "Ja esteu connectat." -#: ../login.php:118 -msgid "Log In" -msgstr "Inici de sessió" - -#: ../login.php:120 -msgid "Create an account." -msgstr "Crea un compte." - -#: ../login.php:121 -msgid "Forgot password?" -msgstr "Heu oblidat la contrasenya?" - -#: ../manage-panel.php:45 +#: ../manage-panel.php:44 msgid "Deleted message." msgstr "Missatge esborrat." -#: ../manage-panel.php:49 +#: ../manage-panel.php:48 msgid "Failed to delete message." msgstr "No s'ha pogut esborrar el missatge." -#: ../manage-panel.php:64 +#: ../manage-panel.php:63 msgid "Invalid page. You may have followed a broken link." msgstr "Pàgina invàlida. És possible que hagueu seguit un enllaç trencat." +#. I18N: Moderator panel #: ../manage-panel.php:67 ../manage.php:38 +msgid "Overview" +msgstr "" + +#. I18N: Moderator panel +#: ../manage-panel.php:72 ../manage.php:45 msgid "General Settings" msgstr "Opcions generals" -#: ../manage-panel.php:71 ../manage.php:43 +#. I18N: Moderator panel +#: ../manage-panel.php:77 ../manage.php:51 msgid "News Messages" msgstr "Missatges de notícies" -#: ../manage-panel.php:75 ../manage.php:48 +#: ../manage-panel.php:81 ../manage.php:70 msgid "Uploaded Files" msgstr "Fitxers pujats" -#: ../manage-panel.php:79 ../manage.php:53 +#: ../manage-panel.php:85 ../manage.php:57 msgid "Client Versions" msgstr "Versions de client:" -#: ../manage-panel.php:83 ../manage.php:58 +#: ../manage-panel.php:89 ../manage.php:63 msgid "Cache Files" msgstr "" -#: ../manage-panel.php:87 ../manage.php:63 +#. I18N: Moderator panel +#: ../manage-panel.php:94 ../manage.php:76 msgid "Event Logs" msgstr "Registres d'events" -#: ../manage-panel.php:96 +#. I18N: Heading in moderator overview panel +#: ../manage-panel.php:107 +msgid "Unapproved Add-Ons" +msgstr "Complements no aprovats" + +#. I18N: Notice on unapproved add-on list in moderator overview panel +#: ../manage-panel.php:109 +msgid "" +"Note that only add-ons where the newest revision is unapproved will appear " +"here." +msgstr "" +"Tingueu en compte que només apareixeran aquí aquells complements dels quals " +"la seva darrera revisió no estigui aprovada." + +#: ../manage-panel.php:131 +msgid "Revisions:" +msgstr "Revisions:" + +#: ../manage-panel.php:136 +msgid "No unapproved add-ons." +msgstr "No hi ha complements no aprovats." + +#: ../manage-panel.php:139 +msgid "Unapproved Files" +msgstr "Fitxers no aprovats." + +#: ../manage-panel.php:140 ../manage-panel.php:153 +msgid "Images:" +msgstr "Imatges:" + +#: ../manage-panel.php:158 +msgid "No unapproved images." +msgstr "No hi ha imatges no aprovades." + +#: ../manage-panel.php:160 +msgid "Source Archives:" +msgstr "Arxius font:" + +#: ../manage-panel.php:173 +#, php-format +msgid "%d File" +msgid_plural "%d Files" +msgstr[0] "%d fitxer" +msgstr[1] "%d fitxers" + +#: ../manage-panel.php:178 +msgid "No unapproved source archives." +msgstr "No hi ha cap arxiu font no aprovat." + +#: ../manage-panel.php:186 msgid "XML Download Frequency" msgstr "Freqüència de descàrrega XML" -#: ../manage-panel.php:97 +#: ../manage-panel.php:187 msgid "Permitted Addon Filetypes" msgstr "Tipus de fitxer permesos en els complements" -#: ../manage-panel.php:98 +#: ../manage-panel.php:188 msgid "Permitted Source Archive Filetypes" msgstr "Tipus de fitxer permesos en els arxius font" -#: ../manage-panel.php:99 +#: ../manage-panel.php:189 msgid "Administrator Email" msgstr "Correu de l'administrador" -#: ../manage-panel.php:100 +#: ../manage-panel.php:190 msgid "Moderator List Email" msgstr "Correu de la llista de moderadors" -#: ../manage-panel.php:102 ../manage-panel.php:104 +#: ../manage-panel.php:192 ../manage-panel.php:194 msgid "False" msgstr "Fals" -#: ../manage-panel.php:102 ../manage-panel.php:104 +#: ../manage-panel.php:192 ../manage-panel.php:194 msgid "True" msgstr "Cert" -#: ../manage-panel.php:105 +#: ../manage-panel.php:195 msgid "List Invisible Addons in XML" msgstr "Mostra els complements invisibles en XML" -#: ../manage-panel.php:106 +#: ../manage-panel.php:196 msgid "Blog RSS Feed" msgstr "Canal RSS del bloc" -#: ../manage-panel.php:107 +#: ../manage-panel.php:197 msgid "Maximum Uploaded Image Dimension" msgstr "Dimensió màxima de les imatges pujades" -#: ../manage-panel.php:108 +#: ../manage-panel.php:198 +msgid "Apache Rewrites" +msgstr "" + +#: ../manage-panel.php:199 msgid "Save Settings" msgstr "Desa la configuració" -#: ../manage-panel.php:115 ../manage-panel.php:137 +#: ../manage-panel.php:207 ../manage-panel.php:229 msgid "Message:" msgstr "Missatge:" -#: ../manage-panel.php:116 ../manage-panel.php:139 +#: ../manage-panel.php:208 ../manage-panel.php:231 msgid "Condition:" msgstr "Condició:" -#: ../manage-panel.php:117 +#: ../manage-panel.php:209 msgid "Display on Website:" msgstr "Mostra a la web:" -#: ../manage-panel.php:118 +#: ../manage-panel.php:210 msgid "Create Message" msgstr "Crea missatge" -#: ../manage-panel.php:131 +#: ../manage-panel.php:223 msgid "No news messages currently exist." msgstr "Actualment no existeixen missatges de notícies." -#: ../manage-panel.php:136 +#: ../manage-panel.php:228 msgid "Date:" msgstr "Data:" -#: ../manage-panel.php:138 +#: ../manage-panel.php:230 msgid "Author:" msgstr "Autor/a:" -#: ../manage-panel.php:140 +#: ../manage-panel.php:232 msgid "Web:" msgstr "Lloc web:" -#: ../manage-panel.php:141 +#: ../manage-panel.php:233 msgid "Actions:" msgstr "Accions:" -#: ../manage-panel.php:161 +#: ../manage-panel.php:253 msgid "No files have been uploaded." msgstr "No s'ha pujat cap fitxer." -#: ../manage-panel.php:165 ../register.php:50 +#: ../manage-panel.php:257 ../register.php:49 msgid "Name:" msgstr "Nom:" -#: ../manage-panel.php:167 +#: ../manage-panel.php:259 msgid "References:" msgstr "" -#: ../manage-panel.php:250 +#: ../manage-panel.php:343 msgid "Clients by User-Agent" msgstr "Clients per agent d'usuari" -#: ../manage-panel.php:257 +#: ../manage-panel.php:350 msgid "" "There are currently no SuperTuxKart clients recorded. Your download script " "may not be configured properly." @@ -1124,43 +1226,43 @@ "En aquests moments no hi ha cap client de SuperTuxKart registrat. El vostre " "script de descàrrega podria no estar ben configurat." -#: ../manage-panel.php:262 +#: ../manage-panel.php:355 msgid "Game Version:" msgstr "Versió del joc:" -#: ../manage-panel.php:262 +#: ../manage-panel.php:355 msgid "User-Agent String:" msgstr "Cadena de l'agent d'usuari:" -#: ../manage-panel.php:281 +#: ../manage-panel.php:375 msgid "Empty cache" msgstr "Buida la memòria cau" -#: ../manage.php:76 +#: ../manage.php:89 msgid "One or more fields has been left blank. Settings were not saved." msgstr "Un o més camps s'han deixat en blanc. La configuració no s'ha desat." -#: ../manage.php:81 +#: ../manage.php:94 msgid "XML Download Frequency value is invalid." msgstr "El valor de la freqüència de descàrrega XML és invàlid." -#: ../manage.php:94 +#: ../manage.php:108 msgid "Saved settings." msgstr "Configuració desada." -#: ../manage.php:112 +#: ../manage.php:126 msgid "Created message." msgstr "Missatge creat." -#: ../manage.php:116 +#: ../manage.php:130 msgid "Failed to create message." msgstr "No s'ha pogut crear el missatge." -#: ../password-reset.php:25 ../password-reset.php:30 +#: ../password-reset.php:27 ../password-reset.php:36 msgid "Reset Password" msgstr "Reinicia la contrasenya" -#: ../password-reset.php:36 +#: ../password-reset.php:44 msgid "" "In order to reset your password, please enter your username and your email " "address. A password reset link will be emailed to you. Your old password " @@ -1171,7 +1273,7 @@ "contrasenya. La vostra contrasenya antiga romandrà inactiva fins que la " "reinicieu." -#: ../password-reset.php:44 ../register.php:54 +#: ../password-reset.php:50 ../register.php:53 msgid "Email Address:" msgstr "Correu electrònic:" @@ -1179,34 +1281,16 @@ msgid "Send Reset Link" msgstr "Envia l'enllaç de reinici" -#: ../password-reset.php:69 -msgid "Please enter a new password for your account." -msgstr "Si us plau, introduïu una nova contrasenya per al vostre compte." - -#: ../password-reset.php:77 -msgid "New Password (confirm):" -msgstr "Nova contrasenya (confirmar):" - -#: ../password-reset.php:127 ../register.php:126 -msgid "An error occurred trying to validate your username." -msgstr "S'ha produït un error intentant validar el vostre nom d'usuari." - -#: ../password-reset.php:128 ../password-reset.php:144 -#: ../password-reset.php:177 ../password-reset.php:209 ../register.php:127 -#: ../register.php:142 -msgid "Please contact a website administrator." -msgstr "Si us plau, contacteu amb l'administrador de la web." - -#: ../password-reset.php:130 +#: ../password-reset.php:107 msgid "Username and email address combination not found." msgstr "No s'ha trobat la combinació de nom d'usuari i adreça de correu." -#: ../password-reset.php:143 ../password-reset.php:176 -#: ../password-reset.php:208 +#: ../password-reset.php:120 ../password-reset.php:155 +#: ../password-reset.php:209 msgid "An error occurred while resetting your password." msgstr "S'ha produït un error mentre es reiniciava la vostra contrasenya." -#: ../password-reset.php:154 +#: ../password-reset.php:132 msgid "" "Password reset link sent. Please reset your password using the link emailed " "to you." @@ -1214,41 +1298,49 @@ "L'enllaç per reiniciar la contrasenya ha estat enviat. Reinicieu la vostra " "contrasenya fent servir l'enllaç enviat." -#: ../password-reset.php:179 +#: ../password-reset.php:158 msgid "Invalid verification code." msgstr "Codi de verificació invàlid." -#: ../password-reset.php:185 +#: ../password-reset.php:169 ../password-reset.php:241 +msgid "Please enter a new password for your account." +msgstr "Si us plau, introduïu una nova contrasenya per al vostre compte." + +#: ../password-reset.php:176 ../password-reset.php:248 +msgid "New Password (confirm):" +msgstr "Nova contrasenya (confirmar):" + +#: ../password-reset.php:186 msgid "Could not reset your password. The link you followed is not valid." msgstr "" "No s'ha pogut reiniciar la vostra contrasenya. L'enllaç que heu seguit no és " "vàlid." -#: ../password-reset.php:225 +#: ../password-reset.php:227 msgid "Changed password." msgstr "Contrasenya canviada." -#: ../register.php:25 +#: ../register.php:24 msgid "Register" msgstr "Registre" -#: ../register.php:30 +#: ../register.php:29 msgid "Account Registration" msgstr "Registre del compte" -#: ../register.php:46 +#: ../register.php:45 msgid "Password (confirm):" msgstr "Contrasenya (confirmeu):" -#: ../register.php:58 +#: ../register.php:57 msgid "Terms:" msgstr "Termes:" -#: ../register.php:60 +#: ../register.php:59 msgid "STK Addons Terms and Conditions" msgstr "Termes i condicions dels complements del STK" -#: ../register.php:61 +#: ../register.php:60 msgid "" "You must agree to these terms in order to upload content to the STK Addons " "site." @@ -1256,7 +1348,7 @@ "Heu d'acceptar aquests termes per poder pujar contingut a la web de " "complements del STK." -#: ../register.php:62 +#: ../register.php:61 msgid "" "The STK Addons service is designed to be a repository exclusively for Super\n" "Tux Kart addon content. All uploaded content must be intended for this\n" @@ -1270,7 +1362,7 @@ "disponible\n" "públicament a Internet, i també dins del joc per a ser descarregat." -#: ../register.php:66 +#: ../register.php:65 msgid "" "Super Tux Kart aims to comply with the Debian Free Software Guidelines " "(DFSG).\n" @@ -1303,7 +1395,7 @@ "sense una llicència\n" "o una atribució adequada podran ser esborrats sense previ avís." -#: ../register.php:74 +#: ../register.php:73 msgid "" "Even with valid licenses and attribution, content may not contain any\n" "of the following:" @@ -1312,23 +1404,23 @@ "inclou... [truncated message content] |
From: <ste...@us...> - 2013-02-02 22:54:51
|
Revision: 12444 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=12444&view=rev Author: stephenjust Date: 2013-02-02 22:54:44 +0000 (Sat, 02 Feb 2013) Log Message: ----------- [stkaddons] Include user rank in api login response Modified Paths: -------------- stkaddons/trunk/client-user.php stkaddons/trunk/include/ClientSession.class.php Modified: stkaddons/trunk/client-user.php =================================================================== --- stkaddons/trunk/client-user.php 2013-02-02 11:32:24 UTC (rev 12443) +++ stkaddons/trunk/client-user.php 2013-02-02 22:54:44 UTC (rev 12444) @@ -92,11 +92,11 @@ function printConnectionXml(ClientSession $session) { if ($session instanceof ClientSessionUser) { - printf('<connection id="%s" user="%d" registered="true" />', - $session->getSessionId(), $session->getUserId()); + printf('<connection id="%s" user="%d" rank="%s" registered="true" />', + $session->getSessionId(), $session->getUserId(), $session->getRank()); } else { - printf('<connection id="%s" registered="false" />', + printf('<connection id="%s" rank="anon" registered="false" />', $session->getSessionId()); } } Modified: stkaddons/trunk/include/ClientSession.class.php =================================================================== --- stkaddons/trunk/include/ClientSession.class.php 2013-02-02 11:32:24 UTC (rev 12443) +++ stkaddons/trunk/include/ClientSession.class.php 2013-02-02 22:54:44 UTC (rev 12444) @@ -178,6 +178,7 @@ { private $user_id; private $user_name; + private $rank; /** * New instance @@ -185,11 +186,12 @@ * @param int $user_id * @param string $user_name */ - protected function __construct($session_id, $user_id, $user_name) + protected function __construct($session_id, $user_id, $user_name, $rank) { parent::__construct($session_id); $this->user_id = $user_id; $this->user_name = $user_name; + $this->rank = $rank; } /** @@ -205,7 +207,7 @@ // TODO: Share password checking with User class // Currently User class is tightly coupled with session handling, so can't use it here yet - $sql = sprintf("SELECT id FROM `%s` WHERE user = '%s' AND pass = '%s'", + $sql = sprintf("SELECT `id`, `role` FROM `%s` WHERE `user` = '%s' AND `pass` = '%s'", DB_PREFIX.'users', $username, Validate::password($password, null, $username)); @@ -218,6 +220,7 @@ $session_id = ClientSession::calcSessionId(); $user_row = mysql_fetch_row($result); $user_id = (int) $user_row[0]; + $rank = $user_row[1]; // if there is already a session, then we update it $sql = sprintf("INSERT INTO `%s` (cid, uid, name) VALUES ('%s', %d, '%s') @@ -228,7 +231,7 @@ mysql_real_escape_string($username)); if (sql_query($sql)) { - return new ClientSessionUser($session_id, $user_id, $username); + return new ClientSessionUser($session_id, $user_id, $username, $rank); } else { throw new ClientSessionConnectException('Could not create new session'); @@ -265,6 +268,10 @@ { return $this->user_id; } + + public function getRank() { + return $this->rank; + } } /** This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ste...@us...> - 2013-02-08 23:05:31
|
Revision: 12464 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=12464&view=rev Author: stephenjust Date: 2013-02-08 23:05:24 +0000 (Fri, 08 Feb 2013) Log Message: ----------- [stkaddons] Make some CSS changes as suggested by BeBeliouS, remove some old files. Modified Paths: -------------- stkaddons/trunk/addons.php stkaddons/trunk/css/skin_default.css Removed Paths: ------------- stkaddons/trunk/image/dl-button-center.png stkaddons/trunk/image/dl-button-left.png stkaddons/trunk/image/dl-button-right.png stkaddons/trunk/image/dl-button.xcf stkaddons/trunk/image/flags.xcf Modified: stkaddons/trunk/addons.php =================================================================== --- stkaddons/trunk/addons.php 2013-02-08 18:55:43 UTC (rev 12463) +++ stkaddons/trunk/addons.php 2013-02-08 23:05:24 UTC (rev 12464) @@ -188,14 +188,14 @@ $class = 'addon-list menu-item unavailable'; else continue; - $icon_html = '<img class="icon" src="'.$icon.'" height="25" width="25" />'; - if (($adc->getStatus() & F_FEATURED) == F_FEATURED) - $icon_html = '<div class="icon"><div class="icon-featured"></div>'.$icon_html.'</div>'; + $icon_html = '<img class="icon" src="'.$icon.'" height="25" width="25" />'; + if (($adc->getStatus() & F_FEATURED) == F_FEATURED) + $icon_html = '<div class="icon-featured"></div>'.$icon_html; $addons[] = array( 'class' => $class, 'url' => "addons.php?type={$_GET['type']}&name={$adc->getId()}", - 'label' => $icon_html.htmlspecialchars($adc->getName($adc->getId())), - 'disp' => File::rewrite("addons.php?type={$_GET['type']}&name={$adc->getId()}") + 'label' => '<div class="icon">'.$icon_html.'</div>'.htmlspecialchars($adc->getName($adc->getId())), + 'disp' => File::rewrite("addons.php?type={$_GET['type']}&name={$adc->getId()}") ); } catch (AddonException $e) { Modified: stkaddons/trunk/css/skin_default.css =================================================================== --- stkaddons/trunk/css/skin_default.css 2013-02-08 18:55:43 UTC (rev 12463) +++ stkaddons/trunk/css/skin_default.css 2013-02-08 23:05:24 UTC (rev 12464) @@ -424,9 +424,9 @@ background-image: url('../image/left-menu.png'); overflow-x: hidden; overflow-y: scroll; - width: 210px; + width: 230px; height: 456px; - padding: 0px 20px 0px 20px; + padding: 0px 10px; } #left-menu_bottom { @@ -437,15 +437,18 @@ #left-menu_body ul { list-style: none; - margin: 0px 10px 0px 0px; - padding: 5px 5px 5px 0px; + margin: 0px; + padding: 0px; } #left-menu_body .menu-item { - display:block; - font-size: 1.5em; + display: block; + font-size: 1.2em; + line-height: 1.5em; padding: 2px; - margin-bottom: 2px; + margin: 5px 0px; + min-height: 25px; + width: 300px; } #left-menu_body .menu-item:hover { Deleted: stkaddons/trunk/image/dl-button-center.png =================================================================== (Binary files differ) Deleted: stkaddons/trunk/image/dl-button-left.png =================================================================== (Binary files differ) Deleted: stkaddons/trunk/image/dl-button-right.png =================================================================== (Binary files differ) Deleted: stkaddons/trunk/image/dl-button.xcf =================================================================== (Binary files differ) Deleted: stkaddons/trunk/image/flags.xcf =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ste...@us...> - 2013-03-27 02:19:16
|
Revision: 12585 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=12585&view=rev Author: stephenjust Date: 2013-03-27 02:19:08 +0000 (Wed, 27 Mar 2013) Log Message: ----------- [stkaddons] Commit draft of privacy policy (see stkaddons.net/privacy.php), commit old fixes to language menu typo Modified Paths: -------------- stkaddons/trunk/include/Template.class.php stkaddons/trunk/include/menu.php Added Paths: ----------- stkaddons/trunk/privacy.php stkaddons/trunk/tpl/default/info-page.tpl Modified: stkaddons/trunk/include/Template.class.php =================================================================== --- stkaddons/trunk/include/Template.class.php 2013-03-27 01:49:54 UTC (rev 12584) +++ stkaddons/trunk/include/Template.class.php 2013-03-27 02:19:08 UTC (rev 12585) @@ -135,7 +135,7 @@ array('ca_ES',-96,-99,'CA'), array('de_DE',0,-33,'DE'), array('es_ES',-96,-66,'ES'), - array('eu-ES', -144, -66, 'EU'), + array('eu_ES', -144, -66, 'EU'), array('fr_FR',0,-66,'FR'), array('ga_IE',0,-99,'GA'), array('gd_GB',-144, -33,'GD'), Modified: stkaddons/trunk/include/menu.php =================================================================== --- stkaddons/trunk/include/menu.php 2013-03-27 01:49:54 UTC (rev 12584) +++ stkaddons/trunk/include/menu.php 2013-03-27 02:19:08 UTC (rev 12585) @@ -92,7 +92,7 @@ array('ca_ES',-96,-99,'CA'), array('de_DE',0,-33,'DE'), array('es_ES',-96,-66,'ES'), - array('eu-ES', -144, -66, 'EU'), + array('eu_ES', -144, -66, 'EU'), array('fr_FR',0,-66,'FR'), array('ga_IE',0,-99,'GA'), array('gd_GB',-144, -33,'GD'), Copied: stkaddons/trunk/privacy.php (from rev 11631, stkaddons/trunk/about.php) =================================================================== --- stkaddons/trunk/privacy.php (rev 0) +++ stkaddons/trunk/privacy.php 2013-03-27 02:19:08 UTC (rev 12585) @@ -0,0 +1,137 @@ +<?php +/* copyright 2013 Stephen Just <ste...@us...> + + This file is part of stkaddons. + + stkaddons is free software: you can redistribute it and/or + modify it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or (at your + option) any later version. + + stkaddons is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + more details. + + You should have received a copy of the GNU General Public License along with + stkaddons. If not, see <http://www.gnu.org/licenses/>. */ + +define('ROOT','./'); +include('include.php'); + +Template::setFile('info-page.tpl'); +$tpl = array(); +$tpl['title'] = htmlspecialchars(_('STK Add-ons').' | '._('Privacy')); + +$page_content = <<< EOF +<h1>Privacy Policy</h1> +<address>Last updated: March 26, 2013</address> +<p>Note that this document is still in a draft state.</p> + +<h2>Introduction</h2> +<p>The SuperTuxKart Add-Ons website (hereafter noted as STKAddons) is a service +provided to complement the SuperTuxKart racing game (STK). The information +collected by this website is to be used solely to enrich the quality of the STK +game.</p> + +<h2>Collected Information</h2> +<p>Upon registering to use the STKAddons site, you are required to provide an +e-mail address and you are asked to provide a name. We do not require that the +name you provide accurately represents your real name. (i.e. you are permitted +to use an alias or a nickname.) You may also choose to provide other kinds of +information as noted below.</p> + +<p>As you interact with the STKAddons service, a variety of data is collected. +For example, when you are logged in, you may submit content to be hosted by the +STKAddons service. We require that all submissions clearly state the names of +any individuals involved in creating the content to provide credit for their +work. You would be expected to provide a personally identifiable name to claim +credit for your work. Again, this is not required to be your real name.</p> + +<p>In addition to this, while logged in, you are able to rate the content of +other users. When you do so, your vote towards the content's rating is +associated with your user account. Votes are only displayed in an aggregated +format.</p> + +<p>When connecting to the STKAddons service from STK, we also collect some non- +personally-idenifying information about what operating system you are using. +As well, all connections to the STKAddons website are logged by our web server. +This information contains your IP address or public hostname and browser user- +agent. We do not avtively monitor this information, and it is collected as a +consequence of the web-server software that we (and most site operators) use.</p> + +<p>In the future, STK will have deeper integration with STKAddons, and at that +time, we will also be storing information required to maintain a user +session within the STK game, similar to a session cookie in a web browser.</p> + +<h3>COPPA Compliance (United States)</h3> +<p>In order to comply with United States law despite not operating in that +jurisdiction, we do not knowingly collect the personal information of persons +under the age of 13 from this region without parental consent. If we discover +that a user is in fact a child from this region, their account will be suspended +until parental consent is obtained, or if parental consent is not obtained in +a timely manner, their account and all related information will be deleted.</p> + +<p>Based on the small amount of information we collect, and the inability of +our organization to provide a mailing address or toll-free telephone number in +the United States, we only require an email with an accompanying digital +signature from a parent/legal guardian to either grant or deny us permission to +collect this personal information. This can be sent to +<tt>stk...@tu...</tt>.</p> + +<h2>Cookies</h2> +The STKAddons service uses cookies to remember your login state, as well as to +remember which language you wish to use the service in. At this time, we do not +employ the use of cookie-based analytics services.</p> + +<h2>Use of Information</h2> +<p>The operators of STKAddons will never disclose your personal notification to +third parties except as noted below.</p> + +<p>When you register for STKAddons, a profile page is created for you. This page +is visible to all other registered users of the STKAddons service. This page +displays the name you enetered at registration time, the date you registered, +your user rank, and links to any content you have submitted through the +STKAddons service.</p> + +<p>When you upload content to the STKAddons service, any information you place +in the license file of the content becomes publicly visible from the website. +Anything else you include in your uploaded file is also publicly available by +other means. As well, the name you registered with is displayed on the page +promoting the content you submitted, with a link to your profile page.</p> + +<p>We do not make available any indication of what rating you have provided for +the content uploaded to STKAddons. However, this information is used to generate +an average rating as provided by all users of the service.</p> + +<p>We do not display your e-mail address publicly anywhere on the STKAddons +website, unless you provide it in some uploaded content package. The website +moderators do not have direct access to your e-mail address, however this +information is stored in plain-text in our database. You will never +be contacted by e-mail through the STKAddons service except for the following: +confirming that you are a real person when registering, resetting your password, +and receiving feedback from moderators for any content you have submitted. We +reserve the right to extend this list as the service evolves, and to notify you +of changes to this policy. We will never disclose your e-mail address to third +parties.</p> + + + +<h2>Feedback</h2> +<p>If you have any questions or concerns about the content of this document, +feel free to contact the website administrators by email at +<tt>stk...@tu...</tt> with any inquiries that you may have.</p> + +<p>Administrators:</p> +<ul> + <li>Stephen Just <ste...@us...></li> +</ul> + +EOF; +$tpl['info_page'] = $page_content; + +Template::assignments($tpl); + +Template::display(); +?> + Copied: stkaddons/trunk/tpl/default/info-page.tpl (from rev 11380, stkaddons/trunk/tpl/default/about.tpl) =================================================================== --- stkaddons/trunk/tpl/default/info-page.tpl (rev 0) +++ stkaddons/trunk/tpl/default/info-page.tpl 2013-03-27 02:19:08 UTC (rev 12585) @@ -0,0 +1,7 @@ +{config_load file="tpl/default/tpl.conf"} +{include file=#header#} + +<div id="content"> + {$info_page} +</div> +{include file=#footer#} \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ste...@us...> - 2013-06-24 04:55:55
|
Revision: 12959 http://sourceforge.net/p/supertuxkart/code/12959 Author: stephenjust Date: 2013-06-24 04:55:51 +0000 (Mon, 24 Jun 2013) Log Message: ----------- [stkaddons] Commit part of searching that I forgot to do a while ago, attempt to fix some unicode display issues for addons. Modified Paths: -------------- stkaddons/trunk/include/Addon.class.php stkaddons/trunk/include/AddonViewer.class.php stkaddons/trunk/tpl/default/addons-panel.tpl Modified: stkaddons/trunk/include/Addon.class.php =================================================================== --- stkaddons/trunk/include/Addon.class.php 2013-06-24 03:57:33 UTC (rev 12958) +++ stkaddons/trunk/include/Addon.class.php 2013-06-24 04:55:51 UTC (rev 12959) @@ -400,18 +400,18 @@ public static function getAddonList($type, $featuredFirst = false) { if (!Addon::isAllowedType($type)) return array(); - if ($featuredFirst) - $querySql = 'SELECT `a`.`id`, (`r`.`status` & '.F_FEATURED.') AS `featured` - FROM `'.DB_PREFIX.'addons` `a` - LEFT JOIN `'.DB_PREFIX.$type.'_revs` `r` + if ($featuredFirst) + $querySql = 'SELECT `a`.`id`, (`r`.`status` & ' . F_FEATURED . ') AS `featured` + FROM `' . DB_PREFIX . 'addons` `a` + LEFT JOIN `' . DB_PREFIX . $type . '_revs` `r` ON `a`.`id` = `r`.`addon_id` - WHERE `a`.`type` = \''.$type.'\' - AND `r`.`status` & '.F_LATEST.' + WHERE `a`.`type` = \'' . $type . '\' + AND `r`.`status` & ' . F_LATEST . ' ORDER BY `featured` DESC, `a`.`name` ASC, `a`.`id` ASC'; - else - $querySql = 'SELECT `id` - FROM `'.DB_PREFIX.'addons` - WHERE `type` = \''.$type.'\' + else + $querySql = 'SELECT `id` + FROM `' . DB_PREFIX . 'addons` + WHERE `type` = \'' . $type . '\' ORDER BY `name` ASC, `id` ASC'; $handle = sql_query($querySql); if (!$handle) @@ -429,7 +429,7 @@ } public function getDescription() { - return htmlentities($this->description); + return htmlspecialchars($this->description); } public function getDesigner() { @@ -612,6 +612,32 @@ } /** + * Search for an addon by its name or description + * @param string $query + * @throws AddonException + * @return array Matching addon id, name and type + */ + public static function search($search_query) { + $search_query = mysql_real_escape_string($search_query); + + $query = 'SELECT `id`, `name`, `type` + FROM `'.DB_PREFIX."addons` + WHERE `name` LIKE '%$search_query%' + OR `description` LIKE '%$search_query%'"; + + $handle = sql_query($query); + if (!$handle) + throw new AddonException(htmlspecialchars(_('Search failed!'))); + + $result = array(); + for ($i = 0; $i < mysql_num_rows($handle); $i++) { + $result[] = mysql_fetch_assoc($handle); + } + + return $result; + } + + /** * Set the add-on's description * @param string $description */ Modified: stkaddons/trunk/include/AddonViewer.class.php =================================================================== --- stkaddons/trunk/include/AddonViewer.class.php 2013-06-24 03:57:33 UTC (rev 12958) +++ stkaddons/trunk/include/AddonViewer.class.php 2013-06-24 04:55:51 UTC (rev 12959) @@ -130,7 +130,7 @@ ), 'license' => array( 'label' => htmlspecialchars(_('License')), - 'value' => htmlspecialchars($this->addon->getLicense(),NULL,NULL,false) + 'value' => htmlspecialchars($this->addon->getLicense(),NULL,'UTF-8',false) ), 'link' => array( 'label' => htmlspecialchars(_('Permalink')), @@ -351,19 +351,20 @@ throw new AddonException(htmlspecialchars(_('You do not have the necessary privileges to perform this action.'))); echo '<br /><hr /><br /><h3>'.htmlspecialchars(_('Configuration')).'</h3>'; - echo '<form name="changeProps" action="'.File::rewrite($this->addon->getLink().'&save=props').'" method="POST">'; + echo '<form name="changeProps" action="'.File::rewrite($this->addon->getLink().'&save=props').'" method="POST" accept-charset="utf-8">'; // Edit designer $designer = ($this->addon->getDesigner() == htmlspecialchars(_('Unknown'))) ? NULL : $this->addon->getDesigner(); echo '<label for="designer_field">'.htmlspecialchars(_('Designer:')).'</label><br />'; - echo '<input type="text" name="designer" id="designer_field" value="'.$designer.'" /><br />'; + echo '<input type="text" name="designer" id="designer_field" value="'.$designer.'" accept-charset="utf-8" /><br />'; echo '<br />'; // Edit description echo '<label for="desc_field">'.htmlspecialchars(_('Description:')).'</label> ('.sprintf(htmlspecialchars(_('Max %u characters')),'140').')<br />'; echo '<textarea name="description" id="desc_field" rows="4" cols="60" onKeyUp="textLimit(document.getElementById(\'desc_field\'),140);" - onKeyDown="textLimit(document.getElementById(\'desc_field\'),140);">'.$this->addon->getDescription().'</textarea><br />'; + onKeyDown="textLimit(document.getElementById(\'desc_field\'),140);" + accept-charset="utf-8">'.$this->addon->getDescription().'</textarea><br />'; // Submit echo '<input type="submit" value="'.htmlspecialchars(_('Save Properties')).'" />'; Modified: stkaddons/trunk/tpl/default/addons-panel.tpl =================================================================== --- stkaddons/trunk/tpl/default/addons-panel.tpl 2013-06-24 03:57:33 UTC (rev 12958) +++ stkaddons/trunk/tpl/default/addons-panel.tpl 2013-06-24 04:55:51 UTC (rev 12959) @@ -73,7 +73,7 @@ {/if} <h3>{$addon.info.license.label}</h3> -<textarea name="license" rows="4" cols="60" readonly="readonly">{$addon.info.license.value}</textarea> +<textarea name="license" rows="4" cols="60" readonly="readonly" accept-charset="utf-8">{$addon.info.license.value}</textarea> <h3>{$addon.info.link.label}</h3> <a href="{$addon.info.link.value}">{$addon.info.link.value}</a> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ste...@us...> - 2013-08-19 01:05:47
|
Revision: 13508 http://sourceforge.net/p/supertuxkart/code/13508 Author: stephenjust Date: 2013-08-19 01:05:41 +0000 (Mon, 19 Aug 2013) Log Message: ----------- [stkaddons] Check in some old fixes so they're in SVN: Download script should not point to file server for xml files, fix typo in xml generation Modified Paths: -------------- stkaddons/trunk/download.php stkaddons/trunk/include/xmlWrite.php Modified: stkaddons/trunk/download.php =================================================================== --- stkaddons/trunk/download.php 2013-08-19 00:19:18 UTC (rev 13507) +++ stkaddons/trunk/download.php 2013-08-19 01:05:41 UTC (rev 13508) @@ -107,6 +107,10 @@ $counterHandle = sql_query($counterQuery); // Redirect to actual resource -header('Location: http://downloads.tuxfamily.org/stkaddons/assets/'.$assetpath); +if ($dir == 'xml') { + header('Location: http://stkaddons.net/xml/'.$file); +} else { + header('Location: http://downloads.tuxfamily.org/stkaddons/assets/'.$assetpath); +} exit; ?> Modified: stkaddons/trunk/include/xmlWrite.php =================================================================== --- stkaddons/trunk/include/xmlWrite.php 2013-08-19 00:19:18 UTC (rev 13507) +++ stkaddons/trunk/include/xmlWrite.php 2013-08-19 01:05:41 UTC (rev 13508) @@ -179,7 +179,7 @@ // Write license path $license_path_format = ConfigManager::get_config('license_json_path'); $license_path = str_replace(array('$aid', '$atype'), - array($addon_result['id'], $addon_result['type']), + array($result['id'], $result['type']), $license_path_format); $writer->writeAttribute('license', $license_path); $image_list_path = ConfigManager::get_config('image_json_path'); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ste...@us...> - 2013-12-23 21:03:41
|
Revision: 14761 http://sourceforge.net/p/supertuxkart/code/14761 Author: stephenjust Date: 2013-12-23 21:03:37 +0000 (Mon, 23 Dec 2013) Log Message: ----------- [stkaddons] Commit some minor fixes Modified Paths: -------------- stkaddons/trunk/include/sql.php stkaddons/trunk/table.sql stkaddons/trunk/tpl/default/images/flags.png Property Changed: ---------------- stkaddons/trunk/ Index: stkaddons/trunk =================================================================== --- stkaddons/trunk 2013-12-23 20:25:58 UTC (rev 14760) +++ stkaddons/trunk 2013-12-23 21:03:37 UTC (rev 14761) Property changes on: stkaddons/trunk ___________________________________________________________________ Modified: svn:ignore ## -3,3 +3,4 ## nbproject pot .htaccess +.htaccess.txt Modified: stkaddons/trunk/include/sql.php =================================================================== --- stkaddons/trunk/include/sql.php 2013-12-23 20:25:58 UTC (rev 14760) +++ stkaddons/trunk/include/sql.php 2013-12-23 21:03:37 UTC (rev 14761) @@ -20,6 +20,7 @@ mysql_connect(DB_HOST, DB_USER, DB_PASSWORD); mysql_select_db(DB_NAME) or die(mysql_error()); +mysql_set_charset('utf8'); function sql_query($query) { Modified: stkaddons/trunk/table.sql =================================================================== --- stkaddons/trunk/table.sql 2013-12-23 20:25:58 UTC (rev 14760) +++ stkaddons/trunk/table.sql 2013-12-23 21:03:37 UTC (rev 14761) @@ -1,240 +1,240 @@ -SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"; - -CREATE TABLE `addons` ( - `id` varchar(30) NOT NULL, - `type` ENUM('karts','tracks','arenas'), - `name` tinytext NOT NULL, - `uploader` int(11) NOT NULL, - `creation_date` timestamp NOT NULL default CURRENT_TIMESTAMP, - `designer` tinytext NOT NULL, - `props` int UNSIGNED NOT NULL DEFAULT '0', - `description` varchar(140) NOT NULL DEFUALT '', - `license` varchar(4096) NULL DEFAULT NULL, - `min_include_ver` varchar(16) NULL DEFAULT NULL, - `max_include_ver` varchar(16) NULL DEFAULT NULL, - UNIQUE KEY `id` (`id`), - INDEX (`type`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - -CREATE TABLE `arenas_revs` ( - `id` char(23) NOT NULL, - `addon_id` varchar(30) NOT NULL, - `fileid` int(10) unsigned NOT NULL DEFAULT '0', - `creation_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, - `revision` tinyint(4) NOT NULL DEFAULT '1', - `format` tinyint(4) NOT NULL, - `image` int(10) unsigned NOT NULL DEFAULT '0', - `status` mediumint(9) unsigned NOT NULL DEFAULT '0', - `moderator_note` varchar(4096) DEFAULT NULL, - UNIQUE KEY `id` (`id`), - KEY `track_id` (`addon_id`), - KEY `status` (`status`), - KEY `revision` (`revision`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - -CREATE TABLE `cache` ( - `file` varchar(30) NOT NULL, - `addon` varchar(30) DEFAULT NULL, - `props` text DEFAULT NULL, - UNIQUE `file` (`file`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - -CREATE TABLE `client_sessions` ( - `uid` int(10) unsigned NOT NULL DEFAULT '0', - `name` varchar(64) NOT NULL DEFAULT '', - `cid` char(24) NOT NULL, - `last-request` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, - PRIMARY KEY (`uid`,`name`), - KEY `uid` (`uid`,`cid`) -) ENGINE=MEMORY DEFAULT CHARSET=utf8; - -CREATE TABLE `clients` ( - `id` int(11) NOT NULL auto_increment PRIMARY KEY, - `agent_string` varchar(255) NOT NULL, - `stk_version` varchar(64) NOT NULL default 'latest', - `disabled` int(1) NOT NULL default 0 -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - -CREATE TABLE `config` ( - `name` varchar(256) NOT NULL UNIQUE, - `value` varchar(512) NOT NULL -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - -INSERT INTO `config` -(`name`,`value`) -VALUES -('xml_frequency','172800'), -('allowed_addon_exts','txt,b3d,xml,png,jpg,jpeg,music,ogg'), -('allowed_source_exts','txt,blend,png,jpg,jpeg,xcf,psd,wav,ogg,flac,xml'), -('admin_email','webmaster@localhost'), -('list_email','sup...@li...'), -('list_invisible','1'), -('blog_feed','http://supertuxkart.blogspot.com/feeds/posts/default?alt=rss'), -('max_image_dimension','1024'); - -CREATE TABLE `files` ( - `id` int(11) NOT NULL auto_increment, - `addon_id` varchar(30) NOT NULL, - `addon_type` ENUM('karts','tracks','arenas'), - `file_type` ENUM('source','image','addon'), - `file_path` text NOT NULL, - `date_added` timestamp NOT NULL default CURRENT_TIMESTAMP, - `approved` int(1) NOT NULL default 0, - `downloads` int UNSIGNED NOT NULL default 0, - `delete_date` date NOT NULL default '0000-00-00', - PRIMARY KEY (`id`), - FULLTEXT (`file_path`), - INDEX (`delete_date`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - -CREATE TABLE `help` ( - `user` int(11) NOT NULL, - `name` tinytext NOT NULL, - `description` mediumtext NOT NULL, - `file` text NOT NULL, - `image` tinytext NOT NULL, - `icon` tinytext NOT NULL, - `date` date NOT NULL, - `available` int(11) NOT NULL, - `version` int(11) NOT NULL, - `id` int(11) NOT NULL auto_increment, - `versionStk` tinytext NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1; - - -CREATE TABLE `history` ( - `date` date NOT NULL, - `id` int(11) NOT NULL auto_increment, - `user` tinytext NOT NULL, - `action` tinytext NOT NULL, - `option` tinytext NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=latin1; - -CREATE TABLE `logs` ( - `id` int(10) unsigned NOT NULL auto_increment, - `date` timestamp NOT NULL default CURRENT_TIMESTAMP, - `user` int(10) unsigned NOT NULL, - `message` text NOT NULL, - `emailed` int(1) unsigned NOT NULL default 0, - PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - -CREATE TABLE `karts_revs` ( - `id` char(23) NOT NULL, - `addon_id` varchar(30) NOT NULL, - `fileid` INT UNSIGNED NOT NULL DEFAULT '0', - `creation_date` timestamp NOT NULL default CURRENT_TIMESTAMP, - `revision` tinyint(4) NOT NULL default '1', - `format` tinyint(4) NOT NULL, - `icon` int UNSIGNED NOT NULL default '0', - `image` int UNSIGNED NOT NULL default '0', - `status` mediumint(9) unsigned NOT NULL default '0', - `moderator_note` varchar(4096) NULL default NULL, - UNIQUE KEY `id` (`id`), - KEY `track_id` (`addon_id`), - KEY `status` (`status`), - KEY `revision` (`revision`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - -CREATE TABLE `news` ( - `id` int(10) unsigned NOT NULL auto_increment, - `date` timestamp NOT NULL default CURRENT_TIMESTAMP, - `author_id` int(11) unsigned NOT NULL default '0', - `content` char(140) default NULL, - `condition` varchar(255) default NULL, - `important` tinyint(1) NOT NULL default '0', - `web_display` tinyint(1) NOT NULL default '1', - `active` tinyint(1) NOT NULL default '1', - `dynamic` int(1) unsigned NOT NULL default '0', - PRIMARY KEY (`id`), - INDEX (`dynamic`), - KEY `date` (`date`,`active`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - -CREATE TABLE `stats` ( - `id` int unsigned NOT NULL auto_increment, - `type` text NOT NULL, - `date` date NOT NULL, - `value` int(10) unsigned NOT NULL default '0', - PRIMARY KEY (`id`), - KEY (`date`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - -CREATE TABLE `tracks_revs` ( - `id` char(23) NOT NULL, - `addon_id` varchar(30) NOT NULL, - `fileid` INT UNSIGNED NOT NULL DEFAULT '0', - `creation_date` timestamp NOT NULL default CURRENT_TIMESTAMP, - `revision` tinyint(4) NOT NULL default '1', - `format` tinyint(4) NOT NULL, - `image` int UNSIGNED NOT NULL default '0', - `status` mediumint(9) unsigned NOT NULL default '0', - `moderator_note` varchar(4096) NULL default NULL, - UNIQUE KEY `id` (`id`), - KEY `track_id` (`addon_id`), - KEY `status` (`status`), - KEY `revision` (`revision`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - -CREATE TABLE `users` ( - `id` int(11) unsigned NOT NULL auto_increment, - `user` tinytext NOT NULL, - `pass` char(96) NOT NULL, - `name` tinytext NOT NULL, - `role` tinytext NOT NULL, - `email` tinytext NOT NULL, - `active` tinyint(1) NOT NULL, - `last_login` timestamp NOT NULL default CURRENT_TIMESTAMP, - `verify` text NOT NULL, - `reg_date` date NOT NULL, - `homepage` text, - PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - -/* Default admin password is 'password' - Change after install. */ -INSERT INTO `users` (`user`, `pass`, `name`, `role`, `email`, `active`, `last_login`, `verify`, `reg_date`, `homepage`) VALUES -('admin', '5e884898da28047151d0e56f8dc6292773603d0d6aabbdd62a11ef721d1542d8', 'Administrator', 'root', 'webmaster@localhost', 1, '2011-03-05 03:24:32', '', '2011-03-03', NULL); - -CREATE TABLE `votes` ( - `id` int unsigned NOT NULL auto_increment, - `user_id` int unsigned NOT NULL, - `addon_id` varchar(30) NOT NULL, - `vote` int(1) unsigned NOT NULL, - PRIMARY KEY (`id`) -) ENGINE=MyISAM DEFAULT CHARSET=utf8; - --- Stored Procedures -DELIMITER // -CREATE PROCEDURE create_file_record (IN id TEXT, IN atype TEXT, IN ftype TEXT, IN fname TEXT, OUT insertid INT) -BEGIN - INSERT INTO `files` - (`addon_id`,`addon_type`,`file_type`,`file_path`) - VALUES - (id,atype,ftype,fname); - SELECT LAST_INSERT_ID() INTO insertid; -END// -DELIMITER ; - -CREATE PROCEDURE increment_download (IN filepath TEXT) - UPDATE `files` - SET `downloads` = `downloads` + 1 - WHERE `file_path` = filepath; - -CREATE PROCEDURE register_user (IN in_user TEXT, IN in_pass CHAR(96), IN in_name TEXT, IN in_email TEXT, IN in_vercode TEXT, IN in_regdate DATE) - INSERT INTO `users` - (`user`,`pass`,`name`,`role`,`email`,`active`,`verify`,`reg_date`) - VALUES - (in_user, in_pass, in_name, 'basicUser', in_email, 0, in_vercode, in_regdate); - -CREATE PROCEDURE set_logintime (IN userid INT(11), IN logintime TIMESTAMP) - UPDATE `users` - SET `last_login` = logintime - WHERE `id` = userid; - -CREATE PROCEDURE log_event (IN in_user INT(10) unsigned, IN in_message TEXT) - INSERT INTO `logs` - (`user`,`message`) - VALUES +SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"; + +CREATE TABLE `addons` ( + `id` varchar(30) NOT NULL, + `type` ENUM('karts','tracks','arenas'), + `name` tinytext NOT NULL, + `uploader` int(11) NOT NULL, + `creation_date` timestamp NOT NULL default CURRENT_TIMESTAMP, + `designer` tinytext NOT NULL, + `props` int UNSIGNED NOT NULL DEFAULT '0', + `description` varchar(140) NOT NULL DEFAULT '', + `license` varchar(4096) NULL DEFAULT NULL, + `min_include_ver` varchar(16) NULL DEFAULT NULL, + `max_include_ver` varchar(16) NULL DEFAULT NULL, + UNIQUE KEY `id` (`id`), + INDEX (`type`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +CREATE TABLE `arenas_revs` ( + `id` char(23) NOT NULL, + `addon_id` varchar(30) NOT NULL, + `fileid` int(10) unsigned NOT NULL DEFAULT '0', + `creation_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, + `revision` tinyint(4) NOT NULL DEFAULT '1', + `format` tinyint(4) NOT NULL, + `image` int(10) unsigned NOT NULL DEFAULT '0', + `status` mediumint(9) unsigned NOT NULL DEFAULT '0', + `moderator_note` varchar(4096) DEFAULT NULL, + UNIQUE KEY `id` (`id`), + KEY `track_id` (`addon_id`), + KEY `status` (`status`), + KEY `revision` (`revision`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +CREATE TABLE `cache` ( + `file` varchar(30) NOT NULL, + `addon` varchar(30) DEFAULT NULL, + `props` text DEFAULT NULL, + UNIQUE `file` (`file`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +CREATE TABLE `client_sessions` ( + `uid` int(10) unsigned NOT NULL DEFAULT '0', + `name` varchar(64) NOT NULL DEFAULT '', + `cid` char(24) NOT NULL, + `last-request` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, + PRIMARY KEY (`uid`,`name`), + KEY `uid` (`uid`,`cid`) +) ENGINE=MEMORY DEFAULT CHARSET=utf8; + +CREATE TABLE `clients` ( + `id` int(11) NOT NULL auto_increment PRIMARY KEY, + `agent_string` varchar(255) NOT NULL, + `stk_version` varchar(64) NOT NULL default 'latest', + `disabled` int(1) NOT NULL default 0 +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +CREATE TABLE `config` ( + `name` varchar(256) NOT NULL UNIQUE, + `value` varchar(512) NOT NULL +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +INSERT INTO `config` +(`name`,`value`) +VALUES +('xml_frequency','172800'), +('allowed_addon_exts','txt,b3d,xml,png,jpg,jpeg,music,ogg'), +('allowed_source_exts','txt,blend,png,jpg,jpeg,xcf,psd,wav,ogg,flac,xml'), +('admin_email','webmaster@localhost'), +('list_email','sup...@li...'), +('list_invisible','1'), +('blog_feed','http://supertuxkart.blogspot.com/feeds/posts/default?alt=rss'), +('max_image_dimension','1024'); + +CREATE TABLE `files` ( + `id` int(11) NOT NULL auto_increment, + `addon_id` varchar(30) NOT NULL, + `addon_type` ENUM('karts','tracks','arenas'), + `file_type` ENUM('source','image','addon'), + `file_path` text NOT NULL, + `date_added` timestamp NOT NULL default CURRENT_TIMESTAMP, + `approved` int(1) NOT NULL default 0, + `downloads` int UNSIGNED NOT NULL default 0, + `delete_date` date NOT NULL default '0000-00-00', + PRIMARY KEY (`id`), + FULLTEXT (`file_path`), + INDEX (`delete_date`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +CREATE TABLE `help` ( + `user` int(11) NOT NULL, + `name` tinytext NOT NULL, + `description` mediumtext NOT NULL, + `file` text NOT NULL, + `image` tinytext NOT NULL, + `icon` tinytext NOT NULL, + `date` date NOT NULL, + `available` int(11) NOT NULL, + `version` int(11) NOT NULL, + `id` int(11) NOT NULL auto_increment, + `versionStk` tinytext NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + + +CREATE TABLE `history` ( + `date` date NOT NULL, + `id` int(11) NOT NULL auto_increment, + `user` tinytext NOT NULL, + `action` tinytext NOT NULL, + `option` tinytext NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1; + +CREATE TABLE `logs` ( + `id` int(10) unsigned NOT NULL auto_increment, + `date` timestamp NOT NULL default CURRENT_TIMESTAMP, + `user` int(10) unsigned NOT NULL, + `message` text NOT NULL, + `emailed` int(1) unsigned NOT NULL default 0, + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +CREATE TABLE `karts_revs` ( + `id` char(23) NOT NULL, + `addon_id` varchar(30) NOT NULL, + `fileid` INT UNSIGNED NOT NULL DEFAULT '0', + `creation_date` timestamp NOT NULL default CURRENT_TIMESTAMP, + `revision` tinyint(4) NOT NULL default '1', + `format` tinyint(4) NOT NULL, + `icon` int UNSIGNED NOT NULL default '0', + `image` int UNSIGNED NOT NULL default '0', + `status` mediumint(9) unsigned NOT NULL default '0', + `moderator_note` varchar(4096) NULL default NULL, + UNIQUE KEY `id` (`id`), + KEY `track_id` (`addon_id`), + KEY `status` (`status`), + KEY `revision` (`revision`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +CREATE TABLE `news` ( + `id` int(10) unsigned NOT NULL auto_increment, + `date` timestamp NOT NULL default CURRENT_TIMESTAMP, + `author_id` int(11) unsigned NOT NULL default '0', + `content` char(140) default NULL, + `condition` varchar(255) default NULL, + `important` tinyint(1) NOT NULL default '0', + `web_display` tinyint(1) NOT NULL default '1', + `active` tinyint(1) NOT NULL default '1', + `dynamic` int(1) unsigned NOT NULL default '0', + PRIMARY KEY (`id`), + INDEX (`dynamic`), + KEY `date` (`date`,`active`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +CREATE TABLE `stats` ( + `id` int unsigned NOT NULL auto_increment, + `type` text NOT NULL, + `date` date NOT NULL, + `value` int(10) unsigned NOT NULL default '0', + PRIMARY KEY (`id`), + KEY (`date`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +CREATE TABLE `tracks_revs` ( + `id` char(23) NOT NULL, + `addon_id` varchar(30) NOT NULL, + `fileid` INT UNSIGNED NOT NULL DEFAULT '0', + `creation_date` timestamp NOT NULL default CURRENT_TIMESTAMP, + `revision` tinyint(4) NOT NULL default '1', + `format` tinyint(4) NOT NULL, + `image` int UNSIGNED NOT NULL default '0', + `status` mediumint(9) unsigned NOT NULL default '0', + `moderator_note` varchar(4096) NULL default NULL, + UNIQUE KEY `id` (`id`), + KEY `track_id` (`addon_id`), + KEY `status` (`status`), + KEY `revision` (`revision`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +CREATE TABLE `users` ( + `id` int(11) unsigned NOT NULL auto_increment, + `user` tinytext NOT NULL, + `pass` char(96) NOT NULL, + `name` tinytext NOT NULL, + `role` tinytext NOT NULL, + `email` tinytext NOT NULL, + `active` tinyint(1) NOT NULL, + `last_login` timestamp NOT NULL default CURRENT_TIMESTAMP, + `verify` text NOT NULL, + `reg_date` date NOT NULL, + `homepage` text, + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +/* Default admin password is 'password' - Change after install. */ +INSERT INTO `users` (`user`, `pass`, `name`, `role`, `email`, `active`, `last_login`, `verify`, `reg_date`, `homepage`) VALUES +('admin', '5e884898da28047151d0e56f8dc6292773603d0d6aabbdd62a11ef721d1542d8', 'Administrator', 'root', 'webmaster@localhost', 1, '2011-03-05 03:24:32', '', '2011-03-03', NULL); + +CREATE TABLE `votes` ( + `id` int unsigned NOT NULL auto_increment, + `user_id` int unsigned NOT NULL, + `addon_id` varchar(30) NOT NULL, + `vote` int(1) unsigned NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=MyISAM DEFAULT CHARSET=utf8; + +-- Stored Procedures +DELIMITER // +CREATE PROCEDURE create_file_record (IN id TEXT, IN atype TEXT, IN ftype TEXT, IN fname TEXT, OUT insertid INT) +BEGIN + INSERT INTO `files` + (`addon_id`,`addon_type`,`file_type`,`file_path`) + VALUES + (id,atype,ftype,fname); + SELECT LAST_INSERT_ID() INTO insertid; +END// +DELIMITER ; + +CREATE PROCEDURE increment_download (IN filepath TEXT) + UPDATE `files` + SET `downloads` = `downloads` + 1 + WHERE `file_path` = filepath; + +CREATE PROCEDURE register_user (IN in_user TEXT, IN in_pass CHAR(96), IN in_name TEXT, IN in_email TEXT, IN in_vercode TEXT, IN in_regdate DATE) + INSERT INTO `users` + (`user`,`pass`,`name`,`role`,`email`,`active`,`verify`,`reg_date`) + VALUES + (in_user, in_pass, in_name, 'basicUser', in_email, 0, in_vercode, in_regdate); + +CREATE PROCEDURE set_logintime (IN userid INT(11), IN logintime TIMESTAMP) + UPDATE `users` + SET `last_login` = logintime + WHERE `id` = userid; + +CREATE PROCEDURE log_event (IN in_user INT(10) unsigned, IN in_message TEXT) + INSERT INTO `logs` + (`user`,`message`) + VALUES (in_user,in_message); \ No newline at end of file Modified: stkaddons/trunk/tpl/default/images/flags.png =================================================================== (Binary files differ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ste...@us...> - 2013-12-24 02:09:52
|
Revision: 14771 http://sourceforge.net/p/supertuxkart/code/14771 Author: stephenjust Date: 2013-12-24 02:09:47 +0000 (Tue, 24 Dec 2013) Log Message: ----------- [stkaddons] Merge Unitraxx's changes Modified Paths: -------------- stkaddons/trunk/client-user.php stkaddons/trunk/config-base.php stkaddons/trunk/include/AddonViewer.class.php stkaddons/trunk/include/ClientSession.class.php stkaddons/trunk/include/Log.class.php stkaddons/trunk/include/Ratings.class.php stkaddons/trunk/include/SMail.class.php stkaddons/trunk/include/User.class.php stkaddons/trunk/include/Validate.class.php stkaddons/trunk/include/addRating.php stkaddons/trunk/include/allow.php stkaddons/trunk/include/coreUser.php stkaddons/trunk/include.php stkaddons/trunk/index.php stkaddons/trunk/password-reset.php stkaddons/trunk/register.php Added Paths: ----------- stkaddons/trunk/address-management.php stkaddons/trunk/include/Achievement.class.php stkaddons/trunk/include/DBConnection.class.php stkaddons/trunk/include/Friend.class.php stkaddons/trunk/include/Server.class.php stkaddons/trunk/include/Verification.class.php stkaddons/trunk/include/XMLOutput.class.php Property Changed: ---------------- stkaddons/trunk/ stkaddons/trunk/assets/ Index: stkaddons/trunk =================================================================== --- stkaddons/trunk 2013-12-24 01:59:35 UTC (rev 14770) +++ stkaddons/trunk 2013-12-24 02:09:47 UTC (rev 14771) Property changes on: stkaddons/trunk ___________________________________________________________________ Added: svn:mergeinfo ## -0,0 +1 ## +/stkaddons/branches/uni:12914-14252 \ No newline at end of property Copied: stkaddons/trunk/address-management.php (from rev 14252, stkaddons/branches/uni/address-management.php) =================================================================== --- stkaddons/trunk/address-management.php (rev 0) +++ stkaddons/trunk/address-management.php 2013-12-24 02:09:47 UTC (rev 14771) @@ -0,0 +1,255 @@ +<?php +/** + * copyright 2013 Glenn De Jonghe + * + * This file is part of SuperTuxKart + * + * stkaddons is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * stkaddons is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with stkaddons. If not, see <http://www.gnu.org/licenses/>. + */ + +define('ROOT', './'); +define('API', 1); +require_once('config.php'); +require_once('include/ClientSession.class.php'); +require_once('include/XMLOutput.class.php'); + +$action = isset($_POST['action']) ? $_POST['action'] : null; +$output = new XMLOutput(); +$output->startDocument('1.0','UTF-8'); + +try { + switch ($action) + { + case 'set': + try { + $id = isset($_POST['id']) ? utf8_encode($_POST['id']) : null; + $token = isset($_POST['token']) ? utf8_encode($_POST['token']) : null; + $address = isset($_POST['address']) ? utf8_encode($_POST['address']) : null; + $private_port = isset($_POST['private_port']) ? utf8_encode($_POST['private_port']) : null; + $port = isset($_POST['port']) ? utf8_encode($_POST['port']) : null; + ClientSession::setPublicAddress($id, $token, $address, $port, $private_port); + + $output->startElement('address-management'); + $output->writeAttribute('success','yes'); + $output->writeAttribute('info',''); + $output->endElement(); + } + catch(Exception $e){ + $output->startElement('address-management'); + $output->writeAttribute('success','no'); + $output->writeAttribute('info', + htmlspecialchars( + $e->getMessage() + )); + $output->endElement(); + } + break; + case 'start-server': + try { + $id = isset($_POST['id']) ? utf8_encode($_POST['id']) : null; + $token = isset($_POST['token']) ? utf8_encode($_POST['token']) : null; + $address = isset($_POST['address']) ? utf8_encode($_POST['address']) : null; + $port = isset($_POST['port']) ? utf8_encode($_POST['port']) : null; + $private_port = isset($_POST['private_port']) ? utf8_encode($_POST['private_port']) : null; + $max_players = isset($_POST['max_players']) ? utf8_encode($_POST['max_players']) : null; + ClientSession::get($token, $id)->createServer($address, $port, $private_port, "Temporary name", $max_players); + + $output->startElement('start-server'); + $output->writeAttribute('success','yes'); + $output->writeAttribute('info',''); + $output->endElement(); + } + catch(Exception $e){ + $output->startElement('start-server'); + $output->writeAttribute('success','no'); + $output->writeAttribute('info', + htmlspecialchars( + $e->getMessage() + )); + $output->endElement(); + } + break; + case 'stop-server': + try { + $id = isset($_POST['id']) ? utf8_encode($_POST['id']) : null; + $token = isset($_POST['token']) ? utf8_encode($_POST['token']) : null; + $address = isset($_POST['address']) ? utf8_encode($_POST['address']) : null; + $port = isset($_POST['port']) ? utf8_encode($_POST['port']) : null; + ClientSession::get($token, $id)->stopServer($address, $port); + + $output->startElement('stop-server'); + $output->writeAttribute('success','yes'); + $output->writeAttribute('info',''); + $output->endElement(); + } + catch(Exception $e){ + $output->startElement('stop-server'); + $output->writeAttribute('success','no'); + $output->writeAttribute('info', + htmlspecialchars( + $e->getMessage() + )); + $output->endElement(); + } + break; + case 'unset': + try { + $id = isset($_POST['id']) ? utf8_encode($_POST['id']) : null; + $token = isset($_POST['token']) ? utf8_encode($_POST['token']) : null; + ClientSession::unsetPublicAddress($id, $token); + + $output->startElement('address-management'); + $output->writeAttribute('success','yes'); + $output->writeAttribute('info',''); + $output->endElement(); + } + catch(Exception $e){ + $output->startElement('address-management'); + $output->writeAttribute('success','no'); + $output->writeAttribute('info', + htmlspecialchars( + $e->getMessage() + )); + $output->endElement(); + } + break; + case 'get': + try { + $id = isset($_POST['id']) ? utf8_encode($_POST['id']) : null; + $token = isset($_POST['token']) ? utf8_encode($_POST['token']) : null; + $peer_id = isset($_POST['peer_id']) ? utf8_encode($_POST['peer_id']) : null; + $session = ClientSession::get($token, $id); + $result = $session->getPeerAddress($peer_id); + + $output->startElement('get-public-ip'); + $output->writeAttribute('success','yes'); + $output->writeAttribute('info',''); + $output->writeAttribute('ip', $result['ip']); + $output->writeAttribute('port', $result['port']); + $output->writeAttribute('private_port', $result['private_port']); + $output->endElement(); + } + catch(Exception $e){ + $output->startElement('get-public-ip'); + $output->writeAttribute('success','no'); + $output->writeAttribute('info', + htmlspecialchars( + $e->getMessage() + )); + $output->endElement(); + } + break; + case 'quick-join': + try { + $id = isset($_POST['id']) ? utf8_encode($_POST['id']) : null; + $token = isset($_POST['token']) ? utf8_encode($_POST['token']) : null; + $result = ClientSession::get($token, $id)->quickJoin(); + + $output->startElement('quick-join'); + $output->writeAttribute('success','yes'); + $output->writeAttribute('info',''); + $output->writeAttribute('hostid',$result['hostid']); + $output->writeAttribute('ip',$result['ip']); + $output->writeAttribute('port',$result['port']); + $output->writeAttribute('private_port', $result['private_port']); + $output->endElement(); + } + catch(Exception $e){ + $output->startElement('quick-join'); + $output->writeAttribute('success','no'); + $output->writeAttribute('info', + htmlspecialchars( + $e->getMessage() + )); + $output->endElement(); + } + break; + case 'request-connection': + try { + $id = isset($_POST['id']) ? utf8_encode($_POST['id']) : null; + $token = isset($_POST['token']) ? utf8_encode($_POST['token']) : null; + $server_id = isset($_POST['server_id']) ? utf8_encode($_POST['server_id']) : null; + ClientSession::get($token, $id)->requestServerConnection($server_id); + + $output->startElement('request-connection'); + $output->writeAttribute('success','yes'); + $output->writeAttribute('serverid', $server_id); + $output->writeAttribute('info',''); + $output->endElement(); + } + catch(Exception $e){ + $output->startElement('request-connection'); + $output->writeAttribute('success','no'); + $output->writeAttribute('info', + htmlspecialchars( + $e->getMessage() + )); + $output->endElement(); + } + break; + case 'poll-connection-requests': + try { + $id = isset($_POST['id']) ? utf8_encode($_POST['id']) : null; + $token = isset($_POST['token']) ? utf8_encode($_POST['token']) : null; + $address = isset($_POST['address']) ? utf8_encode($_POST['address']) : null; + $port = isset($_POST['port']) ? utf8_encode($_POST['port']) : null; + $requests = ClientSession::get($token, $id)->getServerConnectionRequests($address, $port); + $output->startElement('poll-connection-requests'); + $output->writeAttribute('success','yes'); + $output->writeAttribute('info',''); + $output->startElement('users'); + foreach ($requests as $request) { + $output->startElement('user'); + $output->writeAttribute("id", $request['userid']); + $output->endElement(); + } + $output->endElement(); + $output->endElement(); + } + catch(Exception $e){ + $output->startElement('poll-connection-requests'); + $output->writeAttribute('success','no'); + $output->writeAttribute('info', + htmlspecialchars( + $e->getMessage() + )); + $output->endElement(); + } + break; + + default: + $output->startElement('request'); + $output->writeAttribute('success','no'); + $output->writeAttribute('info', + htmlspecialchars( + _('Invalid action.') + )); + $output->endElement(); + break; + } +} +catch (Exception $e) { + $output->startElement('request'); + $output->writeAttribute('success','no'); + $output->writeAttribute('info', + htmlspecialchars( + _('An unexptected error occured.') .' '. + _('Please contact a website administrator.') + )); + $output->endElement(); +} + +$output->endDocument(); +$output->printToScreen(); +?> Index: stkaddons/trunk/assets =================================================================== --- stkaddons/trunk/assets 2013-12-24 01:59:35 UTC (rev 14770) +++ stkaddons/trunk/assets 2013-12-24 02:09:47 UTC (rev 14771) Property changes on: stkaddons/trunk/assets ___________________________________________________________________ Modified: svn:ignore ## -2,3 +2,5 ## *.png *.jpg *.jpeg + +TMPtpl_c Modified: stkaddons/trunk/client-user.php =================================================================== --- stkaddons/trunk/client-user.php 2013-12-24 01:59:35 UTC (rev 14770) +++ stkaddons/trunk/client-user.php 2013-12-24 02:09:47 UTC (rev 14771) @@ -1,8 +1,8 @@ <?php /** - * copyright 2011 + * copyright 2013 Glenn De Jonghe * - * This file is part of stkaddons + * This file is part of SuperTuxKart * * stkaddons is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -17,89 +17,590 @@ * You should have received a copy of the GNU General Public License * along with stkaddons. If not, see <http://www.gnu.org/licenses/>. */ + define('ROOT', './'); -include_once('config.php'); -include_once('include/ClientSession.class.php'); -include_once('include/User.class.php'); +define('API', 1); +require_once(ROOT . 'config.php'); +require_once(ROOT . 'include/ClientSession.class.php'); +require_once(ROOT . 'include/Server.class.php'); +require_once(ROOT . 'include/User.class.php'); +require_once(ROOT . 'include/XMLOutput.class.php'); +$action = isset($_POST['action']) ? $_POST['action'] : ""; +$output = new XMLOutput(); +$output->startDocument('1.0','UTF-8'); -ob_start(); -header('Content-type: text/xml'); -echo "<?xml version=\"1.0\"?>\n"; - -$action = isset($_GET['action']) ? $_GET['action'] : null; try { switch ($action) { + case 'poll': + try { + $userid = isset($_POST['userid']) ? $_POST['userid'] : 0; + $token = isset($_POST['token']) ? $_POST['token'] : ""; + $session = ClientSession::get($token, $userid); + $poll_xml = $session->poll(); + $output->insert($poll_xml); + } + catch(Exception $e){ + $output->startElement('poll'); + $output->writeAttribute('success','no'); + $output->writeAttribute('info', + htmlspecialchars( + $e->getMessage() + )); + $output->endElement(); + } + + break; + case 'connect': try { - $user = isset($_GET['user']) ? $_GET['user'] : null; - $password = isset($_GET['password']) ? $_GET['password'] : null; - $session = ClientSession::create($user, $password); - printConnectionXml($session); + $password = isset($_POST['password']) ? utf8_encode($_POST['password']) : ""; + $username = isset($_POST['username']) ? utf8_encode($_POST['username']) : ""; + $save_session = isset($_POST['save-session']) ? utf8_encode($_POST['save-session']) : ""; + $session = ClientSession::create($username, $password, $save_session == "true"); + $achievements_string = $session->getAchievements(); + $output->startElement('connect'); + $output->writeAttribute('success','yes'); + $output->writeAttribute('token', $session->getSessionID()); + $output->writeAttribute('username', htmlspecialchars($session->getUsername())); + $output->writeAttribute('userid', $session->getUserID()); + if ($achievements_string != "") + $output->writeAttribute('achieved', $achievements_string); + $output->writeAttribute('info',''); + $output->endElement(); + } - catch (ClientSessionConnectException $e) { - sendPlainMessage(403, $e->getMessage()); + catch(Exception $e){ + $output->startElement('connect'); + $output->writeAttribute('success','no'); + $output->writeAttribute('info', + htmlspecialchars( + $e->getMessage() + )); + $output->endElement(); } break; + + case 'saved-session': + try { + $userid = isset($_POST['userid']) ? $_POST['userid'] : 0; + $token = isset($_POST['token']) ? $_POST['token'] : ""; + $session = ClientSession::get($token, $userid); + $session->setOnline(); + User::updateLoginTime($session->getUserID()); + $output->startElement('saved-session'); + $output->writeAttribute('success','yes'); + $output->writeAttribute('token', $session->getSessionID()); + $output->writeAttribute('username', htmlspecialchars($session->getUsername())); + $output->writeAttribute('userid', $session->getUserID()); + $output->writeAttribute('info',''); + $output->endElement(); + + } + catch(Exception $e){ + $output->startElement('saved-session'); + $output->writeAttribute('success','no'); + $output->writeAttribute('info', + htmlspecialchars( + $e->getMessage() + )); + $output->endElement(); + } + break; + + case 'get_server_list': + try { + $servers_xml = Server::getServersAsXML(); + $output->startElement('get_servers_list'); + $output->writeAttribute('success','yes'); + $output->writeAttribute('info',''); + $output->insert($servers_xml); + $output->endElement(); + } + catch(Exception $e){ + $output->startElement('get_servers_list'); + $output->writeAttribute('success','no'); + $output->writeAttribute('info', + htmlspecialchars( + $e->getMessage() + )); + $output->endElement(); + } + + break; + + case 'get-friends-list': + try { + $userid = isset($_POST['userid']) ? $_POST['userid'] : 0; + $token = isset($_POST['token']) ? $_POST['token'] : ""; + $session = ClientSession::get($token, $userid); + $visitingid = isset($_POST['visitingid']) ? $_POST['visitingid'] : 0; + $friends_xml = $session->getFriendsOf($visitingid); + $output->startElement('get-friends-list'); + $output->writeAttribute('success','yes'); + $output->writeAttribute('info',''); + $output->writeAttribute('visitingid', $visitingid); + $output->insert($friends_xml); + $output->endElement(); + } + catch(Exception $e){ + $output->startElement('get-friends-list'); + $output->writeAttribute('success','no'); + $output->writeAttribute('info', + htmlspecialchars( + $e->getMessage() + )); + $output->endElement(); + } + + break; + + case 'get-achievements': + try { + $userid = isset($_POST['userid']) ? $_POST['userid'] : 0; + $token = isset($_POST['token']) ? $_POST['token'] : ""; + $session = ClientSession::get($token, $userid); + $visitingid = isset($_POST['visitingid']) ? $_POST['visitingid'] : 0; + $achievements_string = $session->getAchievements($visitingid); + $output->startElement('get-achievements'); + $output->writeAttribute('success','yes'); + $output->writeAttribute('info',''); + $output->writeAttribute('visitingid', $visitingid); + if ($achievements_string != "") + $output->writeAttribute('achieved', $achievements_string); + $output->endElement(); + } + catch(Exception $e){ + $output->startElement('get-friends-list'); + $output->writeAttribute('success','no'); + $output->writeAttribute('info', + htmlspecialchars( + $e->getMessage() + )); + $output->endElement(); + } + + break; + + case 'get-addon-vote': + try { + $userid = isset($_POST['userid']) ? $_POST['userid'] : 0; + $token = isset($_POST['token']) ? $_POST['token'] : ""; + $addonid = isset($_POST['addonid']) ? $_POST['addonid'] : ""; + $rating_object = new Ratings($addonid, false); + $rating = $rating_object->getUserVote(ClientSession::get($token, $userid)); + $output->startElement('get-addon-vote'); + $output->writeAttribute('success','yes'); + if ($rating === false) { + $output->writeAttribute('voted', "no"); + $output->writeAttribute('rating', -1); + }else{ + $output->writeAttribute('voted', "yes"); + $output->writeAttribute('rating', $rating); + } + $output->writeAttribute('info',''); + $output->endElement(); + } + catch(Exception $e){ + $output->startElement('get-addon-vote'); + $output->writeAttribute('success','no'); + $output->writeAttribute('info', + htmlspecialchars( + $e->getMessage() + )); + $output->endElement(); + } + break; + + case 'set-addon-vote': //returns -1 if no vote found + try { + $userid = isset($_POST['userid']) ? $_POST['userid'] : 0; + $token = isset($_POST['token']) ? $_POST['token'] : ""; + $addonid = isset($_POST['addonid']) ? $_POST['addonid'] : ""; + $rating = isset($_POST['rating']) ? $_POST['rating'] : -1.0; + $rating_object = new Ratings($addonid, false); + $new_vote = $rating_object->setUserVote($rating, ClientSession::get($token, $userid)); + $output->startElement('set-addon-vote'); + $output->writeAttribute('success','yes'); + $output->writeAttribute('new-vote', ($new_vote ? 'yes' : 'no')); + $output->writeAttribute('new-average', $rating_object->getAvgRating()); + $output->writeAttribute('new-number', $rating_object->getNumRatings()); + $output->writeAttribute('addon-id', $rating_object->getAddonId()); + $output->writeAttribute('info',''); + $output->endElement(); + } + catch(Exception $e){ + $output->startElement('set-addon-vote'); + $output->writeAttribute('success','no'); + $output->writeAttribute('info', + htmlspecialchars( + $e->getMessage() + )); + $output->endElement(); + } + break; + + case 'client-quit': + try { + $userid = isset($_POST['userid']) ? $_POST['userid'] : 0; + $token = isset($_POST['token']) ? $_POST['token'] : ""; + ClientSession::get($token, $userid)->clientQuit(); + $output->startElement('client-quit'); + $output->writeAttribute('success','yes'); + $output->writeAttribute('info',''); + $output->endElement(); + } + catch(Exception $e){ + $output->startElement('client-quit'); + $output->writeAttribute('success','no'); + $output->writeAttribute('info', + htmlspecialchars( + $e->getMessage() + )); + $output->endElement(); + } + break; + + case 'host-vote': + try { + $userid = isset($_POST['userid']) ? $_POST['userid'] : 0; + $token = isset($_POST['token']) ? $_POST['token'] : ""; + $hostid = isset($_POST['hostid']) ? $_POST['hostid'] : 0; + $vote = isset($_POST['vote']) ? $_POST['vote'] : 0; + $new_rating = ClientSession::get($token, $userid)->hostVote($hostid, $vote); + $output->startElement('host-vote'); + $output->writeAttribute('success','yes'); + $output->writeAttribute('new-rating', $new_rating); + $output->writeAttribute('hostid', $hostid); + $output->writeAttribute('info',''); + $output->endElement(); + } + catch(Exception $e){ + $output->startElement('host-vote'); + $output->writeAttribute('success','no'); + $output->writeAttribute('info', + htmlspecialchars( + $e->getMessage() + )); + $output->endElement(); + } + break; + + case 'achieving': + try { + $userid = isset($_POST['userid']) ? $_POST['userid'] : 0; + $token = isset($_POST['token']) ? $_POST['token'] : ""; + $achievementid = isset($_POST['achievementid']) ? $_POST['achievementid'] : 0; + ClientSession::get($token, $userid)->onAchieving($achievementid); + } + catch(Exception $e){ + echo "achieving error"; + } + break; + + case 'friend-request': + $friendid = isset($_POST['friendid']) ? $_POST['friendid'] : 0; + try { + $userid = isset($_POST['userid']) ? $_POST['userid'] : 0; + $token = isset($_POST['token']) ? $_POST['token'] : ""; + $session = ClientSession::get($token, $userid); + $session->friendRequest($friendid); + $output->startElement('friend-request'); + $output->writeAttribute('success','yes'); + $output->writeAttribute('info',''); + $output->writeAttribute('friendid', $friendid); + $output->endElement(); + } + catch(Exception $e){ + $output->startElement('friend-request'); + $output->writeAttribute('success','no'); + $output->writeAttribute('info', + htmlspecialchars( + $e->getMessage() + )); + $output->writeAttribute('friendid', $friendid); + $output->endElement(); + } + + break; + + case 'accept-friend-request': + $friendid = isset($_POST['friendid']) ? $_POST['friendid'] : 0; + try { + $userid = isset($_POST['userid']) ? $_POST['userid'] : 0; + $token = isset($_POST['token']) ? $_POST['token'] : ""; + $session = ClientSession::get($token, $userid); + $session->acceptFriendRequest($friendid); + $output->startElement('accept-friend-request'); + $output->writeAttribute('success','yes'); + $output->writeAttribute('info',''); + $output->writeAttribute('friendid', $friendid); + $output->endElement(); + } + catch(Exception $e){ + $output->startElement('accept-friend-request'); + $output->writeAttribute('success','no'); + $output->writeAttribute('info', + htmlspecialchars( + $e->getMessage() + )); + $output->writeAttribute('friendid', $friendid); + $output->endElement(); + } + + break; + + case 'decline-friend-request': + $friendid = isset($_POST['friendid']) ? $_POST['friendid'] : 0; + try { + $userid = isset($_POST['userid']) ? $_POST['userid'] : 0; + $token = isset($_POST['token']) ? $_POST['token'] : ""; + $session = ClientSession::get($token, $userid); + $session->declineFriendRequest($friendid); + $output->startElement('decline-friend-request'); + $output->writeAttribute('success','yes'); + $output->writeAttribute('info',''); + $output->writeAttribute('friendid', $friendid); + $output->endElement(); + } + catch(Exception $e){ + $output->startElement('decline-friend-request'); + $output->writeAttribute('success','no'); + $output->writeAttribute('info', + htmlspecialchars( + $e->getMessage() + )); + $output->writeAttribute('friendid', $friendid); + $output->endElement(); + } + + break; + + case 'cancel-friend-request': + $friendid = isset($_POST['friendid']) ? $_POST['friendid'] : 0; + try { + $userid = isset($_POST['userid']) ? $_POST['userid'] : 0; + $token = isset($_POST['token']) ? $_POST['token'] : ""; + $session = ClientSession::get($token, $userid); + $session->cancelFriendRequest($friendid); + $output->startElement('cancel-friend-request'); + $output->writeAttribute('success','yes'); + $output->writeAttribute('info',''); + $output->writeAttribute('friendid', $friendid); + $output->endElement(); + } + catch(Exception $e){ + $output->startElement('cancel-friend-request'); + $output->writeAttribute('success','no'); + $output->writeAttribute('info', + htmlspecialchars( + $e->getMessage() + )); + $output->writeAttribute('friendid', $friendid); + $output->endElement(); + } + + break; + + case 'remove-friend': + $friendid = isset($_POST['friendid']) ? $_POST['friendid'] : 0; + try { + $userid = isset($_POST['userid']) ? $_POST['userid'] : 0; + $token = isset($_POST['token']) ? $_POST['token'] : ""; + $session = ClientSession::get($token, $userid); + $session->RemoveFriend($friendid); + $output->startElement('remove-friend'); + $output->writeAttribute('success','yes'); + $output->writeAttribute('info',''); + $output->writeAttribute('friendid', $friendid); + $output->endElement(); + } + catch(Exception $e){ + $output->startElement('remove-friend'); + $output->writeAttribute('success','no'); + $output->writeAttribute('info', + htmlspecialchars( + $e->getMessage() + )); + $output->writeAttribute('friendid', $friendid); + $output->endElement(); + } + + break; + + case 'user-search': + try { + $userid = isset($_POST['userid']) ? $_POST['userid'] : 0; + $token = isset($_POST['token']) ? $_POST['token'] : ""; + $session = ClientSession::get($token, $userid); + $search_string = isset($_POST['search-string']) ? $_POST['search-string'] : ""; + $output->startElement('user-search'); + $output->writeAttribute('success','yes'); + $output->writeAttribute('info',''); + $output->writeAttribute('search-string', $search_string); + $output->insert(User::searchUsersAsXML($search_string)); + $output->endElement(); + } + catch(Exception $e){ + $output->startElement('user-search'); + $output->writeAttribute('success','no'); + $output->writeAttribute('info', + htmlspecialchars( + $e->getMessage() + )); + $output->endElement(); + } + + break; + case 'disconnect': try { - $id = isset($_GET['id']) ? $_GET['id'] : null; - $user = isset($_GET['user']) ? $_GET['user'] : null; - ClientSession::destroy($id, $user); - sendPlainMessage(200, 'Connection destroyed'); + $userid = isset($_POST['userid']) ? $_POST['userid'] : 0; + $token = isset($_POST['token']) ? $_POST['token'] : ""; + ClientSession::get($token, $userid)->destroy(); + $output->startElement('disconnect'); + $output->writeAttribute('success','yes'); + $output->writeAttribute('info',''); + $output->endElement(); } - catch (ClientSessionExpiredException $e) { - sendPlainMessage(403, $e->getMessage()); + catch(Exception $e){ + $output->startElement('disconnect'); + $output->writeAttribute('success','no'); + $output->writeAttribute('info', + htmlspecialchars( + $e->getMessage() + )); + $output->endElement(); } - catch (Exception $e) { - sendPlainMessage(500, $e->getMessage()); + break; + + case 'create_server': + try { + $userid = isset($_POST['userid']) ? $_POST['userid'] : 0; + $token = isset($_POST['token']) ? $_POST['token'] : ""; + $server_name = isset($_POST['name']) ? utf8_encode($_POST['name']) : ""; + $max_players = isset($_POST['max_players']) ? $_POST['max_players'] : 0; + $server = ClientSession::get($token, $userid)->createServer(0, 0, $server_name, $max_players); + $output->startElement('server_creation'); + $output->writeAttribute('success','yes'); + $output->writeAttribute('info',''); + $output->insert($server->asXML()); + $output->endElement(); + } + catch(Exception $e){ + $output->startElement('server_creation'); + $output->writeAttribute('success','no'); + $output->writeAttribute('info', + htmlspecialchars( + $e->getMessage() + )); + $output->endElement(); + } break; + + case 'register': + try { + $username = isset($_POST['username']) ? utf8_encode($_POST['username']) : ""; + $password = isset($_POST['password']) ? utf8_encode($_POST['password']) : ""; + $password_confirm = isset($_POST['password_confirm']) ? utf8_encode($_POST['password_confirm']) : "p"; + $email = isset($_POST['email']) ? utf8_encode($_POST['email']) : ""; + $terms = isset($_POST['terms']) ? utf8_encode($_POST['terms']) : ""; + User::register( $username, + $password, + $password_confirm, + $email, + $username, + $terms); + $output->startElement('registration'); + $output->writeAttribute('success','yes'); + $output->writeAttribute('info',''); + $output->endElement(); + } + catch(Exception $e){ + $output->startElement('registration'); + $output->writeAttribute('success','no'); + $output->writeAttribute('info', + htmlspecialchars( + $e->getMessage() + )); + $output->endElement(); + } + break; + + case 'recovery': + try { + $username = isset($_POST['username']) ? utf8_encode($_POST['username']) : ""; + $email = isset($_POST['email']) ? utf8_encode($_POST['email']) : ""; - case 'refresh': + User::recover( $username, $email); + $output->startElement('recovery'); + $output->writeAttribute('success','yes'); + $output->writeAttribute('info',''); + $output->endElement(); + } + catch(Exception $e){ + $output->startElement('recovery'); + $output->writeAttribute('success','no'); + $output->writeAttribute('info', + htmlspecialchars( + $e->getMessage() + )); + $output->endElement(); + } + break; + + case 'change_password': try { - $id = isset($_GET['id']) ? $_GET['id'] : null; - $user = isset($_GET['user']) ? $_GET['user'] : null; - $session = ClientSession::get($id, $user); - $session->regenerate(); - printConnectionXml($session); - break; + $userid = isset($_POST['userid']) ? $_POST['userid'] : 0; + $current = isset($_POST['current']) ? $_POST['current'] : ""; + $new1 = isset($_POST['new1']) ? $_POST['new1'] : ""; + $new2 = isset($_POST['new2']) ? $_POST['new2'] : ""; + User::verifyAndChangePassword($current, $new1, $new2, $userid); + $output->startElement('change_password'); + $output->writeAttribute('success','yes'); + $output->writeAttribute('info',''); + $output->endElement(); + } - catch (ClientSessionExpiredException $e) { - sendPlainMessage(403, $e->getMessage()); + catch(Exception $e){ + $output->startElement('change_password'); + $output->writeAttribute('success','no'); + $output->writeAttribute('info', + htmlspecialchars( + $e->getMessage() + )); + $output->endElement(); } break; + default: - sendPlainMessage(400, "I don't know what you want from me"); + $output->startElement('request'); + $output->writeAttribute('success','no'); + $output->writeAttribute('info', + htmlspecialchars( + _('Invalid action.') + )); + $output->endElement(); break; } + } catch (Exception $e) { - sendPlainMessage(500, $e->getMessage()); + $output->startElement('request'); + $output->writeAttribute('success','no'); + $output->writeAttribute('info', + htmlspecialchars( + _('An unexptected error occured.') .' '. + _('Please contact a website administrator.') + )); + $output->endElement(); } -function sendPlainMessage($status, $msg) -{ - ob_clean(); - header('Content-type: text/plain', true, $status); - echo $msg; -} - -function printConnectionXml(ClientSession $session) -{ - if ($session instanceof ClientSessionUser) { - printf('<connection id="%s" user="%d" rank="%s" registered="true" />', - $session->getSessionId(), $session->getUserId(), $session->getRank()); - } - else { - printf('<connection id="%s" rank="anon" registered="false" />', - $session->getSessionId()); - } -} - -ob_end_flush(); -?> \ No newline at end of file +$output->endDocument(); +$output->printToScreen(); +?> Modified: stkaddons/trunk/config-base.php =================================================================== --- stkaddons/trunk/config-base.php 2013-12-24 01:59:35 UTC (rev 14770) +++ stkaddons/trunk/config-base.php 2013-12-24 02:09:47 UTC (rev 14771) @@ -16,6 +16,13 @@ You should have received a copy of the GNU General Public License along with stkaddons. If not, see <http://www.gnu.org/licenses/>. */ +define("DEBUG_MODE", true); //FIXME turn off on server. +if (DEBUG_MODE){ + error_reporting(E_ALL); + ini_set('display_errors', 'On'); + ini_set('html_errors', 'On'); +} + $dirUpload = "/media/serveur/stkaddons/upload/"; $dirUploadCron = $dirUpload; $dirBase = "http://127.0.0.1/stkaddons/"; @@ -34,8 +41,8 @@ define("DB_USER", 'root'); define("DB_PASSWORD", 'pass'); define("DB_NAME", 'stkbase'); -define("DB_PREFIX", ''); -define("DB_HOST", 'localhost'); +define("DB_PREFIX", 'v2_'); +define("DB_HOST", 'localhost:3306'); define('MAIL_METHOD', 'sendmail'); // 'smtp' or 'sendmail' supported define('SENDMAIL_PATH', '/usr/bin/sendmail'); // Path to sendmail @@ -59,4 +66,4 @@ define("NEWS_XML_LOCAL", UP_LOCATION."xml/news.xml"); define("ASSET_XML_LOCAL", UP_LOCATION."xml/news.xml"); define("JPG_ROOT",ROOT); -?> \ No newline at end of file +?> Copied: stkaddons/trunk/include/Achievement.class.php (from rev 14252, stkaddons/branches/uni/include/Achievement.class.php) =================================================================== --- stkaddons/trunk/include/Achievement.class.php (rev 0) +++ stkaddons/trunk/include/Achievement.class.php 2013-12-24 02:09:47 UTC (rev 14771) @@ -0,0 +1,88 @@ +<?php +/** + * copyright 2013 Glenn De Jonghe + * + * This file is part of SuperTuxKart + * + * stkaddons is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * stkaddons is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with stkaddons. If not, see <http://www.gnu.org/licenses/>. + */ + +require_once(ROOT . 'include/exceptions.php'); +require_once(ROOT . 'include/DBConnection.class.php'); +require_once(ROOT . 'include/User.class.php'); +require_once(ROOT . 'include/ClientSession.class.php'); + + +class AchievementException extends Exception {} + +/** + * Achievement class + */ +class Achievement +{ + public static function getAchievementsOf($userid) + { + try{ + $result = DBConnection::get()->query + ( + "SELECT `achievementid` FROM " . DB_PREFIX ."achieved + WHERE `userid` = :userid", + DBConnection::FETCH_ALL, + array + ( + ':userid' => (int) $userid + ) + ); + }catch (DBException $e){ + throw new AchievementException( + _('An unexpected error occured while fetching the achieved achievements.') . ' ' . + _('Please contact a website administrator.')); + } + $string_list = ""; + foreach ($result as $r){ + $string_list .= $r['achievementid']; + $string_list .= ' '; + } + $string_list = trim($string_list); + return $string_list; + } + + public static function achieve($userid, $achievementid) + { + try{ + $count = DBConnection::get()->query + ( + "INSERT INTO `" . DB_PREFIX ."achieved` (`userid`, `achievementid`) + VALUES (:userid, :achievementid) + ON DUPLICATE KEY UPDATE `userid` = :userid", + DBConnection::ROW_COUNT, + array + ( + ':achievementid' => (int) $achievementid, + ':userid' => (int) $userid + ) + ); + }catch (DBException $e){ + if($e->getErrorCode() == "23503") + throw new AchievementException( + _("Provided an id of an achievement that doesn't exist in the database.")); + else + throw new AchievementException( + _('An unexpected error occured while confirming your achievement.') . ' ' . + _('Please contact a website administrator.')); + } + } +} + +?> Modified: stkaddons/trunk/include/AddonViewer.class.php =================================================================== --- stkaddons/trunk/include/AddonViewer.class.php 2013-12-24 01:59:35 UTC (rev 14770) +++ stkaddons/trunk/include/AddonViewer.class.php 2013-12-24 02:09:47 UTC (rev 14771) @@ -67,8 +67,8 @@ 'percent' => $this->rating->getAvgRatingPercent(), 'decimal' => $this->rating->getAvgRating(), 'count' => $this->rating->getNumRatings(), - 'min_rating' => 1, - 'max_rating' => 3 + 'min_rating' => 0.5, + 'max_rating' => 3.0 ), 'badges' => AddonViewer::badges($this->addon->getStatus()), 'image' => array( Modified: stkaddons/trunk/include/ClientSession.class.php =================================================================== --- stkaddons/trunk/include/ClientSession.class.php 2013-12-24 01:59:35 UTC (rev 14770) +++ stkaddons/trunk/include/ClientSession.class.php 2013-12-24 02:09:47 UTC (rev 14771) @@ -1,8 +1,8 @@ <?php /** - * copyright 2012 + * copyright 2013 Glenn De Jonghe * - * This file is part of stkaddons + * This file is part of SuperTuxKart * * stkaddons is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,167 +18,471 @@ * along with stkaddons. If not, see <http://www.gnu.org/licenses/>. */ -include_once('exceptions.php'); -include_once('sql.php'); -include_once('Validate.class.php'); +require_once(ROOT. 'include/Validate.class.php'); +require_once(ROOT. 'include/Server.class.php'); +require_once(ROOT. 'include/DBConnection.class.php'); +require_once(ROOT. 'include/exceptions.php'); +require_once(ROOT. 'include/User.class.php'); +require_once(ROOT. 'include/Friend.class.php'); +require_once(ROOT. 'include/Achievement.class.php'); + class ClientSessionException extends Exception {} class ClientSessionConnectException extends ClientSessionException {} class ClientSessionExpiredException extends ClientSessionException {} /** * Abstract base class for handling client sessions + * @property string $session_id + * @property int $user_id + * @property string $user_name */ abstract class ClientSession { - private $session_id; + protected $session_id; + protected $user_id; + protected $user_name; - protected function __construct($sessionid) + /** + * @param string $session_id + * @param int $user_id + * @param string $user_name + */ + protected function __construct($session_id, $user_id, $user_name) { - $this->session_id = $sessionid; + $this->session_id = $session_id; + $this->user_id = $user_id; + $this->user_name = $user_name; } /** * Get current session id * @return string session id */ - public function getSessionId() + public function getSessionID() { return $this->session_id; } /** - * Get user name for this session - * @return string user name - */ - abstract public function getName(); - - /** * Get user id for this session * @return int user id */ - abstract public function getUserId(); - + public function getUserID() + { + return $this->user_id; + } + /** - * Regenerate session with new session id + * Get user name for this session + * @return string user name */ - public function regenerate() + public function getUsername() { - $new_session_id = ClientSession::calcSessionId(); - $this->updateSessionId($new_session_id); - // nothing awful happend while updating database, can change attribute safely - $this->session_id = $new_session_id; + return $this->user_name; } - + /** - * Update session id in database table - * @param string new session id - */ - abstract protected function updateSessionId($session_id); - - /** * Create new session * @param string $username user name (registered user or temporary nickname) * @param string $password password of registered user (optional) + * @param bool * @return ClientSession object * @throws InvalidArgumentException when username is not provided */ - public static function create($username, $password = '') + public static function create($username, $password, $save_session) { if (empty($username)) { - throw new InvalidArgumentException('Username required'); + throw new InvalidArgumentException(_('Username required')); } else if (empty($password)) { - return ClientSessionAnonymous::create($username); + throw new InvalidArgumentException(_('Password required')); + //return ClientSessionAnonymous::create($username); } else { - return ClientSessionUser::create($username, $password); + return RegisteredClientSession::create($username, $password, $save_session); } } - + /** * Get session object for already created session * @param string $session_id session id - * @param mixed $user username (string) or numerical user id + * @param numeric $user_id user id * @return ClientSessionAnonymous|ClientSessionUser * @throws ClientSessionExpiredException when session does not exist */ - public static function get($session_id, $user) + public static function get($session_id, $user_id) { - $sql = null; - if (ctype_digit("$user") && $user > 0) { - $sql = sprintf("SELECT * FROM `%s` WHERE cid = '%s' AND uid = %d", - DB_PREFIX.'client_sessions', - mysql_real_escape_string($session_id), - (int) $user); + try{ + $session_info = DBConnection::get()->query + ( + "SELECT * FROM `" . DB_PREFIX . "client_sessions` + WHERE cid = :sessionid AND uid = :userid", + DBConnection::FETCH_ALL, + array + ( + ':sessionid' => (string) $session_id, + ':userid' => (int) $user_id + ) + ); + $size = count($session_info); + if ($size != 1) { + throw new ClientSessionExpiredException(_('Session not valid. Please sign in.')); + }else { + + //Valid session found, get more user info + $user_info = DBConnection::get()->query + ( + "SELECT `user`,`role` + FROM `" . DB_PREFIX . "users` + WHERE `id` = :userid", + DBConnection::FETCH_ALL, + array + ( + ':userid' => (int) $user_id + ) + ); + // here an if statement will come for Guest and registered + return new RegisteredClientSession( $session_info[0]["cid"], + $session_info[0]["uid"], + $user_info[0]["user"]); + } + }catch (DBException $e){ + throw new UserException( + _('An error occurred while verifying session.') .' '. + _('Please contact a website administrator.') + ); } - else { - $sql = sprintf("SELECT * FROM `%s` WHERE cid = '%s' AND name = '%s'", - DB_PREFIX.'client_sessions', - mysql_real_escape_string($session_id), - mysql_real_escape_string($user)); + } + + /** + * Destroy session, you could also call it logout + * @throws ClientSessionExpiredException when session does not exist + */ + public function destroy() + { + try{ + $count = DBConnection::get()->query( + "DELETE FROM `".DB_PREFIX."client_sessions` + WHERE `cid` = :session_id AND uid = :user_id", + DBConnection::ROW_COUNT, + array( + ':user_id' => (int) $this->user_id, + ':session_id' => (string) $this->session_id + ) + ); + }catch(DBException $e){ + throw new ClientSessionExpiredException( + _('An error occurred while signing out.') .' '. + _('Please contact a website administrator.') + ); } + } + + public function clientQuit() + { + try{ + DBConnection::get()->beginTransaction(); + $result = DBConnection::get()->query( + "SELECT `save` FROM `".DB_PREFIX."client_sessions` + WHERE `cid` = :session_id AND uid = :user_id", + DBConnection::FETCH_ALL, + array( + ':user_id' => (int) $this->user_id, + ':session_id' => (string) $this->session_id + ) + ); + if (count($result) == 1) + { + if($result[0]['save'] == 1) + { + $this->setOnline(false); + } + else + $this->destroy(); + } + DBConnection::get()->commit(); + }catch(DBException $e){ + throw new ClientSessionExpiredException( + _('An error occurred while logging out.') .' '. + _('Please contact a website administrator.') + ); + } + } - $result = sql_query($sql); - if (!$result || mysql_num_rows($result) == 0) { - throw new ClientSessionExpiredException('No session found'); + /** + * Sets the public address of a player + * @param int $id user id + * @param string $token user token + * @param int $ip user ip + * @param int $port user port + * @param int $private_port the private port (for LANs and special NATs) + * @throws UserException if the request fails + */ + public static function setPublicAddress($id, $token, $ip, $port, $private_port) + { + try{ + //Query the database to set the ip and port + $count = DBConnection::get()->query + ( + "UPDATE `" . DB_PREFIX . "client_sessions` + SET `ip` = :ip , `port` = :port, `private_port` = :private_port + WHERE `uid` = :userid AND `cid` = :token", + DBConnection::ROW_COUNT, + array + ( + ':ip' => $ip, + ':port' => $port, + ':private_port' => $private_port, + ':userid' => $id, + ':token' => $token + ) + ); + // if count = 0 that may be a re-update of an existing key + if ($count > 1) { + throw new UserException(htmlspecialchars(_('Could not set the ip:port'))); + } + }catch (DBException $e){ + throw new UserException( + _('An error occurred while setting ip:port.') .' '. + _('Please contact a website administrator.') + ); } - else { - $session_row = mysql_fetch_object($result); - if ($session_row->uid == 0) { - return new ClientSessionAnonymous($session_id, $session_row->name); + } + + /** + * Unsets the public address of a user + * @param int $id user id + * @param string $token user token + * @throws UserException if the request fails + */ + public static function unsetPublicAddress($id, $token) + { + try{ + $count = DBConnection::get()->query + ( + "UPDATE `" . DB_PREFIX . "client_sessions` + SET `ip` = '0' , `port` = '0' + WHERE `uid` = :userid AND `cid` = :token", + DBConnection::ROW_COUNT, + array + ( + ':userid' => $id, + ':token' => $token + ) + ); + if ($count == 0) { + throw new ClientSessionException(_('ID:Token must be wrong.')); } - else { ... [truncated message content] |