Pages (2): 1 2   
Member
Member
the_griffin   19-02-2012, 13:13
#1

Hi,

I run Zenphoto 1.2.2 for a very long time successfully including a modification of the rating-plugin. This modification did a replacement of the user-IP by an user-ID (integer value) which I got from my MyBB-forum settings. This is necessary because our forum has several users with different user-IDs but the same IP. On the other side I don't want to get the same user being able to rate an image again and again by using a different IP.

After upgrading to PHP5.3 I had to upgrade Zenphoto as well and tried to integrate my ID-modification for the rating plugin again. However, it seems that something at the rating plugin changed fundamentely.

I have been trying to get rid of this problems by several weeks but didn't succeed. Therefore, I would be very glad to get any hints how to exchange the IP by an integer value (user-ID) again at the rating plugin.

Thank you very much in advance.

Administrator
Administrator
acrylian   20-02-2012, 10:52
#2

Sorry, 1.2.2 is so old that I don't even remember what was different back then. IF you want to us e the same users on your forum and on your Zenphoto install you should take a look at federated_logon plugin instead.

Member
Member
the_griffin   20-02-2012, 20:04
#3

Hi acrylian,

Thank you very much for your answer. I don't blame you for not remembering about this old version...

I suppose that your proposed plugin might be too much for my purpose. The gallery can be accessed by logged in users only and upload of image and creating albums is restricted to admins.

It was charming to avoid the user-IP and using their ID instead.

Therefore I intend not to work with
$ip = getUserIP();
but with
$ip = sanitize($_SESSION['GalleryUser'], 0);
as well in the rating.php and the update.php as well.

var_dump($ip) shows that the user-ID is existing but it seems that the update.php doesn't get it.
Whereas the original database entry (including IP) looks like
a:1:{s:14:"XX.YYY.ZZZ.193";i:5;}
my actual entry (trying to use the user-ID) looks like
a:1:{s:0:"";i:5;}

Any help would really much appreciated as the gallery is really amazing and most welcome in my forum.

Administrator
Administrator
acrylian   21-02-2012, 11:14
#4

Sorry, I cannot dig into this specific problem. The data is submitted via ajax so you might need to add something.

Member
Member
the_griffin   21-02-2012, 11:35
#5

Thank you for your reply, acrylian. However, I think that ajax only submitts the stars rating value but not the IP. Or am I wrong?

Administrator
Administrator
acrylian   21-02-2012, 12:18
#6

Haven't looked at it for quite some time but it does use the IP. It has however an option to hash the IP as storing purely it is considered a privacy issue in countries of the EU. So maybe you have enabled that.

Member
Member
the_griffin   21-02-2012, 20:28
#7

When using the IP, what is not my intention, the database shows this entry:
a:1:{s:14:"XX.YYY.ZZZ.193";i:5;}
Therefore, I don't think that the IP will be hashed.

Nevertheless, is the IP-hash done by zenphoto and if yes, where could I find the setting for this?

Member
Member
sbillard   21-02-2012, 23:54
#8

You want the Disguise IP rating option. However, it will not work in the released Zenphoto as it was apparently only encrypting the IP in one place, not all places needed.

The latter is fixed in the nightly build tonight.

Of course, this will not help in the situation you describe as it simply hashes the IP address so that the paranoid EU cannot complain.

You will need to replace the getUserIP() function calls in the rating plugin scripts with your code above. BTW, $_SESSION['GalleryUser'] is not something that Zenphoto is maintaining, so be sure that it works for any visitor to your site.

Member
Member
the_griffin   22-02-2012, 17:58
#9

I am not sure what you mean with "Disguise IP", sorry.

As described above, replacing the getUserIP() function in the rating plugin was my original intention and the way I how I did it in the 1.2.2 zenphoto version.

I inlude the global variables from the MyBB software to be able to read the uid of the user by using
$_SESSION['GalleryUser'] = $mybb->user['uid'];
$ip = sanitize($_SESSION['GalleryUser'], 0);
This seems to work for the rating.php file as by using
echo var_dump($ip);
I see the correct user-ID. However, I fail to get this written in the database after submitting the rate.

I tried to use session_start() to have the $ip available at function_rating.php and upgrade.php as well but it doesn't work as well.

Member
Member
sbillard   23-02-2012, 02:47
#10

Well, as I said the Disguise IP option will really not do what you want. But that is the name of the option you asked about above. It is an option of the ratings plugin and is inteneded to scramble IP addresses so that no one can complain that you are collecting them. It does NOT allow you to use distinguish among multiple users all having the same IP address.

Replacing the getUserIP() function calls (note the plural) is indeed what you need to do. If you are storing the user data in a session variable then sessions must be enabled for the Zenphoto front end. You can do that by checking the enable gallery sessions check box on the gallery options tab.

Pages (2): 1 2   
  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.