- Timestamp:
- Jun 27, 2010, 10:37:23 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/virtualAutoGrant/virtual_categories_granted_to_creator.php
r6610 r6613 11 11 add_event_handler('get_admin_plugin_menu_links', 'VAG_set_private'); 12 12 function VAG_set_private($menu) { 13 global $page ;13 global $page, $conf; 14 14 if ( isset($page['page']) and $page['page'] != 'site_manager' ) 15 15 $conf['newcat_default_status'] = 'private'; … … 22 22 add_event_handler('get_admin_plugin_menu_links', 'VAG_set_public'); 23 23 function VAG_set_public($menu) { 24 global $page ;24 global $page, $conf; 25 25 if ( isset($page['page']) and $page['page'] != 'site_manager' ) 26 26 $conf['newcat_default_status'] = 'public'; … … 35 35 function VAG_grant_to_prepare($menu) { 36 36 global $conf, $page, $vag; 37 if ( !isset($page['page']) or $page['page'] == 'site_manager' ) return false; 37 if ( !isset($page['page']) or $page['page'] == 'site_manager' ) return false; # Not Virtual 38 38 list($max_id) = pwg_db_fetch_row(pwg_query('SELECT MAX(id) FROM '.CATEGORIES_TABLE . ';')); 39 39 $vag['lastcat before'] == $max_id; … … 54 54 mass_inserts(USER_ACCESS_TABLE, array('user_id','cat_id'), $insert); 55 55 } 56 // To do set level 56 57 } 57 58 } 58 59 } 59 60 60 // API cases : Just do it (even in Admin Photos Add case or other plugins cases)61 // API cases : Just do it 61 62 if ( !function_exists( 'VAG_set_private_by_API' ) ) { 62 63 add_event_handler('invalidate_user_cache', 'VAG_set_private_by_API', 20); … … 64 65 function VAG_set_private_by_API($full) { 65 66 if ( !function_exists( 'ws_categories_add' ) ) return false; // That isn't an API request 66 global $user, $conf, $vag; 67 if ( $_REQUEST['method'] == 'pwg.categories.add' ) { 67 global $user, $conf; 68 $vag = & $conf['virtual_AutoGrant']; 69 if ( isset($_REQUEST['method']) and $_REQUEST['method'] == 'pwg.categories.add' ) { 68 70 list($inserted_id) = pwg_db_fetch_row(pwg_query('SELECT MAX(id) FROM '.CATEGORIES_TABLE 69 71 . ' WHERE name = \'' .pwg_db_real_escape_string($_REQUEST['name']) . '\' AND site_id IS NULL;')); … … 80 82 } 81 83 // "Who can see" management ( only for API, Synchro or old HTTP management on gallery side are ignored ) 82 if ( $_REQUEST['method'] == 'pwg.images.add' and isset($_REQUEST['original_sum'])84 if ( isset($_REQUEST['method']) and $_REQUEST['method'] == 'pwg.images.add' and isset($_REQUEST['original_sum']) 83 85 and $vag['set_who_can_see'] == 1 ) { 84 86 # image to update
Note: See TracChangeset
for help on using the changeset viewer.