mirror of
				https://github.com/ShaYmez/FreeSTAR-Status-Engine.git
				synced 2025-10-31 12:00:19 -04:00 
			
		
		
		
	Update to read relevant options from DB
This commit is contained in:
		
							parent
							
								
									78bb717b0d
								
							
						
					
					
						commit
						a2e0cab819
					
				| @ -19,6 +19,24 @@ else{ | |||||||
|   define("WEB_URL", $db->getSetting($mysqli,"url")); |   define("WEB_URL", $db->getSetting($mysqli,"url")); | ||||||
|   define("MAILER_NAME", $db->getSetting($mysqli,"mailer")); |   define("MAILER_NAME", $db->getSetting($mysqli,"mailer")); | ||||||
|   define("MAILER_ADDRESS", $db->getSetting($mysqli,"mailer_email")); |   define("MAILER_ADDRESS", $db->getSetting($mysqli,"mailer_email")); | ||||||
|  | 
 | ||||||
|  |   define("GOOGLE_RECAPTCHA", $db->getBooleanSetting($mysqli, "google_recaptcha")); | ||||||
|  |   define("GOOGLE_RECAPTCHA_SECRET", $db->getSetting($mysqli, "google_recaptcha_secret")); | ||||||
|  |   define("GOOGLE_RECAPTCHA_SITEKEY", $db->getSetting($mysqli, "google_recaptcha_sitekey")); | ||||||
|  |   define("SUBSCRIBE_EMAIL", $db->getBooleanSetting($mysqli, "subscribe_email")); | ||||||
|  |   define("SUBSCRIBE_TELEGRAM", $db->getBooleanSetting($mysqli, "subscribe_telegram")); | ||||||
|  |   define("TG_BOT_USERNAME", $db->getSetting($mysqli, "tg_bot_username")); | ||||||
|  |   define("TG_BOT_API_TOKEN", $db->getSetting($mysqli, "tg_bot_api_token")); | ||||||
|  |   define("PHP_MAILER", $db->getBooleanSetting($mysqli, "php_mailer")); | ||||||
|  |   define("PHP_MAILER_SMTP", $db->getBooleanSetting($mysqli, "php_mailer_smtp")); | ||||||
|  |   define("PHP_MAILER_PATH", $db->getSetting($mysqli, "php_mailer_path")); | ||||||
|  |   define("PHP_MAILER_HOST", $db->getSetting($mysqli, "php_mailer_host")); | ||||||
|  |   define("PHP_MAILER_PORT", $db->getSetting($mysqli, "php_mailer_port")); | ||||||
|  |   define("PHP_MAILER_SECURE", $db->getBooleanSetting($mysqli, "php_mailer_secure")); | ||||||
|  |   define("PHP_MAILER_USER", $db->getSetting($mysqli, "php_mailer_user")); | ||||||
|  |   define("PHP_MAILER_PASS", $db->getSetting($mysqli, "php_mailer_pass")); | ||||||
|  |   define("CRON_SERVER_IP", $db->getSetting($mysqli, "cron_server_ip")); | ||||||
|  |    | ||||||
|   // Process the subscriber notification queue
 |   // Process the subscriber notification queue
 | ||||||
|   // If CRON_SERVER_IP is not set, call notification once incident has been saved
 |   // If CRON_SERVER_IP is not set, call notification once incident has been saved
 | ||||||
|   if ( empty(CRON_SERVER_IP) ) |   if ( empty(CRON_SERVER_IP) ) | ||||||
|  | |||||||
| @ -13,6 +13,23 @@ define("TITLE", $db->getSetting($mysqli,"title")); | |||||||
| define("WEB_URL", $db->getSetting($mysqli,"url")); | define("WEB_URL", $db->getSetting($mysqli,"url")); | ||||||
| define("MAILER_NAME", $db->getSetting($mysqli,"mailer")); | define("MAILER_NAME", $db->getSetting($mysqli,"mailer")); | ||||||
| define("MAILER_ADDRESS", $db->getSetting($mysqli,"mailer_email")); | define("MAILER_ADDRESS", $db->getSetting($mysqli,"mailer_email")); | ||||||
|  | define("GOOGLE_RECAPTCHA", $db->getBooleanSetting($mysqli, "google_recaptcha")); | ||||||
|  | //define("", $db->getSettings($mysqli, ""));
 | ||||||
|  | define("GOOGLE_RECAPTCHA_SECRET", $db->getSetting($mysqli, "google_recaptcha_secret")); | ||||||
|  | define("GOOGLE_RECAPTCHA_SITEKEY", $db->getSetting($mysqli, "google_recaptcha_sitekey")); | ||||||
|  | define("SUBSCRIBE_EMAIL", $db->getBooleanSetting($mysqli, "subscribe_email")); | ||||||
|  | define("SUBSCRIBE_TELEGRAM", $db->getBooleanSetting($mysqli, "subscribe_telegram")); | ||||||
|  | define("TG_BOT_USERNAME", $db->getSetting($mysqli, "tg_bot_username")); | ||||||
|  | define("TG_BOT_API_TOKEN", $db->getSetting($mysqli, "tg_bot_api_token")); | ||||||
|  | define("PHP_MAILER", $db->getBooleanSetting($mysqli, "php_mailer")); | ||||||
|  | define("PHP_MAILER_SMTP", $db->getBooleanSetting($mysqli, "php_mailer_smtp")); | ||||||
|  | define("PHP_MAILER_PATH", $db->getSetting($mysqli, "php_mailer_path")); | ||||||
|  | define("PHP_MAILER_HOST", $db->getSetting($mysqli, "php_mailer_host")); | ||||||
|  | define("PHP_MAILER_PORT", $db->getSetting($mysqli, "php_mailer_port")); | ||||||
|  | define("PHP_MAILER_SECURE", $db->getBooleanSetting($mysqli, "php_mailer_secure")); | ||||||
|  | define("PHP_MAILER_USER", $db->getSetting($mysqli, "php_mailer_user")); | ||||||
|  | define("PHP_MAILER_PASS", $db->getSetting($mysqli, "php_mailer_pass")); | ||||||
|  | 
 | ||||||
| $mailer       = new Mailer(); | $mailer       = new Mailer(); | ||||||
| $subscriber   = new Subscriber(); | $subscriber   = new Subscriber(); | ||||||
| $subscription =  new Subscriptions(); | $subscription =  new Subscriptions(); | ||||||
|  | |||||||
| @ -40,6 +40,14 @@ define("TITLE", $db->getSetting($mysqli,"title")); | |||||||
| define("WEB_URL", $db->getSetting($mysqli,"url")); | define("WEB_URL", $db->getSetting($mysqli,"url")); | ||||||
| define("MAILER_NAME", $db->getSetting($mysqli,"mailer")); | define("MAILER_NAME", $db->getSetting($mysqli,"mailer")); | ||||||
| define("MAILER_ADDRESS", $db->getSetting($mysqli,"mailer_email")); | define("MAILER_ADDRESS", $db->getSetting($mysqli,"mailer_email")); | ||||||
|  | 
 | ||||||
|  | define("SUBSCRIBE_EMAIL", $db->getBooleanSetting($mysqli,"subscribe_email")); | ||||||
|  | define("SUBSCRIBE_TELEGRAM", $db->getBooleanSetting($mysqli,"subscribe_telegram")); | ||||||
|  | define("TG_BOT_USERNAME", $db->getSetting($mysqli,"tg_bot_username")); | ||||||
|  | define("TG_BOT_API_TOKEN", $db->getSetting($mysqli,"tg_bot_api_token")); | ||||||
|  | define("GOOGLE_RECAPTCHA", $db->getBooleanSetting($mysqli,"google_recaptcha")); | ||||||
|  | define("GOOGLE_RECAPTCHA_SITEKEY", $db->getSetting($mysqli,"google_recaptcha_sitekey")); | ||||||
|  | define("GOOGLE_RECAPTCHA_SECRET", $db->getSetting($mysqli,"google_recaptcha_secret")); | ||||||
| $offset = 0; | $offset = 0; | ||||||
| 
 | 
 | ||||||
| if (isset($_GET['ajax'])) | if (isset($_GET['ajax'])) | ||||||
|  | |||||||
| @ -11,6 +11,14 @@ define("TITLE", $db->getSetting($mysqli,"title")); | |||||||
| define("WEB_URL", $db->getSetting($mysqli,"url")); | define("WEB_URL", $db->getSetting($mysqli,"url")); | ||||||
| define("MAILER_NAME", $db->getSetting($mysqli,"mailer")); | define("MAILER_NAME", $db->getSetting($mysqli,"mailer")); | ||||||
| define("MAILER_ADDRESS", $db->getSetting($mysqli,"mailer_email")); | define("MAILER_ADDRESS", $db->getSetting($mysqli,"mailer_email")); | ||||||
|  | define("SUBSCRIBE_EMAIL", $db->getBooleanSetting($mysqli, "subscribe_email")); | ||||||
|  | define("SUBSCRIBE_TELEGRAM", $db->getBooleanSetting($mysqli, "subscribe_telegram")); | ||||||
|  | define("GOOGLE_RECAPTCHA", $db->getSetting($mysqli, "google_recaptcha")); | ||||||
|  | define("GOOGLE_RECAPTCHA_SECRET", $db->getSetting($mysqli, "google_recaptcha_secret")); | ||||||
|  | define("GOOGLE_RECAPTCHA_SITEKEY", $db->getSetting($mysqli, "google_recaptcha_sitekey")); | ||||||
|  | define("TG_BOT_API_TOKEN", $db->getSetting($mysqli, "tg_bot_api_token")); | ||||||
|  | define("TG_BOT_USERNAME", $db->getSetting($mysqli, "tg_bot_username")); | ||||||
|  | 
 | ||||||
| $subscription = new Subscriptions(); | $subscription = new Subscriptions(); | ||||||
| $telegram     = new Telegram(); | $telegram     = new Telegram(); | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -2,6 +2,17 @@ | |||||||
| require_once ("config.php"); | require_once ("config.php"); | ||||||
| require_once ("classes/telegram.php"); | require_once ("classes/telegram.php"); | ||||||
| require_once ("classes/subscriber.php"); | require_once ("classes/subscriber.php"); | ||||||
|  | require_once ("classes/db-class.php"); | ||||||
|  | $db = new SSDB(); | ||||||
|  | define("NAME", $db->getSetting($mysqli,"name")); | ||||||
|  | define("TITLE", $db->getSetting($mysqli,"title")); | ||||||
|  | define("WEB_URL", $db->getSetting($mysqli,"url")); | ||||||
|  | define("MAILER_NAME", $db->getSetting($mysqli,"mailer")); | ||||||
|  | define("MAILER_ADDRESS", $db->getSetting($mysqli,"mailer_email")); | ||||||
|  | define("SUBSCRIBE_TELEGRAM", $db->getBooleanSetting($mysqli, "subscribe_telegram")); | ||||||
|  | define("SUBSCRIBE_TELEGRAM", $db->getBooleanSetting($mysqli, "subscribe_telegram")); | ||||||
|  | define("TG_BOT_API_TOKEN", $db->getSetting($mysqli, "tg_bot_api_token")); | ||||||
|  | define("TG_BOT_USERNAME", $db->getSetting($mysqli, "tg_bot_username")); | ||||||
| 
 | 
 | ||||||
| $telegram   = new Telegram(); | $telegram   = new Telegram(); | ||||||
| $subscriber = new Subscriber(); | $subscriber = new Subscriber(); | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user