[site_refresh]

Description

Link: [site_refresh]
Author: Jason Huck
Category: Administration
Version: 8.5.x
License: Public Domain
Posted: Mar. 04, 2007
Updated: Jan. 01, 0001
More by this author...
This is an alternate method of restarting the current Lasso Site suggested by Fletcher Sandbeck. Requires a ServerAdmin username and password. Operates atomically and asynchronously, and sleeps for a second to allow the calling page to finish processing and be returned to the user.

Parameters

-username string, required A valid serveradmin username.
-password string, required A valid serveradmin password.

Sample Usage

site_refresh(
    -username='xxxxxx',
    -password='xxxxxx'
);
						

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
define_tag(
	'refresh',
	-namespace='site_',
	-async, -atomic,
	-req='username',
	-req='password',
	-priority='replace',
	-description='Restarts the current Lasso Site asynchronously.'
);
	protect;
		local(
			'url' = 'http://127.0.0.1/serveradmin.0.lassoapp',
			'getparams' = array(
				'tab1' = 'sites',
				'tab2' = 'sites',
				'tab3' = 'sites',
				'site_id' = site_id,
				'action' = 'Start'
			)
		);
		
		// wait a second so the calling page finishes
		sleep(1000);
		
		include_url(
			#url,
			-getparams=#getparams,
			-username=#username,
			-password=#password
		);
		
		handle_error;
			log_critical('[site_refresh] failed: ' + error_msg);
			return;
		/handle_error;
	/protect;
/define_tag;

 

Related Tags



Comments

none

Email:


Password:



Newest

Most Popular

Support tagSwap.net