|
@@ -11,6 +11,9 @@ if (!class_exists("plug_login")) {
|
|
function start() {
|
|
function start() {
|
|
add_action('init', array(&$this, 'override_reset_password_form_redirect'));
|
|
add_action('init', array(&$this, 'override_reset_password_form_redirect'));
|
|
|
|
|
|
|
|
+ add_filter("login_redirect", array(&$this, "my_login_redirect"), 10, 3);
|
|
|
|
+ add_filter("admin_bar_menu", array(&$this, "replace_howdy"), 25);
|
|
|
|
+
|
|
add_filter('login_headerurl', array(&$this, 'login_headerurl'));
|
|
add_filter('login_headerurl', array(&$this, 'login_headerurl'));
|
|
add_filter('login_headertext', array(&$this, 'login_headertext'));
|
|
add_filter('login_headertext', array(&$this, 'login_headertext'));
|
|
add_filter('login_message', array(&$this, 'login_message'));
|
|
add_filter('login_message', array(&$this, 'login_message'));
|
|
@@ -131,6 +134,19 @@ if (!class_exists("plug_login")) {
|
|
});
|
|
});
|
|
|
|
|
|
}
|
|
}
|
|
|
|
+ function replace_howdy($wp_admin_bar) {
|
|
|
|
+ $my_account = $wp_admin_bar->get_node('my-account');
|
|
|
|
+ $newtitle = str_replace('Hejsa,', 'Velkommen,', $my_account->title);
|
|
|
|
+ $wp_admin_bar->add_node(array(
|
|
|
|
+ 'id' => 'my-account',
|
|
|
|
+ 'title' => $newtitle,
|
|
|
|
+ ));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ function my_login_redirect($redirect_to, $request) {
|
|
|
|
+ $redirect_url = WP_SITEURL;
|
|
|
|
+ return $redirect_url;
|
|
|
|
+ }
|
|
|
|
|
|
function override_reset_password_form_redirect() {
|
|
function override_reset_password_form_redirect() {
|
|
$action = isset($_GET['action']) ? $_GET['action'] : '';
|
|
$action = isset($_GET['action']) ? $_GET['action'] : '';
|
|
@@ -185,23 +201,30 @@ if (!class_exists("plug_login")) {
|
|
}
|
|
}
|
|
|
|
|
|
$str = '<style type="text/css">
|
|
$str = '<style type="text/css">
|
|
- body {
|
|
|
|
- background-size: cover;
|
|
|
|
- background-position: center center;
|
|
|
|
- background-image: url(' . stripslashes(get_option($this->pluginname . "_login_background_image")) . ');
|
|
|
|
- }
|
|
|
|
- .login h1 a {margin-top:-50px;padding-bottom: 5px; width: auto; height: 110px; background-size: auto; background-image: url(' . stripslashes(get_option($this->pluginname . "_login_image")) . ');}
|
|
|
|
- .login_holder {
|
|
|
|
- margin-top: 20px;
|
|
|
|
- margin-left: 0;
|
|
|
|
- padding: 26px 24px 46px;
|
|
|
|
- font-weight: 400;
|
|
|
|
- overflow: hidden;
|
|
|
|
- background: #fff;
|
|
|
|
- border: 1px solid #ccd0d4;
|
|
|
|
- box-shadow: 0 1px 3px rgb(0 0 0 / 4%);
|
|
|
|
-
|
|
|
|
- }
|
|
|
|
|
|
+body {
|
|
|
|
+ background-size: cover;
|
|
|
|
+ background-position: center center;
|
|
|
|
+ background-image: url(' . stripslashes(get_option($this->pluginname . "_login_background_image")) . ');
|
|
|
|
+}
|
|
|
|
+.login h1 a {
|
|
|
|
+ margin-top:-50px;
|
|
|
|
+ padding-bottom: 5px;
|
|
|
|
+ width: auto;
|
|
|
|
+ height: 110px;
|
|
|
|
+ background-size: auto;
|
|
|
|
+ background-image: url(' . stripslashes(get_option($this->pluginname . "_login_image")) . ');}
|
|
|
|
+.login_holder {
|
|
|
|
+ margin-top: 20px;
|
|
|
|
+ margin-left: 0;
|
|
|
|
+ padding: 26px 24px 46px;
|
|
|
|
+ font-weight: 400;
|
|
|
|
+ overflow: hidden;
|
|
|
|
+ background: #fff;
|
|
|
|
+ border: 1px solid #ccd0d4;
|
|
|
|
+ box-shadow: 0 1px 3px rgb(0 0 0 / 4%);
|
|
|
|
+
|
|
|
|
+}
|
|
|
|
+' . stripslashes(get_option($this->pluginname . "_login_styles")) . '
|
|
</style>
|
|
</style>
|
|
<script type="text/javascript">
|
|
<script type="text/javascript">
|
|
jQuery(document).ready(function($){
|
|
jQuery(document).ready(function($){
|
|
@@ -317,64 +340,15 @@ if (!class_exists("plug_login")) {
|
|
|
|
|
|
function plugin_form() {
|
|
function plugin_form() {
|
|
$type = isset($_GET['type']) ? $_GET['type'] : 'default';
|
|
$type = isset($_GET['type']) ? $_GET['type'] : 'default';
|
|
-
|
|
|
|
- //19094 __system_side_medlem_af
|
|
|
|
- //$tt = get_post( 19094);
|
|
|
|
- //print_r($_REQUEST);
|
|
|
|
- //$arra = explode("<hr>","".$tt->post_content);
|
|
|
|
- //$listen = array_pop($arra);
|
|
|
|
- $content = "";
|
|
|
|
- //$arr = explode("\n","".$listen);
|
|
|
|
-
|
|
|
|
- $arr = explode("\n", get_option($this->pluginname . "_login_groups", false));
|
|
|
|
-
|
|
|
|
-/* $sel = '<select name="r_membership" id="r_membership" class="input nnl" tabindex="26">';
|
|
|
|
-$sel .= '<option ' . ((!isset($_POST['r_membership']) || $_POST['r_membership'] === "") ? "selected" : "") . '>Vælg </option>';
|
|
|
|
-foreach ($arr as $ii => $title) {
|
|
|
|
-if (strlen($title) > 3) {
|
|
|
|
-$sel .= '<option value="' . $title . '" ' . (isset($_POST['r_membership']) && $_POST['r_membership'] === $title ? "selected" : "") . '>' . $title . '</option>';
|
|
|
|
-}
|
|
|
|
-}
|
|
|
|
-$sel .= '</select>';
|
|
|
|
- */
|
|
|
|
- $sel = '<input type="hidden" name="r_membership" id="r_membership" value="' . $type . '">';
|
|
|
|
$html = '
|
|
$html = '
|
|
- <style type="text/css">
|
|
|
|
- .nnl {
|
|
|
|
- background:#FBFBFB none repeat scroll 0 0;
|
|
|
|
- border:1px solid #E5E5E5;
|
|
|
|
- font-size:20px;
|
|
|
|
- margin-bottom:16px;
|
|
|
|
- margin-right:6px;
|
|
|
|
- margin-top:2px;
|
|
|
|
- padding:3px;
|
|
|
|
- width:97%;
|
|
|
|
- }
|
|
|
|
- </style>
|
|
|
|
-
|
|
|
|
-
|
|
|
|
<div width="100%">
|
|
<div width="100%">
|
|
- <div>
|
|
|
|
- ' . $content . '
|
|
|
|
- </div>
|
|
|
|
-
|
|
|
|
<input type="hidden" name="r_proselect" id="r_proselect" value="' . $type . '">
|
|
<input type="hidden" name="r_proselect" id="r_proselect" value="' . $type . '">
|
|
-
|
|
|
|
<p>
|
|
<p>
|
|
<label style="display: block; margin-bottom: 5px;">' . __('Navn', 'Navn') . '
|
|
<label style="display: block; margin-bottom: 5px;">' . __('Navn', 'Navn') . '
|
|
<input type="text" name="r_navn" id="r_navn" class="input nnl" value="' . (isset($_POST['r_navn']) ? $_POST['r_navn'] : "") . '" size="20" tabindex="25" />
|
|
<input type="text" name="r_navn" id="r_navn" class="input nnl" value="' . (isset($_POST['r_navn']) ? $_POST['r_navn'] : "") . '" size="20" tabindex="25" />
|
|
</label>
|
|
</label>
|
|
</p>
|
|
</p>
|
|
-
|
|
|
|
-
|
|
|
|
- <p>
|
|
|
|
- ' . $sel . '
|
|
|
|
-
|
|
|
|
- </p>
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
|
|
+ <input type="hidden" name="r_membership" id="r_membership" value="' . $type . '">
|
|
</div>
|
|
</div>
|
|
';
|
|
';
|
|
echo $html;
|
|
echo $html;
|
|
@@ -389,7 +363,9 @@ $sel .= '</select>';
|
|
|
|
|
|
update_option($pre . '_background_image', $_POST[$pre . '_background_image']);
|
|
update_option($pre . '_background_image', $_POST[$pre . '_background_image']);
|
|
update_option($pre . '_image', $_POST[$pre . '_image']);
|
|
update_option($pre . '_image', $_POST[$pre . '_image']);
|
|
- update_option($pre . '_groups', $_POST[$pre . '_groups']);
|
|
|
|
|
|
+
|
|
|
|
+ update_option($pre . '_styles', $_POST[$pre . '_styles']);
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
function admin_line($pre) {
|
|
function admin_line($pre) {
|
|
@@ -418,6 +394,10 @@ $sel .= '</select>';
|
|
<button class="button uploadbutton">Upload</button>
|
|
<button class="button uploadbutton">Upload</button>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
+ <hr>
|
|
|
|
+
|
|
|
|
+ <?php echo (__("Login styles:", "dagsopt")) ?><br><textarea style="width: 100%; height: 150px;" name="<?php echo ($pre . '_styles'); ?>"><?php echo (stripslashes(get_option($pre . "_styles"))); ?></textarea>
|
|
|
|
+
|
|
<hr>
|
|
<hr>
|
|
|
|
|
|
<?php echo (__("Login splash html:", "dagsopt")) ?><br><textarea style="width: 100%; height: 150px;" name="<?php echo ($pre . '_support_splash'); ?>"><?php echo (stripslashes(get_option($pre . "_support_splash"))); ?></textarea>
|
|
<?php echo (__("Login splash html:", "dagsopt")) ?><br><textarea style="width: 100%; height: 150px;" name="<?php echo ($pre . '_support_splash'); ?>"><?php echo (stripslashes(get_option($pre . "_support_splash"))); ?></textarea>
|
|
@@ -440,9 +420,7 @@ $sel .= '</select>';
|
|
<?php echo (__("Login splash html register:", "dagsopt")) ?><br><textarea style="width: 100%; height: 150px;" name="<?php echo ($pre . '_support_splash_register'); ?>"><?php echo (stripslashes(get_option($pre . "_support_splash_register"))); ?></textarea>
|
|
<?php echo (__("Login splash html register:", "dagsopt")) ?><br><textarea style="width: 100%; height: 150px;" name="<?php echo ($pre . '_support_splash_register'); ?>"><?php echo (stripslashes(get_option($pre . "_support_splash_register"))); ?></textarea>
|
|
|
|
|
|
|
|
|
|
- <hr>
|
|
|
|
- <?php echo (__("Groups", "dagsopt")) ?><br>
|
|
|
|
- <textarea name="<?php echo ($pre . '_groups'); ?>" rows="7" class="large-text code"><?php echo (stripcslashes(get_option($pre . "_groups"))); ?></textarea>
|
|
|
|
|
|
+
|
|
|
|
|
|
|
|
|
|
<?php
|
|
<?php
|