forum.coppermine-gallery.net
Support => cpg1.5.x Support => cpg1.5 permissions => Topic started by: Shane 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.
-
You can use the group manager (groupmgr.php) to set permissions for groups. You can also use the documentation (http://documentation.coppermine-gallery.net/en/dev_database.htm#db_usergroups) if you want to make these changes with phpmyadmin.
-
It is stored in the table categorymap.
You have to modify the code in catmgr.php that creates the new cat:
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;