Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: Set up default groups that can create albums in categories  (Read 4049 times)

0 Members and 1 Guest are viewing this topic.

Shane

  • Contributor
  • Coppermine regular visitor
  • ***
  • Offline Offline
  • Posts: 76
  • Choose Again
    • The Philmont Forum
Set up default groups that can create albums in categories
« on: July 24, 2010, 11:52:47 pm »

site:  http://troop445.org/cpg

Just upgraded to 1.5.6.

Where in the database is the data kept that tracks which groups can create albums for each category?  Also, what file would I need to change so that these defaults will be included automatically on creation of any new categories?

My gallery is bridged to a Joomla site, and is set up to use the Joomla user groups.  I'd like to set up the default for each new category created so that groups A, B, and C can create albums, but groups D and E cannot.

Any help would be greatly appreciated.  Thanks.
Logged

papukaija

  • Contributor
  • Coppermine frequent poster
  • ***
  • Country: 00
  • Offline Offline
  • Posts: 333
Re: Set up default groups that can create albums in categories
« Reply #1 on: August 02, 2010, 06:31:47 pm »

You can use the group manager (groupmgr.php) to set permissions for groups. You can also use the documentation if you want to make these changes with phpmyadmin.
Logged

Αndré

  • Administrator
  • Coppermine addict
  • *****
  • Country: de
  • Offline Offline
  • Gender: Male
  • Posts: 15765
Re: Set up default groups that can create albums in categories
« Reply #2 on: August 17, 2010, 10:35:55 am »

It is stored in the table categorymap.

You have to modify the code in catmgr.php that creates the new cat:
Code: [Select]
case 'createcat':
    if (!$superCage->post->keyExists('parent') || !$superCage->post->keyExists('name') || !$superCage->post->keyExists('description')) {
        cpg_die(CRITICAL_ERROR, sprintf($lang_catmgr_php['miss_param'], 'createcat'), __FILE__, __LINE__);
    }

    if ($superCage->post->keyExists('name')) {
        $name = $superCage->post->getEscaped('name');
        $name = trim($name);
    }

    if (empty($name)) {
        $name = '<???>';
        break;
    }

    $parent = $superCage->post->getInt('parent');

    $description = $superCage->post->getEscaped('description');

    cpg_db_query("INSERT INTO {$CONFIG['TABLE_CATEGORIES']} (pos, parent, name, description) VALUES (10000, $parent, '$name', '$description')");
   
    //insert in categorymap
    $cid = cpg_db_last_insert_id();
   
    if ($superCage->post->keyExists('user_groups')) {
        foreach ($superCage->post->getInt('user_groups') as $key) {
            cpg_db_query("INSERT INTO {$CONFIG['TABLE_CATMAP']} (cid, group_id) VALUES ($cid, $key)");
        }
    }
   
    break;
Logged
Pages: [1]   Go Up
 

Page created in 0.017 seconds with 19 queries.