Răsfoiți Sursa

Bumped version to 0.0.44

Jannick Knudsen 4 ani în urmă
părinte
comite
e7733830a9
5 a modificat fișierele cu 54 adăugiri și 75 ștergeri
  1. 1 1
      VERSION
  2. 1 0
      VERSIONLOG
  3. 1 1
      package.json
  4. 49 71
      plug_login.php
  5. 2 2
      plugin.php

+ 1 - 1
VERSION

@@ -1 +1 @@
-v0.0.43
+v0.0.44

+ 1 - 0
VERSIONLOG

@@ -42,3 +42,4 @@ v0.0.40
 v0.0.41
 v0.0.42
 v0.0.43
+v0.0.44

+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
   "name": "dagsplug",
-  "version": "0.0.43",
+  "version": "0.0.44",
   "description": "",
   "main": "script_backend.js",
   "scripts": {

+ 49 - 71
plug_login.php

@@ -11,6 +11,9 @@ if (!class_exists("plug_login")) {
 		function start() {
 			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_headertext', array(&$this, 'login_headertext'));
 			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() {
 			$action = isset($_GET['action']) ? $_GET['action'] : '';
@@ -185,23 +201,30 @@ if (!class_exists("plug_login")) {
 			}
 
 			$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>
 		<script type="text/javascript">
 			jQuery(document).ready(function($){
@@ -317,64 +340,15 @@ if (!class_exists("plug_login")) {
 
 		function plugin_form() {
 			$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 = '
- 			<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>
- 				 		' . $content . '
- 				 	</div>
-
 					<input type="hidden" name="r_proselect" id="r_proselect" value="' . $type . '">
-
  					<p>
  						<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" />
  						</label>
 					</p>
-
-
- 					<p>
- 								' . $sel . '
-
-					</p>
-
-
-
-
+					<input type="hidden" name="r_membership" id="r_membership" value="' . $type . '">
 			</div>
 			';
 			echo $html;
@@ -389,7 +363,9 @@ $sel .= '</select>';
 
 			update_option($pre . '_background_image', $_POST[$pre . '_background_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) {
@@ -418,6 +394,10 @@ $sel .= '</select>';
 		<button class="button uploadbutton">Upload</button>
 		</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>
 
 		  <?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>
 
 
-		<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

+ 2 - 2
plugin.php

@@ -4,7 +4,7 @@ Plugin Name: dagsopt
 Plugin URI: https://git.tum.dk/tum.dk/dagsplug/
 Description: Tools
 Author: iskedk
-Version: 0.0.43
+Version: 0.0.44
 Date: 2021-01-14
 Author URI: https://iske.dk/
 Text Domain: dagsopt
@@ -17,7 +17,7 @@ function wppluginspage() {
 $wp_dagsopt = new dagsopt();
 
 class dagsopt {
-	var $version = "0.0.43";
+	var $version = "0.0.44";
 	var $publish_date = "2021-01-14";
 	var $pluginname;
 	var $plugintitle;