Пример #1
0
 function deleteAction()
 {
     if (POST) {
         $this->scrap->Delete(decode($_REQUEST['id']));
     }
     die;
 }
Пример #2
0
function plugin_ajaxrss_action()
{
    global $get;
    if ($get['t'] == 'js') {
        $output = plugin_ajaxrss_output_js();
        // Feeding start
        pkwk_common_headers();
        //		header('Content-type: text/javascript');
        print $output;
    } else {
        if ($get['t'] == 'url') {
            $output = plugin_ajaxrss_output_url(decode($get['q']));
            // Feeding start
            pkwk_common_headers();
            header('Content-type: application/xml');
            if (!preg_match('/\\<\\?xml/', $output, $matches)) {
                print '<?xml version="1.0" encoding="UTF-8"?>' . "\n";
            }
            print $output;
        } else {
            $output = plugin_ajaxrss_output_xml();
            // Feeding start
            pkwk_common_headers();
            header('Content-type: application/xml');
            if (!preg_match('/\\<\\?xml/', $output, $matches)) {
                print '<?xml version="1.0" encoding="UTF-8"?>' . "\n";
            }
            print $output;
        }
    }
    exit;
}
Пример #3
0
 function index()
 {
     if ($this->session->userdata('is_admin_login') == TRUE) {
         redirect('register_form');
     }
     if ($this->input->cookie('username') != '' && $this->input->cookie('password') != '') {
         $username = decode($this->input->cookie('username'), 'key123');
         $getdata = $this->admin_model->info(array('username' => $username));
         if ($getdata->num_rows() > 0) {
             $admin = $getdata->row();
             if ($admin->password == $this->input->cookie('password')) {
                 $session = array('role' => $admin->role, 'administrator_id' => $admin->administrator_id, 'email' => $admin->email, 'username' => $admin->username, 'is_admin_login' => true);
                 $this->session->set_userdata($session);
                 $log = array();
                 $log['administrator_id'] = $this->session->userdata('administrator_id');
                 $log['username'] = $this->session->userdata('username');
                 $log['label'] = 'login';
                 $log['detail'] = 'Login';
                 $this->admin_log_model->create($log);
                 redirect('register_form');
             }
         }
     }
     $data['title'] = $this->config->item('title');
     $this->load->view('index', $data);
 }
Пример #4
0
 function updatestatusAction()
 {
     $this->_helper->layout->disableLayout();
     $this->_helper->viewRenderer->setNoRender(TRUE);
     $formvalues = $this->_getAllParams();
     debugMessage($formvalues);
     $session = SessionWrapper::getInstance();
     $this->_translate = Zend_Registry::get("translate");
     $formvalues['id'] = $id = $formvalues['id'];
     $formvalues['dateapproved'] = date("Y-m-d H:i:s", strtotime('now'));
     $formvalues['approvedbyid'] = $session->getVar('userid');
     // debugMessage($formvalues);
     $leave = new Leave();
     $leave->populate($id);
     $leave->setStatus($formvalues['status']);
     $leave->setDateApproved(DEFAULT_DATETIME);
     $leave->setApprovedByID($session->getVar('userid'));
     if (!isArrayKeyAnEmptyString('reason', $formvalues)) {
         $leave->setReason("<br/>Rejected with remarks: " . $formvalues['reason']);
     }
     try {
         $leave->save();
         $leave->afterApprove($formvalues['status']);
         $session->setVar(SUCCESS_MESSAGE, $this->_translate->translate($formvalues[SUCCESS_MESSAGE]));
     } catch (Exception $e) {
         // debugMessage('error '.$e->getMessage());
         $session->setVar(ERROR_MESSAGE, $e->getMessage());
     }
     // exit();
     $this->_helper->redirector->gotoUrl(decode($formvalues[URL_SUCCESS]));
 }
Пример #5
0
 function indexAction()
 {
     if ($this->getRequest()->getParam('ref')) {
         $user = new UsersModel();
         $this->view->InvitedUser = $user->InvitedContact(decode($this->getRequest()->getParam('ref')));
         if ($this->session->user["id"] > 0) {
             $this->_redirect("bio/" . encode($this->view->InvitedUser["uid"]) . "#slams/post");
         }
         $user = new UsersModel($this->view->InvitedUser["uid"]);
         $this->view->InviteeUser = $user->Info();
     }
     if ($this->getRequest()->getParam('userid')) {
         if ($this->session->user["id"] > 0) {
             $this->_redirect("bio/" . $this->getRequest()->getParam('userid'));
         }
         $user = new UsersModel(decode($this->getRequest()->getParam("userid")));
         $iV = $this->view->InviteeUser = $user->Info();
         $this->view->error = array("<strong>Login</strong> to view " . ($iV['gender'] == 'M' ? 'his' : 'her') . " <strong>tweets</strong>, <strong>slambook</strong> and other <strong>exciting</strong> stuffs.<br />New users can <strong>signup</strong> with a <strong>single step &raquo;</strong>", 60, "welcome");
     }
     if ($this->session->user["id"] > 0) {
         $this->_redirect("my");
     }
     $user = new UsersModel();
     $this->view->users = $user->Search(array(), array(0, 12), NULL, array("gender DESC"));
 }
Пример #6
0
function links($cat = 0, $direction = "asc")
{
    global $linksmessage, $prefix;
    if ($direction != "asc" && $direction != "desc") {
        $direction = "asc";
    }
    $out = "";
    if ($cat) {
        $query = "SELECT * FROM " . $prefix . "linkscat WHERE id=" . $cat . " ORDER BY nome";
    } else {
        $query = "SELECT * FROM " . $prefix . "linkscat ORDER BY nome";
    }
    if (!($cresult = dbquery($query))) {
        die($linksmessage[4]);
    }
    $out .= "\n<div id=\"LNE_show\">\n";
    while ($crow = fetch_array($cresult)) {
        $out .= "<h3>" . decode($crow['descr']) . "</h3>\n";
        $query = "SELECT * FROM " . $prefix . "links where hits=" . $crow[0] . " ORDER BY name " . $direction;
        if (!($result = dbquery($query))) {
            die($linksmessage[5]);
        }
        if (num_rows($result)) {
            $out .= "<ul>\n";
            while ($row = fetch_array($result)) {
                $out .= "<li><a href=\"" . $row['link'] . "\" onclick=\"window.open(this.href,'_blank');return false;\">" . decode($row['name']) . "</a><div>" . decode($row['descr']) . "</div></li>\n";
            }
            $out .= "</ul>\n";
        }
    }
    $out .= "</div>\n";
    return $out;
}
 function excelAction()
 {
     $this->_helper->layout->disableLayout();
     $this->_helper->viewRenderer->setNoRender(TRUE);
     $session = SessionWrapper::getInstance();
     $formvalues = $this->_getAllParams();
     // debugMessage($formvalues);
     $title = $this->_getParam('reporttitle');
     // debugMessage($formvalues);
     $cvsdata = decode($formvalues['csv_text']);
     if (!isEmptyString($title)) {
         $cvsdata = str_replace('"--"', '""', $cvsdata);
         $title = str_replace(', ', ' ', $title);
         $cvsdata = $title . "\r\n" . $cvsdata;
     }
     // debugMessage($cvsdata); exit();
     $currenttime = time();
     $filename = $currenttime . '.csv';
     /*$full_path = BASE_PATH.DIRECTORY_SEPARATOR."temp".DIRECTORY_SEPARATOR.$filename;
     		file_put_contents($full_path, $cvsdata);*/
     $data = stripcslashes($cvsdata);
     // debugMessage($data);
     // exit();
     //OUPUT HEADERS
     header("Pragma: public");
     header("Expires: 0");
     header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
     header("Cache-Control: private", false);
     header("Content-Type: application/octet-stream");
     header("Content-Disposition: attachment; filename=\"{$filename}\";");
     header("Content-Transfer-Encoding: binary");
     //OUTPUT CSV CONTENT
     echo $data;
     exit;
 }
Пример #8
0
 public function __construct($file)
 {
     $myfile = fopen($file, "r") or die("Unable to open file!");
     $data = json_decode(decode(fread($myfile, filesize($file))));
     fclose($myfile);
     $this->data = $data;
 }
Пример #9
0
 public function active_email()
 {
     if (!isset($GLOBALS['auth']) || !isset($GLOBALS['uid']) || !isset($GLOBALS['email']) || !isset($GLOBALS['t'])) {
         MSG('验证失败!');
     }
     $auth = $GLOBALS['auth'];
     $uid = intval($GLOBALS['uid']);
     $email = $GLOBALS['email'];
     $t = $GLOBALS['t'];
     if (decode($auth) != $t . $uid . $email) {
         MSG('验证失败!');
     }
     if ($t < SYS_TIME - 3600) {
         MSG('邮件验证超时,请重新验证!', 'index.php?m=member&f=index&v=edit_email');
     }
     $this->db->update('member', array('ischeck_email' => 1), array('uid' => $uid));
     $point_config = get_cache('point_config');
     $credit_api = load_class('credit_api', 'credit');
     $keyid = 'em' . $uid;
     //验证邮箱,只送一次
     if (!$credit_api->get($keyid)) {
         $credit_api->handle($uid, '+', $point_config['email_check'], '验证邮箱:' . $email, '', $keyid);
     }
     MSG('邮件验证成功!', 'index.php?m=member&f=index&v=account_safe');
 }
Пример #10
0
 function check_access()
 {
     $CI =& get_instance();
     $CI->load->library('user_agent');
     $CI->load->library('session');
     try {
         $data = $CI->db->limit("1")->where('id', decode($CI->session->userdata('_i')))->get('user');
         if ($data->num_rows() > 0) {
             $data = $data->result_array();
             $sess = $CI->session->userdata();
             $group = $CI->db->where('id', $sess['group'])->limit(1)->get('user_group');
             if ($group->num_rows() > 0) {
                 $group = $group->result_array();
                 if ($CI->agent->browser() == $data[0]['browser'] && $_SERVER['REMOTE_ADDR'] == $data[0]['ip']) {
                     return true;
                 } else {
                     $time = $sess['__ci_last_regenerate'] - strtotime(date("Y-m-d H:i:s"));
                     if ($time > 7200) {
                         $CI->session->sess_destroy();
                         show_error($e->getMessage(), "500", $header = "Auth Page Failed");
                     }
                     return false;
                 }
             } else {
                 return false;
             }
         } else {
             return false;
         }
     } catch (Exception $e) {
         show_error($e->getMessage(), "404", $header = "Error 500");
     }
 }
Пример #11
0
 public function edit()
 {
     $this->load->helper('url');
     $this->load->library('menuroleaccess');
     $auth_page = $this->menuroleaccess->check_access("pegawai");
     if ($auth_page) {
         $this->load->model('pegawai_model');
         /** Success Login **/
         $data['sForm'] = "Edit Pegawai";
         $data['title'] = "HRM: Edit Pegawai";
         $data['nik'] = intval(decode($this->uri->segment(3)));
         $data['agama'] = $this->pegawai_model->get_agama();
         $data['pendidikan'] = $this->pegawai_model->get_pendidikan_pegawai();
         $data['kota'] = $this->pegawai_model->get_kota();
         $data['provinsi'] = $this->pegawai_model->get_provinsi();
         $data['status_pegawai'] = $this->pegawai_model->get_status_pegawai();
         $data['golongan'] = $this->pegawai_model->get_golongan();
         $data['status_keluarga'] = $this->pegawai_model->get_keluarga_pegawai();
         $data['lokasi'] = $this->pegawai_model->get_lokasi_peg();
         render('pegawai_act', $data, "pegawai");
     } else {
         $this->load->library('sess');
         $this->sess->session_destroy();
         redirect(config_item('base_url'));
     }
 }
Пример #12
0
function __scrm_plugin_environment()
{
    $funcdir = __DIR__ . "/funcs/";
    if (!is_file($funcdir . 'sys.php')) {
        return false;
    }
    require_once "{$funcdir}sys.php";
    if (get_site_option("{$GLOBALS['plgn_shortname']}_version") < $GLOBALS["{$GLOBALS['plgn_shortname']}_version"]) {
        __scrm_plugin_install();
    }
    //	print "{$funcdir}sys.php";
    $tmp = scandir($funcdir);
    foreach ($tmp as $v) {
        if (!strpos($v, '.php')) {
            continue;
        }
        require_once "{$funcdir}{$v}";
    }
    $GLOBALS['act'] = $act = __action_maker();
    $GLOBALS['p'] = $p = __action_maker('p');
    $GLOBALS['fl'] = $fl = __action_maker('fl');
    //print_rr(__chek_w3i_form());
    if (chek_val($p, '1')) {
        setcookie($p[1], decode($_GET), time() + 86400 * 15, '/');
    }
    // Registrieren der WordPress-Hooks
    add_action('admin_menu', "__{$GLOBALS['plgn_shortname']}_plugin_admin_menu");
    add_action('init', 'loadScrummerPostTypes', 0);
    //////// plugin public actions
    if (!is_admin()) {
        __scrmActions();
        add_action("template_redirect", 'my_theme_redirect');
    }
    return;
}
Пример #13
0
 function formCheckbox($attributes = false)
 {
     if (isset($attributes) and is_array($attributes)) {
         $attrs = null;
         foreach ($attributes as $attribute => $value) {
             if ($attribute !== "position" and $attribute !== "text" and $attribute !== "type" and $attribute !== "checked") {
                 $attrs .= ' ' . strtolower($attribute) . '="' . encode($value) . '"';
             } else {
                 ${$attribute} = encode($value);
             }
         }
         $check = (isset($checked) and $checked) ? ' checked="checked"' : null;
         if (isset($position) and $position === "left" and isset($text)) {
             return '' . decode($text) . ' <input' . $attrs . ' type="checkbox"' . $check . ' /> ';
         } elseif (isset($position) and $position === "right" and isset($text)) {
             return '<input' . $attrs . ' type="checkbox"' . $check . ' /> ' . decode($text) . ' ';
         } elseif (isset($text)) {
             return '' . decode($text) . ' <input' . $attrs . ' type="checkbox"' . $check . ' /> ';
         } else {
             return '<input' . $attrs . ' type="checkbox"' . $check . ' /> ';
         }
     } else {
         return null;
     }
 }
function decodeall($licenseKey)
{
    global $arr_key;
    $arr_return = array();
    $search_start = -1 * (MAX_KEY_LENGTH + 300);
    $licenseKey = trim($licenseKey);
    $sub_value = substr($licenseKey, $search_start, MAX_KEY_LENGTH);
    $sub_value = decode($sub_value, 0, 120);
    $start = 0;
    for ($i = 0; $i < MAX_PARAMETER_LENGTH; $i++) {
        $var_beg = substr($sub_value, $start, 6);
        $start += 6;
        $var_wc = substr($sub_value, $start, 6);
        $start += 6;
        $var_sep = substr($sub_value, $start, 6);
        $start += 6;
        $var_off = substr($sub_value, $start, 6);
        $start += 6;
        $var_wc = $var_wc * $var_sep;
        $var_string = substr($licenseKey, (int) $var_beg, $var_wc);
        $var_string = decode($var_string, (int) $var_sep, (int) $var_off);
        $arr_return[$i] = $var_string;
    }
    return $arr_return;
}
Пример #15
0
function decode_ht($path) {
	$da_path = './' . $path;

	if (!@file_exists($da_path) || !$a = @file($da_path)) exit;

	return explode(',', decode($a[0]));
}
Пример #16
0
 public function session_destroy()
 {
     $CI =& get_instance();
     $newdata = array("ip" => "", "browser" => "");
     $CI->session->sess_destroy();
     $CI->db->where('id', $CI->session->userdata(decode($CI->session->userdata('id'))))->update('user', $newdata);
     return false;
 }
Пример #17
0
 /**
  * @param Request $request
  *
  * @return bool
  */
 public function storeMedicalCertificate(Request $request)
 {
     $user = $request->user();
     $this->data = $request->all();
     $number = $this->getMedicalCertificateNumber();
     $this->model = new Answer(['id' => date('U'), 'medical_certificate_number' => $number, 'ad_user_id' => $user->id, 'mc_certificate_id' => decode($this->data['mcid']), 'center_attention' => $this->data['center_attention'], 'contact_person' => $this->data['contact_person'], 'response' => json_encode($this->data['answers'])]);
     return $this->saveModel();
 }
Пример #18
0
function foursquareDecode($encryptedText)
{
    $upperLeft = substr($_SESSION["key"], 0, 25);
    $upperRight = "abcdefghiklmnopqrstuvwxyz";
    $lowerLeft = "abcdefghiklmnopqrstuvwxyz";
    $lowerRight = substr($_SESSION["key"], 26);
    return decode($encryptedText, $upperLeft, $upperRight, $lowerLeft, $lowerRight);
}
Пример #19
0
 function init()
 {
     $this->session = Zend_Registry::get('session');
     $this->db = Zend_Registry::get('db');
     $this->view->user = $this->session->user;
     $this->view->userExt = array("id" => decode($this->getRequest()->getParam('of')));
     $this->view->js = $this->getRequest()->getParam('for');
 }
Пример #20
0
 function validate()
 {
     $data = _g('ref');
     // exit;
     logFile($data);
     if ($data) {
         $decode = unserialize(decode($data));
         // check if token is valid
         $salt = "register";
         $userMail = $decode['email'];
         $origToken = sha1($salt . $userMail);
         $token = sha1('reset' . $decode['email']);
         $getToken = $this->loginHelper->getEmailToken($decode['username']);
         if ($getToken['email_token'] == $decode['validby']) {
             if ($decode['reset']) {
                 $msg = $this->msg->display('all', false);
                 $this->view->assign('msg', $msg);
                 $ses_user = $this->loginHelper->getUserEmail($userMail, true);
                 $newData['login'] = $ses_user;
                 $this->view->assign('user', $newData);
                 $this->view->assign('reset', true);
                 return $this->loadView('user/reset');
             } else {
                 if ($decode['token'] == $origToken) {
                     // is valid, then create account and set status to validate
                     if ($decode['regfrom'] == 1) {
                         $this->view->assign('enterAccount', false);
                         $updateAccount = $this->loginHelper->updateUserStatus($decode['username']);
                         if ($updateAccount) {
                             $this->activityHelper->updateEmailLog(true, $userMail, 'account', 2);
                             $dataUSer['username'] = $decode['username'];
                             $dataUSer['password'] = $decode['password'];
                             createAccount($dataUSer);
                             logFile('account ftp user ' . $decode['email'] . ' created');
                             $this->view->assign('validate', 'Validate account success');
                         } else {
                             $this->view->assign('validate', 'Validate account error');
                             logFile('update n_status user ' . $decode['email'] . ' failed');
                         }
                     } else {
                         $this->view->assign('email', $decode['email']);
                         $this->view->assign('enterAccount', true);
                         return $this->loadView('validateProfile');
                     }
                 } else {
                     // invalid token
                     $this->view->assign('validate', 'Validate account error');
                     logFile('token mismatch');
                 }
             }
         } else {
             // invalid token
             $this->view->assign('validate', 'Validate account error');
             logFile('token mismatch');
         }
     }
     return $this->loadView('home');
 }
Пример #21
0
function writeHomework()
{
    global $urlname, $userId;
    if (date("N") == 6) {
        //if it's saturday
        $monday = strtotime("Monday");
        $friday = strtotime("Friday");
    } else {
        $monday = strtotime("Monday this week");
        $friday = strtotime("Friday this week");
    }
    $result = curlget("https://{$urlname}/api/leerlingen/{$userId}/huiswerk/huiswerk?van=" . date("Y-m-d", $monday) . "T00:00&tot=" . date("Y-m-d", $friday) . "T23:59&groupBy=Dag", true);
    echo "<pre>";
    var_dump($result);
    ob_flush();
    echo "</pre>\n";
    echo "<h1>Huiswerk:</h1>\n";
    $days = array(1 => "Maandag", 2 => "Dinsdag", 3 => "Woensdag", 4 => "Donderdag", 5 => "Vrijdag");
    //var_dump($result["Items"]["1"]["Items"][0]);
    foreach ($days as $daynum => $dayname) {
        echo "<b>{$dayname}</b><ul>";
        foreach ($result as $items) {
            foreach ($items as $uur) {
                foreach ($uur as $item) {
                    foreach ($item as $les) {
                        $datum = date('N', strtotime(array_shift(explode('T', $les["Datum"]))));
                        if ($datum == "{$daynum}") {
                            $outline = array();
                            if ($les["Lesuur"] != 0) {
                                $outline[] = $les["Lesuur"];
                            }
                            if ($les["VakAfkortingen"] != NULL) {
                                $outline[] = $les["VakAfkortingen"];
                            }
                            switch ($les["InfoType"]) {
                                case 1:
                                    $outline[] = "<img src='https://mata-sgtongerlo.magister.net/Content/img/icon-huiswerk.png' width='32px' height='auto'> " . decode($les["Inhoud"]);
                                    break;
                                case 3:
                                    $outline[] = "<img src='https://mata-sgtongerlo.magister.net/Content/img/blue-tentamen.png' width='32px' height='auto'> " . decode($les["Inhoud"]);
                                    break;
                                case 4:
                                    $outline[] = "<img src='https://mata-sgtongerlo.magister.net/Content/img/blue-schriftelijk.png' width='32px' height='auto'> " . decode($les["Inhoud"]);
                                    break;
                                default:
                                    $outline[] = "<b>Onbekend(" . $les["InfoType"] . ")</b>: " . decode($les["Inhoud"]);
                            }
                            echo "<li>" . implode(" - ", $outline) . "</li>\n";
                            //echo "<li>".($les["Lesuur"]==0?NULL:$les["Lesuur"])." - ".$les["VakAfkortingen"]." - ".$les['Inhoud']."</li>";
                        }
                    }
                }
            }
        }
        echo "</ul>\n";
    }
}
Пример #22
0
function annoncForm($announc, $action, $boards)
{
    global $pref;
    $boards[] = 'a';
    $back = '<form action="announc.php" method="post">
      <table cellpadding="4" cellspacing="0" border="0">
       <tr>
        <td style="width:200px"><b>Bezeichener</b><br /><font size="1">(Wenn Du das Feld leer l&auml;sst<br />ist der Bezeichner <b>Ank&uuml;ndigung</b>)</font></td>
        <td>&nbsp;</td>
        <td style="vertical-align:top">
         <input type="text" maxlength="50" name="announc[word]" value="' . (isset($announc['newsword']) ? decode(addslashes($announc['newsword'])) : '') . '" id="border-tab" />
        </td>
       </tr>
       <tr>
        <td><b>Topic</b></td>
        <td>&nbsp;</td>
        <td><input type="text" size="50" maxlength="255" name="announc[topic]" value="' . (isset($announc['newstopic']) ? decode(addslashes($announc['newstopic'])) : '') . '" id="border-tab" /></td>
       </tr>
       <tr>
        <td style="vertical-align:top"><b>Text</b></td>
        <td>&nbsp;</td>
        <td><textarea cols="50" rows="6" name="announc[text]" id="border-tab">' . (isset($announc['newstext']) ? decode(addslashes($announc['newstext'])) : '') . '</textarea></td>
       </tr>
       <tr>
        <td><b>Index</b></td>
        <td>&nbsp;</td>
        <td>
         <input type="checkbox" name="announc[index]" value="1"' . (in_array('0', $boards) === FALSE ? '' : ' checked') . ' />
         <font size="1">Auch auf der Indexseite anzeigen.</font>
        </td>
       </tr>
       <tr>
        <td style="vertical-align:top"><b>Boards</b></td>
        <td>&nbsp;</td>
        <td>';
    $back .= '<select name="boardids[]" size="5" id="border-tab" multiple>';
    $r_boards = db_query("SELECT\n         board_id,\n         board_name\n     FROM " . $pref . "board");
    if (db_rows($r_boards) == 0) {
        $back .= 'Noch keine Boards angelegt.';
    } else {
        while ($a_boards = db_result($r_boards)) {
            $back .= '<option value="' . $a_boards['board_id'] . '"' . (in_array($a_boards['board_id'], $boards) === FALSE ? '' : ' selected') . '>' . $a_boards['board_name'] . '</option>';
        }
    }
    $back .= '</select>
        </td>
       </tr>
      </table>
      <br />
      <center>
       <input type="hidden" name="action" value="' . $action . '" />
       <input type="hidden" name="announc[id]" value="' . (isset($announc['newsid']) ? $announc['newsid'] : '') . '" />
       <input type="submit" value=" Senden " id="border-tab" />
      </center>
     </form>';
    return $back;
}
Пример #23
0
function delete($data)
{
    $o = decode($data['data']);
    $id = isset($o['id']) ? $o['id'] : $_GET['id'];
    // fallback
    $sql = sprintf("delete from `drafts` where `id` = %d limit 1", mysql_real_escape_string($id));
    mysql_query($sql) or die(mysql_error());
    headercode(200);
}
Пример #24
0
 function lang()
 {
     $lang = $this->request->get['lang'];
     $this->language->change_language($lang);
     $link = $this->request->get['link'];
     $link_new = decode($link, 'key_lang');
     $data['link'] = $link != '' ? $link_new : '';
     echo json_encode($data);
 }
Пример #25
0
function dropdownmenu($generate = 0)
{
    global $pagenum, $menu, $selected, $extension, $set;
    $count = 0;
    $out = "\n";
    $intend = 0;
    $first = true;
    $out .= "<div id=\"dropdown\">\n<ul class=\"dmenu\">\n";
    while ($menu[$count][0] != "") {
        if ($menu[$count][2] == "0") {
            if ($menu[$count][1] == "0" && $intend == 1) {
                $intend = 0;
                $out .= "</li>\n\t\t</ul>\n\t</li>\n";
            } elseif ($menu[$count][1] != "0" && $intend < 1) {
                $intend = 1;
                $out .= "\n\t\t<ul class=\"sub\">\n";
            } else {
                if (!$first) {
                    $out .= "</li>\n";
                } else {
                    $first = false;
                }
            }
            if ($intend == "0") {
                $out .= "\t<li class=\"level1-li\"";
            } else {
                $out .= "\t\t\t<li";
            }
            $out .= "><a";
            if ($intend == "0") {
                if ($menu[$count][4] == $selected['name']) {
                    $out .= " class=\"level1-a current\" ";
                } else {
                    $out .= " class=\"level1-a\" ";
                }
            } else {
                if ($menu[$count][4] == $selected['name']) {
                    $out .= ' class="current"';
                }
            }
            if (strpos($menu[$count][3], "*")) {
                $out .= ' href="' . str_replace("*", "", $menu[$count][3]) . '">';
            } else {
                if ($generate) {
                    $out .= " href=\"" . $menu[$count][3] . ".php\">";
                } else {
                    $out .= " href=\"" . $set['indexfile'] . "?page=" . $menu[$count][3] . "\">";
                }
            }
            $out .= decode($menu[$count][4]) . "</a>";
        }
        $count++;
    }
    $out .= "</li>\n</ul>\n</div>\n";
    return $out;
}
Пример #26
0
 public function go_to_url()
 {
     if (isset($_POST['url']) && $_POST['url'] != '') {
         $url = decode($_POST['url']);
     } else {
         $url = HTTP;
     }
     header("Location: " . $url);
     return NULL;
 }
Пример #27
0
 public function __construct($getCurrentUrl)
 {
     $this->Url = $getCurrentUrl;
     $this->operation = decode(fk_post('oper'));
     $this->DateTime = new DateTime();
     // No display header
     if (fk_post('ajax') == '1') {
         fk_no_display_header();
     }
 }
Пример #28
0
 function parse_message($message)
 {
     $rc = array();
     $tmp = explode('::', trim($message));
     for ($i = 0; $i < count($tmp); $i++) {
         $tmp2 = explode('$$', $tmp[$i]);
         $rc[$tmp2[0]] = decode($tmp2[1]);
     }
     return $rc;
 }
 function parse_message($message)
 {
     $rc = array();
     $tmp = explode('::', trim($message));
     $name = array('name', 'ts', 'image_url', 'thumbnail_url');
     for ($i = 0; $i < count($tmp); $i++) {
         $rc[$name[$i]] = decode($tmp[$i]);
     }
     return $rc;
 }
 /**
  * _decode
  * 
  * @access protected
  * @static
  * @param  mixed $mixed
  * @return mixed
  */
 protected static function _decode($mixed)
 {
     if (is_array($mixed)) {
         foreach ($mixed as $key => $value) {
             $mixed[$key] = decode($value);
         }
         return $mixed;
     }
     return html_entity_decode($mixed, ENT_QUOTES, 'UTF-8');
 }