Changeset 3095291
- Timestamp:
- 05/30/2024 05:14:11 PM (20 months ago)
- Location:
- create-temporary-login
- Files:
-
- 16 added
- 7 edited
-
tags/1.0.3 (added)
-
tags/1.0.3/admin (added)
-
tags/1.0.3/admin/css (added)
-
tags/1.0.3/admin/css/admin.css (added)
-
tags/1.0.3/admin/js (added)
-
tags/1.0.3/admin/js/admin.js (added)
-
tags/1.0.3/create-temporary-login.php (added)
-
tags/1.0.3/includes (added)
-
tags/1.0.3/includes/class-admin.php (added)
-
tags/1.0.3/includes/class-create-temporary-login.php (added)
-
tags/1.0.3/includes/class-option.php (added)
-
tags/1.0.3/index.php (added)
-
tags/1.0.3/languages (added)
-
tags/1.0.3/languages/create-temporary-login.pot (added)
-
tags/1.0.3/readme.txt (added)
-
tags/1.0.3/uninstall.php (added)
-
trunk/admin/css/admin.css (modified) (3 diffs)
-
trunk/create-temporary-login.php (modified) (2 diffs)
-
trunk/includes/class-admin.php (modified) (3 diffs)
-
trunk/includes/class-option.php (modified) (3 diffs)
-
trunk/languages/create-temporary-login.pot (modified) (5 diffs)
-
trunk/readme.txt (modified) (4 diffs)
-
trunk/uninstall.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
create-temporary-login/trunk/admin/css/admin.css
r3083509 r3095291 102 102 .ctl_tokens li a.ctl_token:first-child { 103 103 padding: 5px; 104 display: inline-block;104 display: block; 105 105 border: 1px dashed #3c434a; 106 106 text-decoration: none; … … 132 132 } 133 133 134 .ctl_tokens li a.ctl_delete_link { 135 display: block; 136 } 137 138 .ctl_tokens li a.ctl_delete_link:focus { 139 box-shadow: inset 0px 0px 5px #730b0b; 140 background-color: #a00; 141 border-bottom-right-radius: 10px; 142 border-top-left-radius: 10px; 143 } 144 134 145 135 146 .ctl_tokens li a.ctl_delete_link span{ … … 151 162 display: inline-block; 152 163 } 164 .ctl_token:before { 165 content: attr(data-instruction); 166 position: absolute; 167 z-index: 1; 168 visibility: hidden; 169 width: 120px; 170 background-color: black; 171 color: #fff; 172 text-align: center; 173 padding: 5px 10px; 174 border-radius: 6px; 175 font-size: 11px; 176 top: -36px; 177 left: 50%; 178 margin-left: -60px; 179 } 180 .ctl_token:after { 181 content: " "; 182 position: absolute; 183 visibility: hidden; 184 top: -8px; 185 left: 50%; 186 margin-left: -5px; 187 border-width: 5px; 188 border-style: solid; 189 border-color: black transparent transparent transparent; 190 } 191 192 .ctl_token:hover:before, 193 .ctl_token:hover:after{ 194 visibility: visible; 195 } -
create-temporary-login/trunk/create-temporary-login.php
r3089036 r3095291 1 1 <?php 2 2 /* 3 Plugin Name: Bifröst WP- Create Passwordless Temporary Login Links3 Plugin Name: WP Bifröst - Create Passwordless Temporary Login Links 4 4 Plugin URI: https://wordpress.org/plugins/create-temporary-login 5 5 Description: Create passwordless temporary login links to easily give access to your site's dashboard. 6 Version: 1.0. 26 Version: 1.0.3 7 7 Author: Hakik Zaman 8 8 Author URI: https://profiles.wordpress.org/users/hakik … … 21 21 */ 22 22 if ( ! defined( 'CTLAZ_TEMP_LOGIN_VERSION' ) ) { 23 define( 'CTLAZ_TEMP_LOGIN_VERSION', '1.0. 2' );23 define( 'CTLAZ_TEMP_LOGIN_VERSION', '1.0.3' ); 24 24 } 25 25 -
create-temporary-login/trunk/includes/class-admin.php
r3089036 r3095291 100 100 public function create_temporary_login(){ 101 101 102 echo "<h1>".esc_html__( ' Bifröst WP- Settings (Create Passwordless Temporary Login Links)', 'create-temporary-login' )."</h1>";102 echo "<h1>".esc_html__( 'WP Bifröst - Settings (Create Passwordless Temporary Login Links)', 'create-temporary-login' )."</h1>"; 103 103 $other_attributes = array( 'tabindex' => '1' ); 104 104 submit_button( __( 'Generate a link', 'create-temporary-login' ), 'secondary ctl_generate_link', '', true, $other_attributes ); … … 116 116 $links .= sprintf( 117 117 '<li> 118 <a class="ctl_token" data-url="%1$s" >118 <a class="ctl_token" data-url="%1$s" data-instruction="%10$s"> 119 119 <span class="dashicons dashicons-admin-links"></span> 120 120 <span class="ctl_link">%1$s</span> … … 136 136 </p> 137 137 </li>', 138 // Token generated link to copy it to clipboard138 // 1. Token generated link to copy it to clipboard 139 139 esc_url( site_url('?ctl_token=') . get_user_meta( $user->ID, 'ctl_token', true ) ), 140 // Link of delete the link140 // 2. Link of delete the link 141 141 esc_url( wp_nonce_url( admin_url("users.php?page=create-temporary-login&user_id={$user->ID}"), 'ctl_delete_link', 'ctl_delete_link_nonce' ) ), 142 // Delete text142 // 3. Delete text 143 143 esc_html__( 'Delete', 'create-temporary-login' ), 144 // Copied text after clicking on link144 // 4. Copied text after clicking on link 145 145 esc_html__( 'Copied', 'create-temporary-login' ), 146 // Human readable time to show how many days are remaining146 // 5. Human readable time to show how many days are remaining 147 147 ctlaz_create_temporary_login()->get_option()->get_human_readable_link_duration( $user->ID ), 148 // Text of the Extend Button148 // 6. Text of the Extend Button 149 149 esc_html__( 'Extend 3 days', 'create-temporary-login' ), 150 // Link of extend time for the link150 // 7. Link of extend time for the link 151 151 esc_url( wp_nonce_url( admin_url("users.php?page=create-temporary-login&user_id={$user->ID}"), 'ctl_extend_link', 'ctl_extend_link_nonce' ) ), 152 // Add background color to red if link is expired152 // 8. Add background color to red if link is expired 153 153 ctlaz_create_temporary_login()->get_option()->is_user_expired( $user->ID ) ? 'ctl-danger' : '', 154 // Hide extend button if not expired 155 !ctlaz_create_temporary_login()->get_option()->is_user_expired( $user->ID ) ? 'ctl-display-none' : '' 154 // 9. Hide extend button if not expired 155 !ctlaz_create_temporary_login()->get_option()->is_user_expired( $user->ID ) ? 'ctl-display-none' : '', 156 // 10. Tooltip text 157 esc_html__( 'Click to Copy!', 'create-temporary-login' ) 156 158 157 159 ); -
create-temporary-login/trunk/includes/class-option.php
r3089036 r3095291 29 29 */ 30 30 public function set_hooks(){ 31 add_action( ' admin_init', array( $this, 'set_temporary_logged_in_user_permission' ), 10 );31 add_action( 'wp_dashboard_setup', array( $this, 'set_temporary_logged_in_user_permission' ), 10 ); 32 32 } 33 33 … … 140 140 * To print the available capabilities for this current user- `print_r($user->get_role_caps());` 141 141 */ 142 $user->add_cap( 'create_users', false ); 143 $user->add_cap( 'list_users', false ); 142 144 $user->add_cap( 'delete_users', false ); 143 145 /** … … 146 148 * remove_menu_page( 'users.php' ); 147 149 */ 150 remove_menu_page( 'users.php' ); 151 remove_menu_page( 'profile.php' ); 148 152 } 149 153 -
create-temporary-login/trunk/languages/create-temporary-login.pot
r3089036 r3095291 3 3 msgid "" 4 4 msgstr "" 5 "Project-Id-Version: Bifröst WP - Create Passwordless Temporary Login Links 1.0.2\n"5 "Project-Id-Version: WP Bifröst - Create Passwordless Temporary Login Links 1.0.3\n" 6 6 "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/create-temporary-login\n" 7 7 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" … … 10 10 "Content-Type: text/plain; charset=UTF-8\n" 11 11 "Content-Transfer-Encoding: 8bit\n" 12 "POT-Creation-Date: 2024-05- 19T11:33:51+00:00\n"12 "POT-Creation-Date: 2024-05-30T06:31:54+00:00\n" 13 13 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 14 14 "X-Generator: WP-CLI 2.9.0\n" … … 16 16 17 17 #. Plugin Name of the plugin 18 msgid " Bifröst WP- Create Passwordless Temporary Login Links"18 msgid "WP Bifröst - Create Passwordless Temporary Login Links" 19 19 msgstr "" 20 20 … … 36 36 37 37 #: includes/class-admin.php:102 38 msgid " Bifröst WP- Settings (Create Passwordless Temporary Login Links)"38 msgid "WP Bifröst - Settings (Create Passwordless Temporary Login Links)" 39 39 msgstr "" 40 40 … … 55 55 msgstr "" 56 56 57 #: includes/class-admin.php:247 57 #: includes/class-admin.php:157 58 msgid "Click to Copy!" 59 msgstr "" 60 61 #: includes/class-admin.php:249 58 62 msgid "Create Temporary Login" 59 63 msgstr "" 60 64 61 #: includes/class-admin.php:28 465 #: includes/class-admin.php:286 62 66 msgid "<strong>Error:</strong> The username is not registered on this site. If you are unsure of your username, try your email address instead." 63 67 msgstr "" -
create-temporary-login/trunk/readme.txt
r3089036 r3095291 1 === Bifröst WP- Create Passwordless Temporary Login Links ===1 === WP Bifröst - Create Passwordless Temporary Login Links === 2 2 Contributors: Hakik 3 3 Tags: temporary login, passwordless login, temporary access, login … … 5 5 Requires at least: 6.2 6 6 Tested up to: 6.5 7 Stable tag: 1.0. 27 Stable tag: 1.0.3 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 13 13 == Description == 14 14 15 Create Temporary Loginhelps you create secure passwordless links that allow instant access to your WordPress dashboard.15 WP Bifröst helps you create secure passwordless links that allow instant access to your WordPress dashboard. 16 16 17 17 === How to Create Passwordless Temporary Login Links? === … … 42 42 Not to worry. The URL is automatically disabled at the expiration time with no action needed on your part. 43 43 44 == Screenshots == 45 46 1. Direct link to create the temporary login link. 47 2. Temporary Login submenu under the Users menu. 48 3. Click on this 'Generate a link' button to generate a temporary login link. 49 4. Click on the link to copy the link to the clipboard. 50 5. Delete icon to remove the temporary login link. 51 6. Extend the time for the link for 3 days. 52 44 53 == Changelog == 54 55 = 1.0.3 = 56 * Security: Temporary users are not allowed to access the User/Profile menu. 57 * Tweak: `admin_init` was changed with `wp_dashboard_setup` to control capabilities and admin menu. 58 * Appearance: Fixed the outline style of the delete button and added a tooltip for clear instruction. 45 59 46 60 = 1.0.2 = -
create-temporary-login/trunk/uninstall.php
r3083509 r3095291 6 6 } 7 7 8 // Getting only ctl users8 // Get all users 9 9 $ctl_users = get_users(); 10 10 11 11 foreach ($ctl_users as $key => $user) { 12 //Getting only ctl users 12 13 if( get_user_meta( $user->ID, 'ctl_user', true ) ){ 13 14 wp_delete_user( sanitize_text_field( $user->ID ) );
Note: See TracChangeset
for help on using the changeset viewer.