Changeset 3286600
- Timestamp:
- 05/03/2025 12:41:17 AM (11 months ago)
- Location:
- aio-time-clock-lite/trunk
- Files:
-
- 4 edited
-
aio-settings.php (modified) (5 diffs)
-
aio-time-clock-lite-actions.php (modified) (1 diff)
-
aio-time-clock-lite.php (modified) (1 diff)
-
readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
aio-time-clock-lite/trunk/aio-settings.php
r2856326 r3286600 1 1 <div class="wrap aio_admin_wrapper"> 2 <?php session_start(); ?> 3 <?php 4 $token = isset($_SESSION['timeclock_manage_token']) ? $_SESSION['timeclock_manage_token'] : null; 5 if (!isset($token)) { 6 //echo "setting session"; 7 // generate token and persist for later verification 8 // - in practice use openssl_random_pseudo_bytes() or similar instead of uniqid() 9 $token = md5(uniqid()); 10 $_SESSION['timeclock_manage_token']= $token; 11 session_write_close(); 12 } 13 else{ 14 //echo $token; 15 } 16 ?> 2 17 <?php $logo = plugins_url('/images/logo.png', __FILE__); ?> 3 18 <a href="https://codebangers.com" target="_blank"><img src="<?php echo esc_url($logo); ?>" style="width:15%;"></a> … … 40 55 </h2> 41 56 <!--Handle the Tabs--> 42 <?php if ($tab == "general_settings") { 57 <?php 58 if ($tab == "general_settings") { 43 59 if (get_option('permalink_structure')) { 44 60 //echo 'Permalinks enabled'; … … 51 67 <?php 52 68 } 69 53 70 if (isset($job)){ 54 if ($job == "create_timeclock_page") { 55 $tc_page = $this->aio_check_tc_shortcode_lite(); 56 if ($tc_page == null) { 57 $my_post = array( 58 'post_type' => 'page', 59 'post_title' => 'Time Clock', 60 'post_status' => 'publish', 61 'post_content' => '[show_aio_time_clock_lite]', 62 'comment_status' => 'closed', 63 'post_author' => $current_user->ID 64 ); 65 // Insert the post into the database 66 $new_post_id = wp_insert_post($my_post); 67 } 68 ?> 69 <div id="setting-error-settings_updated" class="updated settings-error aio-tc-alert"> 70 <?php 71 if ($new_post_id != null) { 72 echo esc_attr_x('TimeClock Page Created Sucessfully', 'aio-time-clock-lite'); ?> 73 <a href="<?php echo esc_url(get_permalink($new_post_id)); ?>" class="button small_button" target="_blank"><i class="dashicons dashicons-search"></i><?php echo esc_attr_x('View Page', 'aio-time-clock-lite'); ?></a> 74 <?php } else { 75 echo esc_attr_x('Something went wrong. Timeclock was not created successfully', 'aio-time-clock-lite'); 76 if ($tc_page != null) { 77 echo esc_attr_x('You already have a TimeClock page created', 'aio-time-clock-lite'); ?> 78 <a href="<?php echo esc_url(get_permalink($tc_page)); ?>" class="button small_button" target="_blank"><i class="dashicons dashicons-search"></i><?php echo esc_attr_x('View Page', 'aio-time-clock-lite'); ?></a> 79 <?php 80 } 71 if ($token && $_SESSION['timeclock_manage_token'] === $token) { 72 if ($job == "create_timeclock_page") { 73 $tc_page = $this->aio_check_tc_shortcode_lite(); 74 if ($tc_page == null) { 75 $my_post = array( 76 'post_type' => 'page', 77 'post_title' => 'Time Clock', 78 'post_status' => 'publish', 79 'post_content' => '[show_aio_time_clock_lite]', 80 'comment_status' => 'closed', 81 'post_author' => $current_user->ID 82 ); 83 // Insert the post into the database 84 $new_post_id = wp_insert_post($my_post); 81 85 } 82 86 ?> 83 </div>84 <?php85 }86 if ($job == "create_eprofile_page") {87 $eprofile_page = $this->check_eprofile_shortcode_lite();88 if ($eprofile_page == null){89 $my_post = array(90 'post_type' => 'page',91 'post_title' => 'Employee Profile',92 'post_status' => 'publish',93 'post_content' => '[show_aio_employee_profile_lite]',94 'comment_status' => 'closed',95 'post_author' => 196 );97 // Insert the post into the database98 $new_eprofile_id = wp_insert_post($my_post);87 <div id="setting-error-settings_updated" class="updated settings-error aio-tc-alert"> 88 <?php 89 if ($new_post_id != null) { 90 echo esc_attr_x('TimeClock Page Created Sucessfully', 'aio-time-clock-lite'); ?> 91 <a href="<?php echo esc_url(get_permalink($new_post_id)); ?>" class="button small_button" target="_blank"><i class="dashicons dashicons-search vmiddle"></i><?php echo esc_attr_x('View Page', 'aio-time-clock-lite'); ?></a> 92 <?php } else { 93 echo esc_attr_x('Something went wrong. Timeclock was not created successfully', 'aio-time-clock-lite'); 94 if ($tc_page != null) { 95 echo esc_attr_x('You already have a TimeClock page created', 'aio-time-clock-lite'); ?> 96 <a href="<?php echo esc_url(get_permalink($tc_page)); ?>" class="button small_button" target="_blank"><i class="dashicons dashicons-search vmiddle"></i><?php echo esc_attr_x('View Page', 'aio-time-clock-lite'); ?></a> 97 <?php 98 } 99 } 100 ?> 101 </div> 102 <?php 99 103 } 100 ?> 101 <div id="setting-error-settings_updated" class="updated settings-error aio-tc-alert"> 102 <?php 103 if ($new_eprofile_id != null) { 104 echo esc_attr_x('Employee Profile Page Created Sucessfully', 'aio-time-clock-lite'); ?> 105 <a href="<?php echo esc_url(get_permalink($new_eprofile_id)); ?>" class="button small_button" target="_blank"><i class="dashicons dashicons-search"></i> <?php echo esc_attr_x('View Profile', 'aio-time-clock-lite'); ?></a> 106 <?php 107 } else { 108 echo esc_attr_x('Something went wrong. Employee Profile Page was not created successfully', 'aio-time-clock-lite'); 109 if ($eprofile_page != null) { 110 echo esc_attr_x('You already have a Employee Profile page created', 'aio-time-clock-lite'); ?> 111 <a href="<?php echo esc_url(get_permalink($eprofile_page)); ?>" class="button small_button" target="_blank"><i class="dashicons dashicons-search"></i> <?php echo esc_attr_x('View Profile', 'aio-time-clock-lite'); ?></a> 112 <?php 113 } 104 if ($job == "create_eprofile_page") { 105 $eprofile_page = $this->check_eprofile_shortcode_lite(); 106 if ($eprofile_page == null) { 107 $my_post = array( 108 'post_type' => 'page', 109 'post_title' => 'Employee Profile', 110 'post_status' => 'publish', 111 'post_content' => '[show_aio_employee_profile_lite]', 112 'comment_status' => 'closed', 113 'post_author' => 1 114 ); 115 // Insert the post into the database 116 $new_eprofile_id = wp_insert_post($my_post); 114 117 } 115 118 ?> 116 </div> 117 <?php 119 <div id="setting-error-settings_updated" class="updated settings-error aio-tc-alert"> 120 <?php 121 if ($new_eprofile_id != null) { 122 echo esc_attr_x('Employee Profile Page Created Sucessfully', 'aio-time-clock-lite'); ?> 123 <a href="<?php echo esc_url(get_permalink($new_eprofile_id)); ?>" class="button small_button" target="_blank"><i class="dashicons dashicons-search vmiddle"></i> <?php echo esc_attr_x('View Profile', 'aio-time-clock-lite'); ?></a> 124 <?php 125 } else { 126 echo esc_attr_x('Something went wrong. Employee Profile Page was not created successfully', 'aio-time-clock-lite'); 127 if ($eprofile_page != null) { 128 echo esc_attr_x('You already have a Employee Profile page created', 'aio-time-clock-lite'); ?> 129 <a href="<?php echo esc_url(get_permalink($eprofile_page)); ?>" class="button small_button" target="_blank"><i class="dashicons dashicons-search vmiddle"></i> <?php echo esc_attr_x('View Profile', 'aio-time-clock-lite'); ?></a> 130 <?php 131 } 132 } 133 ?> 134 </div> 135 <?php 136 } 137 session_write_close(); 138 } 139 else{ 140 session_write_close(); 141 die(__("You are not authorized to perform this action", "aio-time-clock")); 118 142 } 119 143 } … … 151 175 $tc_page = $this->aio_check_tc_shortcode_lite(); 152 176 if ($tc_page != null) { ?> 153 <a href="<?php echo esc_url(get_permalink($tc_page)); ?>" class="button small_button" target="_blank"><i class="dashicons dashicons-search "></i> <?php echo esc_attr_x('View Page', 'aio-time-clock-lite'); ?></a>154 <a href="/wp-admin/post.php?post=<?php echo esc_attr($tc_page); ?>&action=edit" class="button small_button" target="_blank"><i class="dashicons dashicons-edit "></i><?php echo esc_attr_x('Edit Page', 'aio-time-clock-lite'); ?></a>177 <a href="<?php echo esc_url(get_permalink($tc_page)); ?>" class="button small_button" target="_blank"><i class="dashicons dashicons-search vmiddle"></i> <?php echo esc_attr_x('View Page', 'aio-time-clock-lite'); ?></a> 178 <a href="/wp-admin/post.php?post=<?php echo esc_attr($tc_page); ?>&action=edit" class="button small_button" target="_blank"><i class="dashicons dashicons-edit vmiddle"></i><?php echo esc_attr_x('Edit Page', 'aio-time-clock-lite'); ?></a> 155 179 <?php } else { ?> 156 <?php echo esc_attr_x('Time Clock page not found. Would you like to create one', 'aio-time-clock-lite'); ?>? <a href="<?php echo esc_url(admin_url('?page=aio-tc-lite&tab=general_settings&job=create_timeclock_page')); ?>" class="button small_button"><span class="dashicons dashicons-plus vmiddle"></span></a>180 <?php echo esc_attr_x('Time Clock page not found. Would you like to create one', 'aio-time-clock-lite'); ?>? <a href="<?php echo esc_url(admin_url('?page=aio-tc-lite&tab=general_settings&job=create_timeclock_page&t=' . $token)); ?>" class="button small_button"><span class="dashicons dashicons-plus vmiddle"></span></a> 157 181 <?php 158 182 } … … 169 193 $eprofile_page = $this->check_eprofile_shortcode_lite(); 170 194 if ($eprofile_page != null) { ?> 171 <a href="<?php echo esc_url(get_permalink(intval($eprofile_page))); ?>" class="button small_button" target="_blank"><i class="dashicons dashicons-search "></i> <?php echo esc_attr_x('View Page', 'aio-time-clock-lite'); ?></a>172 <a href="/wp-admin/post.php?post=<?php echo intval($eprofile_page); ?>&action=edit" class="button small_button" target="_blank"><i class="dashicons dashicons-edit "></i> <?php echo esc_attr_x('Edit Page', 'aio-time-clock-lite'); ?></a>195 <a href="<?php echo esc_url(get_permalink(intval($eprofile_page))); ?>" class="button small_button" target="_blank"><i class="dashicons dashicons-search vmiddle"></i> <?php echo esc_attr_x('View Page', 'aio-time-clock-lite'); ?></a> 196 <a href="/wp-admin/post.php?post=<?php echo intval($eprofile_page); ?>&action=edit" class="button small_button" target="_blank"><i class="dashicons dashicons-edit vmiddle"></i> <?php echo esc_attr_x('Edit Page', 'aio-time-clock-lite'); ?></a> 173 197 <?php 174 198 } else { 175 199 ?> 176 <?php echo esc_attr_x('Employee Profile page not found. Would you like to create one', 'aio-time-clock-lite'); ?>? <a href="<?php echo esc_url(admin_url('?page=aio-tc-lite&tab=general_settings&job=create_eprofile_page')); ?>" class="button small_button"><span class="dashicons dashicons-plus vmiddle"></span></a>200 <?php echo esc_attr_x('Employee Profile page not found. Would you like to create one', 'aio-time-clock-lite'); ?>? ? <a href="<?php echo esc_url(admin_url('?page=aio-tc-lite&tab=general_settings&job=create_eprofile_page&t=' . $token)); ?>" class="button small_button"><span class="dashicons dashicons-plus vmiddle"></span></a> 177 201 <?php 178 202 } -
aio-time-clock-lite/trunk/aio-time-clock-lite-actions.php
r3223707 r3286600 72 72 public function getVersion() 73 73 { 74 return "1.3.32 4";74 return "1.3.325"; 75 75 } 76 76 -
aio-time-clock-lite/trunk/aio-time-clock-lite.php
r3223707 r3286600 6 6 * Author: Codebangers 7 7 * Author URI: https://codebangers.com 8 * Version: 1.3.32 48 * Version: 1.3.325 9 9 */ 10 10 class AIO_Time_Clock_Plugin_Lite -
aio-time-clock-lite/trunk/readme.txt
r3223707 r3286600 338 338 339 339 1. Testing with Wordpress 6.7.1 340 341 2025-5-2 - Version 1.3.325 342 343 1. Fixed security issues
Note: See TracChangeset
for help on using the changeset viewer.