歡迎光臨, 訪客. 請先 登入註冊一個帳號.
五月 08, 2024, 05:06:28 下午
19595 文章 在 3865 主題 由 4580 會員
最新註冊會員: aa123aa1
  列出文章
頁: [1]
1  開發 / 外掛程式 / Re: LifeType跟单一帐号(LDAP)结合的问题! 於: 九月 20, 2007, 08:18:06 上午
我是直接在dousercreation.class.php中加入一步ldap认证,写的不规范;但是勉强可以达到先通过ldap认证才能注册的目的。
代码如下:
程式碼:
			//ldapauth        	
$ldap_server="ldap1.swufe.edu.cn";
$ldap_basedn="********";
$ldap_bindcn="*****".$ldap_basedn;
$ldap_passwd="******";
$ds=ldap_connect($ldap_server);
$dn = "ou=teacher,".$ldap_basedn;
$filter="uid=".$this->userName;
if ($ds)
{
    $r=ldap_bind($ds);
  $sr=ldap_search($ds,$dn,$filter);
    $s_n=ldap_count_entries($ds,$sr);
    if ($s_n!=1)
      {
$this->_view = new SummaryUserCreationView();
//$this->_form->hasRun( true );
$this->_form->setFieldValidationStatus( "userName", false );
$this->setCommonData( true );
  ldap_close($ds);
return false;
      }
    $info = ldap_get_entries($ds, $sr);
    $ldn=$info[0]["dn"];
    @$lbind=ldap_bind($ds,$ldn,$this->userPassword);
    if (!$lbind)
      {
            $this->_view = new SummaryUserCreationView();
                $this->_view->setErrorMessage( $this->_locale->tr("error_invalid_password"));
$this->_form->setFieldValidationStatus( "userPassword", false );               
                $this->setCommonData( true );
                  ldap_close($ds);
                return false;
      }
} else {
    $this->_view = new SummaryUserCreationView();
                $this->_view->setErrorMessage( $this->_locale->tr("can_not_connect_ldap"));
$this->_form->setFieldValidationStatus( "userPasswordCheck", false );               
                $this->setCommonData( true );
                  ldap_close($ds);
                return false;
}
2  開發 / 外掛程式 / Re: moblog中文问题 於: 七月 14, 2007, 09:28:41 上午

参照http://bugs.lifetype.net/view.php?id=578
mark说:"I add a new properties MOBLOG_FORCE_ENCODE_TO_UTF8 to moblogconstants.properties.php. With this, you can convert all incoming messages encodings to UTF-8 (no matter, big5, gb22312 or others)"

原来我上面提到的for1.2版本中moblogconstants.properties.php里默认是关闭编码强制转化的
把"define( 'MOBLOG_FORCE_ENCODE_TO_UTF8', false );"后面的false改为true就支持中文了

再次感谢mark为我们提供了这么好一个plugin
3  開發 / 外掛程式 / moblog中文问题 於: 七月 13, 2007, 05:22:21 下午
我从http://wiki.lifetype.net/index.php/Plugin_moblog下载了for1.2版本的
因为http://wiki.lifetype.org.cn/index.php/Current_Plugins没有找到相应版本
测试成功

但是"BLOG:"是中文的时候没发送成功
或者说内容中有中文就无法识别了(中文部分乱码)

目前有可以解决的办法吗?
mark提供的这个版本只是for1.0的?还是1.2也可以用?
因为对比两个版本的很多文件都不一样
頁: [1]