User Switching - Version 1.0.3

Version Description

  • Croatian translation, plus a small fix to avoid PHP notices triggered by poorly coded plugins.

=

Download this release

Release Info

Developer johnbillion
Plugin Icon 128x128 User Switching
Version 1.0.3
Comparing to
See all releases

Code changes from version 1.0.2 to 1.0.3

languages/user-switching-hr.mo ADDED
Binary file
languages/user-switching-hr.po ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Copyright (C) 2013 John Blackbourn
2
+ # This file is distributed under the same license as the User Switching package.
3
+ # Translators:
4
+ # Ante Sepic <antesepic@gmail.com>, 2014
5
+ msgid ""
6
+ msgstr ""
7
+ "Project-Id-Version: User Switching\n"
8
+ "Report-Msgid-Bugs-To: http://wordpress.org/tag/user-switching\n"
9
+ "POT-Creation-Date: 2013-10-28 23:22:09+00:00\n"
10
+ "PO-Revision-Date: 2014-12-15 17:41+0000\n"
11
+ "Last-Translator: Ante Sepic <antesepic@gmail.com>\n"
12
+ "Language-Team: Croatian (http://www.transifex.com/projects/p/user-switching/language/hr/)\n"
13
+ "MIME-Version: 1.0\n"
14
+ "Content-Type: text/plain; charset=UTF-8\n"
15
+ "Content-Transfer-Encoding: 8bit\n"
16
+ "Language: hr\n"
17
+ "Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n"
18
+
19
+ #: user-switching.php:80
20
+ msgctxt "User Switching title on user profile screen"
21
+ msgid "User Switching"
22
+ msgstr "Promjena prijavljenog korisnika"
23
+
24
+ #: user-switching.php:81 user-switching.php:355 user-switching.php:409
25
+ msgid "Switch&nbsp;To"
26
+ msgstr "Prijavi se kao ovaj korisnik"
27
+
28
+ #: user-switching.php:151 user-switching.php:162 user-switching.php:172
29
+ msgid "Could not switch users."
30
+ msgstr "Promjena korisnika nije uspjela."
31
+
32
+ #: user-switching.php:189
33
+ msgid "Could not switch off."
34
+ msgstr "Prividna odjava nije uspjela."
35
+
36
+ #: user-switching.php:211 user-switching.php:228
37
+ msgid "Switched to %1$s (%2$s)."
38
+ msgstr "Prijavljeni ste kao korisnik %1$s (%2$s)."
39
+
40
+ #: user-switching.php:215 user-switching.php:275 user-switching.php:311
41
+ #: user-switching.php:329 user-switching.php:370
42
+ msgid "Switch back to %1$s (%2$s)"
43
+ msgstr "Vrati se na korisnika %1$s (%2$s)."
44
+
45
+ #: user-switching.php:226
46
+ msgid "Switched back to %1$s (%2$s)."
47
+ msgstr "Vratili ste se na korisnika %1$s (%2$s)."
48
+
49
+ #: user-switching.php:295
50
+ msgid "Switch Off"
51
+ msgstr "Prividno se odjavi"
52
+
53
+ #. Plugin Name of the plugin/theme
54
+ msgid "User Switching"
55
+ msgstr "Promjena prijavljenog korisnika"
56
+
57
+ #. Description of the plugin/theme
58
+ msgid "Instant switching between user accounts in WordPress"
59
+ msgstr "Brzinski se prijavite kao bilo koji korisnik registriran na vašoj WordPress stranici"
readme.txt CHANGED
@@ -4,7 +4,7 @@ Contributors: johnbillion
4
  Tags: users, profiles, user switching, fast user switching, multisite, buddypress, bbpress, become, user management, developer
5
  Requires at least: 3.1
6
  Tested up to: 4.1
7
- Stable tag: 1.0.2
8
  License: GPL v2 or later
9
 
10
  Instant switching between user accounts in WordPress.
@@ -42,6 +42,7 @@ See the [FAQ](https://wordpress.org/plugins/user-switching/faq/) for information
42
  * العربية (Arabic)
43
  * Български (Bulgarian)
44
  * 中文 (Chinese Simplified)
 
45
  * Nederlands (Dutch)
46
  * Suomi (Finnish)
47
  * Français (French)
@@ -61,7 +62,7 @@ See the [FAQ](https://wordpress.org/plugins/user-switching/faq/) for information
61
  * Español (Spanish)
62
  * Türkçe (Turkish)
63
 
64
- Thanks to translations by Hassan Hisham, Tunghsiao Liu, Francois-Xavier Bénard, Ralph Stenzel, Rami Y, Yusuke Hayasaki, Tommixoft, Amin Ab, Bartosz Arendt, Raphael Mendonça, R J, Max Samael, Eko Ikhyar, Marcelo Pedra, Abdullah Pazarbasi, ArianServ, SilverXp, Evi Giannakou, Petya Raykovska, Martin Sauter, Yaser Tallo, Enrique Errando, Sami Keijonen, Ishka Michocka, Alessandro Curci, and Alessandro Tesoro!
65
 
66
  == Screenshots ==
67
 
@@ -121,12 +122,17 @@ When a user switches off, the `switch_off_user` hook is called with the old user
121
 
122
  == Upgrade Notice ==
123
 
124
- = 1.0.2 =
125
 
126
- * New translations: Türkçe (Turkish), Română (Romanian), Nederlands (Dutch), Ελληνικά (Greek), Български (Bulgarian), Suomi (Finnish), and Italiano (Italian).
127
 
128
  == Changelog ==
129
 
 
 
 
 
 
130
  = 1.0.2 =
131
 
132
  * Turkish translation by Abdullah Pazarbasi.
4
  Tags: users, profiles, user switching, fast user switching, multisite, buddypress, bbpress, become, user management, developer
5
  Requires at least: 3.1
6
  Tested up to: 4.1
7
+ Stable tag: 1.0.3
8
  License: GPL v2 or later
9
 
10
  Instant switching between user accounts in WordPress.
42
  * العربية (Arabic)
43
  * Български (Bulgarian)
44
  * 中文 (Chinese Simplified)
45
+ * Hrvatski (Croatian)
46
  * Nederlands (Dutch)
47
  * Suomi (Finnish)
48
  * Français (French)
62
  * Español (Spanish)
63
  * Türkçe (Turkish)
64
 
65
+ Thanks to translations by Hassan Hisham, Tunghsiao Liu, Francois-Xavier Bénard, Ralph Stenzel, Rami Y, Yusuke Hayasaki, Tommixoft, Amin Ab, Bartosz Arendt, Raphael Mendonça, R J, Max Samael, Eko Ikhyar, Marcelo Pedra, Abdullah Pazarbasi, ArianServ, SilverXp, Evi Giannakou, Petya Raykovska, Martin Sauter, Yaser Tallo, Enrique Errando, Sami Keijonen, Ishka Michocka, Alessandro Curci, Alessandro Tesoro, and Ante Sepic!
66
 
67
  == Screenshots ==
68
 
122
 
123
  == Upgrade Notice ==
124
 
125
+ = 1.0.3 =
126
 
127
+ * Croatian translation, plus a small fix to avoid PHP notices triggered by poorly coded plugins.
128
 
129
  == Changelog ==
130
 
131
+ = 1.0.3 =
132
+
133
+ * Croation translation.
134
+ * Avoid PHP notices caused by other plugins which erroneously use boolean `true` as a capability.
135
+
136
  = 1.0.2 =
137
 
138
  * Turkish translation by Abdullah Pazarbasi.
user-switching.php CHANGED
@@ -2,7 +2,7 @@
2
  /*
3
  Plugin Name: User Switching
4
  Description: Instant switching between user accounts in WordPress
5
- Version: 1.0.2
6
  Plugin URI: https://johnblackbourn.com/wordpress-plugin-user-switching/
7
  Author: John Blackbourn
8
  Author URI: https://johnblackbourn.com/
@@ -11,7 +11,7 @@ Domain Path: /languages/
11
  License: GPL v2 or later
12
  Network: true
13
 
14
- Copyright © 2009-2014 John Blackbourn
15
 
16
  This program is free software; you can redistribute it and/or modify
17
  it under the terms of the GNU General Public License as published by
@@ -631,9 +631,9 @@ class user_switching {
631
  * @return array User's capabilities.
632
  */
633
  public function filter_user_has_cap( array $user_caps, array $required_caps, array $args ) {
634
- if ( 'switch_to_user' == $args[0] ) {
635
  $user_caps['switch_to_user'] = ( user_can( $args[1], 'edit_user', $args[2] ) and ( $args[2] != $args[1] ) );
636
- } else if ( 'switch_off' == $args[0] ) {
637
  $user_caps['switch_off'] = user_can( $args[1], 'edit_users' );
638
  }
639
  return $user_caps;
@@ -652,7 +652,7 @@ class user_switching {
652
  * @return array Required capabilities for the requested action.
653
  */
654
  public function filter_map_meta_cap( array $required_caps, $cap, $user_id, array $args ) {
655
- if ( ( 'switch_to_user' == $cap ) and ( $args[0] == $user_id ) ) {
656
  $required_caps[] = 'do_not_allow';
657
  }
658
  return $required_caps;
@@ -729,7 +729,7 @@ if ( !function_exists( 'user_switching_get_olduser_cookie' ) ) {
729
  /**
730
  * Gets the value of the cookie containing the originating user.
731
  *
732
- * @return string|bool The old user cookie, or boolean false on if there isn't one.
733
  */
734
  function user_switching_get_olduser_cookie() {
735
  if ( isset( $_COOKIE[USER_SWITCHING_OLDUSER_COOKIE] ) ) {
2
  /*
3
  Plugin Name: User Switching
4
  Description: Instant switching between user accounts in WordPress
5
+ Version: 1.0.3
6
  Plugin URI: https://johnblackbourn.com/wordpress-plugin-user-switching/
7
  Author: John Blackbourn
8
  Author URI: https://johnblackbourn.com/
11
  License: GPL v2 or later
12
  Network: true
13
 
14
+ Copyright © 2009-2015 John Blackbourn
15
 
16
  This program is free software; you can redistribute it and/or modify
17
  it under the terms of the GNU General Public License as published by
631
  * @return array User's capabilities.
632
  */
633
  public function filter_user_has_cap( array $user_caps, array $required_caps, array $args ) {
634
+ if ( 'switch_to_user' === $args[0] ) {
635
  $user_caps['switch_to_user'] = ( user_can( $args[1], 'edit_user', $args[2] ) and ( $args[2] != $args[1] ) );
636
+ } else if ( 'switch_off' === $args[0] ) {
637
  $user_caps['switch_off'] = user_can( $args[1], 'edit_users' );
638
  }
639
  return $user_caps;
652
  * @return array Required capabilities for the requested action.
653
  */
654
  public function filter_map_meta_cap( array $required_caps, $cap, $user_id, array $args ) {
655
+ if ( ( 'switch_to_user' === $cap ) and ( $args[0] == $user_id ) ) {
656
  $required_caps[] = 'do_not_allow';
657
  }
658
  return $required_caps;
729
  /**
730
  * Gets the value of the cookie containing the originating user.
731
  *
732
+ * @return string|bool The old user cookie, or boolean false if there isn't one.
733
  */
734
  function user_switching_get_olduser_cookie() {
735
  if ( isset( $_COOKIE[USER_SWITCHING_OLDUSER_COOKIE] ) ) {