Exemplo n.º 1
0
 public static function set($name, $value)
 {
     $conf = new CmsConfiguration();
     $result = $conf->filter(array('name' => $name))->first();
     if ($result) {
         return $result->update_attributes(array("value" => serialize($value)));
     } else {
         $conf = new CmsConfiguration();
         return $conf->update_attributes(array("name" => $name, "value" => serialize($value)));
     }
 }
Exemplo n.º 2
0
 function __construct()
 {
     /**
      * authentication
      **/
     $auth = new WaxAuthDb(array("encrypt" => false, "db_table" => $this->auth_database_table, "session_key" => "wildfire_user_cookie"));
     $this->current_user = $auth->get_user();
     if ($this->current_user->usergroup == 30) {
         $this->is_admin = true;
     }
     /**
      * module setup
      **/
     $this->before_filter("all", "check_authorised", array("login"));
     $this->configure_modules();
     $this->all_modules = CMSApplication::get_modules(true);
     if (!array_key_exists($this->module_name, CMSApplication::get_modules())) {
         Session::add_message('This component is not registered with the application.');
         $this->redirect_to('/admin/home/index');
     }
     /**
      * model instanciation
      **/
     $this->cm_conf = CmsConfiguration::get("general");
     if ($this->model_class) {
         $this->model = new $this->model_class($this->cm_conf['campaign_monitor_ClientID']);
         $this->model_name = WXInflections::underscore($this->model_class);
     }
     $this->sub_links["create"] = "Create New " . $this->display_name;
     $this->sub_links["view_subscriber"] = "View Subscribers";
     $this->sub_links["view_segments"] = "View Segments";
     if (!($this->this_page = WaxUrl::get("page"))) {
         $this->this_page = 1;
     }
 }
Exemplo n.º 3
0
 public function before_insert()
 {
     $this->author_ip = $_SERVER["REMOTE_ADDR"];
     $this->time = date("Y-m-d H:i:s");
     $this->config = CmsConfiguration::get("comments");
     $this->flag_spam();
 }
 public function index()
 {
     $this->stat_search = unserialize(file_get_contents("http://stats.oneblackbear.com/index.php?module=API&method=Referers.getKeywords&idSite=5&period=week&date=yesterday&format=PHP&token_auth=ae290d98aa13255678682381827a6862"));
     $this->stat_links = unserialize(file_get_contents("http://stats.oneblackbear.com/index.php?module=API&method=Referers.getWebsites&idSite=5&period=week&date=yesterday&format=PHP&token_auth=ae290d98aa13255678682381827a6862"));
     $this->stat_dash = ($li = CmsConfiguration::get("stat_dash_url")) ? $this->parse_xml($li, 5, "visit_day") : array();
     $this->link_module = $this->render_partial("stat_links");
     $this->search_module = $this->render_partial("stat_search");
     $this->dash_module = $this->render_partial("stat_dash");
 }
 /**
  * find the settings within the cms config and set the relevant data
  */
 protected function variable_setup()
 {
     $this->{$this->type} = CmsConfiguration::get($this->type);
     if (!$this->{$this->type}) {
         $this->{$this->type} = array();
     }
 }
Exemplo n.º 6
0
 private function check_cms_api_key()
 {
     if (!class_exists("CmsConfiguration")) {
         return false;
     } elseif ($general = CmsConfiguration::get('general')) {
         if ($general['campaign_monitor_apikey'] > 0) {
             return $general['campaign_monitor_apikey'];
         } else {
             return false;
         }
     } else {
         return false;
     }
 }
Exemplo n.º 7
0
 /**
  * creates the module listing - filters on user level
  **/
 protected function configure_modules()
 {
     $config = CmsConfiguration::get("modules");
     if (!is_array($mods = $config["enabled_modules"])) {
         $mods = array();
     }
     if ($mods && $this->current_user->usergroup != "30") {
         foreach (CMSApplication::get_modules() as $module => $values) {
             if (!array_key_exists($module, $mods)) {
                 CMSApplication::unregister_module($module);
             }
         }
     }
 }