diff --git a/CHANGELOG.txt b/CHANGELOG.txt
index 074e8937..a7b13777 100644
--- a/CHANGELOG.txt
+++ b/CHANGELOG.txt
@@ -7,7 +7,7 @@
* @license GNU General Public License version 3 or later; see LICENSE
*
* CHANGELOG.txt
- * @since 1.6.16
+ * @since 1.6.17
*/
Changelog
=========
@@ -20,6 +20,7 @@ Changelog
[S] = Security fix (issues that are related to security)
*********************************************
+2021-11-22 [B] Allow ratings from different logged in users regardless of IP address {ron4mac}
2021-11-20 [M] Update third party (ZenPhoto maintained) exif reader {ron4mac}
2021-11-15 [M] Change bridge file for SMF 2.1 to function with latest SMF version {ron4mac}
2021-11-09 [B] Correct install failure when single quote (') is used in db config {ron4mac}
diff --git a/include/cpg16x.files.xml b/include/cpg16x.files.xml
index e8f8b358..463da75c 100644
--- a/include/cpg16x.files.xml
+++ b/include/cpg16x.files.xml
@@ -5581,7 +5581,7 @@
include/themes.inc.php
- 1.6.10
+ 1.6.17
mandatory
read
f7a3b825d8ad2a0e26a0aec5e9e6d355
@@ -7894,7 +7894,7 @@
ratepic.php
- 1.6.03
+ 1.6.17
mandatory
read
ef2b10b0ba399e6316884c877ef35187
diff --git a/include/themes.inc.php b/include/themes.inc.php
index e1468825..3db1b2e7 100644
--- a/include/themes.inc.php
+++ b/include/themes.inc.php
@@ -8,7 +8,7 @@
* @license GNU General Public License version 3 or later; see LICENSE
*
* include/themes.inc.php
- * @since 1.6.10
+ * @since 1.6.17
*/
/////////////////////////////////////////////////////////////////
@@ -3628,7 +3628,7 @@ function theme_html_rating_box()
if ($CURRENT_PIC_DATA['owner_id'] == $USER_DATA['user_id'] && $USER_DATA['user_id'] != 0 && ($CONFIG['rate_own_files'] == 0 || $CONFIG['rate_own_files'] == 2 && !USER_IS_ADMIN)) {
// user is owner
$rate_title = $lang_rate_pic['forbidden'];
- } elseif (!$result_votes->numRows() && !$result_vote_stats->numRows()) {
+ } elseif ((USER_ID && !$result_votes->numRows()) || !$result_vote_stats->numRows()) {
// user hasn't voted yet, show voting things
$rate_title = $lang_rate_pic['rate_this_pic'];
$user_can_vote = 'true';
diff --git a/ratepic.php b/ratepic.php
index f4fb11de..622baead 100644
--- a/ratepic.php
+++ b/ratepic.php
@@ -1,18 +1,15 @@
numRows(true)) {
- $send_back = array(
- 'status' => 'error',
- 'msg' => $lang_rate_pic_php['already_rated'],
- 'a' => $USER,
- );
- echo json_encode($send_back);
- exit;
+// If no logged in user, check if IP already rated this picture - vote stats table
+if (!USER_ID) {
+ $sql = "SELECT null FROM {$CONFIG['TABLE_VOTE_STATS']} WHERE pid = $pic AND ip = '$raw_ip'";
+ $result = cpg_db_query($sql);
+ if ($result->numRows(true)) {
+ $send_back = array(
+ 'status' => 'error',
+ 'msg' => $lang_rate_pic_php['already_rated'],
+ 'a' => $USER,
+ );
+ echo json_encode($send_back);
+ exit;
+ }
}
//Test for Self-Rating