Exemplo n.º 1
0
function get($id)
{
    if (is_get($id)) {
        return $_GET[$id];
    } else {
        return '';
    }
}
Exemplo n.º 2
0
function wpi_get_current_author()
{
    global $author, $author_name;
    if (is_get('author_name')) {
        $user = get_userdatabylogin($author_name);
    } else {
        $user = get_userdata(intval($author));
    }
    return $user;
}
Exemplo n.º 3
0
 public function action_create($id = false)
 {
     if (is_get()) {
         $obj = Controller::getVar('obj');
         $obj = $obj ? $obj : array();
         $obj['active'] = 1;
         Controller::setVar('obj', $obj);
     }
     $result = parent::action_create();
     return $result;
 }
Exemplo n.º 4
0
function need_login($force = false)
{
    if (isset($_GET['abc'])) {
        print_r($_SESSION);
        die;
    }
    if (isset($_SESSION['user_id'])) {
        if (is_post()) {
            unset($_SESSION['loginpage']);
            unset($_SESSION['loginpagepost']);
        }
        return $_SESSION['user_id'];
    }
    if (is_get()) {
        Session::Set('loginpage', $_SERVER['REQUEST_URI']);
    } else {
        Session::Set('loginpage', $_SERVER['HTTP_REFERER']);
        Session::Set('loginpagepost', json_encode($_POST));
    }
    return redirect(WEB_ROOT . '/login.php?' . $_SERVER['QUERY_STRING']);
}
Exemplo n.º 5
0
Arquivo: edit.php Projeto: noikiy/mdwp
<?php
require_once(dirname(dirname(dirname(__FILE__))) . '/app.php');
require_once(dirname(__FILE__) . '/current.php');

need_manager();
need_rbac_auth('team_create_edit');

$id = abs(intval($_GET['id']));
$team = $eteam = Table::Fetch('team', $id);

if ( is_get() && empty($team) ) {
	$team = array();
	$team['id'] = 0;
	$team['user_id'] = $login_user_id;
	$team['begin_time'] = strtotime('+1 days');
	$team['end_time'] = strtotime('+2 days');
	$team['expire_time'] = strtotime('+1 months +15 days');
	$team['min_number'] = 10;
	$team['per_number'] = 1;
    $team['permin_number'] = 1;
	$team['market_price'] = 1;
	$team['team_price'] = 1;
	$team['delivery'] = 'coupon';
	$team['address'] = $profile['address'];
	$team['mobile'] = $profile['mobile'];
	$team['fare'] = 5;
	$team['farefree'] = 0;
	$team['bonus'] = abs(intval($INI['system']['invitecredit']));
	$team['conduser'] = $INI['system']['conduser'] ? 'Y' : 'N';
	$team['buyonce'] = 'Y';
	$team['booking'] = empty($team['booking'])?0:1;
Exemplo n.º 6
0
<?php

require_once dirname(dirname(dirname(__FILE__))) . '/app.php';
import('backup');
need_manager(true);
function _go_reload()
{
    redirect(WEB_ROOT . '/manage/misc/backup.php');
}
/* get tables */
$db_name = $INI['db']['name'];
$tables = DB::GetQueryResult("SHOW TABLE STATUS FROM `{$db_name}`", false);
/* end */
if (is_get()) {
    $results = DB::GetQueryResult("SHOW TABLE STATUS FROM `{$db_name}`", false);
    $option_table = Utility::OptionArray($results, 'name', 'name');
    die(include template('manage_misc_backup'));
}
$bftype = $_POST['bfzl'];
if ($bftype == "quanbubiao") {
    if (!$_POST['fenjuan']) {
        //不是分卷
        $sql = null;
        foreach ($tables as $one) {
            $table = $one['name'];
            $sql .= backup_make_header($table);
            $query = DB::Query("SELECT * FROM `{$table}`");
            while ($r = DB::NextRecord($query)) {
                $sql .= backup_make_record($table, $r);
            }
        }
Exemplo n.º 7
0
function need_login($force = false)
{
    if (isset($_SESSION['user_id'])) {
        if (is_post()) {
            unset($_SESSION['loginpage']);
            unset($_SESSION['loginpagepost']);
        }
        return $_SESSION['user_id'];
    }
    if (is_get()) {
        Session::Set('loginpage', $_SERVER['REQUEST_URI']);
    } else {
        Session::Set('loginpage', $_SERVER['HTTP_REFERER']);
        Session::Set('loginpagepost', json_encode($_POST));
    }
    return redirect(WEB_ROOT . '/account/loginup.php');
}
Exemplo n.º 8
0
<?php include template("header");?>
<?php if(is_get()){?>
<div class="sysmsgw" id="sysmsg-error"><div class="sysmsg"><p>此订单尚未完成付款,请重新付款</p><span class="close">关闭</span></div></div>
<?php }?>

<div class="layout">
<div class="team_main" style="overflow:hidden">
  
  <div class="pay_main">
    <div id="content">
        <div id="deal-buy" class="box">
            
             <div id="deal-buy" class="pay_header">
                <div class="head">
                    <h2  style="_margin-top:20px; font-size:18px;">充值金额:<strong style=" font-size:22px;" class="total-money money2"><?php echo moneyit($total_money); ?></strong> 元</h2>
                </div>
                <div class="sect">
                    <div style="text-align:left;">
						<?php echo $payhtml; ?>
						 <div style="float:left; margin-top:10px; width:680px;"><a href="/credit/charge.php?money=<?php echo $total_money; ?>">&raquo; 返回选择其他支付方式</a></div>
                    </div>
                </div>
            </div>
         
        </div>
    </div>
</div>
</div> <!-- bd end -->
</div> <!-- bdw end -->

<?php include template("footer");?>
Exemplo n.º 9
0
Arquivo: edit.php Projeto: noikiy/mdwp
<?php
require_once(dirname(dirname(dirname(__FILE__))) . '/app.php');
//require_once(dirname(__FILE__) . '/current.php');

need_manager();
need_rbac_auth('news_edit_create');

$id = abs(intval($_GET['id']));
$news  = Table::Fetch('news', $id);

if ( is_get() && empty($news) ) {
	$news = array();
	$news['id'] = 0;
	$news['begin_time'] = strtotime('+0 days');

}
else if ( is_post() ) {
	$news = $_POST;
	$insert = array(
		'title', 
		'begin_time', 
		'detail',
		);
	
	$news['begin_time'] = strtotime($news['begin_time']);
	$insert = array_unique($insert);
	$table = new Table('news', $news);
	$table->SetStrip('detail');

	if ( $news['id'] && $news['id'] == $id ) {
		$table->SetPk('id', $id);
Exemplo n.º 10
0
function need_login($force = false)
{
    if (isset($_SESSION['user_id'])) {
        return $_SESSION['user_id'];
    }
    if (is_get() || $force) {
        Session::Set('loginpage', $_SERVER['REQUEST_URI']);
    }
    return redirect(WEB_ROOT . '/account/login.php');
}
Exemplo n.º 11
0
 public function upme_customizer()
 {
     /**
      * @submit settings page
      */
     if (is_in_post('submit')) {
         $this->upme_update_custom_field($_POST, 'normal');
         //$this->update();
     }
     /* Create a new field */
     if (is_in_post('upme-add')) {
         $this->upme_add_custom_field($_POST, 'normal');
     }
     /* Trash field */
     if (is_get()) {
         if (isset($_GET['trash_field']) && !isset($_POST['submit']) && !isset($_POST['reset-options']) && !isset($_POST['reset-options-fields'])) {
             $fields = get_option('upme_profile_fields');
             $trash = $_GET['trash_field'];
             if (isset($fields[$trash])) {
                 /* UPME Action for before deleteing custom field */
                 do_action('upme_before_delete_field', $fields[$trash]);
                 // End Action
                 if (isset($this->delete_error)) {
                     if ('' != $this->delete_error) {
                         echo '<div class="updated"><p><strong>' . $this->delete_error . '</strong></p></div>';
                     }
                 } else {
                     $trash_field = $fields[$trash];
                     unset($fields[$trash]);
                     update_option('upme_profile_fields', $fields);
                     /* UPME Action for after deleting custom field */
                     do_action('upme_after_delete_field', $trash_field);
                     // End Action
                     $update_cache_link = ' <a href="' . get_admin_url('', 'admin.php?page=upme-search-cache') . '">' . __('Update Now', 'upme') . '</a>';
                     echo '<div class="updated"><p><strong>' . __('Profile field was sent to Trash. It is recommended to update your user search cache.', 'upme') . $update_cache_link . '</strong></p></div>';
                 }
             }
         }
     }
     if (is_in_post('reset-options-fields')) {
         $this->reset_all('normal');
     }
     include_once upme_path . 'admin/field-builder.php';
 }
Exemplo n.º 12
0
<?php

require_once dirname(dirname(__FILE__)) . '/app.php';
if (isset($_SESSION['user_id'])) {
    unset($_SESSION['user_id']);
    ZLogin::NoRemember();
    $login_user = $login_user_id = $login_manager = $login_leader = null;
}
$code = strval($_GET['code']);
if ($code == 'ok' && is_get()) {
    die(include template('account_reset_ok'));
}
$user = Table::Fetch('user', $code, 'recode');
if (!$user) {
    Session::Set('error', '重设密码的链接无效');
    redirect(WEB_ROOT . '/index.php');
}
if (is_post()) {
    if ($_POST['password'] == $_POST['password2']) {
        ZUser::Modify($user['id'], array('password' => $_POST['password'], 'recode' => ''));
        redirect(WEB_ROOT . '/account/reset.php?code=ok');
    }
    Session::Set('error', '两次输入的密码不匹配,请重新设置');
}
$pagetitle = '重设密码';
include template('account_reset');
Exemplo n.º 13
0
Arquivo: edit.php Projeto: noikiy/mdwp
<?php
require_once(dirname(dirname(dirname(__FILE__))) . '/app.php');
//require_once(dirname(__FILE__) . '/current.php');

need_manager();
need_rbac_auth('mltad_edit_create');

$id = abs(intval($_GET['id']));
$mltad  = Table::Fetch('mltad', $id);
$mltad = $eteam = Table::Fetch('mltad', $id);



if ( is_get() && empty($mltad) ) {
	$mltad = array();
	$mltad['id'] = 0;
	$mltad['begin_time'] = strtotime('+0 days');
	$mltad['end_time'] = strtotime('+7 days');

}
else if ( is_post() ) {
	$mltad = $_POST;
	$insert = array(
		'title', 
		'begin_time', 
		'end_time', 
		'detail',
		'image',
		'lianjie',
		'mltadw',
		'sort_mltad',
Exemplo n.º 14
0
 /**
  * Wpi::setThemeOptions()
  * 
  * @return
  */
 public function setThemeOptions()
 {
     if (!class_exists('wpiAdmin')) {
         self::getFile('admin', 'class');
         $this->AdminUI = new wpiAdmin();
         $req_page = basename(WPI_DIR . 'functions.php');
         $token = wpiFilter::NONCE_THEME_OPTIONS;
         if (is_get('page') && is_get('page') == $req_page) {
             if (is_req('action') && 'save' == b64_safe_decode($_REQUEST['action'])) {
                 check_admin_referer($token);
                 $this->AdminUI->filterRequest($_REQUEST);
                 wp_redirect('themes.php?page=' . $req_page . '&saved=true');
                 die;
             }
             add_action('admin_head', array($this->AdminUI, 'printCSS'));
             wp_enqueue_script(WPI_META . '_admin');
         }
         add_theme_page(__('WPI Theme Options', WPI_META), __('Theme Options', WPI_META), 'edit_themes', $req_page, array($this->AdminUI, 'themeOptions'));
     }
 }
Exemplo n.º 15
0
function is_ajax()
{
    if (isset($_SERVER["HTTP_X_REQUESTED_WITH"]) && !empty($_SERVER["HTTP_X_REQUESTED_WITH"]) && strtolower($_SERVER["HTTP_X_REQUESTED_WITH"]) == "xmlhttprequest") {
        return true;
    }
    return false;
}
function is_get()
{
    if ($_SERVER["REQUEST_METHOD"] == "GET") {
        return true;
    }
    return false;
}
## Обработка запросов
if (is_get() && is_ajax()) {
    $count = (int) $_GET["count"];
    $count_next = (int) $_GET["count_next"];
    $table = $_GET["table"];
    $sort = $_GET["sort"];
    $type_id = $_GET["type_id"];
    $skip_id = $_GET["skip_id"];
    if (empty($skip_id)) {
        $skip_id = 0;
    }
    switch ($table) {
        case 'artists':
            $html = getArtistBlock($count, $count_next);
            break;
        case 'artists':
            $html = getArtistBlock($count, $count_next);