2005-12-26: Ubuntu Breezy Backports

No post for more than one month. Well, I cur­rently simply don’t have the time to do some­thing excit­ing :). For now, the new Ubuntu Breezy Back­ports repos­it­ory must suf­fice. It con­tains the Mono pack­ages from Ubuntu Dap­per, com­piled for the latest Breezy on i386. There are also pack­ages for Anja on i386 and AMD64 avail­able. All the pack­ages are needed by our robots.

Please add the fol­low­ing lines to your /etc/apt/sources.list if you’re inter­ested in the back­ports or Anja:

deb http://npw.net/debian unstable main
deb-src http://npw.net/debian unstable main

The pack­ages are not signed since they were just recompiled!

2005-11-24: WP: Allow users to edit posts of other users

In wp-admin/edit-pages.php line 19:


AND ($wpdb->users.user\_level <= $user_level OR $wpdb->posts.post\_author = $user_ID)

2005-10-20: Mails

What’s going wrong here? I sup­pose these mails are enogh for one day. Even though the aver­age inform­a­tion con­tent is near zero: bounces…

My inbox today

2005-10-12: WordPress hack … just a note to myself

Hack for classes.php in line 315 (1.5.2). It allows two (sub-)pages to have the same name (slug):

    $temp = dirname(
        str_replace(
            '%2F',
            '/',
            urlencode($q['pagename'])));

    $names = explode('/', $temp);
    $parent = null;

    foreach ($names as $name) {
        $name = sanitize_title($name);
        $query = "SELECT ID " .
            "FROM $wpdb->posts " .
            "WHERE post_name='$name'" .
            (isset($parent) ?
                " AND post_parent=$parent" :
                "");

        $parent = null;
        $parent = $wpdb->get_var($query);

        if (!isset($parent)) {
            // an error occured, continue as normal
            $parent = null;
            break;
        }
    }

    $q['pagename'] = sanitize_title(
        basename(
            str_replace(
                '%2F',
                '/',
                urlencode($q['pagename']))));
    $q['name'] = $q['pagename'];
    $where .=
        " AND post_name = '" .
        $q['pagename'] .
        "'" .
        (isset($parent) ?
            " AND post_parent=$parent" :
            "");

Another hack: allow users with user level >= 5 to edit other user’s posts/pages. This was required for our department’s web­site. post-functions.php functions-post.php line 352 (1.5.2):

    if ((($user_id == $post_author_data->ID) &&
         !($post->post_status == 'publish' &&
            $author_data->user_level < 2)) ||
         ($author_data->user_level >
             $post_author_data->user_level) ||
         (($author_data->user_level >=
             $post_author_data->user_level) &&
          ($author_data->user_level >= 5)) ||
         ($author_data->user_level >= 10) )
    {
        return true;
    } else {
        return false;
    }

2005-10-06: Open Root Server Network

I tent­at­ively switched my nameserv­ers to the Open Root Server Net­work (OSRN) root serv­ers. Seems to be a prom­ising choice, so let’s give it a try.

You are currently browsing the phbaer blog archives for the year 2005.

Bookmarks

Meta