Admin accounts can't manage "My Gallery" Admin accounts can't manage "My Gallery"
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

Admin accounts can't manage "My Gallery"

Started by EZ, December 31, 2005, 05:59:01 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

EZ

Hi,

I recently switched from 1.3.x to 1.4.2 (after much pain), and since then my admin accounts don't show the standard buttons for managing their own albums. Regular users seem to have those buttons.

One of the admin accounts is the "main" admin user that's created during setup, and the other account is bridged from phpBB. Both accounts have full admin rights. Of course I did try to switch between admin and user modes, log out and back in, delete cookies and close the browser, etc. all to no avail.

By the way I've just updated to 1.4.3 (no pain this time!), but no change.

Update:

I noticed two strange details that may help nail this problem:

1. Before the update to 1.4.3, I had one user who was registered and assigned to the same group as most other users, yet her name wouldn't show under her albums. I could not find anything different about her account, and I was about to post a support question.

2. However after the update to 1.4.3 her account seems to be back to normal. On the other hand, now my two admin accounts manage their albums, and indeed the names don't show up under the albums list.

Any ideas?

Thanks,

EZ.

Nibbler

Admins don't have a "My Gallery", they use the album manager to create their user galleries.

EZ

#2
Nibbler -

First of all thanks for the reply.

It's been a long time since I tried to upload photos to my own albums, so I may have forgotten how to do it... Anyway:

Both admin accounts show "My Gallery" in the main menu. Clicking the link shows the admin's album list. I'd expect that at least in user mode the admin should have the user buttons. The bigger problem however, is that no one can view my albums (for both my admin accounts). The album list shows an album thumbnail for each of the account, but:

* The names of the admins are not shown under their album thumbnails.

* Clicking on a thumbnail goes to an empty list. At that point the breadcrumb shows "Members albums > Anonymous".

Why not see for yourself: http://hug-elad.org/gallery/index.php?cat=1. Ignore the strange characters, it's just Hebrew. The first (top left) and the 10th (bottom row second from left) albums are the two admins' albums. Note that there's no name and try to click on the albums.

Thanks,

EZ.

Nibbler

Coppermine can't determine the ownership of these albums for some reason and this is the cause of both issues. Can you post the debug output from that page for me ?

EZ

Nibbler -

Here is the output for the Members Albums page:
Quote
USER:
------------------
Array
(
    [ID] => 4104d2f5a07b5640ab274d94a7f681bc
    [am] => 1
    [lang] => english
    [lap] => 1
)

==========================
USER DATA:
------------------
Array
(
    [user_id] => 90
    [user_name] => EZ
    [groups] => Array
        (
           
  • => 102
                [1] => 187
                [2] => 206
                [3] => 108
            )

        [disk_max] => 999999
        [disk_min] => 0
        [can_rate_pictures] => 1
        [can_send_ecards] => 1
        [ufc_max] => 3
        [ufc_min] => 3
        [custom_user_upload] => 1
        [num_file_upload] => 5
        [num_URI_upload] => 3
        [can_post_comments] => 1
        [can_upload_pictures] => 1
        [can_create_albums] => 1
        [has_admin_access] => 1
        [pub_upl_need_approval] => 0
        [priv_upl_need_approval] => 0
        [group_name] => Administrators
        [upload_form_config] => 3
        [group_quota] => 0
        [can_see_all_albums] => 1
        [group_id] => 102
    )

    ==========================
    Queries:
    ------------------
    Array
    (
       
  • => SELECT extension, mime, content, player FROM cpg_filetypes; (0.001s)
        [1] => select * from cpg_plugins order by priority asc; (0.004s)
        [2] => SELECT * FROM cpg_bridge (0.001s)
        [3] => SELECT u.user_id AS user_id, u.user_password AS password, u.user_level FROM `hugelad_phpbb`.phpbb_users AS u, `hugelad_phpbb`.phpbb_sessions AS s WHERE u.user_id=s.session_user_id AND s.session_id = '89cd6f81c0cddfd6458b260a9d424a8d' AND u.user_id > 0 (0.004s)
        [4] => SELECT u.user_id AS id, u.username AS username, u.user_password AS password, ug.group_id AS group_id FROM `hugelad_phpbb`.phpbb_users AS u, `hugelad_phpbb`.phpbb_user_group AS ug WHERE u.user_id=ug.user_id AND u.user_id='90' (0.001s)
        [5] => SELECT ug.group_id+100 AS group_id FROM `hugelad_phpbb`.phpbb_users AS u, `hugelad_phpbb`.phpbb_user_group AS ug, `hugelad_phpbb`.phpbb_groups as g WHERE u.user_id=ug.user_id AND u.user_id='90' AND g.group_id = ug.group_id (0.001s)
        [6] => SELECT MAX(group_quota) as disk_max, MIN(group_quota) as disk_min, MAX(can_rate_pictures) as can_rate_pictures, MAX(can_send_ecards) as can_send_ecards, MAX(upload_form_config) as ufc_max, MIN(upload_form_config) as ufc_min, MAX(custom_user_upload) as custom_user_upload, MAX(num_file_upload) as num_file_upload, MAX(num_URI_upload) as num_URI_upload, MAX(can_post_comments) as can_post_comments, MAX(can_upload_pictures) as can_upload_pictures, MAX(can_create_albums) as can_create_albums, MAX(has_admin_access) as has_admin_access, MIN(pub_upl_need_approval) as pub_upl_need_approval, MIN( priv_upl_need_approval) as  priv_upl_need_approval FROM cpg_usergroups WHERE group_id in (102,187,206,108) (0.001s)
        [7] => SELECT group_name FROM  cpg_usergroups WHERE group_id= 102 (0s)
        [8] => SELECT user_favpics FROM cpg_favpics WHERE user_id = 90 (0.001s)
        [9] => DELETE FROM cpg_banned WHERE expiry < '2006-01-01 08:02:33' (0.001s)
        [10] => SELECT * FROM cpg_banned WHERE (ip_addr='85.65.246.146' OR ip_addr='85.65.246.146' OR user_id=90) AND brute_force=0 (0s)
        [11] => SELECT aid FROM cpg_albums as a WHERE category>=10000 (0.003s)
        [12] => SELECT cid FROM cpg_categories WHERE parent = '1' (0.001s)
        [13] => SELECT name, parent FROM cpg_categories WHERE cid = '1' (0.001s)
        [14] => SELECT cid, name, description, thumb FROM cpg_categories WHERE parent = '1'  ORDER BY pos (0.001s)
        [15] => SELECT aid FROM cpg_albums as a WHERE category >= 10000 (0.002s)
        [16] => SELECT COUNT(*) FROM cpg_pictures WHERE approved = 'NO' (0.007s)
        [17] => select null from cpg_albums as p  INNER JOIN cpg_pictures AS pics ON pics.aid = p.aid where ( category>10000 ) group by category; (0.052s)
        [18] => SELECT category - 10000 as user_id FROM cpg_albums AS a INNER JOIN cpg_pictures AS p ON p.aid = a.aid WHERE ((isnull(approved) or approved='YES') AND category > 10000)  GROUP BY category LIMIT 0, 12  (0.009s)
        [19] => SELECT user_id AS user_id, username AS user_name FROM `hugelad_phpbb`.phpbb_users WHERE user_id IN (2,9,20,24,25,27,45,73,86,90,91,93) (0.001s)
        [20] => SELECT owner_id as user_id,COUNT(DISTINCT a.aid) as alb_count,COUNT(DISTINCT pid) as pic_count,MAX(pid) as thumb_pid, MAX(galleryicon) as gallery_pid FROM cpg_albums AS a INNER JOIN cpg_pictures AS p ON p.aid = a.aid WHERE ((isnull(approved) or approved='YES') AND category > 10000)  GROUP BY category ORDER BY category LIMIT 0, 12  (0.225s)
        [21] => SELECT filepath, filename, url_prefix, pwidth, pheight FROM cpg_pictures WHERE pid='292' (0.126s)
        [22] => SELECT filepath, filename, url_prefix, pwidth, pheight FROM cpg_pictures WHERE pid='678' (0.039s)
        [23] => SELECT filepath, filename, url_prefix, pwidth, pheight FROM cpg_pictures WHERE pid='777' (0.002s)
        [24] => SELECT filepath, filename, url_prefix, pwidth, pheight FROM cpg_pictures WHERE pid='46' (0s)
        [25] => SELECT filepath, filename, url_prefix, pwidth, pheight FROM cpg_pictures WHERE pid='1100' (0.143s)
        [26] => SELECT filepath, filename, url_prefix, pwidth, pheight FROM cpg_pictures WHERE pid='1633' (0.001s)
        [27] => SELECT filepath, filename, url_prefix, pwidth, pheight FROM cpg_pictures WHERE pid='677' (0s)
        [28] => SELECT filepath, filename, url_prefix, pwidth, pheight FROM cpg_pictures WHERE pid='2217' (0s)
        [29] => SELECT filepath, filename, url_prefix, pwidth, pheight FROM cpg_pictures WHERE pid='560' (0.003s)
        [30] => SELECT filepath, filename, url_prefix, pwidth, pheight FROM cpg_pictures WHERE pid='44' (0.001s)
        [31] => SELECT filepath, filename, url_prefix, pwidth, pheight FROM cpg_pictures WHERE pid='2193' (0.001s)
        [32] => SELECT filepath, filename, url_prefix, pwidth, pheight FROM cpg_pictures WHERE pid='1522' (0s)
        [33] => SELECT count(*) FROM cpg_albums as a WHERE category = '1' (0.001s)
    )

    ==========================
    GET :
    ------------------
    Array
    (
        [cat] => 1
    )

    ==========================
    POST :
    ------------------
    Array
    (
    )

    ==========================
    VERSION INFO :
    ------------------
    PHP version: 4.3.10 - OK
    ------------------
    mySQL version: 4.0.14-standard
    ------------------
    Coppermine version: 1.4.3(stable)
    ==========================
    Module: GD
    ------------------
    GD Version: bundled (2.0.28 compatible)
    FreeType Support:
    T1Lib Support:
    GIF Read Support: 1
    GIF Create Support: 1
    JPG Support: 1
    PNG Support: 1
    WBMP Support: 1
    XBM Support: 1
    JIS-mapped Japanese Font Support:

    ==========================
    Module: mysql
    ------------------
    MySQL Supportenabled
    Active Persistent Links 0
    Active Links 2
    Client API version 3.23.49
    MYSQL_MODULE_TYPE builtin
    MYSQL_SOCKET /var/lib/mysql/mysql.sock
    MYSQL_INCLUDE no value
    MYSQL_LIBS no value
    ==========================
    Module: zlib
    ------------------
    ZLib Support enabled
    Compiled Version 1.1.4
    Linked Version 1.1.4
    ==========================
    Server restrictions (safe mode)?
    ------------------
    Directive | Local Value | Master Value
    safe_mode | Off | Off
    safe_mode_exec_dir | no value | no value
    safe_mode_gid | Off | Off
    safe_mode_include_dir | no value | no value
    safe_mode_exec_dir | no value | no value
    sql.safe_mode | Off | Off
    disable_functions | no value | no value
    file_uploads | On | On
    include_path | .:/usr/local/lib/php | .:/usr/local/lib/php
    open_basedir | /home/hugelad/:/tmp/:/var/www/:/usr/lib/php/:/etc/virtual/ | no value
    ==========================
    email
    ------------------
    Directive | Local Value | Master Value
    sendmail_from | me@localhost.com | me@localhost.com
    sendmail_path | /usr/sbin/sendmail -t -i  | /usr/sbin/sendmail -t -i
    SMTP | localhost | localhost
    smtp_port | 25 | 25
    ==========================
    Size and Time
    ------------------
    Directive | Local Value | Master Value
    max_execution_time | 30 | 30
    max_input_time | 60 | 60
    upload_max_filesize | 2M | 2M
    post_max_size | 8M | 8M
    ==========================
    Page generated in 7.591 seconds - 34 queries in 0.634 seconds - Album set : AND aid IN (31,32,34,30,6,7,8,9,10,11,13,14,15,16,17,18,19,20,21,23,27,28,29,35,36,37,39,40,41,42,43,44,45,47,48,49,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,69,70,71,72,73,74,75,76,78,79,80,81,82,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101) ; Meta set: AND aid IN (31,32,34,30,6,7,8,9,10,11,13,14,15,16,17,18,19,20,21,23,27,28,29,35,36,37,39,40,41,42,43,44,45,47,48,49,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,69,70,71,72,73,74,75,76,78,79,80,81,82,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101) ;
Thanks,

Eyal.

Nibbler

It looks like you have batch added these pics into the user gallery, and as such they are not actually owned by the user whose gallery they are in. The code uses the owner_id to get the username (bridge/udb_base.inc.php):

$sql  = "SELECT owner_id as user_id,";

If you change that to

$sql  = "SELECT category - 10000 as user_id, ";

Then it can use the category number to determine ownership instead, which should be successful.

EZ

Nibbler -



The problem is with access to ALBUMS, not pics, so I'm not sure I understand your answer.

Or maybe you mean that album ownership is determined from the owner_id of the pictures in the album? If yes, then what happens with albums that contain pictures with different owner ids?

EZ.

Nibbler

Quote from: EZ on January 02, 2006, 11:15:54 AM
what happens with albums that contain pictures with different owner ids?

We're talking about user galleries here, all pics are owned by the same user.

EZ

Nibbler -

On the one hand albums are linked to users by means of a "virtual category", which is the user id + 10000. On the other hand, when it's time to display the albums, the link is determined by the owner id of pictures in the album.

This is a design bug, and it is a sure way to a mess.

An album should have a category, which is used to structure the albums into some hierarchy. Seperately, each album should have an owner, who can manage the album.

EZ.