Exemple #1
0
<?php

include __DIR__ . '/baseRules.php';
$rules['login'] = array('_method' => array('post' => array('ver', 'access_token', 'deviceToken', 'plat', 'type', 'u_tags')), 'ver' => ver(), 'access_token' => array('required' => 1, 'filters' => 'trim', 'msg' => '11051'), 'deviceToken' => array('required' => 0, 'length' => array(14, 64), 'regex' => '/^[a-zA-Z0-9]+$/', 'filters' => 'trim', 'msg' => '11051'), 'plat' => array('required' => 1, 'range' => array(1, 3), 'filters' => 'trim', 'msg' => '11051'), 'type' => array('required' => 1, 'range' => array(1, 3), 'filters' => 'trim', 'msg' => '11111'), 'u_tags' => array('required' => 1, 'filters' => 'trim', 'length' => array(10, 32), 'msg' => '11051'));
$rules['reg'] = array('_method' => array('post' => array('ver', 'mobi', 'pass', 'session', 'deviceToken', 'u_tags', 'plat', 'name', 'pic', 'type', 'cver', 'captcha')), 'ver' => ver(), 'mobi' => mobile(), 'pass' => password(), 'session' => array('required' => 1, 'filters' => 'trim', 'msg' => '11111'), 'deviceToken' => array('required' => 1, 'length' => array(14, 64), 'regex' => '/^[a-zA-Z0-9]+$/', 'filters' => 'trim', 'msg' => '10010'), 'u_tags' => array('required' => 1, 'filters' => 'trim', 'length' => array(10, 32), 'msg' => '11051'), 'plat' => array('required' => 1, 'range' => array(1, 3), 'filters' => 'trim', 'msg' => '11051'), 'name' => array('required' => 1, 'length' => array(1, 12), 'filters' => 'trim', 'msg' => '10011'), 'pic' => array('required' => 0, 'filters' => 'trim', 'msg' => '10011'), 'type' => array('required' => 1, 'range' => array(1, 3), 'filters' => 'trim', 'msg' => '11111'), 'cver' => array('required' => 0, 'filters' => 'trim', 'msg' => '11111'), 'captcha' => captcha());
$rules['bind'] = array('_method' => array('post' => array('ver', 'token', 'access_token', 'plat', 'u_tags')), 'ver' => ver(), 'token' => token(), 'access_token' => array('required' => 1, 'filters' => 'trim', 'msg' => '11051'), 'plat' => array('required' => 1, 'range' => array(1, 3), 'filters' => 'trim', 'msg' => '11051'), 'u_tags' => array('required' => 1, 'filters' => 'trim', 'length' => array(10, 32), 'msg' => '11051'));
$rules['del'] = array('_method' => array('post' => array('ver', 'token', 'plat')), 'ver' => ver(), 'token' => token(), 'plat' => array('required' => 1, 'range' => array(1, 3), 'filters' => 'trim', 'msg' => '11051'));
return $rules;
Exemple #2
0
<?php

include __DIR__ . '/baseRules.php';
$rules['detail'] = array('_request' => array('soap', 'secure', 'ajax'), '_method' => array('get' => array('orderId')), 'orderId' => array('required' => 1, 'regex' => '/^\\d+$/', 'filters' => 'trim', 'msg' => '请选择数量'));
$rules['editgoods'] = array('_request' => array('soap', 'secure', 'ajax'), '_method' => array('post' => array('orderGoodsId', 'orderId', 'goodsId', 'colorId', 'sizeId', 'price', 'goodsNum')), 'orderGoodsId' => array('required' => 1, 'regex' => '/^\\d+$/', 'filters' => 'trim', 'msg' => '订单商品错误'), 'orderId' => array('required' => 1, 'regex' => '/^\\d+$/', 'filters' => 'trim', 'msg' => '订单ID错误'), 'goodsId' => array('required' => 1, 'regex' => '/^\\d+$/', 'filters' => 'trim', 'msg' => '商品ID错误'), 'colorId' => array('required' => 1, 'regex' => '/^\\d+$/', 'filters' => 'trim', 'msg' => '没有这种颜色'), 'sizeId' => array('required' => 1, 'regex' => '/^\\d+$/', 'filters' => 'trim', 'msg' => '没有这种尺码'), 'price' => array('required' => 1, 'regex' => '/^[0-9]+([.]{1}[0-9]+){0,1}$/', 'filters' => 'trim', 'msg' => '价格格式错误'), 'goodsNum' => array('required' => 1, 'regex' => '/^[1-9]\\d*$/', 'filters' => 'trim', 'msg' => '价格格式错误'));
$rules['editorder'] = array('_request' => array('ajax'), '_method' => array('post' => array('orderId', 'shippingType', 'mobi', 'province', 'city', 'district', 'street', 'addr', 'consignee')), 'orderId' => array('required' => 1, 'regex' => '/^\\d+$/', 'filters' => 'trim', 'msg' => '订单id错误'), 'shippingType' => array('required' => 1, 'range' => array(1, 3), 'filters' => 'trim', 'msg' => '请选择数量'), 'mobi' => mobile(), 'province' => array('required' => 1, 'regex' => '/^\\d+$/', 'filters' => 'trim', 'msg' => '不是正确的地址'), 'city' => array('required' => 1, 'regex' => '/^\\d+$/', 'filters' => 'trim', 'msg' => '不是正确的地址'), 'district' => array('required' => 1, 'regex' => '/^\\d+$/', 'filters' => 'trim', 'msg' => '不是正确的地址'), 'street' => array('required' => 0, 'regex' => '/^\\d+$/', 'filters' => 'trim', 'msg' => '不是正确的地址'), 'addr' => array('required' => 1, 'length' => array(0, 255), 'filters' => 'trim', 'msg' => '地址格式错误'), 'consignee' => array('required' => 1, 'length' => array(0, 60), 'filters' => 'trim', 'msg' => '收件人名字格式错误'));
$rules['detail'] = array('_request' => array('soap', 'secure', 'ajax'), '_method' => array('get' => array('orderId')), 'orderId' => array('required' => 1, 'regex' => '/^\\d+$/', 'filters' => 'trim', 'msg' => '订单id错误'));
$rules['goodsattr'] = array('_request' => array('soap', 'secure', 'ajax'), '_method' => array('post' => array('goodsId')), 'goodsId' => array('required' => 1, 'regex' => '/^\\d+$/', 'filters' => 'trim', 'msg' => '商品id错误'));
$rules['getsizebycid'] = array('_request' => array('soap', 'secure', 'ajax'), '_method' => array('post' => array('goodsId', 'colorId')), 'goodsId' => array('required' => 1, 'regex' => '/^\\d+$/', 'filters' => 'trim', 'msg' => '商品id错误'), 'colorId' => array('required' => 1, 'regex' => '/^\\d+$/', 'filters' => 'trim', 'msg' => '颜色id错误'));
$rules['editstatus'] = array('_request' => array('soap', 'secure', 'ajax'), '_method' => array('post' => array('orderId', 'operate')), 'orderId' => array('required' => 1, 'regex' => '/^\\d+$/', 'filters' => 'trim', 'msg' => '订单ID错误'), 'operate' => array('required' => 1, 'range' => array('invalid', 'applyBack', 'deliver', 'orderSuccess', 'orderClose'), 'filters' => 'trim', 'msg' => '操作错误'));
$rules['batchoperate'] = array('_request' => array('ajax'), '_method' => array('post' => array('orderIds', 'operate')), 'orderIds' => array('required' => 1, 'filters' => 'trim', 'msg' => ''), 'operate' => array('required' => 1, 'range' => array('batchInvalid', 'batchDeliver', 'batchApplyBack', 'batchOrderSuccess', 'batchOrderClose'), 'filters' => 'trim', 'msg' => '请检查操作的合法性'));
$rules['getgoods'] = array('_request' => array('ajax'), '_method' => array('post' => array('goodsName')), 'goodsName' => array('required' => 1, 'filters' => 'trim', 'msg' => ''));
$rules['checkgoods'] = array('_request' => array('ajax'), '_method' => array('post' => array('goodsId', 'colorId', 'sizeId')), 'goodsId' => array('required' => 1, 'regex' => '/^\\d+$/', 'filters' => 'trim', 'msg' => '商品ID错误'), 'colorId' => array('required' => 1, 'regex' => '/^\\d+$/', 'filters' => 'trim', 'msg' => '颜色ID错误'), 'sizeId' => array('required' => 1, 'regex' => '/^\\d+$/', 'filters' => 'trim', 'msg' => '尺码ID错误'));
$rules['create'] = array('_request' => array('ajax'), '_method' => array('post' => array('goodsData', 'consignee', 'mobi', 'province', 'city', 'district', 'street', 'addr', 'shippingFee', 'orderFee')), 'goodsData' => array('required' => 1, 'msg' => '订单商品有误'), 'consignee' => array('required' => 1, 'length' => array(0, 60), 'filters' => 'trim', 'msg' => '收件人名字格式错误'), 'mobi' => mobile(), 'province' => array('required' => 1, 'regex' => '/^\\d+$/', 'filters' => 'trim', 'msg' => '不是正确的地址'), 'city' => array('required' => 1, 'regex' => '/^\\d+$/', 'filters' => 'trim', 'msg' => '不是正确的地址'), 'district' => array('required' => 1, 'regex' => '/^\\d+$/', 'filters' => 'trim', 'msg' => '不是正确的地址'), 'street' => array('required' => 0, 'regex' => '/^\\d+$/', 'filters' => 'trim', 'msg' => '不是正确的地址'), 'addr' => array('required' => 1, 'length' => array(0, 255), 'filters' => 'trim', 'msg' => '地址格式错误'), 'shippingFee' => array('required' => 1, 'regex' => '/^[0-9]+([.]{1}[0-9]+){0,1}$/', 'filters' => 'trim', 'msg' => '快递金额格式错误'), 'orderFee' => array('required' => 1, 'regex' => '/^[0-9]+([.]{1}[0-9]+){0,1}$/', 'filters' => 'trim', 'msg' => '应付金额格式错误'));
return $rules;
Exemple #3
0
function define_config()
{
    $qbn = sql('mail,rstr,mbrs,config,dscrp', 'qdu', 'a', 'name="' . $_SESSION['qb'] . '"');
    //echo $qbn['rstr'];
    $_SESSION['rstr'] = strsplit($qbn['rstr']);
    //restricts
    //$_SESSION['rstr']=msql_read('',$_SESSION['qb'].'_rstr','',1);
    $prmb = explode('#', $qbn["config"]);
    $_SESSION['prmb'] = prmb_defaults($prmb);
    //config
    $qbin["adminmail"] = $qbn["mail"];
    //$qbin["struct"]=$qbn["struct"];
    $qbin["membrs"] = tab_members($qbn["mbrs"]);
    $qbin["dscrp"] = $qbn["dscrp"];
    $_SESSION['qbin'] = $qbin;
    $_SESSION['modsnod'] = $_SESSION['qb'] . '_mods_' . prmb(1);
    if ($_SESSION['prmb'][5]) {
        auto_design();
    }
    define_mods('');
    $_SESSION['nms'] = msql_read('lang', 'helps_nominations', '', 1);
    $_SESSION['picto'] = msql_read('system', 'edition_pictos', '', 1);
    $_SESSION['icons'] = msql_read('system', 'program_pictos', '', 1);
    $_SESSION['art_options'] = array("related", "folder", "lang", "template", "authlevel", "tracks", "2cols");
    $_SESSION['node_clr'] = $_SESSION['qb'];
    $_SESSION['mobile'] = mobile();
    $_SESSION["switch"] = '';
    $_SESSION['prma'] = '';
    $_SESSION['ip'] = sesmk('hostname');
}
Exemple #4
0
function define_config()
{
    $qbn = sql('mail,rstr,mbrs,config,dscrp', 'qdu', 'a', 'name="' . $_SESSION['qb'] . '"');
    $_SESSION['rstr'] = strsplit($qbn['rstr']);
    unset($_SESSION['rstr'][0]);
    //$_SESSION['rstr']=msql_read('',$_SESSION['qb'].'_rstr','',1);
    $prmb = explode('#', $qbn['config']);
    $_SESSION['prmb'] = prmb_defaults($prmb);
    //config
    $qbin['adminmail'] = $qbn['mail'];
    //$qbin['struct']=$qbn['struct'];
    $qbin['membrs'] = tab_members($qbn['mbrs']);
    $qbin['dscrp'] = $qbn['dscrp'];
    $_SESSION['qbin'] = $qbin;
    $_SESSION['modsnod'] = $_SESSION['qb'] . '_mods_' . prmb(1);
    if ($_SESSION['prmb'][5]) {
        auto_design();
    }
    define_mods('');
    $_SESSION['nms'] = msql_read('lang', 'helps_nominations', '', 1);
    $_SESSION['art_options'] = array('related', 'folder', 'agenda', 'lang', 'template', 'authlevel', 'tracks', '2cols', 'fav', 'like', 'poll');
    $_SESSION['node_clr'] = $_SESSION['qb'];
    $_SESSION['mobile'] = mobile();
    $_SESSION['switch'] = '';
    $_SESSION['prma'] = '';
    $_SESSION['ip'] = sesmk('hostname');
}
Exemple #5
0
<?php

include __DIR__ . '/baseRules.php';
$rules['checkcap'] = array('_request' => array('ajax'), '_method' => array('post' => array('regtype', 'captcha', 'mobile', 'codeImg')), 'regtype' => array('required' => 1, 'valueis' => '7', 'filters' => 'trim', 'msg' => '验证码类型错误'), 'captcha' => array('required' => 1, 'filters' => 'trim', 'regex' => '/^\\d{4}$/', 'msg' => '请输入正确的4位验证码'), 'codeImg' => array('required' => '', 'filters' => 'trim', 'length' => 4, 'msg' => '请输入正确的4位验证码'), 'mobile' => mobile());
$rules['setPwd'] = array('_request' => array('ajax'), '_method' => array('post' => array('passwd', 'repwd')), 'passwd' => passwd(), 'repwd' => confirmpass());
return $rules;
Exemple #6
0
<?php 
include __DIR__ . '/baseRules.php';
$rules['index'] = array('_request' => array('soap', 'secure', 'ajax'), '_method' => array('post' => array('mobile', 'smscaptach', 'passwd', 'confirmpass', 'readme', 'email')), 'mobile' => mobile(), 'smscaptach' => array('required' => 1, 'length' => 6, 'filters' => 'trim', 'regex' => '/^\\w[6]$/', 'msg' => '请输入6位短信验证码'), 'passwd' => passwd(), 'confirmpass' => confirmpass(), 'readme' => array('required' => 1, 'valueis' => 'yes', 'filters' => 'trim', 'msg' => '请阅读并同意使用条款'), 'email' => email(), 'age' => array('required' => 1, 'between' => array(3, 12), 'filters' => 'trim', 'msg' => '年龄必须在3-12岁之间'), 'sex' => array('required' => 1, 'range' => array(1, 3), 'filters' => 'trim', 'sanitize' => function ($v) {
    return $v + 1;
}, 'msg' => '请选择宝贝性别'), 'size' => array('required' => 1, 'rangeout' => array(39, 25), 'filters' => 'trim', 'msg' => '对不起,39码和25码已经售罄'), 'orderids' => array('required' => 1, 'nums' => array(1), 'filters' => 'trim', 'msg' => '请至少选择一个订单'), 'avatar' => array('required' => 1, 'default' => array('xx.gif'), 'nums' => array(1, 5), 'filetype' => array('gif', 'jpg', 'png'), 'filesize' => 10 * 1024 * 1024, 'msg' => '请选择以gif,jpg,png结尾的图片'));
$rules['login'] = array('_request' => array('ajax'), '_method' => array('post' => array('mobile', 'passwd')), 'mobile' => mobile(), 'passwd' => passwd());
$rules['register'] = array('_request' => array('ajax'), '_method' => array('post' => array('mobile', 'passwd', 'confirmpass', 'email', 'captcha', 'agree', 'regtype', 'codeImg')), 'mobile' => mobile(), 'passwd' => passwd(), 'email' => optionalEmail(), 'confirmpass' => confirmpass(), 'regtype' => array('required' => 1, 'valueis' => '1', 'filters' => 'trim', 'msg' => '验证码类型错误'), 'captcha' => array('required' => 1, 'filters' => 'trim', 'regex' => '/^\\d{4}$/', 'msg' => '请输入正确的4位验证码'), 'agree' => array('required' => 1, 'valueis' => 'on', 'filters' => 'trim', 'msg' => '请先阅读网站使用条款和隐私条款'), 'codeImg' => array('required' => '', 'filters' => 'trim', 'length' => 4, 'msg' => '请输入正确的4位验证码'));
$rules['adduserinfo'] = array('_request' => array('ajax'), '_method' => array('post' => array('mobile', 'passwd', 'confirmpass', 'email', 'captcha', 'agree', 'openid', 'wbuid', 'regtype', 'pic', 'codeImg')), 'mobile' => mobile(), 'passwd' => passwd(), 'email' => optionalEmail(), 'confirmpass' => confirmpass(), 'regtype' => array('required' => 1, 'valueis' => '1', 'filters' => 'trim', 'msg' => '验证码类型错误'), 'captcha' => array('required' => 1, 'filters' => 'trim', 'regex' => '/^\\d{4}$/', 'msg' => '请输入正确的4位验证码'), 'agree' => array('required' => 1, 'valueis' => 'on', 'filters' => 'trim', 'msg' => '请先阅读网站使用条款和隐私条款'), 'openid' => array('required' => 0, 'length' => 32, 'filters' => 'trim', 'msg' => '错误的openid'), 'wbuid' => array('required' => 0, 'regex' => '/^\\d+$/', 'filters' => 'trim', 'msg' => '错误的uid'), 'pic' => array('required' => 0, 'length' => array(10, 200), 'filters' => 'trim', 'msg' => '错误的图片地址'), 'codeImg' => array('required' => '', 'filters' => 'trim', 'length' => 4, 'msg' => '请输入正确的4位验证码'));
$rules['existtel'] = array('_request' => array('ajax'), '_method' => array('post' => array('mobile')), 'mobile' => mobile());
return $rules;
Exemple #7
0
<?php

include __DIR__ . '/baseRules.php';
$rules['reg'] = array('_method' => array('post' => array('ver', 'mobi', 'captcha', 'pass', 'file', 'type', 'deviceToken', 'cver')), 'ver' => ver(), 'mobi' => mobile(), 'captcha' => captcha(), 'pass' => password(), 'type' => array('required' => 1, 'range' => array(1, 3), 'filters' => 'trim', 'msg' => '11111'), 'deviceToken' => array('required' => 0, 'length' => array(14, 64), 'regex' => '/^[a-zA-Z0-9]+$/', 'filters' => 'trim', 'msg' => '10010'), 'cver' => array('required' => 0, 'filters' => 'trim', 'msg' => '11111'));
$rules['login'] = array('_method' => array('post' => array('ver', 'mobi', 'pass', 'type', 'deviceToken', 'cver')), 'ver' => ver(), 'mobi' => mobile(), 'pass' => password(), 'type' => array('required' => 1, 'range' => array(1, 3), 'filters' => 'trim', 'msg' => '11111'), 'deviceToken' => array('required' => 0, 'length' => array(14, 64), 'regex' => '/^[a-zA-Z0-9]+$/', 'filters' => 'trim', 'msg' => '10010'), 'cver' => array('required' => 0, 'filters' => 'trim', 'msg' => '11111'));
$rules['change'] = array('_method' => array('post' => array('ver', 'token', 'captcha', 'passnew')), 'ver' => ver(), 'token' => token(), 'captcha' => captcha(), 'passnew' => password());
$rules['edit'] = array('_method' => array('post' => array('ver', 'token', 'uname')), 'ver' => ver(), 'token' => token(), 'uname' => array('required' => 0, 'length' => array(1, 12), 'filters' => 'trim', 'msg' => '10011'));
$rules['trial'] = array('_method' => array('post' => array('ver', 'lat', 'lng')), 'ver' => ver(), 'lat' => array('required' => '1', 'filters' => 'trim', 'msg' => '10024'), 'lng' => array('required' => '1', 'filters' => 'trim', 'msg' => '10024'));
$rules['logout'] = array('_method' => array('post' => array('ver', 'token', 'deviceToken')), 'ver' => ver(), 'token' => mobile(), 'token' => array('required' => 0, 'filters' => 'trim', 'length' => 32, 'msg' => '00000'), 'deviceToken' => array('required' => 0, 'length' => array(14, 64), 'regex' => '/^[a-zA-Z0-9]+$/', 'filters' => 'trim', 'msg' => '10010'));
return $rules;
Exemple #8
0
<?php

include __DIR__ . '/baseRules.php';
$rules['captcha'] = array('_method' => array('post' => array('ver', 'mobi', 'captcha')), 'ver' => ver(), 'token' => mobile(), 'captcha' => captcha());
$rules['reset'] = array('_method' => array('post' => array('session', 'passnew')), 'session' => array('required' => 1, 'filters' => 'trim', 'msg' => '11111'), 'pass' => password());
return $rules;
Exemple #9
0
if (!empty($_SESSION['upload_user_path']) && !is_writable($_SESSION['upload_root_path'] . $_SESSION['upload_user_path'] . $_SESSION['current_path'])) {
    $message .= '<div class="error">' . e('Problem accessing ' . $_SESSION['current_path'] . ': folder not writable', false) . '</div>';
}
$behaviour['FILES_TO_ECHO'] = ['txt', 'md', 'nfo', 'js', 'html', 'php', 'htm', 'css', 'm3u', 'sh', 'java', 'sql', 'py', 'bat', 'xml', 'c', 'ini', 'htaccess', 'ovhconfig', 'gitignore', 'po'];
$behaviour['FILES_TO_RETURN'] = ['jpg', 'jpeg', 'gif', 'png', 'pdf', 'swf', 'mp3', 'svg'];
$behaviour['FILES_TO_OFFICE'] = ['doc', 'docx', 'xls', 'xlsx', 'ppt'];
$auto_dropzone['destination_filepath'] = $_SESSION['current_path'] . '/';
$auto_thumb['default_width'] = '64';
$auto_thumb['default_height'] = '64';
$auto_thumb['dont_try_to_resize_thumbs_files'] = true;
// constantes
define('THEME_PATH', 'templates/' . $_SESSION['theme'] . '/');
require_once __DIR__ . '/include_html.php';
$ids = purgeIDs();
// variables
$mobile = mobile();
// savoir si l'utilisateur utilise un navigateur mobile
$shared_with = load_folder_share();
// récupère la liste des dossiers partagés
// fonctions
function load($file)
{
    return file_exists($file) ? unserialize(gzinflate(base64_decode(substr(file_get_contents($file), 9, -strlen(6))))) : array();
}
function save($file, $data)
{
    return file_put_contents($file, '<' . '?php /* ' . base64_encode(gzdeflate(serialize($data))) . ' */ ?' . '>');
    //PSPad 4.5.2 fix
}
function store($ids = null)
{