Link | admin_groupassignhost |
Author | Jason Huck |
Category | Administration |
Version | 8.x |
License | http://opensource.org/licenses/artistic-license.php |
Posted | 21 Nov 2006 |
Updated | 21 Nov 2006 |
More by this author... |
Assigns the specified host to the specified group. Requires authentication as a user with permissions on Lasso's internal db's, i.e., with [auth_admin].
admin_groupassignhost( -group='TestGroup', -host='Local MySQL' );
Click the "Download" button below to retrieve a copy of this tag, including the complete documentation and sample usage shown on this page. Place the downloaded ".inc" file in your LassoStartup folder, restart Lasso, and you can begin using this tag immediately.
define_tag( 'groupassignhost', -namespace='admin_', -req='group', -req='host', -priority='replace', -description='Assigns the specified host to the specified group.' ); inline( -database='lasso_internal', -sql='SELECT 1'); local('sql' = ' SELECT id FROM security_groups WHERE name = \'' + #group + '\' '); inline( -sql=#sql); local('groupID') = field('id'); /inline; local('hostID') = host_id(#host); local('sql' = ' SELECT id FROM security_group_host_map WHERE id_host = ' + #hostID + ' AND id_group = ' + #groupID + ' '); protect; inline( -sql=#sql); if(found_count); local('sql' = ' UPDATE security_group_host_map SET allow = \'Q\' WHERE id = ' + field('id') + ' '); inline( -sql=#sql); /inline; else; local('sql' = ' INSERT INTO security_group_host_map ( id_host, id_group, allow ) VALUES ( ' + #hostID + ', ' + #groupID + ', \'Q\' ) '); inline( -sql=#sql); /inline; /if; /inline; return(true); handle_error; return(false); /handle_error; /protect; /inline; /define_tag;
No comments
©LassoSoft Inc 2015 | Web Development by Treefrog Inc | Privacy | Legal terms and Shipping | Contact LassoSoft