mirror of
				https://github.com/Mibew/design.git
				synced 2025-10-31 18:41:05 +03:00 
			
		
		
		
	Create cron_get_uri function
This commit is contained in:
		
							parent
							
								
									ff3bfa545f
								
							
						
					
					
						commit
						8914f01b3b
					
				| @ -202,4 +202,25 @@ function cron_index_messages() { | ||||
| 	$db->query('COMMIT'); | ||||
| } | ||||
| 
 | ||||
| /** | ||||
|  * Generates cron URI | ||||
|  * | ||||
|  * @global string $webimroot Path of the mibew instalation from server root. | ||||
|  * It defined in libs/config.php | ||||
|  * @param string $cron_key Cron security key | ||||
|  * @return string Cron URI | ||||
|  */ | ||||
| function cron_get_uri($cron_key) { | ||||
| 	global $webimroot; | ||||
| 
 | ||||
| 	$path = (empty($_SERVER['HTTPS']) || $_SERVER['HTTPS'] == 'off') | ||||
| 		? 'http://' | ||||
| 		: 'https://'; | ||||
| 	$path .= $_SERVER['SERVER_NAME'] . $webimroot . '/cron.php'; | ||||
| 	$path .= empty($cron_key) | ||||
| 		? '' | ||||
| 		: '?cron_key='.$cron_key; | ||||
| 	return $path; | ||||
| } | ||||
| 
 | ||||
| ?>
 | ||||
| @ -19,6 +19,7 @@ require_once('../libs/init.php'); | ||||
| require_once('../libs/operator.php'); | ||||
| require_once('../libs/settings.php'); | ||||
| require_once('../libs/styles.php'); | ||||
| require_once('../libs/cron.php'); | ||||
| 
 | ||||
| $operator = check_login(); | ||||
| force_password($operator); | ||||
| @ -109,13 +110,7 @@ $page['stored'] = isset($_GET['stored']); | ||||
| $page['enabletracking'] = Settings::get('enabletracking'); | ||||
| $page['formcronkey'] = $params['cron_key']; | ||||
| 
 | ||||
| $page['cron_path'] = (empty($_SERVER['HTTPS']) || $_SERVER['HTTPS'] == 'off') | ||||
| 	? 'http://' | ||||
| 	: 'https://'; | ||||
| $page['cron_path'] .= $_SERVER['SERVER_NAME'] . $webimroot . '/cron.php'; | ||||
| $page['cron_path'] .= empty($params['cron_key']) | ||||
| 	? '' | ||||
| 	: '?cron_key='.$params['cron_key']; | ||||
| $page['cron_path'] = cron_get_uri($params['cron_key']); | ||||
| 
 | ||||
| if (Settings::get('enabletracking')) { | ||||
| 	$page['forminvitationstyle'] = $params['invitationstyle']; | ||||
| @ -126,4 +121,5 @@ prepare_menu($operator); | ||||
| setup_settings_tabs(0); | ||||
| start_html_output(); | ||||
| require('../view/settings.php'); | ||||
| 
 | ||||
| ?>
 | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user