[site_create]

Description

Link: [site_create]
Author: Jason Huck
Category: Administration
Version: 8.5.x
License: Public Domain
Posted: May. 19, 2007
Updated: Jan. 01, 0001
More by this author...
This tag creates a new Lasso Site by submitting the Add Site form in ServerAdmin.LassoApp. Uses the same defaults as that form for the optional params, and runs asynchronously.

Parameters

-username string, required The ServerAdmin username.
-password string, required The ServerAdmin password.
-name string, required The name of the new Lasso Site to be created.
-adminusername string, required The SiteAdmin username for the new Lasso Site.
-adminpassword string, required The SiteAdmin password for the new Lasso Site.
-description string, optional An optional description of the new Lasso Site.
-duplicate integer, optional The site id of another Lasso Site to duplicate when creating the new one.
-installdocs boolean, optional Whether or not to install a copy of the online reference. Defaults to false.
-hostname string, optional Initial host name for the site. Defaults to '%.'
-hostroot string, optional Initial host root for the site. Defaults to '/%.'
-initialize boolean, optional Whether or not to automatically initialize the site. Defaults to false.
-smtphost string, optional The SMTP host for the new Lasso Site.
-smtpusername string, optional Valid username for the specified SMTP host.
-smtppassword string, optional Valid password for the specified SMTP user.

Sample Usage

site_create(
	-username='yourserveradminusername',
	-password='yourserveradminpassword',
	-name='Name of New Site',
	-adminusername='Admin User for New Site',
	-adminpassword='Admin User Password',
	-description='This Lasso Site was made from a ctag.'
);
						

Source Code

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.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
define_tag(
	'create',
	-namespace='site_',
	-async, -atomic,
	-req='username',
	-req='password',
	-req='name',
	-req='adminusername',
	-req='adminpassword',
	-opt='description',
	-opt='duplicate', -type='integer',
	-opt='installdocs', -type='boolean',
	-opt='hostname',
	-opt='hostroot',
	-opt='initialize', -type='boolean',
	-opt='smtphost',
	-opt='smtpusername',
	-opt='smtppassword',
	-priority='replace',
	-description='Creates a new Lasso Site via ServerAdmin.'
);
	protect;		
		local('getparams') = array(
			'tab1' = 'sites',
			'tab2' = 'sites',
			'tab3' = 'sites',
			'dialog_action' = '',						// (empty string)
			'site_name' = #name,
			'site_description' = local('description'),
			'site_duplicate' = local('duplicate'),		// (site id)
			'site_reference' = (!local_defined('installdocs') || !#installdocs ? 'No' | 'Yes'),
			'site_host_new' = (local_defined('hostname') ? #hostname | '%'),
			'site_root_new' = (local_defined('hostroot') ? #hostroot | '/%'),
			'site_username' = #adminusername,
			'site_password' = #adminpassword,
			'site_confirm' = #adminpassword,
			'lasso_site_initialized' = (!local_defined('initialize') || !#initialize ? 'N' | 'Y'),
			'lasso_smtp_host' = local('smtphost'),
			'lasso_smtp_username' = local('smtpusername'),
			'lasso_smtp_password' = local('smtppassword'),
			'action' = 'Add Site'
		);

		local('url' = 'http://127.0.0.1/serveradmin.0.lassoapp');
					
		include_url(
			#url,
			-getparams=#getparams,
			-username=#username,
			-password=#password
		);
		
		handle_error;
			log_critical('[site_create] failed: ' + error_msg);
			return;
		/handle_error;
	/protect;
/define_tag;

 

Related Tags



Comments

none

Email:


Password:



Newest

Most Popular

Support tagSwap.net