织梦模板团_DEDECMS模板_织梦企业模板_织梦免费模板下载_DEDE仿站_织梦建站
SOSO您喜欢的模板
当前位置: 织梦模板团 > 安装使用 >
织梦DEDECMS网站的注册会员自动激活discuz会员的方法(5)
更多
admin / 2012-05-16 00:54

    
     include_once DEDEINC.'/membermodel.cls.php';
    
     $membermodel = new membermodel($mtype);
    
     $modid=$membermodel->modid;
     
     $modelform = $this->db->getOne("select * from dede_member_model where id='$modid' ");
    
     $this->db->ExecuteNoneQuery("INSERT INTO `{$membermodel->table}` (`mid`) VALUES ('$mid');");
        
     //----------------------------------------------
     //模拟登录
     //---------------------------
     include_once DEDEINC.'/memberlogin.class.php';
     $cfg_ml = new MemberLogin(7*3600); 内容来自织梦模板团
     $cfg_ml->PutLoginInfo($mid);    
    
    }
   
   }
} 织梦模板

function synlogout($get, $post)
{
   if(!API_SYNLOGOUT)
   {
    return API_RETURN_FORBIDDEN;
   }

   //note 同步登出 API 接口
   header('P3P: CP="CURa ADMa DEVa PSAo PSDo OUR BUS UNI PUR INT DEM STA PRE COM NAV OTC NOI DSP COR"');
   include_once DEDEINC.'/memberlogin.class.php';
   $cfg_ml = new MemberLogin();
   $cfg_ml->ExitCookie();
}

织梦模板团

function updatepw($get, $post)
{
   if(!API_UPDATEPW)
   {
    return API_RETURN_FORBIDDEN;
   }
   $username = $get['username'];
   $password = $get['password'];
  
   //note 修改密码 API 接口
   $newpw = md5($password);
   $this->db->ExecuteNoneQuery("UPDATE `dede_member` SET `pwd`='$newpw' WHERE `userid`='$username'");
   return API_RETURN_SUCCEED;
}

本文来自织梦模板团

function updatebadwords($get, $post)
{
   if(!API_UPDATEBADWORDS)
   {
    return API_RETURN_FORBIDDEN;
   }

内容来自织梦模板团

   $row = $this->db->GetOne("SELECT `value` FROM `dede_sysconfig` WHERE `varname`='cfg_replacestr'");
  
   $badwords = isset($row['value']) ? explode(",", $row['value']) : array();
  
   if(is_array($post))
   {
    foreach($post as $k => $v)
    {
     if(in_array($v['find'],$badwords)) continue;
     $badwords[] = $v['find'];
    }
   }
内容来自织梦模板团

   $badwords_comma = !empty($badwords) ? implode(",", $badwords) : '';
  

织梦模板团

   $this->db->ExecuteNoneQuery("UPDATE `dede_sysconfig` SET `value`='$badwords_comma' WHERE `varname`='cfg_replacestr'");
  
   $cachefile = DEDEDATA.'/config.cache.inc.php';
  
   if(!is_writeable($cachefile))
   {
    return API_RETURN_FORBIDDEN;
   }
本文来自织梦模板团

   $fp = fopen($cachefile, 'w');
   $this->db->SetQuery("SELECT `varname`,`type`,`value`,`groupid` From `dede_sysconfig` order by aid asc ");
   $this->db->Execute();
   $s = '<?php'."\r\n";
   while($row = $this->db->GetArray())
   {
    $s .= '$'.$row['varname'].' = '.($row['type']=='number' ? $row['value'] : "'".str_replace("'",'',$row['value'])."'").";\r\n";
   }
   $s .= '?>';
   fwrite($fp, $s);
   fclose($fp);
   return API_RETURN_SUCCEED;
}

function updatehosts($get, $post)
{
   if(!API_UPDATEHOSTS)
   {
    return API_RETURN_FORBIDDEN;
   }
   //note 理新HOST缓存 API 接口
   $cachefile = UC_CLIENT_ROOT.'/data/cache/hosts.php';


DedeCMS(467)
  • 上一篇:织梦DEDECMS5.7网站软件登记替换成图标显示的方法
  • 下一篇:织梦DEDECMS网站怎么调用TAG关键字文章列表