/** * @return Growl */ protected function getGrowler() { $growler = new Growl($this->config['address'], $this->config['password'], $this->config['app_name']); $growler->addNotification('alert'); $growler->register(); return $growler; }
public function save() { nzbVR::instance()->settings->set("base_url", $this->params()->get("base_url")); nzbVR::instance()->settings->set("main_skin", $this->params()->get("main_skin")); nzbVR::instance()->settings->set("mobile_skin", $this->params()->get("mobile_skin")); nzbVR::instance()->settings->set("newzbin_username", base64_encode($this->params()->get("newzbin_username"))); nzbVR::instance()->settings->set("newzbin_password", base64_encode($this->params()->get("newzbin_password"))); nzbVR::instance()->settings->set("sabnzbd_address", $this->params()->get("sabnzbd_address")); nzbVR::instance()->settings->set("sabnzbd_apikey", base64_encode($this->params()->get("sabnzbd_apikey"))); nzbVR::instance()->settings->set("sabnzbd_username", base64_encode($this->params()->get("sabnzbd_username"))); nzbVR::instance()->settings->set("sabnzbd_password", base64_encode($this->params()->get("sabnzbd_password"))); nzbVR::instance()->settings->set("xbmc_address", $this->params()->get("xbmc_address")); nzbVR::instance()->settings->set("xbmc_username", base64_encode($this->params()->get("xbmc_username"))); nzbVR::instance()->settings->set("xbmc_password", base64_encode($this->params()->get("xbmc_password"))); nzbVR::instance()->settings->set("prowl_apikey", base64_encode($this->params()->get("prowl_apikey"))); nzbVR::instance()->settings->set("growl_password", base64_encode($this->params()->get("growl_password"))); if ($this->params()->get("growl_address") != nzbVR::instance()->settings->growl_address) { nzbVR::instance()->settings->set("growl_address", $this->params()->get("growl_address")); if (nzbVR::instance()->settings->growl_address != "") { $growl = new Growl(); $growl->addNotification("Report found for watcher", true); $growl->register(); } } nzbVR::instance()->settings->save(); //$this->notification("Settings saved successfully", "success"); $this->redirect("index"); }
<?php require_once 'lib/growl/class.growl.php'; include "config.php"; include "lib/functions.php"; mysql_connect($host, $user, $pass) or die(mysql_error()); mysql_select_db($table) or die(mysql_error()); $config = getsettings(); $gametypes = gametypes(); $growlip = $config['growlip']['config']; $growlpass = $config['growlpass']['config']; $growl = new Growl(); $growl->setAddress($growlip, $growlpass); foreach (array_keys($gametypes) as $shortname) { $growl->addNotification("{$shortname}"); } // Register with the remote machine. // You only need to do this once. $growl->register(); ?> <meta http-equiv="refresh" content="0; URL=ssmsconfig.php">