get up to date for merge

This commit is contained in:
tcit 2014-09-28 17:31:02 +02:00
commit ffcd442989
11 changed files with 116 additions and 33 deletions

View File

@ -117,10 +117,10 @@ class Database {
$query = $this->executeQuery($sql, array());
}
public function install($login, $password)
public function install($login, $password, $email = '')
{
$sql = 'INSERT INTO users ( username, password, name, email) VALUES (?, ?, ?, ?)';
$params = array($login, $password, $login, ' ');
$params = array($login, $password, $login, $email);
$query = $this->executeQuery($sql, $params);
$sequence = '';

View File

@ -74,12 +74,13 @@ class Poche
/**
* Creates a new user
*/
public function createNewUser($username, $password)
public function createNewUser($username, $password, $email = "")
{
if (!empty($username) && !empty($password)){
$newUsername = filter_var($username, FILTER_SANITIZE_STRING);
$email = filter_var($email, FILTER_SANITIZE_STRING);
if (!$this->store->userExists($newUsername)){
if ($this->store->install($newUsername, Tools::encodeString($password . $newUsername))) {
if ($this->store->install($newUsername, Tools::encodeString($password . $newUsername), $email)) {
Tools::logm('The new user ' . $newUsername . ' has been installed');
$this->messages->add('s', sprintf(_('The new user %s has been installed. Do you want to <a href="?logout">logout ?</a>'), $newUsername));
Tools::redirect();

View File

@ -292,9 +292,11 @@ php composer.phar install</code></pre></li>
<p>
<label for="password">Password</label>
<input type="password" required id="password" name="password" value="wallabag" />
<label for="show">Show password:</label> <input style="margin-left:-80px;" name="show" id="show" type="checkbox" onchange="document.getElementById('password').type = this.checked ? 'text' : 'password'">
</p>
<p>
<label for="show">Show password:</label> <input name="show" id="show" type="checkbox" onchange="document.getElementById('password').type = this.checked ? 'text' : 'password'">
<label for="email">Email (not required)</label>
<input type="email" id="email" name="email" />
</p>
</fieldset>

View File

@ -4,16 +4,14 @@ msgstr ""
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2014-02-25 15:17+0300\n"
"PO-Revision-Date: \n"
"Last-Translator: Maryana <mariroz@mr.lviv.ua>\n"
"Last-Translator: tcit <tcit@tcit.fr>\n"
"Language-Team: \n"
"Language: \n"
"Language: en\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Generator: Poedit 1.5.4\n"
"X-Poedit-Language: English\n"
"X-Generator: Poedit 1.6.4\n"
"X-Poedit-Basepath: .\n"
"X-Poedit-SearchPath-0: /home/mariroz/_DEV/web/wallabag/wallabag-master-testing\n"
msgid "wallabag, a read it later open source system"
msgstr "wallabag, a read it later open source system"
@ -84,8 +82,12 @@ msgstr "A more recent development version is available."
msgid "Feeds"
msgstr "Feeds"
msgid "Your feed token is currently empty and must first be generated to enable feeds. Click <a href='?feed&amp;action=generate'>here to generate it</a>."
msgstr "Your feed token is currently empty and must first be generated to enable feeds. Click <a href='?feed&amp;action=generate'>here to generate it</a>."
msgid ""
"Your feed token is currently empty and must first be generated to enable "
"feeds. Click <a href='?feed&amp;action=generate'>here to generate it</a>."
msgstr ""
"Your feed token is currently empty and must first be generated to enable "
"feeds. Click <a href='?feed&amp;action=generate'>here to generate it</a>."
msgid "Unread feed"
msgstr "Unread feed"
@ -102,8 +104,12 @@ msgstr "Your token:"
msgid "Your user id:"
msgstr "Your user id:"
msgid "You can regenerate your token: <a href='?feed&amp;action=generate'>generate!</a>."
msgstr "You can regenerate your token: <a href='?feed&amp;action=generate'>generate!</a>."
msgid ""
"You can regenerate your token: <a href='?feed&amp;action=generate'>generate!"
"</a>."
msgstr ""
"You can regenerate your token: <a href='?feed&amp;action=generate'>generate!"
"</a>."
msgid "Change your theme"
msgstr "Change your theme"
@ -135,8 +141,10 @@ msgstr "Repeat your new password:"
msgid "Import"
msgstr "Import"
msgid "Please execute the import script locally as it can take a very long time."
msgstr "Please execute the import script locally as it can take a very long time."
msgid ""
"Please execute the import script locally as it can take a very long time."
msgstr ""
"Please execute the import script locally as it can take a very long time."
msgid "More info in the official documentation:"
msgstr "More info in the official documentation:"
@ -184,8 +192,12 @@ msgstr "return to article"
msgid "plop"
msgstr "plop"
msgid "You can <a href='wallabag_compatibility_test.php'>check your configuration here</a>."
msgstr "You can <a href='wallabag_compatibility_test.php'>check your configuration here</a>."
msgid ""
"You can <a href='wallabag_compatibility_test.php'>check your configuration "
"here</a>."
msgstr ""
"You can <a href='wallabag_compatibility_test.php'>check your configuration "
"here</a>."
msgid "favoris"
msgstr "favoris"
@ -247,8 +259,14 @@ msgstr "installation"
msgid "install your wallabag"
msgstr "install your wallabag"
msgid "wallabag is still not installed. Please fill the below form to install it. Don't hesitate to <a href='http://doc.wallabag.org/'>read the documentation on wallabag website</a>."
msgstr "wallabag is still not installed. Please fill the below form to install it. Don't hesitate to <a href='http://doc.wallabag.org/'>read the documentation on wallabag website</a>."
msgid ""
"wallabag is still not installed. Please fill the below form to install it. "
"Don't hesitate to <a href='http://doc.wallabag.org/'>read the documentation "
"on wallabag website</a>."
msgstr ""
"wallabag is still not installed. Please fill the below form to install it. "
"Don't hesitate to <a href='http://doc.wallabag.org/'>read the documentation "
"on wallabag website</a>."
msgid "Login"
msgstr "Login"
@ -401,7 +419,8 @@ msgid "a more recent development version is available."
msgstr "a more recent development version is available."
msgid "Please execute the import script locally, it can take a very long time."
msgstr "Please execute the import script locally, it can take a very long time."
msgstr ""
"Please execute the import script locally, it can take a very long time."
msgid "More infos in the official doc:"
msgstr "More infos in the official doc:"
@ -448,8 +467,12 @@ msgstr "in demo mode, you can't update your password"
msgid "your password has been updated"
msgstr "your password has been updated"
msgid "the two fields have to be filled & the password must be the same in the two fields"
msgstr "the two fields have to be filled & the password must be the same in the two fields"
msgid ""
"the two fields have to be filled & the password must be the same in the two "
"fields"
msgstr ""
"the two fields have to be filled & the password must be the same in the two "
"fields"
msgid "still using the \""
msgstr "still using the \""
@ -505,6 +528,46 @@ msgstr "Cache deleted."
msgid "Oops, it seems you don't have PHP 5."
msgstr "Oops, it seems you don't have PHP 5."
msgid "Add user"
msgstr "Add user"
msgid "Add a new user :"
msgstr "Add a new user :"
msgid "Login for new user"
msgstr "Login for new user"
msgid "Password for new user"
msgstr "Password for new user"
msgid "Email for new user (not required)"
msgstr "Email for new user (not required)"
msgid "Send"
msgstr "Send"
msgid "Delete account"
msgstr "Delete account"
msgid "You can delete your account by entering your password and validating."
msgstr "You can delete your account by entering your password and validating."
msgid "Be careful, data will be erased forever (that is a very long time)."
msgstr "Be careful, data will be erased forever (that is a very long time)."
msgid "Type here your password"
msgstr "Type here your password"
msgid "You are the only user, you cannot delete your own account."
msgstr "You are the only user, you cannot delete your own account."
msgid ""
"To completely remove wallabag, delete the wallabag folder on your web server "
"(and eventual databases)."
msgstr ""
"To completely remove wallabag, delete the wallabag folder on your web server "
"(and eventual databases)."
#~ msgid "poche it!"
#~ msgstr "poche it!"

View File

@ -4,7 +4,7 @@ msgstr ""
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2014-05-10 20:09+0100\n"
"PO-Revision-Date: \n"
"Last-Translator: Gilles Wittezaële <gilles.wittezaele@laposte.net>\n"
"Last-Translator: tcit <tcit@tcit.fr>\n"
"Language-Team: \n"
"Language: fr_FR\n"
"MIME-Version: 1.0\n"
@ -12,7 +12,7 @@ msgstr ""
"Content-Transfer-Encoding: 8bit\n"
"X-Poedit-KeywordsList: _;gettext;gettext_noop\n"
"X-Poedit-SourceCharset: UTF-8\n"
"X-Generator: Poedit 1.5.4\n"
"X-Generator: Poedit 1.6.4\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
msgid "wallabag, a read it later open source system"
@ -298,6 +298,9 @@ msgstr "Nom d'utilisateur"
msgid "Password for new user"
msgstr "Mot de passe du nouvel utilisateur"
msgid "Email for new user (not required)"
msgstr "E-mail pour le nouvel utilisateur (facultatif)"
msgid "Send"
msgstr "Envoyer"
@ -320,10 +323,12 @@ msgstr ""
"Vous êtes l'unique utilisateur, vous ne pouvez pas supprimer votre compte."
msgid ""
"To completely remove wallabag, delete the wallabag folder on your web server."
"To completely remove wallabag, delete the wallabag folder on your web server "
"(and eventual databases)."
msgstr ""
"Pour désinstaller complètement wallabag, supprimez le répertoire "
"<code>wallabag</code> de votre serveur Web."
"<code>wallabag</code> de votre serveur Web (ainsi que les bases de données "
"éventuelles)."
msgid "Save a link"
msgstr "Ajouter un lien"

View File

@ -136,11 +136,15 @@
<fieldset class="w500p">
<div class="row">
<label class="col w150p" for="newusername">{% trans 'Login for new user' %}</label>
<input class="col" type="text" id="newusername" name="newusername" placeholder="{% trans 'Login' %}">
<input class="col" type="text" id="newusername" name="newusername" placeholder="{% trans 'Login' %}" required>
</div>
<div class="row">
<label class="col w150p" for="password4newuser">{% trans "Password for new user" %}</label>
<input class="col" type="password" id="password4newuser" name="password4newuser" placeholder="{% trans "Password" %}">
<input class="col" type="password" id="password4newuser" name="password4newuser" placeholder="{% trans 'Password' %}" required>
</div>
<div class="row">
<label class="col w150p" for="newuseremail">{% trans 'Email for new user (not required)' %}</label>
<input class="col" type="email" id="newuseremail" name="newuseremail" placeholder="{% trans 'Email' %}">
</div>
<div class="row mts txtcenter">
<button type="submit">{% trans "Send" %}</button>
@ -161,5 +165,5 @@
</div>
</form>
{% else %}<p>{% trans "You are the only user, you cannot delete your own account." %}<br />
{% trans "To completely remove wallabag, delete the wallabag folder on your web server." %}</p>{% endif %}
{% trans "To completely remove wallabag, delete the wallabag folder on your web server (and eventual databases)." %}</p>{% endif %}
{% endblock %}

View File

@ -89,7 +89,7 @@ form fieldset {
margin: 0;
}
form input[type="text"], select, form input[type="password"], form input[type="url"] {
form input[type="text"], select, form input[type="password"], form input[type="url"], form input[type="email"] {
border: 1px solid #999;
padding: 0.5em 1em;
min-width: 12em;

View File

@ -97,6 +97,10 @@
<label class="col w150p" for="password4newuser">{% trans "Password for new user" %}</label>
<input class="col" type="password" id="password4newuser" name="password4newuser" placeholder="{% trans "Password" %}">
</div>
<div class="row">
<label class="col w150p" for="newuseremail">{% trans 'Email for new user (not required)' %}</label>
<input class="col" type="email" id="newuseremail" name="newuseremail" placeholder="{% trans 'Email' %}">
</div>
<div class="row mts txtcenter">
<button type="submit">{% trans "Send" %}</button>
</div>
@ -116,6 +120,6 @@
</div>
</form>
{% else %}<p>{% trans "You are the only user, you cannot delete your own account." %}<br />
{% trans "To completely remove wallabag, delete the wallabag folder on your web server." %}</p>{% endif %}
{% trans "To completely remove wallabag, delete the wallabag folder on your web server (and eventual databases)." %}</p>{% endif %}
</div>
{% endblock %}

View File

@ -142,6 +142,10 @@
<label class="col w150p" for="password4newuser">{% trans "Password for new user" %}</label>
<input class="col" type="password" id="password4newuser" name="password4newuser" placeholder="{% trans "Password" %}">
</div>
<div class="row">
<label class="col w150p" for="newuseremail">{% trans 'Email for new user (not required)' %}</label>
<input class="col" type="email" id="newuseremail" name="newuseremail" placeholder="{% trans 'Email' %}">
</div>
<div class="row mts txtcenter">
<button type="submit">{% trans "Send" %}</button>
</div>
@ -161,5 +165,5 @@
</div>
</form>
{% else %}<p>{% trans "You are the only user, you cannot delete your own account." %}<br />
{% trans "To completely remove wallabag, delete the wallabag folder on your web server." %}</p>{% endif %}
{% trans "To completely remove wallabag, delete the wallabag folder on your web server (and eventual databases)." %}</p>{% endif %}
{% endblock %}