2011年6月6日月曜日

XOOPS Cube のユーザー名を変更可能にするハック

デフォルトでユーザー名を流し込んで、後からユーザー自身に変えさせるという場合XOOPS Cube はユーザー名変更できないという件に対応。本当はもっと煩雑な手続きを入れた方がいいんですけどとりあえずサクッと変更できる感じで。

modules/user/templtes/user_edituser.html

26行目付近に uname を入力可能にします。
      <!-- {$thisUser->getShow('uname')} -->
      <{xoops_input name=uname size=25 maxlength=25 value=$thisUser->getShow('uname')}>
  modules/user/forms/EditUserForm.class.php に uname追加

27行目付近
        $this->mFormProperties['uid'] =& new XCube_IntProperty('uid');
        $this->mFormProperties['uname'] =& new XCube_StringProperty('uname');
        $this->mFormProperties['name'] =& new XCube_StringProperty('name');

192行目付近
    function update(&$obj)
    {
        $obj->set('uname', $this->get('uname'));    // bluemooninc
        $obj->set('name', $this->get('name'));

0 件のコメント:

コメントを投稿