本文整理汇总了PHP中front::cookie_encode方法的典型用法代码示例。如果您正苦于以下问题:PHP front::cookie_encode方法的具体用法?PHP front::cookie_encode怎么用?PHP front::cookie_encode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类front
的用法示例。
在下文中一共展示了front::cookie_encode方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: remotelogin_action
function remotelogin_action() {
cookie::del('passinfo');
$this->view->loginfalse=cookie::get('loginfalse'.md5($_SERVER['REQUEST_URI']));
if (front::$args) {
$user=new user();
$args = xxtea_decrypt(base64_decode(front::$args), config::get('cookie_password'));
$user=$user->getrow(unserialize($args));
if (is_array($user)) {
if ($user['groupid'] == '888')
front::$isadmin=true;
cookie::set('login_username',$user['username']);
cookie::set('login_password',front::cookie_encode($user['password']));
session::set('username',$user['username']);
require_once ROOT.'/celive/include/config.inc.php';
require_once ROOT.'/celive/include/celive.class.php';
$login=new celive();
$login->auth();
$GLOBALS['auth']->remotelogin($user['username'],$user['password']);
$GLOBALS['auth']->check_login1();
front::$user=$user;
}elseif (!is_array(front::$user) ||!isset(front::$isadmin)) {
cookie::set('loginfalse'.md5($_SERVER['REQUEST_URI']),(int) cookie::get('loginfalse'.md5($_SERVER['REQUEST_URI'])) +1,time() +3600);
event::log('loginfalse','失败 user='.$user['username']);
front::flash('密码错误或不存在该管理员!');
front::refresh(url('admin/login',true));
}
}
$this->render();
}
示例2: init
function init() {
if(!union::getconfig('enabled')) {
echo '<script type="text/javascript">alert("'.lang('推广联盟未开启,转让会员中心!').'")</script>';
front::refresh(url::create('user/index'));
}
$user='';
if(cookie::get('login_username') &&cookie::get('login_password')) {
$user=new user();
$user=$user->getrow(array('username'=>cookie::get('login_username')));
}
if(!is_array($user) &&front::$act != 'into'&&front::$act != 'login'&&front::$act != 'register'&&front::$act != 'login_js'&&front::$act != 'login_success'&&front::$act != 'getpass'&&front::$act != 'edit'){
front::redirect(url::create('user/login'));
}else{
if (is_array($user) && cookie::get('login_password') == front::cookie_encode($user['password'])) {
$this->view->user = $user;
$this->view->usergroupid = $user['groupid'];
$obj = new usergroup();
$this->roles = $obj->getrow(array('groupid'=>$this->view->usergroupid));
}
}
$this->_user=new user;
$this->view->form = $this->_user->get_form();
$this->view->field = $this->_user->getFields();
$this->view->primary_key=$this->_user->primary_key;
$this->view->data = $this->view->user;
$this->_union = new union();
$this->view->uniondata = $this->_union->getrow(array('userid'=>$this->view->data['userid']));
if(!$this->view->uniondata &&front::$act != 'register'&&front::$act != 'into') {
echo '<script type="text/javascript">alert("'.lang('未申请账号,转入联盟申请页面!').'");window.location.href="'.url::create('union/register').'";</script>';
//front::refresh(url::create('union/register'));
}
$this->_pagesize=config::get('manage_pagesize');
}
示例3: init
function init() {
if(cookie::get('login_username') &&cookie::get('login_password')) {
$user=new user();
$user=$user->getrow(array('username'=>cookie::get('login_username')));
if(is_array($user) &&cookie::get('login_password')==front::cookie_encode($user['password'])) {
$this->view->user=$user;
$this->view->usergroupid=$user['groupid'];
}
}
else $this->view->usergroupid=0;
}
示例4: check_admin
function check_admin() {
if (cookie::get('login_username')&&cookie::get('login_password')) {
$user=new user();
$user=$user->getrow(array('username'=>cookie::get('login_username')));
$roles = session::get('roles');
if ($roles && is_array($user)&&cookie::get('login_password')==front::cookie_encode($user['password'])) {
$this->view->user=$user;
front::$user=$user;
}else{
$user=null;
}
}
if (!isset($user)||!is_array($user)) {
front::redirect(url::create('admin/login'));
}
}
示例5: init
function init() {
$this->archive = new archive();
$this->category = category::getInstance();
$this->view->category = $this->category->category;
if (front::get('page'))
$page = front::get('page');
else
$page = 1;
$this->view->page = $page;
front::check_type($page);
$_catpage = category::categorypages(front::get('catid'));
if ($_catpage) {
$this->pagesize = $_catpage;
} else {
$this->pagesize = config::get('list_pagesize');
}
front::check_type($this->pagesize);
$announcement = new announcement();
$this->view->announcements = $announcement->getrows(null, 10);
$this->view->usergroupid = 1000;
front::check_type(cookie::get('login_username'), 'safe');
front::check_type(cookie::get('login_password'), 'safe');
$this->view->showarchive = archive::getInstance()->getrow(front::get('aid'));
$addcontentuser = new user();
$addcontentuser = $addcontentuser->getrow(array('userid' => $this->view->showarchive['userid']));
if (is_array($addcontentuser)) {
$this->view->adduser = $addcontentuser;
}
if (cookie::get('login_username') && cookie::get('login_password')) {
$user = new user();
$user = $user->getrow(array('username' => cookie::get('login_username')));
if (is_array($user) && cookie::get('login_password') == front::cookie_encode($user['password'])) {
$this->view->user = $user;
$this->view->usergroupid = $user['groupid'];
$obj = new usergroup();
$this->roles = $obj->getrow(array('groupid'=>$this->view->usergroupid));
}
}
}
示例6: updialog_action
function updialog_action(){
$this->view->isadmin = 0;
if (cookie::get('login_username')&&cookie::get('login_password')) {
$user=new user();
$user=$user->getrow(array('username'=>cookie::get('login_username')));
$roles = session::get('roles');
if ($roles && is_array($user)&&cookie::get('login_password')==front::cookie_encode($user['password'])) {
$this->view->isadmin = 1;
}
}
echo $this->view->fetch();
exit;
}
示例7: register_action
//.........这里部分代码省略.........
return;
}
if(strlen(front::post('username'))<4) {
front::flash(lang('用户名太短!'));
return;
}
if(strlen(front::post('e_mail'))<1) {
front::flash(lang('请填写邮箱!'));
return;
}
if(strlen(front::post('tel'))<1) {
front::flash(lang('请填写手机号码!'));
return;
}
if(front::post('username') &&front::post('password')) {
$username=front::post('username');
$password=md5(front::post('password'));
$e_mail=front::post('e_mail');
$tel=front::post('tel');
if(!preg_match('/^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$/', front::ip())&&!preg_match('@^\s*((([0-9A-Fa-f]{1,4}:){7}(([0-9A-Fa-f]{1,4})|:))|(([0-9A-Fa-f]{1,4}:){6}(:|((25[0-5]|2[0-4]\d|[01]?\d{1,2})(\.(25[0-5]|2[0-4]\d|[01]?\d{1,2})){3})|(:[0-9A-Fa-f]{1,4})))|(([0-9A-Fa-f]{1,4}:){5}((:((25[0-5]|2[0-4]\d|[01]?\d{1,2})(\.(25[0-5]|2[0-4]\d|[01]?\d{1,2})){3})?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:){4}(:[0-9A-Fa-f]{1,4}){0,1}((:((25[0-5]|2[0-4]\d|[01]?\d{1,2})(\.(25[0-5]|2[0-4]\d|[01]?\d{1,2})){3})?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:){3}(:[0-9A-Fa-f]{1,4}){0,2}((:((25[0-5]|2[0-4]\d|[01]?\d{1,2})(\.(25[0-5]|2[0-4]\d|[01]?\d{1,2})){3})?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:){2}(:[0-9A-Fa-f]{1,4}){0,3}((:((25[0-5]|2[0-4]\d|[01]?\d{1,2})(\.(25[0-5]|2[0-4]\d|[01]?\d{1,2})){3})?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(([0-9A-Fa-f]{1,4}:)(:[0-9A-Fa-f]{1,4}){0,4}((:((25[0-5]|2[0-4]\d|[01]?\d{1,2})(\.(25[0-5]|2[0-4]\d|[01]?\d{1,2})){3})?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(:(:[0-9A-Fa-f]{1,4}){0,5}((:((25[0-5]|2[0-4]\d|[01]?\d{1,2})(\.(25[0-5]|2[0-4]\d|[01]?\d{1,2})){3})?)|((:[0-9A-Fa-f]{1,4}){1,2})))|(((25[0-5]|2[0-4]\d|[01]?\d{1,2})(\.(25[0-5]|2[0-4]\d|[01]?\d{1,2})){3})))(%.+)?\s*$@', front::ip())){
exit('来源非法');
}
$data=array(
'username'=>$username,
'password'=>$password,
'e_mail'=>$e_mail,
'tel'=>$tel,
'groupid'=>101,
'userip'=>front::ip()
);
//phpox 2011-06-10
foreach($this->view->field as $f){
$name=$f['name'];
if(!preg_match('/^my_/',$name)) {
unset($field[$name]);
continue;
}
if(!setting::$var['user'][$name]['showinreg']) {
continue;
}
$data[$name] = front::post($name);
}
if($this->_user->getrow(array('username'=>$username))) {
front::flash(lang('该用户名已被注册!'));
return;
}
$insert=$this->_user->rec_insert($data);
$_userid = $this->_user->insert_id();
if($insert){
if(config::get('sms_on') && config::get('sms_reg_on')){
sendMsg($tel,config::get('sms_reg'));
}
$cmsname = config::get('sitename');
if(config::get('email_reg_on')){
$this->sendmail($e_mail,"欢迎注册 $cmsname !",lang('尊敬的').$username.', '.lang('您好!欢迎你注册'.$cmsname.'!'));
}
front::flash(lang('注册成功!'));
}else {
front::flash(lang('注册失败!'));
return;
}
if(union::getconfig('enabled')) {
$union_visitid = intval(cookie::get('union_visitid'));
$union_userid = intval(cookie::get('union_userid'));
if($union_visitid &&$union_userid) {
$union_reg = new union();
$r = $union_reg->getrow(array('userid'=>$union_userid));
if($r) {
$union_reg->rec_update(array('registers'=>'[registers+1]'),array('userid'=>$union_userid));
if($union_reg->affected_rows()) {
$union_visit_reg = new union_visit();
$union_visit_reg->rec_update(array('regusername'=>front::post('username'),'regtime'=>time()),array('visitid'=>$union_visitid));
$this->_user->rec_update(array('introducer'=>$union_userid),array('userid'=>$_userid));
$regrewardtype = union::getconfig('regrewardtype');
$regrewardnumber = union::getconfig('regrewardnumber');
switch($regrewardtype) {
case 'point':
union::pointadd($r['username'],$regrewardnumber,'union');
break;
}
}
}
}
}
$user=$data;
cookie::set('login_username',$user['username']);
cookie::set('login_password',front::cookie_encode($user['password']));
session::set('username',$user['username']);
front::redirect(url::create('user'));
exit;
}
else {
front::flash(lang('注册失败!'));
return;
}
}
}
示例8: getPrices
function getPrices($price) {
if (cookie::get('login_username') && cookie::get('login_password')) {
$user = new user();
$user = $user->getrow(array('username' => cookie::get('login_username')));
if (is_array($user) && cookie::get('login_password') == front::cookie_encode($user['password'])) {
$obj = new usergroup();
$roles = $obj->getrow(array('groupid' => $user['groupid']));
}
}
if ($roles['discount'] != 0) {
$newprice = $price * $roles['discount'] * 0.1;
}else{
$newprice = $price;
}
return array('oldprice'=>$price,'price'=>$newprice,'groupname'=>$roles['name']);
}