Ejemplo n.º 1
0
 function on_submit()
 {
     $og_name = Url::get('og_name');
     $u_name = Url::get('u_name');
     $u_yahoo = Url::get('u_yahoo');
     $u_skype = Url::get('u_skype');
     $OnlineSupport = array();
     if ($og_name) {
         foreach ($og_name as $gid => $g_name) {
             if ($g_name != '' && isset($u_name[$gid], $u_yahoo[$gid], $u_skype[$gid])) {
                 $garray = array('name' => $g_name, 'users' => array());
                 foreach ($u_name[$gid] as $uid => $name) {
                     if ($name != '' && isset($u_yahoo[$gid][$uid], $u_skype[$gid][$uid]) && ($u_yahoo[$gid][$uid] != '' || $u_skype[$gid][$uid] != '')) {
                         $garray['users'][$uid] = array('name' => $name, 'yahoo' => $u_yahoo[$gid][$uid], 'skype' => $u_skype[$gid][$uid]);
                     }
                 }
                 if ($garray['users']) {
                     $OnlineSupport[$gid] = $garray;
                 }
             }
         }
     }
     if (isset(CGlobal::$configs['OnlineSupport'])) {
         DB::update('configs', array("conf_val" => addslashes(serialize($OnlineSupport))), "conf_key='OnlineSupport'", __FILE__ . " Dòng:" . __LINE__);
     } else {
         DB::insert('configs', array("conf_key" => 'OnlineSupport', "conf_val" => addslashes(serialize($OnlineSupport))), __FILE__ . " Dòng:" . __LINE__);
     }
     AZLib::get_config(0, 1);
     AZLib::refreshParent();
 }
Ejemplo n.º 2
0
 function on_submit()
 {
     $footerContent = Url::get('content');
     if (get_magic_quotes_gpc()) {
         $footerContent = stripslashes($footerContent);
     }
     require_once ROOT_PATH . 'includes/htmLawed.php';
     $config = array('safe' => 1, 'elements' => '*', 'deny_attribute' => 'class, id');
     $spec = 'a = title, href;';
     // The 'a' element can have only these attributes
     $footerContent = htmLawed($footerContent, $config, $spec);
     $footerContent = AZLib::clean_value($footerContent);
     $this->checkFormInput('Nội dung', 'content', $footerContent, 'str', true);
     if (!$this->errNum) {
         if (isset(CGlobal::$configs['footer_content'])) {
             DB::update('configs', array("conf_val" => $footerContent), "conf_key='footer_content'");
         } else {
             DB::insert('configs', array("conf_key" => 'footer_content', "conf_val" => $footerContent));
         }
         AZLib::get_config(0, 1);
         AZLib::refreshParent();
     }
 }