netcommons / NetCommons2

NetCommons Version2
17 stars 21 forks source link

プライベートルームの作成者が、本人でなければ本人に更新する処理のバグ #124

Open akagane99 opened 9 years ago

akagane99 commented 9 years ago

不具合内容

https://github.com/netcommons/NetCommons2/blob/develop/html/webapp/modules/module/update/Update.class.php#L358-L365

影響範囲

akagane99 commented 9 years ago

プルリク投げられないので、修正ベタ書き。

修正

https://github.com/netcommons/NetCommons2/blob/develop/html/webapp/modules/module/update/Update.class.php#L365

        //
        // private_spaceのinsert_user_idを自分自身に更新
        //
        $private_pages = $this->db->execute("SELECT {pages}.*, {pages_users_link}.user_id,{users}.handle " .
                                    " FROM {pages},{pages_users_link} " .
                                    " LEFT JOIN {users} ON {users}.user_id = {pages_users_link}.user_id ".
                                    " WHERE {pages}.default_entry_flag = "._OFF." AND {pages}.private_flag = "._ON.
                                    " AND {pages}.thread_num = 0 AND {pages}.room_id = {pages_users_link}.room_id AND ({pages}.insert_user_id != {pages_users_link}.user_id OR {pages}.insert_user_name != {users}.handle) ");

                                    " AND {pages}.room_id = {pages_users_link}.room_id AND ({pages}.insert_user_id != {pages_users_link}.user_id OR {pages}.insert_user_name != {users}.handle) ");

この条件いらない {pages}.thread_num = 0 (プライベートルームのトップだけ対象にする条件)

akagane99 commented 9 years ago

NC1⇒NC2のデータ移行に関わる不具合をもう1つ

症状

修正箇所

https://github.com/netcommons/NetCommons2/blob/e89bfb7c3e9253c07c34ac16999b44428473b51e/html/webapp/modules/menu/components/View.class.php#L274 https://github.com/netcommons/NetCommons2/blob/e89bfb7c3e9253c07c34ac16999b44428473b51e/html/webapp/modules/menu/components/View.class.php#L288

$parent_page =& $pre_buf_row[$row['parent_id']];

$parent_page = $pre_buf_row[$row['parent_id']];

参照渡し、いらない。

akagane99 commented 9 years ago

@kteraguchi のアドバイスにより解決できた。感謝!