From a64d41557a62ec6051d7fa08d1ba941e089aa5c2 Mon Sep 17 00:00:00 2001 From: arno Date: Sat, 7 Aug 2010 12:05:20 +0200 Subject: [PATCH] allow anonymous routes creation --- COPYING.TXT | 5 +- application/controllers/GeomController.php | 10 +- application/controllers/IdxController.php | 12 +- application/controllers/LoginController.php | 6 +- application/controllers/PathController.php | 20 +- application/controllers/UserController.php | 1 - application/forms/Geom.php | 17 +- application/forms/User.php | 2 +- application/languages/lang_en.po | 287 +++++++++++------ application/languages/lang_fr.po | 298 ++++++++++++------ application/models/Path.php | 27 +- application/models/PathMapper.php | 16 +- application/models/User.php | 10 - application/models/UserMapper.php | 6 +- application/views/helpers/Anchor.php | 5 +- application/views/scripts/idx/index.phtml | 5 +- .../views/scripts/termsofuse/index.phtml | 6 +- public/css/syj.css | 6 + public/icons/bullet_arrow_down.png | Bin 0 -> 201 bytes public/icons/bullet_arrow_right.png | Bin 0 -> 229 bytes public/js/account.js | 3 +- public/js/contact.js | 3 +- public/js/login.js | 3 +- public/js/newpwd.js | 6 +- public/js/syj.js | 89 +++--- public/js/utils.js | 3 +- scripts/data.postgres.sql | 20 +- scripts/schema.postgres.sql | 17 +- 28 files changed, 549 insertions(+), 334 deletions(-) create mode 100644 public/icons/bullet_arrow_down.png create mode 100644 public/icons/bullet_arrow_right.png diff --git a/COPYING.TXT b/COPYING.TXT index 754dd92..5106604 100644 --- a/COPYING.TXT +++ b/COPYING.TXT @@ -2,8 +2,9 @@ Version 3, and redistributed under the conditions of this license. A copy of modified AGPL license is included in this file. -- delete.png comes form FamFamFam Silk Icons. Author is Mark James. It is - licensed under a Creative Commons Attribution 2.5 License. See +- delete.png, bullet_arrow_down.png and bullet_arrow_right.png comes form + FamFamFam Silk Icons. Author is Mark James. They are licensed under a + Creative Commons Attribution 2.5 License. See http://www.famfamfam.com/lab/icons/silk/ for more informations. diff --git a/application/controllers/GeomController.php b/application/controllers/GeomController.php index 38d5ce7..70acf76 100644 --- a/application/controllers/GeomController.php +++ b/application/controllers/GeomController.php @@ -24,8 +24,12 @@ class GeomController extends Zend_Controller_Action return; } - $api->setCheckIfNoneMatch(true)->setBody(json_encode( - array('owner' => (string)$path->owner->pseudo, 'geom' => (string)$path->geom) - )); + $data = array('geom' => (string)$path->geom, + 'title' => (string)$path->displayTitle); + if ($path->creator) { + $data['creator'] = (string)$path->creator->pseudo; + } + + $api->setCheckIfNoneMatch(true)->setBody(json_encode($data)); } } diff --git a/application/controllers/IdxController.php b/application/controllers/IdxController.php index ac31558..caad6a1 100644 --- a/application/controllers/IdxController.php +++ b/application/controllers/IdxController.php @@ -68,14 +68,12 @@ class IdxController extends Zend_Controller_Action } if (isset($path)) { - if ($user and $path->owner->id == $user->id) { - $loggedinfo->isowner = true; - } else { - $loggedinfo->isowner = false; + $loggedinfo->iscreator = $path->isCreator($user); + if ($path->creator) { + $loggedinfo->creatorname = $this->view->escape((string)$path->creator->pseudo); } - $loggedinfo->ownername = $this->view->escape((string)$path->owner->pseudo); } else { - $loggedinfo->isowner = true; + $loggedinfo->iscreator = true; } $this->view->headScript()->prependScript((string) $loggedinfo); @@ -93,8 +91,6 @@ class IdxController extends Zend_Controller_Action 'userEmptyWarn' => __("you must enter a login name"), 'loginSuccess' => __("Login correct"), 'loginFailure' => __("Wrong login/password"), - 'loginNeeded' => __("You need to login before retrying to save"), - 'cookiesNeeded' => __("You need to have cookies enabled to login to SYJ"), 'passwordEmptyWarn' => __("you must enter a password"), 'passwordNoMatchWarn' => __("Password do not match"), 'acceptTermsofuseWarn' => __("You must accept terms of use"), diff --git a/application/controllers/LoginController.php b/application/controllers/LoginController.php index dd07b1e..495c27c 100644 --- a/application/controllers/LoginController.php +++ b/application/controllers/LoginController.php @@ -63,13 +63,13 @@ class LoginController extends Zend_Controller_Action if (!$pathMapper->find((int)$login_geom_id, $path)) { throw new Syj_Exception_Request(); } - if ($path->owner->id === $userid) { - $api->setBody("1"); // owner of displayed geometry + if ($path->creator->id === $userid) { + $api->setBody("1"); // creator of displayed geometry } else { $api->setBody("0"); } } else { - $api->setBody("1"); // no geometry displayed: owner of the (future) geometry + $api->setBody("1"); // no geometry displayed: creator of the (future) geometry } } else { $this->redirect(); diff --git a/application/controllers/PathController.php b/application/controllers/PathController.php index 37394d0..6ef9529 100644 --- a/application/controllers/PathController.php +++ b/application/controllers/PathController.php @@ -6,12 +6,6 @@ class PathController extends Zend_Controller_Action { public function indexAction() { $formData = $this->_helper->SyjPostData->getPostData('Syj_Form_Geom'); - - $user = $this->_helper->SyjSession->user(); - if (!$user) { - throw new Syj_Exception_Forbidden(); - } - $decoder = new gisconverter\WKT(); try { @@ -32,16 +26,24 @@ class PathController extends Zend_Controller_Action } } $path->geom = $geom; + + $user = $this->_helper->SyjSession->user(); + if (!$user and !$formData["geom_accept"]) { + throw new Syj_Exception_Request(); + } + if ($path->getId()) { - if ($path->owner->id != $user->id) { - throw new Syj_Exception_Forbidden(); + if (!$path->isCreator($user)) { + throw new Syj_Exception_Request(); } } else { - $path->owner = $user; + $path->creator = $user; } + if (isset($formData["geom_title"])) { $path->title = $formData["geom_title"]; } + $path->creatorIp = $this->getRequest()->getClientIp(true); try { $pathMapper->save ($path); } catch(Zend_Db_Statement_Exception $e) { diff --git a/application/controllers/UserController.php b/application/controllers/UserController.php index ed078ad..2bd41d3 100644 --- a/application/controllers/UserController.php +++ b/application/controllers/UserController.php @@ -19,7 +19,6 @@ class UserController extends Zend_Controller_Action $user->pseudo = $formData["user_pseudo"]; $user->password = sha1($formData["user_password"]); $user->email = $formData["user_email"]; - $user->creationAddr = $this->getRequest()->getClientIp(true); if (Zend_Registry::isRegistered('Zend_Translate')) { $translator = Zend_Registry::get('Zend_Translate'); diff --git a/application/forms/Geom.php b/application/forms/Geom.php index 751d798..cad18a7 100644 --- a/application/forms/Geom.php +++ b/application/forms/Geom.php @@ -20,12 +20,23 @@ class Syj_Form_Geom extends Zend_Form 'attribs' => array('maxlength' => '40', 'size' => '20'), 'validators' => array(new Zend_Validate_StringLength(0, 40)) )); + + $translator = $this->getTranslator(); + $anchor = $this->getView()->Anchor("termsofuse", $translator->translate("terms of use"), array('id' => 'geom_termsofuse_anchor')); + $text = $translator->translate("I've read and accepted %s"); + $text = vsprintf($text, $anchor); + $touaccept = array('Checkbox', 'geom_accept', array("label" => $text, + 'decorators' => array( + 'ViewHelper', + 'label', + array('HtmlTag', array('tag' => 'div', 'id' => 'geom_accept_container'))))); + $submit = array('Submit', 'geom_submit', array('label' => __("save"))); - $this->addElements(array($id, $data, $title, $submit)); + $this->addElements(array($id, $data, $title, $touaccept, $submit)); - // fieldset around title - //$this->addDisplayGroup(array('geom_title'), 'metadata', array('decorators' => array('FormElements', 'Fieldset'))); + $decorator = $this->geom_accept->getDecorator('Zend_Form_Decorator_Label'); + $decorator->setOption('escape', false); $this->geom_title->addDecorator('HtmlTag', array('tag' => 'br', 'openOnly' => true))-> addDecorator('label'); diff --git a/application/forms/User.php b/application/forms/User.php index b74258a..40bd518 100644 --- a/application/forms/User.php +++ b/application/forms/User.php @@ -45,7 +45,7 @@ class Syj_Form_User extends Syj_Form_TableAbstract 'decorators' => array( 'ViewHelper', 'label', - array('HtmlTag', array('tag' => 'div'))), + array('HtmlTag', array('tag' => 'div', 'id' => 'user_accept_container'))), 'validators' => array(new Zend_Validate_Identical('1')))); $decorator = $this->user_accept->getDecorator('Zend_Form_Decorator_Label'); diff --git a/application/languages/lang_en.po b/application/languages/lang_en.po index fb6c771..542754f 100644 --- a/application/languages/lang_en.po +++ b/application/languages/lang_en.po @@ -2,7 +2,7 @@ msgid "" msgstr "" "Project-Id-Version: syj\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2010-08-02 11:52+0200\n" +"POT-Creation-Date: 2010-08-07 10:20+0200\n" "PO-Revision-Date: \n" "Last-Translator: arno \n" "Language-Team: arno \n" @@ -37,8 +37,12 @@ msgstr "go to main page" #: application/views/scripts/contact/index.phtml:8 #, php-format -msgid "There was an unkwown message when sending the message. Please try again later, or send a mail directly to %s" -msgstr "There was an unkwown message when sending the message. Please try again later, or send a mail directly to %s" +msgid "" +"There was an unkwown message when sending the message. Please try again " +"later, or send a mail directly to %s" +msgstr "" +"There was an unkwown message when sending the message. Please try again " +"later, or send a mail directly to %s" #: application/views/scripts/contact/success.phtml:4 msgid "Email was send successfully" @@ -53,8 +57,12 @@ msgid "Welcome on Syj." msgstr "Welcome on Syj." #: application/views/scripts/idx/index.phtml:17 -msgid "To create a journey, just click on the map to add points to your route. You can zoom and move map with controls upper left." -msgstr "To create a journey, just click on the map to add points to your route. You can zoom and move map with controls upper left." +msgid "" +"To create a journey, just click on the map to add points to your route. You " +"can zoom and move map with controls upper left." +msgstr "" +"To create a journey, just click on the map to add points to your route. You " +"can zoom and move map with controls upper left." #: application/views/scripts/idx/index.phtml:19 msgid "When you have finished a path, press \"save\", button." @@ -66,42 +74,85 @@ msgstr "edit" #: application/views/scripts/idx/index.phtml:35 #: application/controllers/LoginController.php:8 -#: application/layouts/scripts/footer.phtml:54 -#: application/forms/Login.php:26 +#: application/layouts/scripts/footer.phtml:54 application/forms/Login.php:26 msgid "login" msgstr "login" -#: application/views/scripts/idx/index.phtml:36 -#: application/views/scripts/idx/index.phtml:65 +#: application/views/scripts/idx/index.phtml:37 +#: application/views/scripts/idx/index.phtml:68 msgid "create an account" msgstr "create an account" +#: application/views/scripts/idx/index.phtml:38 +msgid "Whith an account, you can manage and modify your routes" +msgstr "Whith an account, you can manage and modify your routes" + #: application/views/scripts/termsofuse/index.phtml:3 -msgid "Show Your Journey is a site whose goal is to allow anyone to publish routes, for example, hiking itinerary, bicycle trip, travel itinerary or whatever." -msgstr "Show Your Journey is a site whose goal is to allow anyone to publish routes, for example, hiking itinerary, bicycle trip, travel itinerary or whatever." +msgid "" +"Show Your Journey is a site whose goal is to allow anyone to publish routes, " +"for example, hiking itinerary, bicycle trip, travel itinerary or whatever." +msgstr "" +"Show Your Journey is a site whose goal is to allow anyone to publish routes, " +"for example, hiking itinerary, bicycle trip, travel itinerary or whatever." #: application/views/scripts/termsofuse/index.phtml:7 -msgid "In order to publish a route, you must first create an account. A valid email is asked for, and ip address of account creation is stored on the server. Those informations will not be divulged to anyone without the user explicit permission." -msgstr "In order to publish a route, you must first create an account. A valid email is asked for, and ip address of account creation is stored on the server. Those informations will not be divulged to anyone without the user explicit permission." +msgid "" +"In order to publish a route, you must first create an account. A valid email " +"is asked for, and ip address of account creation is stored on the server. " +"Those informations will not be divulged to anyone without the user explicit " +"permission." +msgstr "" +"In order to publish a route, you must first create an account. A valid email " +"is asked for, and ip address of account creation is stored on the server. " +"Those informations will not be divulged to anyone without the user explicit " +"permission." #: application/views/scripts/termsofuse/index.phtml:11 -msgid "When you create a route, you accept that it's available under a creative commons by license. This means you accept that anyone can reproduce and republish your itinerary, or a modified version of it, under the condition that he specify the proper creator of this work. This also means you need to get appropriate permissions from the creator if you want to upload a route you didn't create yourself." -msgstr "When you create a route, you accept that it's available under a creative commons by license. This means you accept that anyone can reproduce and republish your itinerary, or a modified version of it, under the condition that he specify the proper creator of this work. This also means you need to get appropriate permissions from the creator if you want to upload a route you didn't create yourself." +msgid "" +"When you create a route, you accept that it's free for any use. This means " +"you accept that anyone can reuse, reproduce, or republish your itinerary, or " +"a modified version of it for any purpose. This also means you need to get " +"appropriate permissions from the creator if you want to upload a route you " +"didn't create yourself." +msgstr "" +"When you create a route, you accept that it's free for any use. This means " +"you accept that anyone can reuse, reproduce, or republish your itinerary, or " +"a modified version of it for any purpose. This also means you need to get " +"appropriate permissions from the creator if you want to upload a route you " +"didn't create yourself." #: application/views/scripts/termsofuse/index.phtml:15 -msgid "Show Your Journey is not responsible for the accuracy of the routes published. It's the user responsibility to check that a route is accessible and safe." -msgstr "Show Your Journey is not responsible for the accuracy of the routes published. It's the user responsibility to check that a route is accessible and safe." +msgid "" +"Show Your Journey is not responsible for the accuracy of the routes " +"published. It's the user responsibility to check that a route is accessible " +"and safe." +msgstr "" +"Show Your Journey is not responsible for the accuracy of the routes " +"published. It's the user responsibility to check that a route is accessible " +"and safe." #: application/views/scripts/termsofuse/index.phtml:19 -msgid "Show Your Journey service is provided \"as is\" with no guarantee for accuracy or accessibility." -msgstr "Show Your Journey service is provided \"as is\" with no guarantee for accuracy or accessibility." +msgid "" +"Show Your Journey service is provided \"as is\" with no guarantee for " +"accuracy or accessibility." +msgstr "" +"Show Your Journey service is provided \"as is\" with no guarantee for " +"accuracy or accessibility." #: application/views/scripts/termsofuse/index.phtml:23 -msgid "Sources of the software running the website are publicly available under a agpl license. The map used to display the routes comes from openstreetmap." -msgstr "Sources of the software running the website are publicly available under a agpl license. The map used to display the routes comes from openstreetmap." +msgid "" +"Sources of the software running the website are publicly available under a agpl license. The " +"map used to display the routes comes from openstreetmap." +msgstr "" +"Sources of the software running the website are publicly available under a agpl license. The " +"map used to display the routes comes from openstreetmap." #: application/views/scripts/newpwd/success.phtml:4 -#: application/controllers/IdxController.php:106 +#: application/controllers/IdxController.php:102 msgid "A link to reset your password has been emailed to you" msgstr "A link to reset your password has been emailed to you" @@ -140,8 +191,14 @@ msgstr "log in" #: application/views/scripts/pending/password_validate.phtml:15 #, php-format -msgid "Your new password is now %s. You can %s with this new password. Don't forget to change it again to a personal password as soon as possible." -msgstr "Your new password is now %s. You can %s with this new password. Don't forget to change it again to a personal password as soon as possible." +msgid "" +"Your new password is now %s. You can %s with this new " +"password. Don't forget to change it again to a personal password as soon as " +"possible." +msgstr "" +"Your new password is now %s. You can %s with this new " +"password. Don't forget to change it again to a personal password as soon as " +"possible." #: application/views/scripts/account/success.phtml:4 msgid "Your account was modified successfully" @@ -175,13 +232,15 @@ msgstr "[SYJ] Reset your password" msgid "" "Hi %user%,\n" "\n" -"Someone, probably you, has asked to reset your password. If you want to reset\n" +"Someone, probably you, has asked to reset your password. If you want to " +"reset\n" "your password, please follow this link:\n" "%hashurl%\n" "\n" "If you do not not confirm within 2 days, your password will not be reset.\n" "\n" -"Please do not reply this email. If you need to contact us, please use the form\n" +"Please do not reply this email. If you need to contact us, please use the " +"form\n" "contact at %contacturl%\n" "\n" "Thanks,\n" @@ -190,13 +249,15 @@ msgid "" msgstr "" "Hi %user%,\n" "\n" -"Someone, probably you, has asked to reset your password. If you want to reset\n" +"Someone, probably you, has asked to reset your password. If you want to " +"reset\n" "your password, please follow this link:\n" "%hashurl%\n" "\n" "If you do not not confirm within 2 days, your password will not be reset.\n" "\n" -"Please do not reply this email. If you need to contact us, please use the form\n" +"Please do not reply this email. If you need to contact us, please use the " +"form\n" "contact at %contacturl%\n" "\n" "Thanks,\n" @@ -211,14 +272,17 @@ msgstr "[SYJ] Validate your account" msgid "" "Hi %user%, and welcome on syj\n" "\n" -"Your account is currently active, but you need to confirm your inscription by\n" +"Your account is currently active, but you need to confirm your inscription " +"by\n" "following this link:\n" "%hashurl%\n" "\n" -"If you do not not confirm your inscription within 7 days, your account and all\n" +"If you do not not confirm your inscription within 7 days, your account and " +"all\n" "your items will be deleted.\n" "\n" -"Please do not reply this email. If you need to contact us, please use the form\n" +"Please do not reply this email. If you need to contact us, please use the " +"form\n" "contact at %contacturl%\n" "\n" "Thanks,\n" @@ -227,14 +291,17 @@ msgid "" msgstr "" "Hi %user%, and welcome on syj\n" "\n" -"Your account is currently active, but you need to confirm your inscription by\n" +"Your account is currently active, but you need to confirm your inscription " +"by\n" "following this link:\n" "%hashurl%\n" "\n" -"If you do not not confirm your inscription within 7 days, your account and all\n" +"If you do not not confirm your inscription within 7 days, your account and " +"all\n" "your items will be deleted.\n" "\n" -"Please do not reply this email. If you need to contact us, please use the form\n" +"Please do not reply this email. If you need to contact us, please use the " +"form\n" "contact at %contacturl%\n" "\n" "Thanks,\n" @@ -253,7 +320,8 @@ msgid "" "account will be deleted tomorrow. Please follow this link:\n" "%hashurl%\n" "\n" -"Please do not reply this email. If you need to contact us, please use the form\n" +"Please do not reply this email. If you need to contact us, please use the " +"form\n" "contact at %contacturl%\n" "\n" "Thanks,\n" @@ -266,7 +334,8 @@ msgstr "" "account will be deleted tomorrow. Please follow this link:\n" "%hashurl%\n" "\n" -"Please do not reply this email. If you need to contact us, please use the form\n" +"Please do not reply this email. If you need to contact us, please use the " +"form\n" "contact at %contacturl%\n" "\n" "Thanks,\n" @@ -281,11 +350,13 @@ msgstr "[SYJ] Account deactivated" msgid "" "Hi %user%,\n" "\n" -"You have not validated your syj account on time. Therefore, your account and\n" +"You have not validated your syj account on time. Therefore, your account " +"and\n" "all your data have been deleted. Nevertheless, you can still create a new\n" "account.\n" "\n" -"Please do not reply this email. If you need to contact us, please use the form\n" +"Please do not reply this email. If you need to contact us, please use the " +"form\n" "contact at %contacturl%\n" "\n" "Regards,\n" @@ -294,11 +365,13 @@ msgid "" msgstr "" "Hi %user%,\n" "\n" -"You have not validated your syj account on time. Therefore, your account and\n" +"You have not validated your syj account on time. Therefore, your account " +"and\n" "all your data have been deleted. Nevertheless, you can still create a new\n" "account.\n" "\n" -"Please do not reply this email. If you need to contact us, please use the form\n" +"Please do not reply this email. If you need to contact us, please use the " +"form\n" "contact at %contacturl%\n" "\n" "Regards,\n" @@ -306,7 +379,7 @@ msgstr "" "Syj team" #: application/controllers/LoginController.php:101 -#: application/controllers/IdxController.php:92 +#: application/controllers/IdxController.php:90 msgid "you must enter a login name" msgstr "you must enter a login name" @@ -350,8 +423,7 @@ msgid "Value is required and can't be empty" msgstr "Value is required and can't be empty" #: application/controllers/ContactController.php:123 -#: application/forms/Contact.php:32 -#: application/validate/EmailAddress.php:13 +#: application/forms/Contact.php:32 application/validate/EmailAddress.php:13 msgid "Invalid email" msgstr "Invalid email" @@ -360,8 +432,7 @@ msgid "Oups, something went wrong" msgstr "Oups, something went wrong" #: application/controllers/TermsofuseController.php:12 -#: application/layouts/scripts/footer.phtml:67 -#: application/forms/User.php:41 +#: application/layouts/scripts/footer.phtml:67 application/forms/User.php:41 msgid "terms of use" msgstr "terms of use" @@ -375,19 +446,18 @@ msgid "Wrong password" msgstr "Wrong password" #: application/controllers/AccountController.php:56 -#: application/controllers/IdxController.php:104 +#: application/controllers/IdxController.php:100 msgid "an user is already registered with this email" msgstr "an user is already registered with this email" #: application/controllers/AccountController.php:84 -#: application/controllers/IdxController.php:98 +#: application/controllers/IdxController.php:94 #: application/forms/Account.php:40 msgid "Password do not match" msgstr "Password do not match" #: application/controllers/AccountController.php:85 -#: application/forms/Account.php:33 -#: application/forms/User.php:18 +#: application/forms/Account.php:33 application/forms/User.php:18 #, php-format msgid "At least %d characters" msgstr "At least %d characters" @@ -396,87 +466,85 @@ msgstr "At least %d characters" msgid "You have made no change" msgstr "You have made no change" -#: application/controllers/IdxController.php:85 +#: application/controllers/IdxController.php:83 msgid "save took place successfully" msgstr "save took place successfully" -#: application/controllers/IdxController.php:86 -msgid "server did not understood request. That's probably caused by a bug in SYJ" -msgstr "server did not understood request. That's probably caused by a bug in SYJ" +#: application/controllers/IdxController.php:84 +msgid "" +"server did not understood request. That's probably caused by a bug in SYJ" +msgstr "" +"server did not understood request. That's probably caused by a bug in SYJ" -#: application/controllers/IdxController.php:87 +#: application/controllers/IdxController.php:85 msgid "path did not exist in the server. May be it has been already deleted" msgstr "path did not exist in the server. May be it has been already deleted" -#: application/controllers/IdxController.php:88 -msgid "similar path seems to already exist. Please do not create two exactly identical paths" -msgstr "similar path seems to already exist. Please do not create two exactly identical paths" +#: application/controllers/IdxController.php:86 +msgid "" +"similar path seems to already exist. Please do not create two exactly " +"identical paths" +msgstr "" +"similar path seems to already exist. Please do not create two exactly " +"identical paths" -#: application/controllers/IdxController.php:89 +#: application/controllers/IdxController.php:87 msgid "server could not be reached" msgstr "server could not be reached" -#: application/controllers/IdxController.php:90 +#: application/controllers/IdxController.php:88 msgid "there was a server error" msgstr "there was a server error" -#: application/controllers/IdxController.php:91 +#: application/controllers/IdxController.php:89 msgid "there was an unknown error" msgstr "there was an unknown error" -#: application/controllers/IdxController.php:93 +#: application/controllers/IdxController.php:91 msgid "Login correct" msgstr "Login correct" -#: application/controllers/IdxController.php:94 +#: application/controllers/IdxController.php:92 msgid "Wrong login/password" msgstr "Wrong login/password" -#: application/controllers/IdxController.php:95 -msgid "You need to login before retrying to save" -msgstr "You need to login before retrying to save" - -#: application/controllers/IdxController.php:96 -msgid "You need to have cookies enabled to login to SYJ" -msgstr "You need to have cookies enabled to login to SYJ" - -#: application/controllers/IdxController.php:97 +#: application/controllers/IdxController.php:93 msgid "you must enter a password" msgstr "you must enter a password" -#: application/controllers/IdxController.php:99 +#: application/controllers/IdxController.php:95 msgid "You must accept terms of use" msgstr "You must accept terms of use" -#: application/controllers/IdxController.php:100 +#: application/controllers/IdxController.php:96 msgid "you must enter an email" msgstr "you must enter an email" -#: application/controllers/IdxController.php:101 +#: application/controllers/IdxController.php:97 msgid "invalid email" msgstr "invalid email" -#: application/controllers/IdxController.php:102 +#: application/controllers/IdxController.php:98 msgid "pseudo must only contain letters, digits, dots or underscores" msgstr "pseudo must only contain letters, digits, dots or underscores" -#: application/controllers/IdxController.php:103 +#: application/controllers/IdxController.php:99 msgid "unavailable pseudo" msgstr "unavailable pseudo" -#: application/controllers/IdxController.php:105 +#: application/controllers/IdxController.php:101 msgid "Account created" msgstr "Account created" -#: application/controllers/IdxController.php:107 +#: application/controllers/IdxController.php:103 msgid "Now, you can retry to save" msgstr "Now, you can retry to save" -#: application/controllers/IdxController.php:108 +#: application/controllers/IdxController.php:104 msgid "route by" msgstr "route by" -#: application/controllers/IdxController.php:109 +#: application/controllers/IdxController.php:105 msgid "Map by OpenStreetMap" msgstr "Map by OpenStreetMap" @@ -492,8 +560,7 @@ msgstr "contact" msgid "user" msgstr "user" -#: application/forms/Login.php:10 -#: application/forms/Account.php:35 +#: application/forms/Login.php:10 application/forms/Account.php:35 #: application/forms/User.php:21 msgid "password" msgstr "password" @@ -535,14 +602,12 @@ msgstr "optional title for this journey" msgid "save" msgstr "save" -#: application/forms/Account.php:27 -#: application/forms/User.php:34 +#: application/forms/Account.php:27 application/forms/User.php:34 #: application/forms/Newpwd.php:28 msgid "email" msgstr "email" -#: application/forms/Account.php:42 -#: application/forms/User.php:28 +#: application/forms/Account.php:42 application/forms/User.php:28 msgid "confirm password" msgstr "confirm password" @@ -559,8 +624,14 @@ msgid "user name" msgstr "user name" #: application/forms/User.php:35 -msgid "After creating your account, you will receive a confirmation email. You have 7 days to confirm otherwise, your account and your routes will all be deleted." -msgstr "After creating your account, you will receive a confirmation email. You have 7 days to confirm otherwise, your account and your routes will all be deleted." +msgid "" +"After creating your account, you will receive a confirmation email. You have " +"7 days to confirm otherwise, your account and your routes will all be " +"deleted." +msgstr "" +"After creating your account, you will receive a confirmation email. You have " +"7 days to confirm otherwise, your account and your routes will all be " +"deleted." #: application/forms/User.php:42 #, php-format @@ -573,8 +644,12 @@ msgstr "create account" #: application/forms/Pending/ResetPassword.php:11 #, php-format -msgid "Hi %s. Someone, probably you, has asked to reset password for your account. To get a new password, validate with following button." -msgstr "Hi %s. Someone, probably you, has asked to reset password for your account. To get a new password, validate with following button." +msgid "" +"Hi %s. Someone, probably you, has asked to reset password for your account. " +"To get a new password, validate with following button." +msgstr "" +"Hi %s. Someone, probably you, has asked to reset password for your account. " +"To get a new password, validate with following button." #: application/forms/Pending/ResetPassword.php:16 #: application/forms/Newpwd.php:33 @@ -586,24 +661,42 @@ msgid "cancel request" msgstr "cancel request" #: application/forms/Pending/ResetPassword.php:24 -msgid "To cancel this request, press following button. Your password will not change." -msgstr "To cancel this request, press following button. Your password will not change." +msgid "" +"To cancel this request, press following button. Your password will not " +"change." +msgstr "" +"To cancel this request, press following button. Your password will not " +"change." #: application/forms/Pending/ValidateCreation.php:11 #, php-format -msgid "Someone, probably you, has registered an account %s with email address %s on syj. To confirm this account creation, validate with following button." -msgstr "Someone, probably you, has registered an account %s with email address %s on syj. To confirm this account creation, validate with following button." +msgid "" +"Someone, probably you, has registered an account %s with email address %s on " +"syj. To confirm this account creation, validate with following button." +msgstr "" +"Someone, probably you, has registered an account %s with email address %s on " +"syj. To confirm this account creation, validate with following button." #: application/forms/Pending/ValidateCreation.php:23 msgid "delete" msgstr "delete" #: application/forms/Pending/ValidateCreation.php:24 -msgid "To cancel account creation, press following button. The account and all its data will be deleted." -msgstr "To cancel account creation, press following button. The account and all its data will be deleted." +msgid "" +"To cancel account creation, press following button. The account and all its " +"data will be deleted." +msgstr "" +"To cancel account creation, press following button. The account and all its " +"data will be deleted." + +#~ msgid "You need to login before retrying to save" +#~ msgstr "You need to login before retrying to save" + +#~ msgid "You need to have cookies enabled to login to SYJ" +#~ msgstr "You need to have cookies enabled to login to SYJ" #~ msgid "main page" #~ msgstr "main page" + #~ msgid "reset password" #~ msgstr "reset password" - diff --git a/application/languages/lang_fr.po b/application/languages/lang_fr.po index 49da3b5..8951ba1 100644 --- a/application/languages/lang_fr.po +++ b/application/languages/lang_fr.po @@ -2,11 +2,7 @@ msgid "" msgstr "" "Project-Id-Version: syj\n" "Report-Msgid-Bugs-To: \n" -<<<<<<< HEAD -"POT-Creation-Date: 2010-08-02 11:52+0200\n" -======= -"POT-Creation-Date: 2010-08-07 09:23+0200\n" ->>>>>>> d6dc392... terms of use about service availibity +"POT-Creation-Date: 2010-08-07 10:20+0200\n" "PO-Revision-Date: \n" "Last-Translator: arno \n" "Language-Team: arno \n" @@ -41,8 +37,12 @@ msgstr "aller à la page d'accueil" #: application/views/scripts/contact/index.phtml:8 #, php-format -msgid "There was an unkwown message when sending the message. Please try again later, or send a mail directly to %s" -msgstr "Il s'est produit une erreur inconnue lors de l'envoi du message. Merci de réessayer plus tard, ou d'écrire directement à %s" +msgid "" +"There was an unkwown message when sending the message. Please try again " +"later, or send a mail directly to %s" +msgstr "" +"Il s'est produit une erreur inconnue lors de l'envoi du message. Merci de " +"réessayer plus tard, ou d'écrire directement à %s" #: application/views/scripts/contact/success.phtml:4 msgid "Email was send successfully" @@ -50,15 +50,22 @@ msgstr "L'email a été envoyé avec succès" #: application/views/scripts/idx/index.phtml:8 msgid "SYJ needs javascript. Please activate scripts in your browser." -msgstr "SYJ a besoin de javascript pour fonctionner. Veuillez activer les scripts dans votre navigateur." +msgstr "" +"SYJ a besoin de javascript pour fonctionner. Veuillez activer les scripts " +"dans votre navigateur." #: application/views/scripts/idx/index.phtml:15 msgid "Welcome on Syj." msgstr "Bienvenue sur Syj." #: application/views/scripts/idx/index.phtml:17 -msgid "To create a journey, just click on the map to add points to your route. You can zoom and move map with controls upper left." -msgstr "Pour créer un trajet, cliquez simplement sur la carte pour ajouter des points à votre tracé. Vous pouvez zoomer et bouger la carte avec les boutons en haut à gauche." +msgid "" +"To create a journey, just click on the map to add points to your route. You " +"can zoom and move map with controls upper left." +msgstr "" +"Pour créer un trajet, cliquez simplement sur la carte pour ajouter des " +"points à votre tracé. Vous pouvez zoomer et bouger la carte avec les boutons " +"en haut à gauche." #: application/views/scripts/idx/index.phtml:19 msgid "When you have finished a path, press \"save\", button." @@ -70,44 +77,90 @@ msgstr "modifier" #: application/views/scripts/idx/index.phtml:35 #: application/controllers/LoginController.php:8 -#: application/layouts/scripts/footer.phtml:54 -#: application/forms/Login.php:26 +#: application/layouts/scripts/footer.phtml:54 application/forms/Login.php:26 msgid "login" msgstr "connexion" -#: application/views/scripts/idx/index.phtml:36 -#: application/views/scripts/idx/index.phtml:65 +#: application/views/scripts/idx/index.phtml:37 +#: application/views/scripts/idx/index.phtml:68 msgid "create an account" msgstr "créer un compte" +#: application/views/scripts/idx/index.phtml:38 +msgid "Whith an account, you can manage and modify your routes" +msgstr "Avec un compte, vous pourrez gérer et modifier vos itinéraires" + #: application/views/scripts/termsofuse/index.phtml:3 -msgid "Show Your Journey is a site whose goal is to allow anyone to publish routes, for example, hiking itinerary, bicycle trip, travel itinerary or whatever." -msgstr "Show Your Journey est un site dont le but est de permettre à quiconque de publier des itinéraires, par exemples, des itinéraires de randonnées, des trajets cyclistes, des itinéraires de voyages, ou n'importe quoi d'autre." +msgid "" +"Show Your Journey is a site whose goal is to allow anyone to publish routes, " +"for example, hiking itinerary, bicycle trip, travel itinerary or whatever." +msgstr "" +"Show Your Journey est un site dont le but est de permettre à quiconque de " +"publier des itinéraires, par exemples, des itinéraires de randonnées, des " +"trajets cyclistes, des itinéraires de voyages, ou n'importe quoi d'autre." #: application/views/scripts/termsofuse/index.phtml:7 -msgid "In order to publish a route, you must first create an account. A valid email is asked for, and ip address of account creation is stored on the server. Those informations will not be divulged to anyone without the user explicit permission." -msgstr "Pour publier un itinéraire, vous devez tout d'abord créer un compte. Un email valide est demandé, et l'adresse ip de création du compte est enregistrée sur le serveur. Ces informations ne seront divulguées à personne sans la permission explicite de l'utilisateur." +msgid "" +"In order to publish a route, you must first create an account. A valid email " +"is asked for, and ip address of account creation is stored on the server. " +"Those informations will not be divulged to anyone without the user explicit " +"permission." +msgstr "" +"Pour publier un itinéraire, vous devez tout d'abord créer un compte. Un " +"email valide est demandé, et l'adresse ip de création du compte est " +"enregistrée sur le serveur. Ces informations ne seront divulguées à personne " +"sans la permission explicite de l'utilisateur." #: application/views/scripts/termsofuse/index.phtml:11 -msgid "When you create a route, you accept that it's available under a creative commons by license. This means you accept that anyone can reproduce and republish your itinerary, or a modified version of it, under the condition that he specify the proper creator of this work. This also means you need to get appropriate permissions from the creator if you want to upload a route you didn't create yourself." -msgstr "Lorsque vous créez un itinéraire, vous acceptez qu'il soit disponible sous licence creative commons by. Cela veut dire que n'importe qui peut reproduire et redistribuer votre itinéraire, ou une version modifiée de celui-ci, à la condition qu'il indique correctement l'auteur de l'œuvre. Cela veut également dire que vous devez obtenir les autorisations nécessaires si vous voulez publier un itinéraire dont vous n'êtes pas l'auteur." +msgid "" +"When you create a route, you accept that it's free for any use. This means " +"you accept that anyone can reuse, reproduce, or republish your itinerary, or " +"a modified version of it for any purpose. This also means you need to get " +"appropriate permissions from the creator if you want to upload a route you " +"didn't create yourself." +msgstr "" +"Lorsque vous créez un itinéraire, vous acceptez qu'il soit utilisable sans " +"restriction. Cela veut dire que n'importe qui peut réutiliser, reproduire ou " +"redistribuer votre itinéraire, ou une version modifiée de celui-ci, et pour " +"n'importe quel usage. Cela veut également dire que vous devez obtenir les " +"autorisations nécessaires si vous voulez publier un itinéraire dont vous " +"n'êtes pas l'auteur." #: application/views/scripts/termsofuse/index.phtml:15 -msgid "Show Your Journey is not responsible for the accuracy of the routes published. It's the user responsibility to check that a route is accessible and safe." -msgstr "Show Your Journey n'est pas responsable de l'exactitude des itinéraires publiés. Il appartient à l'utilisateur de vérifier qu'un chemin est praticable et sécurisé." +msgid "" +"Show Your Journey is not responsible for the accuracy of the routes " +"published. It's the user responsibility to check that a route is accessible " +"and safe." +msgstr "" +"Show Your Journey n'est pas responsable de l'exactitude des itinéraires " +"publiés. Il appartient à l'utilisateur de vérifier qu'un chemin est " +"praticable et sécurisé." #: application/views/scripts/termsofuse/index.phtml:19 -msgid "Show Your Journey service is provided \"as is\" with no guarantee for accuracy or accessibility." -msgstr "Show Your Journey est proposé sans garantie de fiabilité ou de disponibilité." +msgid "" +"Show Your Journey service is provided \"as is\" with no guarantee for " +"accuracy or accessibility." +msgstr "" +"Show Your Journey est proposé sans garantie de fiabilité ou de disponibilité." #: application/views/scripts/termsofuse/index.phtml:23 -msgid "Sources of the software running the website are publicly available under a agpl license. The map used to display the routes comes from openstreetmap." -msgstr "Les sources du logiciel qui fait tourner le site web sont disponibles publiquement sous une licence agpl. La carte utilisée pour l'affichage des itinéraires vient d'openstreetmap." +msgid "" +"Sources of the software running the website are publicly available under a agpl license. The " +"map used to display the routes comes from openstreetmap." +msgstr "" +"Les sources du logiciel qui fait tourner le site web sont disponibles publiquement sous une licence " +"agpl. La carte utilisée pour l'affichage des itinéraires vient d'openstreetmap." #: application/views/scripts/newpwd/success.phtml:4 -#: application/controllers/IdxController.php:106 +#: application/controllers/IdxController.php:102 msgid "A link to reset your password has been emailed to you" -msgstr "Un email contenant un lien pour réinitialiser votre mot de passe vous a été envoyé" +msgstr "" +"Un email contenant un lien pour réinitialiser votre mot de passe vous a été " +"envoyé" #: application/views/scripts/pending/password_cancel.phtml:12 msgid "You have canceled the request." @@ -144,8 +197,14 @@ msgstr "vous connecter" #: application/views/scripts/pending/password_validate.phtml:15 #, php-format -msgid "Your new password is now %s. You can %s with this new password. Don't forget to change it again to a personal password as soon as possible." -msgstr "Votre nouveau mot de passe est %s. Vous pouvez %s avec le nouveau mot de passe. N'oubliez pas de le rechanger le plus tôt possible pour utiliser un mot de passe personnel." +msgid "" +"Your new password is now %s. You can %s with this new " +"password. Don't forget to change it again to a personal password as soon as " +"possible." +msgstr "" +"Votre nouveau mot de passe est %s. Vous pouvez %s avec le " +"nouveau mot de passe. N'oubliez pas de le rechanger le plus tôt possible " +"pour utiliser un mot de passe personnel." #: application/views/scripts/account/success.phtml:4 msgid "Your account was modified successfully" @@ -178,13 +237,15 @@ msgstr "[SYJ] Réinitialisation de votre mot de passe" msgid "" "Hi %user%,\n" "\n" -"Someone, probably you, has asked to reset your password. If you want to reset\n" +"Someone, probably you, has asked to reset your password. If you want to " +"reset\n" "your password, please follow this link:\n" "%hashurl%\n" "\n" "If you do not not confirm within 2 days, your password will not be reset.\n" "\n" -"Please do not reply this email. If you need to contact us, please use the form\n" +"Please do not reply this email. If you need to contact us, please use the " +"form\n" "contact at %contacturl%\n" "\n" "Thanks,\n" @@ -200,7 +261,8 @@ msgstr "" "Si vous n'avez pas confirmé d'ici 2 jours, votre mot de passe ne sera pas\n" "réinitialisé.\n" "\n" -"Veuillez ne pas répondre à cet email. Si vous avez besoin de nous contacter,\n" +"Veuillez ne pas répondre à cet email. Si vous avez besoin de nous " +"contacter,\n" "merci d'utiliser le formulaire à l'adresse suivante:\n" "%contacturl%\n" "\n" @@ -216,14 +278,17 @@ msgstr "[SYJ] Validation de la création du compte" msgid "" "Hi %user%, and welcome on syj\n" "\n" -"Your account is currently active, but you need to confirm your inscription by\n" +"Your account is currently active, but you need to confirm your inscription " +"by\n" "following this link:\n" "%hashurl%\n" "\n" -"If you do not not confirm your inscription within 7 days, your account and all\n" +"If you do not not confirm your inscription within 7 days, your account and " +"all\n" "your items will be deleted.\n" "\n" -"Please do not reply this email. If you need to contact us, please use the form\n" +"Please do not reply this email. If you need to contact us, please use the " +"form\n" "contact at %contacturl%\n" "\n" "Thanks,\n" @@ -236,10 +301,12 @@ msgstr "" "suivant ce lien:\n" "%hashurl%\n" "\n" -"Si vous ne confirmez pas votre inscription d'ici 7 jours, votre compte ainsi que\n" +"Si vous ne confirmez pas votre inscription d'ici 7 jours, votre compte ainsi " +"que\n" "toutes vos modifications seront supprimés.\n" "\n" -"Veuillez ne pas répondre à cet email. Si vous avez besoin de nous contacter,\n" +"Veuillez ne pas répondre à cet email. Si vous avez besoin de nous " +"contacter,\n" "merci d'utiliser le formulaire à l'adresse suivante:\n" "%contacturl%\n" "\n" @@ -259,7 +326,8 @@ msgid "" "account will be deleted tomorrow. Please follow this link:\n" "%hashurl%\n" "\n" -"Please do not reply this email. If you need to contact us, please use the form\n" +"Please do not reply this email. If you need to contact us, please use the " +"form\n" "contact at %contacturl%\n" "\n" "Thanks,\n" @@ -272,7 +340,8 @@ msgstr "" "validez pas, il sera supprimé demain. Merci de suivre ce lien:\n" "%hashurl%\n" "\n" -"VVeuillez ne pas répondre à cet email. Si vous avez besoin de nous contacter,\n" +"VVeuillez ne pas répondre à cet email. Si vous avez besoin de nous " +"contacter,\n" "merci d'utiliser le formulaire à l'adresse suivante:\n" "%contacturl%\n" "\n" @@ -288,11 +357,13 @@ msgstr "[SYJ] Compte désactivé" msgid "" "Hi %user%,\n" "\n" -"You have not validated your syj account on time. Therefore, your account and\n" +"You have not validated your syj account on time. Therefore, your account " +"and\n" "all your data have been deleted. Nevertheless, you can still create a new\n" "account.\n" "\n" -"Please do not reply this email. If you need to contact us, please use the form\n" +"Please do not reply this email. If you need to contact us, please use the " +"form\n" "contact at %contacturl%\n" "\n" "Regards,\n" @@ -305,14 +376,15 @@ msgstr "" "vous données ont donc été supprimés. Vous pouvez toujours recréer\n" "un nouveau compte.\n" "\n" -"Veuillez ne pas répondre à cet email. Si vous avez besoin de nous contacter,\n" +"Veuillez ne pas répondre à cet email. Si vous avez besoin de nous " +"contacter,\n" "merci d'utiliser le formulaire à l'adresse suivante:\n" "%contacturl%\n" "\n" "L'équipe de Syj" #: application/controllers/LoginController.php:101 -#: application/controllers/IdxController.php:92 +#: application/controllers/IdxController.php:90 msgid "you must enter a login name" msgstr "vous devez entrer un nom d'utilisateur" @@ -356,8 +428,7 @@ msgid "Value is required and can't be empty" msgstr "Le champ est requis, et ne doit pas être vide" #: application/controllers/ContactController.php:123 -#: application/forms/Contact.php:32 -#: application/validate/EmailAddress.php:13 +#: application/forms/Contact.php:32 application/validate/EmailAddress.php:13 msgid "Invalid email" msgstr "Email invalide" @@ -366,8 +437,7 @@ msgid "Oups, something went wrong" msgstr "Oups, il y a eu un souci" #: application/controllers/TermsofuseController.php:12 -#: application/layouts/scripts/footer.phtml:67 -#: application/forms/User.php:41 +#: application/layouts/scripts/footer.phtml:67 application/forms/User.php:41 msgid "terms of use" msgstr "conditions d'utilisation" @@ -381,19 +451,18 @@ msgid "Wrong password" msgstr "Mauvais mot de passe" #: application/controllers/AccountController.php:56 -#: application/controllers/IdxController.php:104 +#: application/controllers/IdxController.php:100 msgid "an user is already registered with this email" msgstr "il y'a déjà un utilisateur enregistré avec cet email" #: application/controllers/AccountController.php:84 -#: application/controllers/IdxController.php:98 +#: application/controllers/IdxController.php:94 #: application/forms/Account.php:40 msgid "Password do not match" msgstr "Les mots de passe ne correspondent pas" #: application/controllers/AccountController.php:85 -#: application/forms/Account.php:33 -#: application/forms/User.php:18 +#: application/forms/Account.php:33 application/forms/User.php:18 #, php-format msgid "At least %d characters" msgstr "Au moins %d caractères" @@ -402,87 +471,88 @@ msgstr "Au moins %d caractères" msgid "You have made no change" msgstr "Vous n'avez fait aucun changement" -#: application/controllers/IdxController.php:85 +#: application/controllers/IdxController.php:83 msgid "save took place successfully" msgstr "La sauvegarde s'est déroulée correctement" -#: application/controllers/IdxController.php:86 -msgid "server did not understood request. That's probably caused by a bug in SYJ" -msgstr "Le serveur n'a pas compris la requête. Il s'agit probablement d'un bug dans SYJ" +#: application/controllers/IdxController.php:84 +msgid "" +"server did not understood request. That's probably caused by a bug in SYJ" +msgstr "" +"Le serveur n'a pas compris la requête. Il s'agit probablement d'un bug dans " +"SYJ" -#: application/controllers/IdxController.php:87 +#: application/controllers/IdxController.php:85 msgid "path did not exist in the server. May be it has been already deleted" msgstr "Le chemin n'existait pas sur le serveur. Il a peut-être supprimé" -#: application/controllers/IdxController.php:88 -msgid "similar path seems to already exist. Please do not create two exactly identical paths" -msgstr "Il semble qu'il y ait déjà un chemin similaire. Veuillez ne pas créer deux chemins exactement identiques" +#: application/controllers/IdxController.php:86 +msgid "" +"similar path seems to already exist. Please do not create two exactly " +"identical paths" +msgstr "" +"Il semble qu'il y ait déjà un chemin similaire. Veuillez ne pas créer deux " +"chemins exactement identiques" -#: application/controllers/IdxController.php:89 +#: application/controllers/IdxController.php:87 msgid "server could not be reached" msgstr "serveur inaccessible" -#: application/controllers/IdxController.php:90 +#: application/controllers/IdxController.php:88 msgid "there was a server error" msgstr "Il s'est produit une erreur serveur" -#: application/controllers/IdxController.php:91 +#: application/controllers/IdxController.php:89 msgid "there was an unknown error" msgstr "Il s'est produit une erreur inconnue" -#: application/controllers/IdxController.php:93 +#: application/controllers/IdxController.php:91 msgid "Login correct" msgstr "Vous êtes connectés" -#: application/controllers/IdxController.php:94 +#: application/controllers/IdxController.php:92 msgid "Wrong login/password" msgstr "Mauvais nom d'utilisateur ou mot de passe" -#: application/controllers/IdxController.php:95 -msgid "You need to login before retrying to save" -msgstr "Vous devez vous connecter avant de réesayer de sauvegarder" - -#: application/controllers/IdxController.php:96 -msgid "You need to have cookies enabled to login to SYJ" -msgstr "Vous devez activer les cookies pour pouvoir vous connecter à SYJ" - -#: application/controllers/IdxController.php:97 +#: application/controllers/IdxController.php:93 msgid "you must enter a password" msgstr "vous devez entrer un mot de passe" -#: application/controllers/IdxController.php:99 +#: application/controllers/IdxController.php:95 msgid "You must accept terms of use" msgstr "Vous devez accepter les conditions d'utilisation" -#: application/controllers/IdxController.php:100 +#: application/controllers/IdxController.php:96 msgid "you must enter an email" msgstr "vous devez entrer un email" -#: application/controllers/IdxController.php:101 +#: application/controllers/IdxController.php:97 msgid "invalid email" msgstr "email invalide" -#: application/controllers/IdxController.php:102 +#: application/controllers/IdxController.php:98 msgid "pseudo must only contain letters, digits, dots or underscores" -msgstr "le pseudo ne peut contenir que des lettres, des chiffres, des points ou des soulignés" +msgstr "" +"le pseudo ne peut contenir que des lettres, des chiffres, des points ou des " +"soulignés" -#: application/controllers/IdxController.php:103 +#: application/controllers/IdxController.php:99 msgid "unavailable pseudo" msgstr "pseudo non disponible" -#: application/controllers/IdxController.php:105 +#: application/controllers/IdxController.php:101 msgid "Account created" msgstr "Compte créé" -#: application/controllers/IdxController.php:107 +#: application/controllers/IdxController.php:103 msgid "Now, you can retry to save" msgstr "Maintenant, vous pouvez réessayer de sauvegarder" -#: application/controllers/IdxController.php:108 +#: application/controllers/IdxController.php:104 msgid "route by" msgstr "tracé par" -#: application/controllers/IdxController.php:109 +#: application/controllers/IdxController.php:105 msgid "Map by OpenStreetMap" msgstr "Carte par OpenStreetMap" @@ -498,8 +568,7 @@ msgstr "contact" msgid "user" msgstr "utilisateur" -#: application/forms/Login.php:10 -#: application/forms/Account.php:35 +#: application/forms/Login.php:10 application/forms/Account.php:35 #: application/forms/User.php:21 msgid "password" msgstr "mot de passe" @@ -541,14 +610,12 @@ msgstr "titre facultatif pour ce trajet" msgid "save" msgstr "enregistrer" -#: application/forms/Account.php:27 -#: application/forms/User.php:34 +#: application/forms/Account.php:27 application/forms/User.php:34 #: application/forms/Newpwd.php:28 msgid "email" msgstr "email" -#: application/forms/Account.php:42 -#: application/forms/User.php:28 +#: application/forms/Account.php:42 application/forms/User.php:28 msgid "confirm password" msgstr "confirmation du mot de passe" @@ -565,8 +632,14 @@ msgid "user name" msgstr "nom d'utilisateur" #: application/forms/User.php:35 -msgid "After creating your account, you will receive a confirmation email. You have 7 days to confirm otherwise, your account and your routes will all be deleted." -msgstr "Après la création de votre compte, vous recevrez un mail de confirmation. Vous avez 7 jours pour confirmer sinon, votre compte et tous vos tracés seront supprimés." +msgid "" +"After creating your account, you will receive a confirmation email. You have " +"7 days to confirm otherwise, your account and your routes will all be " +"deleted." +msgstr "" +"Après la création de votre compte, vous recevrez un mail de confirmation. " +"Vous avez 7 jours pour confirmer sinon, votre compte et tous vos tracés " +"seront supprimés." #: application/forms/User.php:42 #, php-format @@ -579,8 +652,13 @@ msgstr "créer le compte" #: application/forms/Pending/ResetPassword.php:11 #, php-format -msgid "Hi %s. Someone, probably you, has asked to reset password for your account. To get a new password, validate with following button." -msgstr "Bonjour %s. Quelqu'un, probablement vous, a demandé de réinitialiser le mot de passe de votre compte. Pour avoir un nouveau mot de passe, validez avec le bouton suivant." +msgid "" +"Hi %s. Someone, probably you, has asked to reset password for your account. " +"To get a new password, validate with following button." +msgstr "" +"Bonjour %s. Quelqu'un, probablement vous, a demandé de réinitialiser le mot " +"de passe de votre compte. Pour avoir un nouveau mot de passe, validez avec " +"le bouton suivant." #: application/forms/Pending/ResetPassword.php:16 #: application/forms/Newpwd.php:33 @@ -592,21 +670,40 @@ msgid "cancel request" msgstr "annuler la requête" #: application/forms/Pending/ResetPassword.php:24 -msgid "To cancel this request, press following button. Your password will not change." -msgstr "Pour annuler la requête, pressez le bouton suivant. Votre mot de passe ne sera pas changé." +msgid "" +"To cancel this request, press following button. Your password will not " +"change." +msgstr "" +"Pour annuler la requête, pressez le bouton suivant. Votre mot de passe ne " +"sera pas changé." #: application/forms/Pending/ValidateCreation.php:11 #, php-format -msgid "Someone, probably you, has registered an account %s with email address %s on syj. To confirm this account creation, validate with following button." -msgstr "Quelqu'un, probablement vous, a enregistré un compte %s avec l'adresse email %s sur syj. Pour confirmer la création du compte, validez avec le bouton suivant." +msgid "" +"Someone, probably you, has registered an account %s with email address %s on " +"syj. To confirm this account creation, validate with following button." +msgstr "" +"Quelqu'un, probablement vous, a enregistré un compte %s avec l'adresse email " +"%s sur syj. Pour confirmer la création du compte, validez avec le bouton " +"suivant." #: application/forms/Pending/ValidateCreation.php:23 msgid "delete" msgstr "supprimer" #: application/forms/Pending/ValidateCreation.php:24 -msgid "To cancel account creation, press following button. The account and all its data will be deleted." -msgstr "Pour annuler la création du compte, pressez le bouton suivant. Le compte ainsi que toutes ses données seront supprimés." +msgid "" +"To cancel account creation, press following button. The account and all its " +"data will be deleted." +msgstr "" +"Pour annuler la création du compte, pressez le bouton suivant. Le compte " +"ainsi que toutes ses données seront supprimés." + +#~ msgid "You need to login before retrying to save" +#~ msgstr "Vous devez vous connecter avant de réesayer de sauvegarder" + +#~ msgid "You need to have cookies enabled to login to SYJ" +#~ msgstr "Vous devez activer les cookies pour pouvoir vous connecter à SYJ" #~ msgid "main page" #~ msgstr "page d'accueil" @@ -614,4 +711,3 @@ msgstr "Pour annuler la création du compte, pressez le bouton suivant. Le compt #, fuzzy #~ msgid "reset password" #~ msgstr "Réinitialiser mon mot de passe" - diff --git a/application/models/Path.php b/application/models/Path.php index 41706e4..1041a7f 100644 --- a/application/models/Path.php +++ b/application/models/Path.php @@ -6,9 +6,10 @@ class Syj_Model_Path extends Syj_Model_Generic { protected $_id; protected $_geom; - protected $_owner; + protected $_creator; protected $_title; protected $_urlcomp; + protected $_creator_ip; public function setId($id) { $this->_id = (int) $id; @@ -28,13 +29,20 @@ class Syj_Model_Path extends Syj_Model_Generic return $this->_geom; } - public function setOwner(Syj_Model_User $owner) { - $this->_owner = $owner; + public function setCreator(Syj_Model_User $creator = null) { + $this->_creator = $creator; return $this; } - public function getOwner() { - return $this->_owner; + public function getCreator() { + return $this->_creator; + } + + public function isCreator(Syj_Model_User $creator = null) { + if (!$creator or !$this->creator) { + return false; + } + return ($creator->id == $this->creator->id); } public function setTitle($title) { @@ -65,4 +73,13 @@ class Syj_Model_Path extends Syj_Model_Generic return $this->_urlcomp; } + public function setCreatorIp($_creator_ip) { + $this->_creator_ip = (string) $_creator_ip; + return $this; + } + + public function getCreatorIp() { + return $this->_creator_ip; + } + } diff --git a/application/models/PathMapper.php b/application/models/PathMapper.php index 01e2818..c899364 100644 --- a/application/models/PathMapper.php +++ b/application/models/PathMapper.php @@ -58,8 +58,9 @@ class Syj_Model_PathMapper public function save (Syj_Model_Path $path) { $data = array( 'geom'=> (string)$path->geom, - 'owner'=> $path->owner->id, - 'title'=> $path->title + 'creator'=> $path->creator->id, + 'title'=> $path->title, + 'creator_ip'=> $path->creatorIp ); if (null === ($id = $path->getId())) { $path->id = $this->getDbTable()->insert($data); @@ -75,13 +76,14 @@ class Syj_Model_PathMapper $item->setId($row->id)-> setGeom($geom)-> setTitle($row->title)-> - setUrlComp($row->urlcomp); + setUrlComp($row->urlcomp)-> + setCreatorIp($row->creator_ip); - if (!$item->getOwner()) { + if (!$item->getCreator()) { $user = new Syj_Model_User(); $userMapper = new Syj_Model_UserMapper(); - if ($userMapper->find($row->owner, $user)) { - $item->setOwner($user); + if ($userMapper->find($row->creator, $user)) { + $item->setCreator($user); } } return $item; @@ -99,7 +101,7 @@ class Syj_Model_PathMapper protected function _select() { $table = $this->getDbTable(); $select = $table->select(); - $select->from($table, array('id', 'ST_AsText(geom) AS wkt', 'owner', 'title', 'urlcomp')); + $select->from($table, array('id', 'ST_AsText(geom) AS wkt', 'creator', 'title', 'urlcomp', 'creator_ip')); return $select; } diff --git a/application/models/User.php b/application/models/User.php index 14d1588..f541af3 100644 --- a/application/models/User.php +++ b/application/models/User.php @@ -9,7 +9,6 @@ class Syj_Model_User extends Syj_Model_Generic protected $_password; protected $_email; protected $_lang; - protected $_creation_addr; public function setId($id) { $this->_id = (int) $id; @@ -56,15 +55,6 @@ class Syj_Model_User extends Syj_Model_Generic return $this->_lang; } - public function setCreationAddr($creation_addr) { - $this->_creation_addr = (string) $creation_addr; - return $this; - } - - public function getCreationAddr() { - return $this->_creation_addr; - } - public function notifyPendings() { $pendingMapper = new Syj_Model_PendingMapper(); $pendings = $pendingMapper->fetchForUser($this); diff --git a/application/models/UserMapper.php b/application/models/UserMapper.php index a4364a0..67faea8 100644 --- a/application/models/UserMapper.php +++ b/application/models/UserMapper.php @@ -51,8 +51,7 @@ class Syj_Model_UserMapper ->setPassword($row->password) ->setPseudo($row->pseudo) ->setEmail($row->email) - ->setLang($row->lang) - ->setCreationAddr($row->creation_addr); + ->setLang($row->lang); } public function save (Syj_Model_User $user) { @@ -60,8 +59,7 @@ class Syj_Model_UserMapper 'pseudo'=> (string) $user->pseudo, 'password'=> (string)$user->password, 'email'=> (string) $user->email, - 'lang'=> (string) $user->lang, - 'creation_addr'=> (string) $user->creationAddr + 'lang'=> (string) $user->lang ); if (null === ($id = $user->getId())) { $user->id = $this->getDbTable()->insert($data); diff --git a/application/views/helpers/Anchor.php b/application/views/helpers/Anchor.php index ddfe744..55cae33 100644 --- a/application/views/helpers/Anchor.php +++ b/application/views/helpers/Anchor.php @@ -4,7 +4,7 @@ class Syj_View_Helper_Anchor extends Zend_View_Helper_HtmlElement { - public function Anchor($href, $text = null, array $attribs=array()) { + public function Anchor($href, $text = null, array $attribs=array(), $escape = true) { $lang = Zend_Controller_Front::getInstance()->getRequest()->getQuery('lang'); if ($lang) { $translator = Zend_Registry::get('Zend_Translate'); @@ -18,7 +18,8 @@ class Syj_View_Helper_Anchor extends Zend_View_Helper_HtmlElement if (!isset($text)) { $text = $href; } - $html = '_htmlAttribs($attribs) . '>' . $this->view->escape($text) . ''; + $content = $escape ? $this->view->escape($text) : $text; + $html = '_htmlAttribs($attribs) . '>' . $content . ''; return $html; } } diff --git a/application/views/scripts/idx/index.phtml b/application/views/scripts/idx/index.phtml index ce8b6f7..7d0fe87 100644 --- a/application/views/scripts/idx/index.phtml +++ b/application/views/scripts/idx/index.phtml @@ -33,7 +33,10 @@
anchor('login', $this->translate('login'), array('id' => 'login_control_anchor', 'class' => 'login-anchor')); - echo $this->anchor('', $this->translate('create an account'), array('id' => 'user_control_anchor', 'class' => 'login-anchor')); + $anchortext = sprintf("%s
%s
", + $this->translate('create an account'), + $this->translate('Whith an account, you can manage and modify your routes')); + echo $this->anchor('', $anchortext, array('id' => 'user_control_anchor', 'class' => 'login-anchor'), false); ?>
diff --git a/application/views/scripts/termsofuse/index.phtml b/application/views/scripts/termsofuse/index.phtml index c8ed6f9..f6ef416 100644 --- a/application/views/scripts/termsofuse/index.phtml +++ b/application/views/scripts/termsofuse/index.phtml @@ -4,15 +4,15 @@ echo $this->translate('Show Your Journey is a site whose goal is to allow anyone ?>

translate('In order to publish a route, you must first create an account. A valid email is asked for, and ip address of account creation is stored on the server. Those informations will not be divulged to anyone without the user explicit permission.'); +echo $this->translate('In order to publish a route, you must first create an account. A valid email is asked for, and ip address of account creation is stored on the server. Those informations will not be divulged to anyone without the user explicit permission.'); ?>

translate('When you create a route, you accept that it\'s available under a creative commons by license. This means you accept that anyone can reproduce and republish your itinerary, or a modified version of it, under the condition that he specify the proper creator of this work. This also means you need to get appropriate permissions from the creator if you want to upload a route you didn\'t create yourself.'); +echo $this->translate('When you create a route, you accept that it\'s free for any use. This means you accept that anyone can reuse, reproduce, or republish your itinerary, or a modified version of it for any purpose. This also means you need to get appropriate permissions from the creator if you want to upload a route you didn\'t create yourself.'); ?>

translate('Show Your Journey is not responsible for the accuracy of the routes published. It\'s the user responsibility to check that a route is accessible and safe.'); +echo $this->translate('Show Your Journey is not responsible for the accuracy of the routes published. It\'s the user responsibility to check that a route is accessible and safe.'); ?>

C#5QQ<|d}62BjvZR2H60wE-%M_H=O!(Kw&{<9vg>5sxM-`@i?U z_W%6<>VNmY^FQu?=k0EK8(;qS{{MRQfQxhfe|^4DBSLrMi_=~IrT?G*6aRH>fZ%Fr xHSdzT`JeW`iC!n;=N{%MvhUm!=_W-^hCUIl<$=usRzPbQJYD@<);T3K0RSKzPZ9tC literal 0 HcmV?d00001 diff --git a/public/icons/bullet_arrow_right.png b/public/icons/bullet_arrow_right.png new file mode 100644 index 0000000000000000000000000000000000000000..1ba25194a4a4b75de5786f5ef26e4f3ff2025c0a GIT binary patch literal 229 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!60wlNoGJgf67>k44ofy`glX(f`FeQ1ryDXX0ZsYkSWVUtjR*QGtr};rzDv_?;oA;vNJXIQHSM^m4B^+$n~~90kM~)>w$2 U;rxH28)zwmr>mdKI;Vst07S=4o&W#< literal 0 HcmV?d00001 diff --git a/public/js/account.js b/public/js/account.js index c19d30e..d479e55 100644 --- a/public/js/account.js +++ b/public/js/account.js @@ -44,8 +44,7 @@ document.observe("dom:loaded", function() { * if there are errors, cancel submission */ if (errorElements.length) { - errorElements[0].highlight('#F08080').focus(); - errorElements[0].select(); + errorElements[0].highlight('#F08080').activate(); evt.stop(); } }); diff --git a/public/js/contact.js b/public/js/contact.js index e417341..416d745 100644 --- a/public/js/contact.js +++ b/public/js/contact.js @@ -25,8 +25,7 @@ document.observe("dom:loaded", function() { * if there are errors, cancel submission */ if (errorElements.length) { - errorElements[0].highlight('#F08080').focus(); - errorElements[0].select(); + errorElements[0].highlight('#F08080').activate(); evt.stop(); } }); diff --git a/public/js/login.js b/public/js/login.js index 2721840..ee9dd9c 100644 --- a/public/js/login.js +++ b/public/js/login.js @@ -10,8 +10,7 @@ document.observe("dom:loaded", function() { $$('.error').invoke('remove'); if (!loginput.check(function() { return !this.value.strip().empty(); }, SyjStrings.userEmptyWarn)) { - loginput.highlight('#F08080').focus(); - loginput.select(); + loginput.highlight('#F08080').activate(); evt.stop(); return; } diff --git a/public/js/newpwd.js b/public/js/newpwd.js index 02f4023..388ee08 100644 --- a/public/js/newpwd.js +++ b/public/js/newpwd.js @@ -16,16 +16,14 @@ document.observe("dom:loaded", function() { tofocus = $$('form input:not([readonly],[disabled])')[0]; } if (tofocus) { - tofocus.focus(); - tofocus.select(); + tofocus.activate(); } $("newpwdform").observe('submit', function(evt) { $$('.error').invoke('remove'); if ($('newpwd_email').value.strip().empty()) { insertErrorBefore($('newpwdform').select('table')[0], SyjStrings.notEmptyField); - $('newpwd_email').highlight('#F08080').focus(); - $('newpwd_email').select(); + $('newpwd_email').highlight('#F08080').activate(); evt.stop(); } }); diff --git a/public/js/syj.js b/public/js/syj.js index db4259e..65f6897 100644 --- a/public/js/syj.js +++ b/public/js/syj.js @@ -4,7 +4,7 @@ Element.addMethods('input', { observe : Element.Methods.observe.wrap(function(proceed, element, eventName, handler) { if (eventName === "contentchange") { proceed(element, 'keyup', function(evt) { - if (evt.keyCode == 13) { + if (evt.keyCode === 13) { return; } handler.apply(null, arguments); @@ -47,8 +47,7 @@ var SyjSaveUI = { } this.enableSubmit(); $("geom_title").disabled = false; - $("geom_title").focus(); - $("geom_title").select(); + $("geom_title").activate(); $("geomform").removeClassName("disabled"); this.status = "enabled"; return this; @@ -253,8 +252,8 @@ var SYJView = { layerOptions = {format: OpenLayers.Format.WKT, projection: WGS84, styleMap: styleMap.view}; - if (gLoggedInfo.ownername) { - layerOptions.attribution = SyjStrings.routeBy + ' ' + '' + gLoggedInfo.ownername + ''; + if (gLoggedInfo.creatorname) { + layerOptions.attribution = SyjStrings.routeBy + ' ' + '' + gLoggedInfo.creatorname + ''; } this.viewLayer = new OpenLayers.Layer.Vector("View Layer", layerOptions); @@ -308,6 +307,13 @@ var SYJView = { }, prepareForm: function(form) { + if (!loginMgr.logged && !$("geom_accept").checked) { + this.messenger.setMessage(SyjStrings.acceptTermsofuseWarn, "warn"); + $("geom_accept_container").highlight('#F08080'); + $("geom_accept").activate(); + return false; + } + var line, realPoints, idx, handler; line = new OpenLayers.Geometry.LineString(); @@ -328,6 +334,7 @@ var SYJView = { this.needsFormResubmit = false; SyjSaveUI.disable.bind(SyjSaveUI).defer(); this.messenger.hide(); + return true; }, editMode: function() { @@ -434,16 +441,6 @@ var SYJView = { } } break; - case 403: - message = ""; - this.needsFormResubmit = true; - if (loginMgr.hasAlreadyConnected()) { - SYJLogin.messenger.setMessage(SyjStrings.cookiesNeeded, "warn"); - } else { - SYJLogin.messenger.setMessage(SyjStrings.loginNeeded, "warn"); - } - SYJLogin.modalbox.show(); - break; case 500: message = SyjStrings.serverError; this.needsFormResubmit = true; @@ -492,7 +489,7 @@ var SYJModalClass = Class.create({ checkNotEmpty: function(input, message) { if ($(input).value.strip().empty()) { this.messenger.setMessage(message, "warn"); - $(input).highlight('#F08080').focus(); + $(input).highlight('#F08080').activate(); return false; } return true; @@ -506,8 +503,7 @@ var SYJModalClass = Class.create({ if (simplebox === this.modalbox) { input = this.area.select('input[type="text"]')[0]; (function () { - input.focus(); - input.select(); + input.activate(); }).defer(); } else { this.modalbox.hide(); @@ -544,8 +540,7 @@ var SYJModalClass = Class.create({ this.messenger.setMessage(message, "error"); input = this.area.select('input[type="text"]')[0]; - input.highlight('#F08080').focus(); - input.select(); + input.highlight('#F08080').activate(); }, reset: function() { @@ -562,7 +557,7 @@ var SYJUserClass = Class.create(SYJModalClass, { $super(); $("termsofusearea").hide(); - $("user_termsofuse_anchor").observe("click", function(evt) { + $$("#user_termsofuse_anchor, #geom_termsofuse_anchor").invoke('observe', "click", function(evt) { if (!this.toubox) { $("termsofusearea").show(); $("termsofuseiframe").setAttribute("src", evt.target.href); @@ -587,6 +582,19 @@ var SYJUserClass = Class.create(SYJModalClass, { $("user_password-desc").setMessageStatus("success"); } }.bindAsEventListener(this)); + + $("account-info").hide(); + $("account-info-bullet").observe('click', function(evt) { + var elt = $("account-info"); + if (elt.visible()) { + evt.target.src = "icons/bullet_arrow_right.png"; + elt.hide(); + } else { + evt.target.src = "icons/bullet_arrow_down.png"; + elt.show(); + } + evt.stop(); + }); }, presubmit: function() { @@ -596,8 +604,7 @@ var SYJUserClass = Class.create(SYJModalClass, { if (!($("user_pseudo").value.match(/^[a-zA-Z0-9_.]+$/))) { this.messenger.setMessage(SyjStrings.invalidPseudo, "warn"); - $("user_pseudo").highlight('#F08080').focus(); - $("user_pseudo").select(); + $("user_pseudo").highlight('#F08080').activate(); return false; } @@ -607,15 +614,13 @@ var SYJUserClass = Class.create(SYJModalClass, { if ($("user_password").value.length < 6) { $("user_password-desc").setMessageStatus("warn"); - $("user_password").highlight('#F08080').focus(); - $("user_password").select(); + $("user_password").highlight('#F08080').activate(); return false; } if ($("user_password").value !== $("user_password_confirm").value) { this.messenger.setMessage(SyjStrings.passwordNoMatchWarn, "warn"); - $("user_password").highlight('#F08080').focus(); - $("user_password").select(); + $("user_password").highlight('#F08080').activate(); return false; } @@ -625,7 +630,8 @@ var SYJUserClass = Class.create(SYJModalClass, { if (!$("user_accept").checked) { this.messenger.setMessage(SyjStrings.acceptTermsofuseWarn, "warn"); - $("user_accept").highlight('#F08080').focus(); + $("user_accept_container").highlight('#F08080'); + $("user_accept").activate(); return false; } @@ -639,7 +645,7 @@ var SYJUserClass = Class.create(SYJModalClass, { this.modalbox.hide(); if (SYJView.needsFormResubmit) { SYJView.messenger.addMessage(SyjStrings.canResubmit); - $("geom_submit").focus(); + $("geom_submit").activate(); } }, @@ -677,8 +683,7 @@ var SYJUserClass = Class.create(SYJModalClass, { if (message) { this.messenger.setMessage(message, "error"); if (focusInput) { - focusInput.highlight('#F08080').focus(); - focusInput.select(); + focusInput.highlight('#F08080').activate(); } return; } @@ -714,7 +719,7 @@ var SYJLoginClass = Class.create(SYJModalClass, { this.modalbox.hide(); if (SYJView.needsFormResubmit) { SYJView.messenger.addMessage(SyjStrings.canResubmit); - $("geom_submit").focus(); + $("geom_submit").activate(); } }, @@ -738,8 +743,7 @@ var SYJLoginClass = Class.create(SYJModalClass, { if (message) { this.messenger.setMessage(message, "error"); if (focusInput) { - focusInput.highlight('#F08080').focus(); - focusInput.select(); + focusInput.highlight('#F08080').activate(); } return; } @@ -776,30 +780,25 @@ var loginMgr = Object.extend(gLoggedInfo, { } if (this.logged) { this.controlsdeck.setIndex(1); + $("geom_accept_container").hide(); } else { this.controlsdeck.setIndex(0); + $("geom_accept_container").show(); } - if (this.isowner) { + if (this.iscreator) { $("data_controls").show(); } else { $("data_controls").hide(); } }, - login: function(aIsOwner) { - if (typeof aIsOwner === "boolean") { - this.isowner = aIsOwner; + login: function(aIsCreator) { + if (typeof aIsCreator === "boolean") { + this.iscreator = aIsCreator; } this.logged = true; - this.connections++; this.updateUI(); - }, - - // needed in case of 403 errors: if user has already connected successfully - // before, it probably means he has cookies disabled - hasAlreadyConnected: function() { - return (this.connections >= 1); } }); diff --git a/public/js/utils.js b/public/js/utils.js index d8696a0..3e10f5c 100644 --- a/public/js/utils.js +++ b/public/js/utils.js @@ -143,8 +143,7 @@ Element.addMethods('form', { if (error && (typeof tofocus.highlight === "function")) { tofocus.highlight('#F08080'); } - tofocus.focus(); - tofocus.select(); + tofocus.activate(); } }, diff --git a/scripts/data.postgres.sql b/scripts/data.postgres.sql index 0d47807..d4b21ef 100644 --- a/scripts/data.postgres.sql +++ b/scripts/data.postgres.sql @@ -1,23 +1,23 @@ BEGIN; -INSERT INTO users (password, pseudo, email, creation_addr, lang) VALUES +INSERT INTO users (password, pseudo, email, lang) VALUES ('0b9c2625dc21ef05f6ad4ddf47c5f203837aa32c', -- sha1 of "toto" - 'arno', 'arno@renevier.net', '127.0.0.1', 'fr'); + 'arno', 'arno@renevier.net', 'fr'); -INSERT INTO users (password, pseudo, email, creation_addr, lang) VALUES +INSERT INTO users (password, pseudo, email, lang) VALUES ('0b9c2625dc21ef05f6ad4ddf47c5f203837aa32c', -- sha1 of "toto" - 'user', 'user@renevier.net', '127.0.0.1', 'en'); + 'user', 'user@renevier.net', 'en'); -INSERT INTO paths (geom, owner, title) VALUES +INSERT INTO paths (geom, creator, title, creator_ip) VALUES (ST_GeographyFromText ('SRID=4326;LINESTRING(2.437892 48.638297, 2.431111 48.643628, 2.436218 48.648108, 2.415104 48.660355)'), - 1, 'ris-orangis'); + 1, 'ris-orangis', '127.0.0.1'); -INSERT INTO paths (geom, owner, title) VALUES +INSERT INTO paths (geom, creator, title, creator_ip) VALUES (ST_GeographyFromText ('SRID=4326;LINESTRING(2.466474 48.649242, 2.459993 48.651766, 2.478619 48.656160, 2.462826 48.672883, 2.468061 48.690564)'), - 1, 'Forêt de Sénart'); + 1, 'Forêt de Sénart', '127.0.0.1'); -INSERT INTO paths (geom, owner, title, urlcomp) VALUES +INSERT INTO paths (geom, creator, title, urlcomp, creator_ip) VALUES (ST_GeographyFromText ('SRID=4326; LINESTRING(2.452204 48.634880, 2.453599 48.635745, 2.449908 48.637744, 2.448149 48.638595, 2.442999 48.642593, 2.440360 48.645500, 2.438471 48.646847, 2.436712 48.647938, 2.433729 48.650036, 2.423387 48.655877, 2.415297 48.660384, 2.417142 48.661659, 2.417700 48.662297, 2.417700 48.662921, 2.416434 48.663941, 2.415361 48.665018, 2.411671 48.671211, 2.410340 48.672585, 2.408237 48.674272, 2.407122 48.675717, 2.405341 48.677403, 2.403431 48.678933, 2.402251 48.680619, 2.401006 48.680605, 2.399504 48.680662, 2.397702 48.684189, 2.397294 48.684203, 2.395213 48.683849, 2.391522 48.684359, 2.392466 48.688057, 2.389891 48.688467, 2.386994 48.689402, 2.386029 48.689742, 2.386351 48.690280, 2.387445 48.690040, 2.389269 48.692589, 2.396221 48.699034, 2.399182 48.702206, 2.400384 48.703934, 2.401328 48.705718, 2.403173 48.710589, 2.404118 48.712288, 2.406478 48.714440, 2.408667 48.715459, 2.412915 48.718234, 2.417250 48.720527, 2.423215 48.722962, 2.428107 48.724123, 2.433043 48.724463, 2.440381 48.726246, 2.442688 48.727386, 2.441475 48.727754, 2.440048 48.727563, 2.441733 48.728518, 2.443042 48.728256, 2.445359 48.727860, 2.445037 48.727265, 2.444565 48.727449, 2.445724 48.729558, 2.445853 48.732163, 2.445917 48.735630, 2.444522 48.738460, 2.444673 48.738574, 2.443085 48.740229, 2.440810 48.741842, 2.437935 48.744984, 2.435575 48.748493, 2.428579 48.754774, 2.421241 48.760546, 2.414289 48.766628, 2.413559 48.769117, 2.413731 48.771521, 2.415104 48.773473, 2.415919 48.775481, 2.415962 48.776640, 2.422957 48.787160, 2.424116 48.789619, 2.423773 48.792418, 2.421498 48.796857, 2.420340 48.798270, 2.423601 48.798949, 2.428966 48.800164, 2.427936 48.800673, 2.427163 48.801521, 2.427721 48.802426, 2.428579 48.802765, 2.425833 48.806977, 2.422442 48.812064, 2.420254 48.815342, 2.419739 48.817037, 2.419953 48.824186, 2.422957 48.824130, 2.423429 48.824610, 2.426906 48.828622, 2.429094 48.831984, 2.430382 48.834696, 2.431326 48.835176, 2.432270 48.839921, 2.433043 48.841136, 2.434416 48.844921, 2.415361 48.846700, 2.414589 48.846982, 2.413816 48.846898, 2.396865 48.848423, 2.396007 48.848959, 2.395191 48.848592, 2.384119 48.850258, 2.380342 48.850286, 2.374763 48.851642, 2.369356 48.853223, 2.365150 48.853873, 2.360902 48.855172, 2.347941 48.858588, 2.340817 48.860960, 2.335238 48.862682, 2.335539 48.863247, 2.332363 48.870587, 2.323651 48.869203, 2.321806 48.866747, 2.321334 48.866296, 2.320261 48.864771, 2.313738 48.864912, 2.313437 48.862767, 2.310390 48.862597, 2.309961 48.857148, 2.303181 48.852800)'), - 2, 'Convergence 2010 départ d''Évry', 'convergence_2010'); + 2, 'Convergence 2010 départ d''Évry', 'convergence_2010', '127.0.0.1'); COMMIT; diff --git a/scripts/schema.postgres.sql b/scripts/schema.postgres.sql index 5877f8c..4c257b3 100644 --- a/scripts/schema.postgres.sql +++ b/scripts/schema.postgres.sql @@ -10,8 +10,7 @@ CREATE TABLE users ( pseudo VARCHAR(20) UNIQUE NOT NULL CHECK (pseudo ~ '^[a-zA-Z0-9_.]+$'), email VARCHAR(320) UNIQUE NOT NULL, lang VARCHAR(3), - creation_time TIMESTAMP NOT NULL DEFAULT NOW(), - creation_addr INET NOT NULL + creation_time TIMESTAMP NOT NULL DEFAULT NOW() ); --- @@ -101,21 +100,25 @@ DROP TABLE IF EXISTS paths CASCADE; CREATE TABLE paths ( id INTEGER PRIMARY KEY DEFAULT nextval('paths_id_seq'), geom GEOGRAPHY (LINESTRING, 4326) NOT NULL, - owner INTEGER NOT NULL REFERENCES users ON DELETE CASCADE, + creator INTEGER REFERENCES users ON DELETE CASCADE, + creator_ip INET NOT NULL, title VARCHAR(40), + last_update TIMESTAMP NOT NULL DEFAULT NOW(), urlcomp VARCHAR(20) UNIQUE CHECK (urlcomp ~ '^[a-z][a-zA-Z0-9_]*$') -- ~: matches regular expression; case sensitive ); --- unique (geom, owner) constraint will not work: first because of postgis --- #541; then because equality is checked by comparing bbox instead of real --- geometries. So, we implement that constraint in a trigger CREATE OR REPLACE FUNCTION tg_paths_bu() RETURNS TRIGGER AS $$ DECLARE res INTEGER; BEGIN - SELECT INTO res COUNT(*) FROM paths WHERE ST_AsBinary(geom) = ST_AsBinary(NEW.geom) AND owner = NEW.owner AND id != NEW.id; + SELECT INTO res COUNT(*) FROM paths WHERE ST_AsBinary(geom) = ST_AsBinary(NEW.geom) AND creator = NEW.creator AND id != NEW.id; + -- unique (geom, creator) constraint will not work: first because of postgis + -- #541; then because equality is checked by comparing bbox instead of real + -- geometries. So, we implement that constraint in a trigger IF res >= 1 THEN RAISE 'duplicate key paths_geom_key' using ERRCODE = 'unique_violation'; ELSE + -- update last_update TIMESTAMP + NEW.last_update = NOW(); RETURN NEW; END IF; END; -- 2.39.2