|
@@ -26,6 +26,9 @@ if (!class_exists("plug_login")) {
|
|
|
}
|
|
|
add_action('login_head', array(&$this, 'login_head'));
|
|
|
|
|
|
+ add_action('user_register', array(&$this, 'plugin_user_register'), 10, 3);
|
|
|
+ add_action('personal_options_update', array(&$this, 'plugin_user_register'), 10, 3);
|
|
|
+
|
|
|
add_action('admin_enqueue_scripts', function () {
|
|
|
/*
|
|
|
if possible try not to queue this all over the admin by adding your settings GET page val into next
|
|
@@ -49,14 +52,22 @@ if (!class_exists("plug_login")) {
|
|
|
return $mime_types;
|
|
|
}, 1, 1);
|
|
|
|
|
|
- add_action('admin_footer', function () {
|
|
|
+ add_action('register_post', array(&$this, 'register_post'), 10, 3);
|
|
|
+ add_action('edit_user_profile', array(&$this, 'plugin_show_user_profile'), 10, 3);
|
|
|
+ add_action('admin_footer', array(&$this, 'admin_footer'), 10, 3);
|
|
|
|
|
|
- /*
|
|
|
+ }
|
|
|
+
|
|
|
+//add_action('show_user_profile', 'plugin_show_user_profile');
|
|
|
+
|
|
|
+ function admin_footer() {
|
|
|
+
|
|
|
+ /*
|
|
|
if possible try not to queue this all over the admin by adding your settings GET page val into next
|
|
|
if( empty( $_GET['page'] ) || "my-settings-page" !== $_GET['page'] ) { return; }
|
|
|
*/
|
|
|
|
|
|
- ?>
|
|
|
+ ?>
|
|
|
|
|
|
<script>
|
|
|
jQuery(document).ready(function($){
|
|
@@ -131,9 +142,32 @@ if (!class_exists("plug_login")) {
|
|
|
</script>
|
|
|
|
|
|
<?php
|
|
|
-});
|
|
|
+}
|
|
|
+
|
|
|
+ function plugin_show_user_profile($user) {
|
|
|
+
|
|
|
+ ?>
|
|
|
+ <h3><?php _e('Pro/Select information')?></h3>
|
|
|
+ <table class="form-table">
|
|
|
+ <tr>
|
|
|
+
|
|
|
+ <td><input type="hidden" name="r_proselect" id="r_proselect" value="<?php echo $user->Proselect; ?>" /><?php echo $user->Proselect; ?></td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <th><label for="Navn"><?php _e('Navn');?></label></th>
|
|
|
+ <td><input type="text" name="r_navn" id="r_navn" value="<?php echo $user->Navn; ?>" /></td>
|
|
|
+ </tr>
|
|
|
+ <tr>
|
|
|
+ <th><label for="Medlem af"><?php _e('Medlem af');?></label></th>
|
|
|
+ <td><input type="text" name="r_membership" id="r_membership" value="<?php echo $user->Gruppe; ?>" /></td>
|
|
|
+ </tr>
|
|
|
+
|
|
|
+
|
|
|
+ </table>
|
|
|
+ <?php
|
|
|
|
|
|
}
|
|
|
+
|
|
|
function replace_howdy($wp_admin_bar) {
|
|
|
$my_account = $wp_admin_bar->get_node('my-account');
|
|
|
$newtitle = str_replace('Hejsa,', 'Velkommen,', $my_account->title);
|
|
@@ -259,22 +293,67 @@ body {
|
|
|
$str .= apply_filters('the_content', $page->post_content);
|
|
|
|
|
|
} else {
|
|
|
- $str .= get_option($this->pluginname . "_login_support_splash_" . $_GET['action'], false);
|
|
|
+ $str .= stripslashes(get_option($this->pluginname . "_login_support_splash_" . $_GET['action'], false));
|
|
|
|
|
|
}
|
|
|
|
|
|
} else {
|
|
|
- $str .= get_option($this->pluginname . "_login_support_splash_" . $_GET['action'], false);
|
|
|
+ $str .= stripslashes(get_option($this->pluginname . "_login_support_splash_" . $_GET['action'], false));
|
|
|
|
|
|
}
|
|
|
} else {
|
|
|
- $str .= get_option($this->pluginname . "_login_support_splash", false);
|
|
|
+ $str .= stripslashes(get_option($this->pluginname . "_login_support_splash", false));
|
|
|
}
|
|
|
$str .= '</p></div>';
|
|
|
|
|
|
return $str;
|
|
|
}
|
|
|
|
|
|
+ function plugin_user_register($id) {
|
|
|
+ $user_info = get_userdata($id);
|
|
|
+
|
|
|
+ update_user_meta($id, 'Proselect', $_POST['r_proselect']);
|
|
|
+
|
|
|
+ update_user_meta($id, 'Navn', $_POST['r_navn']);
|
|
|
+
|
|
|
+ update_user_meta($id, 'Gruppe', $_POST['r_membership']);
|
|
|
+
|
|
|
+ // update_usermeta($id, 'Institution' , $_POST['r_institution'] );
|
|
|
+ // update_usermeta($id, 'Fag' , $_POST['r_fag'] );
|
|
|
+ // update_usermeta($id, 'Fødselsår' , $_POST['r_alder'] );
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ function register_post($login, $email, $errors) {
|
|
|
+
|
|
|
+ if (empty($_POST['r_proselect'])) {
|
|
|
+ $_POST['r_proselect'] = "Perspektiv";
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ if (empty($_POST['r_navn'])) {
|
|
|
+ $errors->add('demo_error', __('Du skal udfylde Navn'));
|
|
|
+ }
|
|
|
+ ;
|
|
|
+ if (empty($_POST['r_membership']) || $_POST['r_membership'] === "Vælg gruppe") {
|
|
|
+ $errors->add('demo_error', __('Du skal udfylde Gruppe'));
|
|
|
+ }
|
|
|
+ ;
|
|
|
+/* if(empty($_POST['r_fag'])){
|
|
|
+$errors->add('demo_error',__('Du skal udfylde Fag'));
|
|
|
+};
|
|
|
+if(empty($_POST['r_alder'])){
|
|
|
+$errors->add('demo_error',__('Du skal udfylde Alder'));
|
|
|
+}else{
|
|
|
+$alder = intval($_POST['r_alder']);
|
|
|
+if($alder < 1900 || $alder > 2005){
|
|
|
+$errors->add('demo_error',__('hmmm.. din alder virker mystisk'));
|
|
|
+};
|
|
|
+};
|
|
|
+ */
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
function help() {
|
|
|
?>
|
|
|
<?php echo (__("Adds logo to login page", "dagsopt")) ?>
|
|
@@ -284,7 +363,7 @@ body {
|
|
|
|
|
|
function login_head() {
|
|
|
$type = isset($_GET['type']) ? $_GET['type'] : 'default';
|
|
|
- if ($type !== "default") {
|
|
|
+ if ($type !== "!!default") {
|
|
|
?>
|
|
|
<script type='text/javascript' src='/wp-includes/js/jquery/jquery.js?ver=1.4.2'></script>
|
|
|
<script type="text/javascript">
|
|
@@ -331,7 +410,6 @@ body {
|
|
|
}
|
|
|
?>
|
|
|
|
|
|
- <link rel="stylesheet" href="<?php bloginfo('stylesheet_directory');?>/style2.css">
|
|
|
|
|
|
|
|
|
<?php
|