Пример #1
0
/**
 * opidr()
 *
 * @param mixed $openid_info
 * @return void
 */
function opidr($openid_info)
{
    global $lang_module, $nv_Request, $nv_redirect;
    $nv_Request->unset_request('openid_attribs', 'session');
    $openid_info['redirect'] = nv_redirect_decrypt($nv_redirect);
    $contents = openid_callback($openid_info);
    include NV_ROOTDIR . '/includes/header.php';
    echo nv_site_theme($contents, false);
    include NV_ROOTDIR . '/includes/footer.php';
    exit;
}
Пример #2
0
/**
 * reg_result()
 * 
 * @param mixed $array
 * @return
 */
function reg_result($array)
{
    global $nv_redirect;
    $array['redirect'] = nv_redirect_decrypt($nv_redirect);
    $string = json_encode($array);
    return $string;
}
Пример #3
0
                     $sth = $db->prepare('SELECT MAX(t1.weight) FROM ' . NV_BLOCKS_TABLE . '_weight t1 INNER JOIN ' . NV_BLOCKS_TABLE . '_groups t2 ON t1.bid = t2.bid WHERE t1.func_id=' . $func_id . ' AND t2.theme= :theme AND t2.position= :position');
                     $sth->bindParam(':theme', $selectthemes, PDO::PARAM_STR);
                     $sth->bindParam(':position', $row['position'], PDO::PARAM_STR);
                     $sth->execute();
                     $weight = $sth->fetchColumn();
                     $weight = intval($weight) + 1;
                     $db->query('INSERT INTO ' . NV_BLOCKS_TABLE . '_weight (bid, func_id, weight) VALUES (' . $row['bid'] . ', ' . $func_id . ', ' . $weight . ')');
                 }
             }
             $nv_Cache->delMod('themes');
             // Chuyen huong
             $xtpl->assign('BLOCKMESS', $is_add ? $lang_module['block_add_success'] : $lang_module['block_update_success']);
             if (empty($blockredirect)) {
                 $xtpl->parse('blockredirect.refresh');
             } else {
                 $xtpl->assign('BLOCKREDIRECT', nv_redirect_decrypt($blockredirect));
                 $xtpl->parse('blockredirect.redirect');
             }
             $xtpl->parse('blockredirect');
             $contents = $xtpl->text('blockredirect');
             include NV_ROOTDIR . '/includes/header.php';
             echo $contents;
             include NV_ROOTDIR . '/includes/footer.php';
             die;
         }
     } elseif (!empty($row['bid'])) {
         $db->query('DELETE FROM ' . NV_BLOCKS_TABLE . '_groups WHERE bid=' . $row['bid']);
         $db->query('DELETE FROM ' . NV_BLOCKS_TABLE . '_weight WHERE bid=' . $row['bid']);
         $nv_Cache->delMod('themes');
     }
 }
Пример #4
0
    $array = !empty($array['body']) ? is_serialized_string($array['body']) ? unserialize($array['body']) : array() : array();
    $error = '';
    if (!empty(NukeViet\Http\Http::$error)) {
        $error = nv_http_get_lang(NukeViet\Http\Http::$error);
    } elseif (empty($array['status']) or !isset($array['error']) or !isset($array['data']) or !isset($array['pagination']) or !is_array($array['error']) or !is_array($array['data']) or !is_array($array['pagination']) or !empty($array['error']) and (!isset($array['error']['level']) or empty($array['error']['message']))) {
        $error = $lang_global['error_valid_response'];
    } elseif (!empty($array['error']['message'])) {
        $error = $array['error']['message'];
    }
    // Show error
    if (!empty($error)) {
        $xtpl->assign('ERROR', $error);
        $xtpl->parse('main.error');
        $contents = $xtpl->text('main.error');
    } else {
        // Save cookies
        nv_store_cookies(nv_object2array($cookies), $stored_cookies);
        $redirect = $request['redirect'] ? nv_redirect_decrypt($request['redirect']) : NV_BASE_ADMINURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name;
        $xtpl->assign('REDIRECT_LINK', $redirect);
        $xtpl->parse('main.ok');
        $contents = $xtpl->text('main.ok');
    }
    include NV_ROOTDIR . '/includes/header.php';
    echo $contents;
    include NV_ROOTDIR . '/includes/footer.php';
}
$xtpl->parse('main');
$contents = $xtpl->text('main');
include NV_ROOTDIR . '/includes/header.php';
echo nv_admin_theme($contents);
include NV_ROOTDIR . '/includes/footer.php';
Пример #5
0
    if ($data['step'] == 'step3') {
        die(json_encode(array('status' => 'error', 'input' => 'new_password', 'step' => 'step4', 'info' => $lang_module['lostpass_newpass_mess'], 'mess' => $lang_module['lostpass_newpass_mess'])));
    }
    $new_password = $nv_Request->get_title('new_password', 'post', '');
    $re_password = $nv_Request->get_title('re_password', 'post', '');
    if (($check_new_password = nv_check_valid_pass($new_password, NV_UPASSMAX, NV_UPASSMIN)) != '') {
        die(json_encode(array('status' => 'error', 'input' => 'new_password', 'step' => 'step4', 'info' => $lang_module['lostpass_newpass_mess'], 'mess' => $check_new_password)));
    }
    if ($new_password != $re_password) {
        die(json_encode(array('status' => 'error', 'input' => 're_password', 'step' => 'step4', 'info' => $lang_module['lostpass_newpass_mess'], 'mess' => $lang_global['passwordsincorrect'])));
    }
    $re_password = $crypt->hash_password($new_password, $global_config['hashprefix']);
    $stmt = $db->prepare("UPDATE " . NV_MOD_TABLE . " SET password= :password, passlostkey='' WHERE userid=" . $row['userid']);
    $stmt->bindParam(':password', $re_password, PDO::PARAM_STR);
    $stmt->execute();
    $name = $global_config['name_show'] ? array($row['first_name'], $row['last_name']) : array($row['last_name'], $row['first_name']);
    $name = array_filter($name);
    $name = implode(' ', $name);
    $sitename = '<a href="' . NV_MY_DOMAIN . NV_BASE_SITEURL . '">' . $global_config['site_name'] . '</a>';
    $message = sprintf($lang_module['edit_mail_content'], $name, $sitename, $lang_global['password'], $new_password);
    @nv_sendmail($global_config['site_email'], $row['email'], $lang_module['edit_mail_subject'], $message);
    $redirect = nv_redirect_decrypt($nv_redirect, true);
    $url = !empty($redirect) ? $redirect : nv_url_rewrite(NV_BASE_SITEURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&amp;' . NV_NAME_VARIABLE . '=' . $module_name, true);
    die(json_encode(array('status' => 'ok', 'input' => $url, 'step' => '', 'mess' => $lang_module['editinfo_ok'])));
}
$page_title = $mod_title = $lang_module['lostpass_page_title'];
$key_words = $module_info['keywords'];
$contents = user_lostpass($data);
include NV_ROOTDIR . '/includes/header.php';
echo nv_site_theme($contents);
include NV_ROOTDIR . '/includes/footer.php';
Пример #6
0
/**
 * nv_get_redirect()
 *
 * @param string $mode
 * @param bool $decode
 * @return
 */
function nv_get_redirect($mode = 'post,get', $decode = false)
{
    global $nv_Request;
    $nv_redirect = '';
    if ($mode != 'post' and $mode != 'get') {
        $mode = 'post,get';
    }
    if ($nv_Request->isset_request('nv_redirect', $mode)) {
        $nv_redirect = $nv_Request->get_title('nv_redirect', $mode, '');
        $rdirect = nv_redirect_decrypt($nv_redirect);
        if ($decode) {
            return $rdirect;
        }
        if (empty($rdirect)) {
            $nv_redirect = '';
        }
    }
    return $nv_redirect;
}
Пример #7
0
<?php

/**
 * @Project NUKEVIET 4.x
 * @Author VINADES.,JSC (contact@vinades.vn)
 * @Copyright (C) 2014 VINADES.,JSC. All rights reserved
 * @License GNU/GPL version 2 or any later version
 * @Createdate 9-8-2010 14:43
 */
if (!defined('NV_IS_FILE_ADMIN')) {
    die('Stop!!!');
}
$pro_id = $nv_Request->get_int('pro_id', 'get', 0);
$nv_redirect = $nv_Request->get_title('nv_redirect', 'get', '');
$nv_redirect = nv_redirect_decrypt($nv_redirect);
if (empty($pro_id)) {
    Header('Location: ' . NV_BASE_ADMINURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&' . NV_NAME_VARIABLE . '=' . $module_name . '&' . NV_OP_VARIABLE . '=items');
    die;
}
$per_page = 50;
$page = $nv_Request->get_int('page', 'get', 1);
$base_url = NV_BASE_ADMINURL . 'index.php?' . NV_LANG_VARIABLE . '=' . NV_LANG_DATA . '&amp;' . NV_NAME_VARIABLE . '=' . $module_name . '&amp;' . NV_OP_VARIABLE . '=' . $op . '&amp;pro_id=' . $pro_id;
// Product info
$pro_info = array();
$sql = 'SELECT id, ' . NV_LANG_DATA . '_title as title, product_unit FROM ' . $db_config['prefix'] . '_' . $module_data . '_rows WHERE id = ' . $pro_id;
$pro_info = $db->query($sql)->fetch();
// Product unit
$sql = 'SELECT ' . NV_LANG_DATA . '_title FROM ' . $db_config['prefix'] . '_' . $module_data . '_units WHERE id = ' . $pro_info['product_unit'];
list($pro_info['product_unit']) = $db->query($sql)->fetch(3);
$page_title = sprintf($lang_module['seller_list'], $pro_info['title']);
$db->sqlreset()->select('COUNT(*)')->from($db_config['prefix'] . '_' . $module_data . '_orders_id t1')->join(' INNER JOIN ' . $db_config['prefix'] . '_' . $module_data . '_orders t2 ON t1.order_id = t2.order_id')->where('t1.proid = ' . $pro_id);