home » zplus/freepost.git
Author zPlus <--> 2016-09-06 06:16:18
Committer zPlus <--> 2016-09-06 06:16:18
Commit 201a0c7 (patch)
Tree c262cc1
Parent(s)

Merge branch 'librejs' # By Adonay Felipe Nogueira * librejs: Adds licensing syntax, as recognized by GNU LibreJS, to pages that load "./template/vote.twig", that has HTML/JavaScript event handlers.


commits diff: 02d5d2c..201a0c7
4 files changed, 16 insertions, 31 deletionsdownload


Diffstat
?--------- LibreJS.html 19
-rw-r--r-- database.php 23
-rw-r--r-- template/footer.twig 1
-rw-r--r-- template/login_reset.twig 4

Diff options
View
Side
Whitespace
Context lines
Inter-hunk lines
+0/-19 D   LibreJS.html
index 4cf55cb..0000000
old size: 509B - new size: 0B
deleted file mode: -rw-r--r--
@@ -1,19 +0,0 @@
1 - <!--
2 - <table id="jslicense-labels1">
3 - (one <tr> per js file)
4 - <tr>
5 - <td>link to file</td>
6 - <td>link to one or more licenses</td>
7 - <td>link to source</td>
8 - </tr>
9 - </table>
10 -
11 - -->
12 -
13 - <table id="jslicense-labels1">
14 - <tr>
15 - <td><a href="javascript/freepost.js">freepost.js</a></td>
16 - <td><a href="http://www.gnu.org/licenses/agpl-3.0.html">AGPL-3.0</a></td>
17 - <td><a href="javascript/freepost.js">freepost.js</a></td>
18 - </tr>
19 - </table>
19 > \ No newline at end of file

+14/-9 M   database.php
index 7961967..3e99aa4
old size: 39K - new size: 39K
@@ -824,10 +824,18 @@ class Database
824 824 {
825 825 $query = $this->database->prepare (
826 826 'UPDATE `user`' .
827 - 'SET `about` = ?, `email` = ? ' .
828 - 'WHERE `id` = ?');
829 -
830 - $query->execute (array ($about, $email, $user_id));
827 + 'SET `about` = :about, `email` = :email ' .
828 + 'WHERE `id` = :user_id');
829 +
830 + $query->bindValue (':about', $about, PDO::PARAM_STR);
831 + $query->bindValue (':user_id', $user_id, PDO::PARAM_INT);
832 +
833 + if (NULL == $email || '' == $email)
834 + $query->bindValue (':email', NULL, PDO::PARAM_NULL);
835 + else
836 + $query->bindValue (':email', $email, PDO::PARAM_STR);
837 +
838 + $query->execute ();
831 839 }
832 840
833 841 /**
@@ -1202,9 +1210,6 @@ class Database
1202 1210
1203 1211 $this->database->beginTransaction();
1204 1212
1205 - // Get the user
1206 - $user = self::get_post ($user_hash_id);
1207 -
1208 1213 // Generate a new secret token (used for validation)
1209 1214 $token = self::get_random_string (32);
1210 1215
@@ -1224,7 +1229,7 @@ class Database
1224 1229
1225 1230 $query->execute (array ($token, $user_hash_id));
1226 1231
1227 - $affected_rows = $query->rowCount();
1232 + $affected_rows = $query->rowCount ();
1228 1233
1229 1234 $this->database->commit ();
1230 1235
@@ -1249,7 +1254,7 @@ class Database
1249 1254
1250 1255 $query = $this->database->prepare (
1251 1256 'UPDATE `user`' .
1252 - 'SET `password` = SHA2(CONCAT(?, `salt`), 512), `passwordResetToken` = "", `passwordResetTokenExpire` = NULL ' .
1257 + 'SET `password` = SHA2(CONCAT(?, `salt`), 512), `passwordResetToken` = NULL, `passwordResetTokenExpire` = NULL ' .
1253 1258 'WHERE `passwordResetToken` = ? AND `passwordResetTokenExpire` > NOW()');
1254 1259
1255 1260 $query->execute (array ($new_password, $token));

+0/-1 M   template/footer.twig
index 8ee79a7..f8f7f99
old size: 2K - new size: 2K
@@ -4,7 +4,6 @@
4 4 <div class="footer">
5 5 <p>
6 6 Text is available under a <a href="http://creativecommons.org/licenses/by/4.0">Creative Commons Attribution 4.0 International License</a>.
7 - <a href="{{ ''|docroot }}LibreJS.html" data-jslicense="1">JavaScript license information</a>.
8 7 </p>
9 8
10 9 <ul>

+2/-2 M   template/login_reset.twig
index 3080669..cc42335
old size: 2K - new size: 2K
@@ -2,7 +2,7 @@
2 2
3 3 <div class="login">
4 4 {% if feedback %}
5 - <div class="feedback">
5 + <div class="alert bg-danger">
6 6 {{ feedback }}
7 7 </div>
8 8 {% endif %}
@@ -44,7 +44,7 @@
44 44 </div>
45 45
46 46 <div>
47 - <input type="submit" name="reset" class="btn btn-primary" value="Login" />
47 + <input type="submit" name="reset" class="btn btn-primary" value="Send reset code" />
48 48 </div>
49 49 </form>
50 50